From jackrabbit-dev-return-5413-apmail-incubator-jackrabbit-dev-archive=www.apache.org@incubator.apache.org Wed Feb 01 13:47:56 2006 Return-Path: Delivered-To: apmail-incubator-jackrabbit-dev-archive@www.apache.org Received: (qmail 26491 invoked from network); 1 Feb 2006 13:47:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Feb 2006 13:47:56 -0000 Received: (qmail 94992 invoked by uid 500); 1 Feb 2006 13:47:54 -0000 Mailing-List: contact jackrabbit-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-dev@incubator.apache.org Received: (qmail 94981 invoked by uid 99); 1 Feb 2006 13:47:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2006 05:47:54 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [81.223.48.5] (HELO mailrelay.edis.at) (81.223.48.5) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2006 05:47:53 -0800 Received: from [192.168.40.105] (83-64-161-207.finon.xdsl-line.inode.at [::ffff:83.64.161.207]) (AUTH: CRAM-MD5 michael.singer@it-specialist.at) by mailrelay.edis.at with esmtp; Wed, 01 Feb 2006 14:47:32 +0100 id 0028C0D4.43E0BBF4.0000198C Message-ID: <43E0BBF1.1040208@it-specialist.at> Date: Wed, 01 Feb 2006 14:47:29 +0100 From: Michael Singer User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: jackrabbit-dev@incubator.apache.org Subject: Re: Behavior of CompactNodeTypeDefReader in contribution nt-ns-util References: <43E090F2.30607@it-specialist.at> <8be731880602010534g43e359adp47dfa61daf2ef87a@mail.gmail.com> In-Reply-To: <8be731880602010534g43e359adp47dfa61daf2ef87a@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N this issue arraised due to my weird implementation of building a NodeType-Dependancy Tree ;-) I am adding each Type to its declared SuperTypes (encapsulated as TreeNodes of course) and this generated tree looks realy strange because every type is added to nt:base AND its declared SuperTypes. Anyway, thank you for fixing it... Tobias Bocanegra wrote: > hi michael, > you are right. this extra declaration is not needed (but does not do > any harm neither). i will fix this. thanks for reporting this. > > regads, toby > > On 2/1/06, Michael Singer wrote: >> Hi list, >> >> I wrote a simple program which uses the nt-ns-util contribution to >> register custom node types written in CND language. >> >> I defined the following (very simple) custom node types: >> >> >> [test:firstnodetype] >> + test:secondnodetype mandatory >> >> >> [test:secondnodetype] > test:firstnodetype >> + test:thirdnodetype >> >> >> [test:thirdnodetype] > test:secondnodetype >> - test:catalog (string) < 'URI', 'URN', 'DOI', 'ISBN', 'ISSN' >> - test:entry (string) m >> >> >> In the resulting custom_nodetypes.xml each of the custom nodes has a >> supertype of "nt:base" but I didn't explicitely define a supertype of >> "nt:base" for [test:secondnodetype] and [test:thirdnodetype]. >> >> I think this behavior is wrong since the method getDeclaredSupertypes() >> of class NodeType always returns "nt:base" plus the explicitely declared >> Supertype (which it e.g. does not for "nt:folder"). >> >> I changed the code to avoid the creation of "nt:base" supertypes if not >> explicitely declared (if no supertype is declared "nt:base" still gets >> created). This patch will do the change: >> >> Index: >> Z:/_DATA/workspace/nt-ns-util/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java >> =================================================================== >> --- >> Z:/_DATA/workspace/nt-ns-util/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java >> (revision 374032) >> +++ >> Z:/_DATA/workspace/nt-ns-util/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java >> (working copy) >> @@ -206,7 +206,7 @@ >> // add nt:base to superclasses if not mixin >> if (!ntd.isMixin()) { >> HashSet superTypes = new >> HashSet(Arrays.asList(ntd.getSupertypes())); >> - if (!superTypes.contains(QName.NT_BASE)) { >> + if (superTypes.size() == 0) { >> superTypes.add(QName.NT_BASE); >> ntd.setSupertypes((QName[]) superTypes.toArray(new >> QName[superTypes.size()])); >> } >> >> Can someone tell me if I am missing something? >> >> -- >> kind regards >> >> Michael >> > > > -- > -----------------------------------------< tobias.bocanegra@day.com >--- > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel > T +41 61 226 98 98, F +41 61 226 98 97 > -----------------------------------------------< http://www.day.com >--- -- kind regards Michael