Hello,
I read/apply this doc with succcess:
http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HAccessobjectsin…
With this code I can display all objects ATTACHED to THIS page.
***********
#set($class = $obj.xWikiClass) ## access the class object representing
SomeSpace.SomeClass
#foreach($prop in $class.properties) ## go through all properties
...
***********
but if I attached some class to another page, how can I list properties?
Another question:
I have a page with 3 same Class, how to list them (like ?editor=class did)?
An example:
MySpaceMyClass contain this Class properties:
- My Field ID (IdField: String)
- My Lib Field (LibField: String)
I create MySpace.MyNiceDoc and add my previous Class MySpace/MyNiceDoc?editor=object
and contain:
Objets de type MySpace.MyClass (2)
* MyClass 0
- My Field ID
- My Lib Field
*MyClass 1:
- My Field ID
- My Lib Field
With it I like to fill a select list from this doc (but from another doc to).
How can I proceed? because on MySpace.MyNiceDoc I can only display one/First Lib values
with this code:
{{velocity}}
## Retrieve the first object (index [0]) among all objects attached to this page and of a
certain class
#set($obj = $doc.getObject('MySpace.MyClass'))
#set($class = $obj.xWikiClass) ## access the class object representing
SomeSpace.SomeClass
#foreach($prop in $class.properties) ## go through all properties
* ${prop.prettyName} : $doc.display($prop.getName())
#end
{{/velocity}}
I guess i need a loop but which one?
And the big question (who I think it will interest everyone), how can I use documentation
(
http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation?xpage=embed and or
http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/or…
)
to guess xWikiClass (or my loop) by example?
A doc/example to use documentation will be welcome. :-)
thxs for any help.
Pascal B