Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 33567 invoked from network); 24 Apr 2006 03:46:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Apr 2006 03:46:08 -0000 Received: (qmail 67663 invoked by uid 500); 24 Apr 2006 03:46:07 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 67574 invoked by uid 500); 24 Apr 2006 03:46:06 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 67565 invoked by uid 99); 24 Apr 2006 03:46:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Apr 2006 20:46:06 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of davek@us.ibm.com designates 32.97.110.150 as permitted sender) Received: from [32.97.110.150] (HELO e32.co.us.ibm.com) (32.97.110.150) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Apr 2006 20:46:05 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k3O3jgbE008525 for ; Sun, 23 Apr 2006 23:45:42 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k3O3fr3L206978 for ; Sun, 23 Apr 2006 21:41:57 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id k3O3jcMA008617 for ; Sun, 23 Apr 2006 21:45:38 -0600 Received: from d03nm119.boulder.ibm.com (d03nm119.boulder.ibm.com [9.17.195.145]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id k3O3jcDc008614 for ; Sun, 23 Apr 2006 21:45:38 -0600 In-Reply-To: <7246864.1145746271514.JavaMail.jira@brutus> To: dev@jackrabbit.apache.org Subject: Re: [jira] Resolved: (JCR-349) New node type namespaces should be automatically registered MIME-Version: 1.0 X-Mailer: Lotus Notes Release 7.0 HF144 February 01, 2006 From: David Kennedy Message-ID: Date: Sun, 23 Apr 2006 23:48:54 -0400 X-MIMETrack: Serialize by Router on D03NM119/03/M/IBM(Release 6.53HF654 | July 22, 2005) at 04/23/2006 21:48:57, Serialize complete at 04/23/2006 21:48:57 Content-Type: multipart/alternative; boundary="=_alternative 0014A5FA8525715A_=" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --=_alternative 0014A5FA8525715A_= Content-Type: text/plain; charset="US-ASCII" Hi Jukka, I looked at the changes you made to the registerNamespace method in the NodeTypeManagerImpl to find a unique prefix and was hoping you could shed some light on why you continue to try to find a different unique prefix if the original prefix is already registered. If I'm defining nodetypes and am using prefix foo mapped to uri http://myfoo.namespace, I'll have cases in my nodetype definition and my code looking for names and types using the foo prefix. If, when registering the namespace, the uri http://myfoo.namespace was not found, but the foo prefix was registered against another namespace, say http://someother.namepspace, the code you modified will continue to register the uri against foo2 and so forth. Won't it be a problem not that my nodetypes and code are referencing nodes and types in the http://someother.namespace space since I'm using the foo prefix and don't know about the foo2 prefix? David "Jukka Zitting (JIRA)" 04/22/2006 06:51 PM Please respond to dev@jackrabbit.apache.org To dev@jackrabbit.apache.org cc Subject [jira] Resolved: (JCR-349) New node type namespaces should be automatically registered [ http://issues.apache.org/jira/browse/JCR-349?page=all ] Jukka Zitting resolved JCR-349: ------------------------------- Fix Version: 1.1 Resolution: Fixed Great work David, thanks a lot! I applied your patch in revision 396173 with minor cleanups and modifications listed below: * Changed code formatting to match the Jackrabbit conventions (see the Checkstyle configuration) * Made some minor reorganizations to make the code flow more apparent. * Added automatic namespace prefix generation as discussed below. * Made the unit tests check for existing namespaces to avoid errors when rerunning the test suite. * Used the TestRepository factory instead of the TransientRepository class to better integrate the unit tests with the main test suite. > I don't follow the "generate another PREFIX". I changed the code to check for the uri, but if the uri isn't found, I just try to > register the prefix to uri.....if the prefix is already registered to a different uri, we'll get an exception which is what we want. > If the prefix isn't registered, we're good to go. Let me know if I'm missing something. The namespace prefix is not really essential internally, so we can avoid the exception caused by a possible prefix conflict, by automatically generating a unique prefix in such a case. > New node type namespaces should be automatically registered > ----------------------------------------------------------- > > Key: JCR-349 > URL: http://issues.apache.org/jira/browse/JCR-349 > Project: Jackrabbit > Type: Improvement > Components: config > Versions: 0.9, 1.0 > Reporter: Jukka Zitting > Assignee: Jukka Zitting > Priority: Minor > Fix For: 1.1 > Attachments: nsreg, nsreg > > A user currently needs to explicitly register any new namespaces used in new node types before registering the node types. See for example the problem on the mailing list: > http://mail-archives.apache.org/mod_mbox/incubator-jackrabbit-dev/200603.mbox/%3c1142091097.13136.0.camel@localhost.localdomain%3e > The node type registration should be changed so that new namespaces are automatically registered. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --=_alternative 0014A5FA8525715A_=--