Best Practices
Version 3.2 by Silvia Macovei on 2010/02/26
XWiki Application Organization
This Best Practices document explains how to best organize an XWiki Application.
Check for Object existence in Class Sheets documents
Class sheet documents should be written using the following construct (this is an example for displaying documents containing XWiki.XWikiUsers objects):
#set($obj = $doc.getObject("XWiki.XWikiUsers"))
#if(!$obj)
1 User Sheet
This stylesheet must be applied on a document containing a XWiki.XWikiUsers object.
#else
1 $msg.get("userProfile", [$xwiki.getUserName($doc.fullName, false)])
...
#end
#if(!$obj)
1 User Sheet
This stylesheet must be applied on a document containing a XWiki.XWikiUsers object.
#else
1 $msg.get("userProfile", [$xwiki.getUserName($doc.fullName, false)])
...
#end