jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Kennedy <da...@us.ibm.com>
Subject Re: [jira] Resolved: (JCR-349) New node type namespaces should be automatically registered
Date Mon, 24 Apr 2006 03:48:54 GMT
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?


"Jukka Zitting (JIRA)" <jira@apache.org> 
04/22/2006 06:51 PM
Please respond to


[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:

> 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:
For more information on JIRA, see:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message