Thank you for you prompt reply and for the tip.
It's a code feature but a javadoc issue :
Hope this help to enhance xwiki documentation :)
2011/8/22 Vincent Massol <vincent(a)massol.net>et>:
Hi,
On Aug 22, 2011, at 5:41 PM, Maxime Sinclair wrote:
Hi,
In XE 2.7.2 and 3.1, using Groovy in a wiki page, a call to
- xwiki.getDocument( "Main.WebHome") returns the correct document object
- xwiki.getDocument( "WebHome") returns the WebHome doc object of the
current space (not really documented in the javadoc)
- xwiki.getDocument( "NotExistingDocName") returns a Document object
(a empty one I suppose) instead of a null
Is it a bug or do I miss something ?
It's a feature. It creates a doc if it doesn't exist (but not saved).
Is there another way to test that a page,
specified by its name, exists ?
xwiki.getDocument( "NotExistingDocName").isNew().
Thanks
-Vincent
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users