gregoryjoseph a écrit :
> Thanks for the hint; however, I still don't know what any of the values are.
> My initial fake query might have been misleading because of the
> prop_name='foo' clause, might have been clearer with prop_name='tag'. In
> short, I know the property *name* I'm looking for, and I want to collect all
> its existing *values* over a set of nodes in my tree.
>
Hi Gregory,
Because you want to browse tags, you might want to change your model by:
- creating a branch with the tags (/jcr:root/tags/foo)
- references these tags in your node by using a path property or
a reference property.
Reference property allow you to count references and then simply use:
node.getReferences().getSize()
on the tag node to get its sizes.
But, references comes with somes constraints [1].
The "query" will just be :
List<Pair<String, Integer>> tagCloud = new ArrayList()
for (Node node : tagsNode.getNodes())
tagCloud.add(new Pair(node.getName(), node.getReferences().getSize())
[1]
http://wiki.apache.org/jackrabbit/DavidsModel#head-ed794ec9f4f716b3e53548be6dd91b23e5dd3f3a
--
Sébastien Launay
|