Tobias Bocanegra wrote:
On 7/8/08, Matthijs Wensveen <[EMAIL PROTECTED]> wrote:
Hi,
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.
yes, you can pass a filter for the Node.getNodes() call where you can
for example test the node.isNodeType().
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.
My node type is defined as:
[eb:ContentTreeItem]
- eb:friendlyName
+ eb:specialPage = eb:SpecialPage
multiple
+ * = eb:ContentTreeItem
multiple
no, a primary item can't be a SNS node def. Do you really need SNS for
your content tree items? SNS usually cause more problems than distinct
node names. especially in a tree, i would name the nodes according to
the name of the tree node.
Ah, sorry, the the definition is incorrect, the '*' item does not have
multiple on it. But I think the same answer applies to wildcard
children? The problem is that I don't know the name in advance, so I
can't test for a specific child. The node.isNodeType suggestion is a
good one though. I'll implement that.
Thanks (also Alexander),
Matthijs
--
Matthijs Wensveen
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500