## ## ## #template("name.vm") ## Searches for the given velocity template and interprets it. ## Only the velocity parser is executed on the file. ## The template is searched in the following locations, in this order: ## - as a property of the XWikiSkins object attached to the current skin document ## - as an attachment to the current skin document ## - as a file in the directory corresponding to the current skin ## - the above 3 locations corresponding to the base skin ## - the above 3 locations corresponding to the default skin ## - as a file in the /templates/ directory ## #macro(template $tname) $xwiki.parseTemplate($tname) #end ## ## ## #renderTemplate("name.vm") ## Searches for the given velocity template and renders it. ## The template is searched in the following locations, in this order: ## - as a property of the XWikiSkins object attached to the current skin document ## - as an attachment to the current skin document ## - as a file in the directory corresponding to the current skin ## - the above 3 locations corresponding to the base skin ## - the above 3 locations corresponding to the default skin ## - as a file in the /templates/ directory ## #macro(renderTemplate $tname ) $xwiki.renderTemplate($tname) #end ## ## ## #includeTopic("Space.Document") ## Includes another fully rendered document inside the current response. ## The topic is interpreted and rendered exactly as if it were viewed in a separate response, ## meaning that the $doc variable will point to the included document. The resulting string is ## wrapped with {pre}...{/pre}, in order to prevent double-rendering. ## The platform prevents recursive includes. ## This macro is useful for creating composite documents from smaller parts, or the other way around, ## splitting a large document into smaller distinct chunks which can be edited in parallel. ## #macro(includeTopic $topic) $xwiki.includeTopic($topic) #end ## ## ## #includeMacros("Space.Document") ## Includes the content of another document as velocity macros. Because of the way the velocity ## engine works, trying to place macros in another document and including it with another method ## will not have the expected result. Other than making the macros available, it works just as ## #includeForm($topic) ## #macro(includeMacros $topic) $xwiki.includeForm($topic) #end ## ## ## #includeForm("Space.Document") ## Includes another fully rendered document inside the current response. ## The included content is interpreted and rendered in the current context, meaning that $doc will ## point to the current document (the includer), and not the included one. The resulting string is ## wrapped with {pre}...{/pre}, in order to prevent double-rendering. ## The platform prevents recursive includes. ## This macro is the core of the document-template-sheet functionality of XWiki, where a document ## has an XObject attached to it, its content consists of the "#includeForm('Some.Sheet')" statement, ## and the sheet works just as if it were actually inside the document's content. ## #macro(includeForm $topic) $xwiki.includeForm($topic) #end ## ## ## #includeInContext("Some.Document") ## Alias for #includeForm ## #macro(includeInContext $topic) $xwiki.includeForm($topic) #end ## ## ## #includeServlet("/xwiki/bin/view/Some/Document?params") ## Invokes on the server another servlet corresponding to the passed URL, and returns the output. ## This is done using standard servlet mechanisms (javax.servlet.RequestDispatcher#include). ## #macro(includeServlet $url) $xwiki.invokeServletAndReturnAsString($url) #end ## ## ## #versions() ## Displays links to the last 4 versions (including the current one), and to the full history ## page of the current document. ## #macro(versions) #foreach($rev in $tdoc.getRecentRevisions(4)) $rev | #end #if ($tdoc.realLanguage!="") $msg.get("diff") | #else $msg.get("history") | #end #end ## ## ## #errorMarkup() ## Display all queued Struts errors ## #macro(errorMarkup) #if ($errors && $!errors.exist() )