Hello xwiki users

I need a little bit of light about reference.

I use this methods, hasParent(EntityReference expectedParent) and i noticed 
that I can not use string to set EntityReference.
Then i must use this before: "#set ($reference = 
$services.model.resolveSpace('xwiki:Encyclopédie'))" and 
"$doc.documentReference.hasParent($reference)" because 
$doc.documentReference.hasParent('xwiki:Encyclopédie') doesn't work.
Am I right? Anyway, I can understand that.

Another point about documentation 
http://extensions.xwiki.org/xwiki/bin/view/Extension/Model+Module#HScriptServiceAPI
 (because I spend a lot of time to identify my issue because the "x" characters:
Create a Document Reference: "#set ($reference = 
$services.model.createDocumentReference("wiki", ["space"], "page"))"
 but
$doc.documentReference.spaceReferences.get(0) display "Space 
xwiki:Encyclopédie".
Reference use "xwiki" but createDocumentReference use "wiki"?
"wiki" is it a wiki name example?

Another question:
What is the difference between: $services.model.createDocumentReference and 
services.model.resolveDocument?
With resolveDocument the Page must exist?
Can I use CreateDocumentReference if target document exist?

Last point:
I think these 2 simples examples missing in: 
http://extensions.xwiki.org/xwiki/bin/view/Extension/Model+Module#HScriptServiceAPI
#set ($reference = $services.model.resolveSpace('xwiki:MySpace'))
#set ($reference = $services.model.resolveSpace('xwiki:MySpace.MyPage'))
What do you think?

Ty

Pascal B
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to