On Tue, Jul 8, 2008 at 2:49 PM, Matthijs Wensveen <[EMAIL PROTECTED]> wrote:
> Is it possible to ask a Node whether it has child nodes of a specific
> nodeType? Currently I'm able to do this with an XPath query, but it would be
> a lot easier, and possibly faster, when I could ask this to the node
> directly.

No, this is not possible, but you can easily filter the nodes in the
iterator returned by Node.getNodes(). This would not be a performance
difference if it would be implemented directly in JCR.

> Also, is it possible to mark a child node definition that is also marked as
> 'multiple' with 'primary'? If that is the case, maybe I could use
> getPrimaryItem.

Node.getPrimaryItem() simple does a getProperty() or getNode() (if
property exists, it is preferred) with the exact name defined in the
primaryItem setting of the node type. So if you have same name
siblings, you can only get one of them (eg. "mychildnode" or
"mychildnode[2]").

Regards,
Alex

-- 
Alexander Klimetschek
[EMAIL PROTECTED]

Reply via email to