Wiki source code of Course Tags

Last modified by Hal Eden on 2010/08/20 11:33

Show last authors
1
2 #if(!$request.tag)
3
4 #set($sql = "select distinct elements(prop.list) from BaseObject as obj, DBStringListProperty as prop, XWikiDocument as doc where obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags' and obj.name=doc.fullName and doc.space = '${doc.getSpace()}'")
5 #set ($tags = $xwiki.search($sql))
6
7 #set ($title = "Course Tags")
8 #if ($tags.size() > 0)
9 #set ($title = "$title <a href='$xwiki.getURL('Main.TagsRss', 'view', 'xpage=rdf')' style=''><img src='$xwiki.getSkinFile('icons/black-rss.png')'/></a>")
10 #end
11
12 1 $title
13
14 #if ($tags.size() == 0)
15 No documents have been tagged yet. To tag a document, edit it and enter the tags you wish to use in the Tag field visible on that page. For more information on tagging please refer to the [XWiki User Guide>http://www.xwiki.org/xwiki/bin/view/UserGuide/].
16 #else
17 The following tags are available in the course space:
18 #foreach($tag in $tags)
19 * [$tag>$doc.fullName?tag=$tag] <a href="$xwiki.getURL("Main.TagsRss", "view", "tag=$tag&xpage=rdf")" style=""><img src="$xwiki.getSkinFile("icons/black-rss-mini.png")"></a>
20 #end
21 #end
22
23 #else
24 1 Documents tagged with '$request.tag' <a href="$xwiki.getURL("Main.TagsRss", "view", "tag=$request.tag&xpage=rdf")" style=""><img src="$xwiki.getSkinFile("icons/black-rss.png")" border="0px" /></a>
25
26 [View all tags>$doc.fullName]
27
28 #set($sql = ", BaseObject as obj, DBStringListProperty as prop where obj.name=doc.fullName and obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags' and '$request.tag' in elements(prop.list) and doc.space = '${doc.getSpace()}' order by doc.name asc")
29 #set ($list = $xwiki.searchDocuments($sql))
30 #includeInContext("XWiki.Results")
31 #end