<
From version < 6.1 >
edited by Vincent Massol
on 2012/11/17
To version < 6.2 >
edited by Manuel Smeria
on 2013/01/24
>
Change comment: minor fixes

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.ManuelSmeria
Content
... ... @@ -1,7 +1,11 @@
1 +{{box cssClass="floatinginfobox" title="**Contents**"}}
1 1  {{toc/}}
3 +{{/box}}
4 +
2 2  = Where to put code? =
3 3  
4 -Since xwiki allows to put code both in wiki pages and in Java you might wonder where you should put your code. Here's some general guidelines:
7 +Since xwiki allows you to put code both in wiki pages and in Java you might wonder where you should put your code. Here are some general guidelines:
8 +
5 5  * Don't put "business logic" code in wiki pages. Use Java for that. This gives you nice IDEs, the ability to easily debug the code and the ability to write automated unit tests. Generally speaking it makes it easy on maintenance.
6 6  * In general put the minimum amount of scripts in your wiki pages since that makes it harder to maintain.
7 7  * The only scripts that you may put in wiki pages are "presentation logic" code.
... ... @@ -28,7 +28,7 @@
28 28  {{/code}}
29 29  
30 30  {{info}}
31 -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.
35 +The 'if' tests first for the non existence. This is so that XWiki can 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.
32 32  {{/info}}
33 33  
34 34  = Handling errors when using xredirect for non-Javascript UIs =

Get Connected