Wiki source code of Extensions Wiki

Version 53.1 by Marius Dumitru Florea on 2013/03/22 14:56

Show last authors
1 {{velocity}}
2 ## This pages serves 2 purposes:
3 ## - Used by the Extension Manager UI to display the documentation link for an extension based on the Maven <url> element which are set to http://xwiki.org/documentation?id=${groupId}:${artifactId}&path=...
4 ## See http://markmail.org/thread/s5lszhwxa5e7yl5u for details
5 ## - It's displays the list of extensions (when there's no "id" request parameter)
6 ##
7 #if ("$!request.id" != "")
8 ## Remove the part after ":::" (see top level pom.xml source for explanation as to why)
9 #set ($id = $stringtool.substringBefore($request.id, ":::"))
10 ## Locate the extension by its id
11 ## Special case, if the id is the one of the top level POM, then redirect to the main wiki
12 #if ($id == "org.xwiki.commons:xwiki-commons")
13 $response.sendRedirect($xwiki.getURL("xwiki:Main.WebHome"))
14 #else
15 #set ($xwql = "where doc.object(ExtensionCode.ExtensionClass).id = '$id'")
16 #set ($result = $services.query.xwql($xwql).execute())
17 #if ($result.size() > 0)
18 $response.sendRedirect($xwiki.getURL($result.get(0)))
19 #else
20 ## Unknown ID, list all extensions
21 {{include document="Extension.WebHome"/}}
22 #end
23 #end
24 #else
25 {{include document="Extension.WebHome"/}}
26 #end
27 {{/velocity}}

Get Connected