Groovy
Retrieve the first object (index [0]) among all objects attached to this page and class XWikiComments
com.xpn.xwiki.api.Object@18a12ec2
Retrieve all objects attached to this page and of class XWikiComments
[com.xpn.xwiki.api.Object@2526c4e6, com.xpn.xwiki.api.Object@1448eb18, com.xpn.xwiki.api.Object@3f427f0f, com.xpn.xwiki.api.Object@26a3d23b, com.xpn.xwiki.api.Object@4d3f334e, com.xpn.xwiki.api.Object@70416d80, com.xpn.xwiki.api.Object@577c2813, com.xpn.xwiki.api.Object@182b2444, com.xpn.xwiki.api.Object@3859f8c1, com.xpn.xwiki.api.Object@1ada63ce]
Retrieve the author property of all objects attached to this page and of class XWikiComments
println objsAuthors
[
First comment
,Second comment
,Third comment
,Fourth comment
,Fifth comment
,Sixth comment
,Seventh comment
,Fetch an element of a list by index
http://langref.org/all-languages/lists/access/fetch-by-index
result = list[2] // index starts at 0
println result
Check the code proposed by Vincent here...
http://xwiki.475771.n2.nabble.com/Groovy-equivalents-to-Velocity-examples-td7602776.html
Retrieve the author property of the fifth object attached to this page and of class XWikiComments by index
println objsAuthor
XWiki.IsabelListaGarcia
Retrieve the author property of the first object attached to this page and of class XWikiComments by index; objs was assigned above!
XWiki.RicardoRodriguezFernandez