From users-return-9356-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Tue Oct 21 20:17:08 2008 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 8481 invoked from network); 21 Oct 2008 20:17:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Oct 2008 20:17:08 -0000 Received: (qmail 56741 invoked by uid 500); 21 Oct 2008 20:17:09 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 56723 invoked by uid 500); 21 Oct 2008 20:17:09 -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 56712 invoked by uid 99); 21 Oct 2008 20:17:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 13:17:09 -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 207.126.148.181 as permitted sender) Received: from [207.126.148.181] (HELO eu3sys201aog001.obsmtp.com) (207.126.148.181) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 21 Oct 2008 20:15:57 +0000 Received: from source ([209.85.198.249]) by eu3sys201aob001.postini.com ([207.126.154.11]) with SMTP; Tue, 21 Oct 2008 20:16:33 UTC Received: by rv-out-0708.google.com with SMTP id f25so2167791rvb.32 for ; Tue, 21 Oct 2008 13:16:33 -0700 (PDT) Received: by 10.141.129.14 with SMTP id g14mr5922940rvn.56.1224619593474; Tue, 21 Oct 2008 13:06:33 -0700 (PDT) Received: by 10.141.122.19 with HTTP; Tue, 21 Oct 2008 13:06:33 -0700 (PDT) Message-ID: Date: Tue, 21 Oct 2008 22:06:33 +0200 From: "Alexander Klimetschek" To: users@jackrabbit.apache.org Subject: Re: node types In-Reply-To: <20097843.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20093480.post@talk.nabble.com> <20097843.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Oct 21, 2008 at 9:40 PM, vlad_v wrote: > primaryItemName="jcr:content"> > > nt:folder > nt:file > You should not extend from both nt:folder and nt:file at the same time (multiple inheritance). > autoCreated="false" mandatory="false" > onParentVersion="COPY" > protected="false" multiple="false"/> > > > > I put the file in the repository/nodetypes and it is called > custom_nodetypes.xml. You should register the node type via the NodeTypeManager as described on http://jackrabbit.apache.org/node-types.html > It seems to be correct the sintax because tomcat > doesn't produce any exceptions at startup. > but, when i do this : > > node.addNode(login, "nt:owner"); > i get: > > javax.jcr.nodetype.ConstraintViolationException: /new_folder/vlad1: > mandatory child node {http://www.jcp.org/jcr/1.0}content does not exist Did you add a subnode jcr:content before you called saved? nt:file requires the mandatory child node jcr:content (and your nt:owner type extends from nt:file). > I thought it is not good to use the namespace "nt" and i put in > ns_reg.properties > a new line: owner=http://www.jcp.org/jcr/1.0 but tomcat complains with > Unknown namespace prefix owner. You have to define the new namespace "owner" in the node type xml root element (just as the others already present) and, as mentioned above, register the new node types through the java api. Namespaces will be registered automatically. Directly modifying ns_reg.properties is not recommended (for example, you have to change the ns_idx.properties accordingly, which can be tricky). Regards, Alex -- Alexander Klimetschek alexander.klimetschek@day.com