You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 52 Next »

Unknown macro: {jython}

from com.atlassian.confluence.search.v2 import ContentSearch
from com.atlassian.confluence.search.v2.query import LabelQuery
search = ContentSearch(LabelQuery("devel"),None,None,None)
results = searchManager.searchEntities(search)
out.print("<div class='recently-updated recently-updated-concise'><h4 class='sub-heading'>ECMWF Software Packages</h4><div class='results-container'><ul>")
for i in results:
out.print("<li class='update-item'><div class='icon-container'><a href='/wiki%s'>%s</a></div><div class='update-item-desc'>%s</div></li>" % (i.urlPath,i.displayTitle,i.content))
out.print("</ul></div></div>")

Unknown macro: {jython}

from com.atlassian.confluence.search.v2 import ContentSearch
from com.atlassian.confluence.search.v2.query import LabelQuery
from com.atlassian.confluence.security import Permission

  1. Careful!! GeneralUtil.getRelativeTime is deprecated
    from com.atlassian.confluence.util import GeneralUtil

query = LabelQuery("releases")
search = ContentSearch(query,None,None,None)
results = searchManager.searchEntities(search)
alist = []
for i in results:
for a in i.attachments:
alist.append((a.lastModificationDate, a))

alist.sort()
alist.reverse()

out.print("<div class='recently-updated recently-updated-concise'><h4 class='sub-heading'>Latest Releases</h4><div class='results-container'><ul>")
for d,i in alist:
out.print("""
<li class='update-item'>
<div class='icon-container'><a href=\"/wiki%s\">%s (%s)</a></div>
<div class='update-item-desc'>from <a href='/wiki/display/%s'>%s</a></div>
<div class='update-item-date'>%s (%s)</div>
</li>""" % (i.downloadPathWithoutVersion, i.fileName, i.niceFileSize, i.space.key, i.space.name, GeneralUtil.getRelativeTime(d), permissionManager.hasPermission(request.userPrincipal,Permission.VIEW,i)))

out.print("</ul></div></div>")

Unknown macro: {jython}

from com.atlassian.confluence.search.v2 import ContentSearch
from com.atlassian.confluence.search.v2.query import LabelQuery

  1. Careful!! GeneralUtil.getRelativeTime is deprecated
    from com.atlassian.confluence.util import GeneralUtil

query = LabelQuery("news")
search = ContentSearch(query,None,None,None)
results = searchManager.search(search)

out.print("<div class='recently-updated recently-updated-concise'><h4 class='sub-heading'>Latest News</h4><div class='results-container'><ul>")
for i in results:
out.print("""
<li class='update-item'>
<div class='icon-container'><a href=\"/wiki%s\">%s</a></div>
<div class='update-item-desc'>from <a href='/wiki/display/%s'>%s</a></div>
<div class='update-item-date'>%s</div>
</li>""" % (i.urlPath,i.displayTitle, i.spaceKey,i.spaceName,GeneralUtil.getRelativeTime(i.lastModificationDate)))

out.print("</ul></div></div>")



Recently Updated


  • No labels