Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 60816 invoked from network); 8 Jul 2008 15:28:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jul 2008 15:28:50 -0000 Received: (qmail 25934 invoked by uid 500); 8 Jul 2008 15:28:49 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 25919 invoked by uid 500); 8 Jul 2008 15:28:49 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 25908 invoked by uid 99); 8 Jul 2008 15:28:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jul 2008 08:28:49 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aklimets@day.com designates 62.192.10.254 as permitted sender) Received: from [62.192.10.254] (HELO goobak01.day.com) (62.192.10.254) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jul 2008 15:27:57 +0000 Received: by goobak01.day.com (Postfix, from userid 1212) id 8FE635087F; Tue, 8 Jul 2008 17:27:52 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.238]) by goobak01.day.com (Postfix) with ESMTP id 2B41250843 for ; Tue, 8 Jul 2008 17:27:51 +0200 (CEST) Received: by wx-out-0506.google.com with SMTP id i31so971450wxd.28 for ; Tue, 08 Jul 2008 08:27:59 -0700 (PDT) Received: by 10.142.217.17 with SMTP id p17mr1839253wfg.105.1215530878985; Tue, 08 Jul 2008 08:27:58 -0700 (PDT) Received: by 10.142.148.15 with HTTP; Tue, 8 Jul 2008 08:27:53 -0700 (PDT) Message-ID: Date: Tue, 8 Jul 2008 17:27:53 +0200 From: "Alexander Klimetschek" To: users@jackrabbit.apache.org Subject: Re: Node.getNodes and Node.hasNodes for a specific nodeType In-Reply-To: <48736267.1040904@func.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48736267.1040904@func.nl> X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Jul 8, 2008 at 2:49 PM, Matthijs Wensveen 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 alexander.klimetschek@day.com