[xwiki-dev] [Best practice] Test for Object in Class sheets

Vincent Massol vincent at massol.net
Tue Apr 17 11:49:37 CEST 2007


Added here: http://www.xwiki.org/xwiki/bin/view/DevGuide/BestPractices

Anyone wants to add some other best practice?

Thanks
-Vincent

On Apr 16, 2007, at 11:49 PM, Sergiu Dumitriu wrote:

>
>
> On 4/17/07, Vincent Massol <vincent at massol.net> wrote:
> Hi,
>
> I'd like to propose the following best practice: to test for Object
> existence in class sheets. For example:
>
> #set($obj = $doc.getObject("XWiki.XWikiUsers"))
> #if($obj)
>
> ...
>
> #else
>
> I'll add here:
> 1 User sheet
>
>    This stylesheet must be applied on a document containing a
> XWiki.XWikiUsers object.
> #end
>
> If you're all ok I'll add it to the dev guide on http://www.xwiki.org/
> xwiki/bin/view/DevGuide/BestPractices (I'll remove what's in there
> and send each best practice separately to this list for agreement as
> this is old stuff).
>
> Thanks
> -Vincent
>
>
> More, I'd reverse the two branches, as the document title will  
> otherwise be $obj.name. Because not all users will fill in the  
> title field.
>
> Sergiu
> -- 
> http://purl.org/net/sergiu
>
> --
> You receive this message as a subscriber of the xwiki- 
> dev at objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-dev-unsubscribe at objectweb.org
> For general help: mailto:sympa at objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/ 
> wws

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xwiki.org/pipermail/devs/attachments/20070417/112577ec/attachment.html 


More information about the devs mailing list