Changes for page Best Practices

Last modified by Vincent Massol on 2017/09/05

From version < 1.3 >
edited by Vincent Massol
on 2007/04/17
To version 1.1 >
edited by Vincent Massol
on 2006/12/05
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,22 +1,28 @@
1 1  1 Best Practices
2 2  
3 -#toc("" "" "")
3 +1.1 Naming Best Practices
4 4  
5 -1.1 Check for Object existence in Class Sheets documents
5 +1.1.1 Application
6 +* Each application must have its own Space if a user interface is needed.
6 6  
7 -Class sheet documents should be written using the following construct (this is an example for displaying documents containing XWiki.XWikiUsers objects):
8 +1.1.1 Classes
9 +* Classes must be in the XWiki space
10 +* The name must end with "Class" like "TagClass"
8 8  
9 -{code}
10 -\#set($obj = \$doc.getObject("XWiki.XWikiUsers"))
11 -\#if(!$obj)
12 - \1 User Sheet
13 - This stylesheet must be applied on a document containing a XWiki.XWikiUsers object.
14 -\#else
15 - \1 \$msg.get("userProfile", [\$xwiki.getUserName($doc.fullName, false)])
16 - ...
17 -\#end
18 -{code}
12 +1.1.1 Macro
13 +* Macro must be in the XWiki space
14 +* The name must end with "Macro" like "TagMacro"
19 19  
20 -#info("The 'if' tests first for the non existence. This is so that XWiki extract the title from the ~~1 User Sheet~~, which is a proper title to display when viewsing the sheet page, instead of the computed name which will usually display something wrong.")
16 +1.1.1 Sheets
17 +* Sheets must be in the XWiki space
18 +* The name must end with "Sheet" like "TagSheet"
21 21  
20 +1.1.1 Templates
21 +* Templates must be in the XWiki space
22 +* The name must end with "Templates" like "TagTemplates"
22 22  
24 +1.1.1 Objects
25 +* Objects must be in their own space
26 +
27 +<span style="background-color:yellow">TODO: Explain the reasons behind these practices</span>
28 +

Get Connected