Pascal Voitot wrote:
Hello,
I want to do the following:
I create a class with one LongProperty field containing a long ID of another
BaseObject.
The idea is to link an object to another object by simply using its hashcode
ID and not the whole docname+classname+nb string. A one-to-one association
if you prefer.
$xwiki.search("from BaseObject as obj...") will return a BaseObject so I can
get the ID here.
But in velocity, I access objects using $doc.getObject() which returns a
Object API.
I can't find any simple way to retrieve the ID of the nested BaseObject from
Object API because getBaseObject requires programming rights.
Do you have an idea for me?
Is it mandatory to use the docname+classname+nb string to identify an object
from velocity?
If you don't want to use programming rights, then yes. The object ID is
internal, and should not be used directly.
--
Sergiu Dumitriu
http://purl.org/net/sergiu/