Maybe it is bad design for custom solution, but for management
simplicity I store different objects
(values for database lists for form selections) in the same space.
Now they are quite many and listing class name for this object would
help.
Your code require iteration over all used classes, and searching for
appropriate documents.
I assume, more efficient way would be starting from documents and
finding their classes.
Another solution would be adding prefix in names, to distinguish them,
but this requires data changes.
Valdis
On 02/10/2010 05:43 PM, Valdis Vītoliņš wrote:
Can somebody provide code snippet
how to got associated class name for documents in space
which have added custom objects?
e.g. this simply list different objects in space
{{velocity}}
#set($hql = "where doc.space='Custom' order by doc.name asc")
#set($results = $xwiki.searchDocuments($hql, 0, 0))
#foreach ($item in $results)
* [[$item]]
#end
{{/velocity}}
and I'd like to get class names for different types of listed
docs/objects
Thanks in advance,
Valdis
I'm not sure I understand the question. Do you want to list all
documents in a space having an object from a given type?
", BaseObject obj where doc.space='Custom' and obj.name=doc.fullName and
obj.className='Custom.MyClass'"