[xwiki-users] Looping through staticlist contents; and others

Robin Fernandes rewbs.soal at gmail.com
Mon Feb 12 00:37:13 CET 2007


Hi,

I too wanted to get all available options for a list property,
preferably as a simple ArrayList for easy use in a script. The method
I found works with both static lists and db lists, but required
programming rights - which is going to be a problem for me.

Is there another way to do this that doesn't require programming rights?

1.1.1 All available items for a list property
#### $doc contains an instance of class "Main.MyClass"
#### whose list prop is called "theList".
#set($obj=$doc.getObject("Main.MyClass"))
#set($propName="theList")

#### These operations that require programming rights
#set($xCtx=$context.getContext())
#set($xObj=$obj.getXWikiObject())
#set($xClass=$xObj.getxWikiClass($xCtx))
#set($xProp=$xClass.get($propName))

#set($allItems=$xProp.getList($xCtx))
#foreach ($item in $allItems)
  * $item
#end



On 08/02/07, Esbach, Brandon <Esbachb at tycoelectronics.com> wrote:
>
>
>
> Hi All,
>
> I was wondering if there was a simple way to get all the options for a
> static list - eg, via a query?
> In a few of my custom classes, I have several staticlist properties - I need
> to cycle through the available options of each within velocity.
>
> Brandon Esbach
> Software Engineer
> M/A-Com Eurotec Operations
> LoughMahon Technology Park,
> Skehard Road,
> Blackrock,
> Cork, Ireland
> Tel  +353 21 4808305
>
> --
> You receive this message as a subscriber of the xwiki-users at objectweb.org
> mailing list.
> To unsubscribe:
> mailto:xwiki-users-unsubscribe at objectweb.org
> For general help: mailto:sympa at objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>




More information about the users mailing list