Question Can you create a page pointing to all pages with a certain property value?
Answer I figured out that it's possible to do this using velocity script:

* Get a list of documents using \$xwiki.searchDocuments().   This returns a list of document names in string format, not a list of document objects.
* Iterate through the list using a \#foreach statement.  For each result:
** use \$xwiki.getDocument($docname) to obtain the document object
** Then use the document.getObject(\$objectname) function to obtain the object you're interested in
** Finally use object.getProperty(\$propname).getValue() to obtain the value of the desired property, and use this to determine whether this document meets your criteria
Note: I had some problems with set statements, because if you try to set a variable to a null object, it seems to retain it's old value? So when iterating over pages which might not have a certain object, be careful to check the property directly.
Version 1.5 last modified by Mattia Colagrossi on 14/12/2007 at 17:08

Comments 1

su_liam | 20.01.2006 at 09:32 AM
My effort at this has failed horribly. Would it be possible to see an example of this?

Thanks

Attachments 0

No attachments for this document

Creator: starwed on 2006/01/14 21:37
This wiki is licensed under a Creative Commons license
1.3.2.9174