You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Christoph Kiehl <ki...@subshell.com> on 2006/08/18 15:18:50 UTC

Reregistering Nodetypes

Hi,

currently there are only API methods to register new nodetypes but not to modify 
  aka reregister nodetypes.
I would like to add the following methods to JackrabbitNodeTypeManager:

NodeType[] registerNodeTypes(InputSource in, boolean reregisterExistent)
NodeType[] registerNodeTypes(InputStream in, String contentType, boolean 
reregisterExistent)

If the parameter reregisterExistent is true, already existent nodetypes will be 
reregistered.
What do you think about that? Did I miss anything?

Cheers,
Christoph


Re: Reregistering Nodetypes

Posted by Stefan Guggisberg <st...@gmail.com>.
On 8/18/06, Christoph Kiehl <ki...@subshell.com> wrote:
> Nicolas wrote:
>
> > Why not use
> > EffectiveNodeType<file:///home/ntoper/ebooks/jackrabbit/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.html>
> >
> > *reregisterNodeType<file:///home/ntoper/ebooks/jackrabbit/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.html#reregisterNodeType%28org.apache.jackrabbit.core.nodetype.NodeTypeDef%29>
> >
> > *(NodeTypeDef<file:///home/ntoper/ebooks/jackrabbit/org/apache/jackrabbit/core/nodetype/NodeTypeDef.html>
> >
> > ntd) from the NodeTypeRegistry?.
>
> Because of three things:
>
> 1. NodeTypeRegistry is no part of the public API, but JackrabbitNodeTypeManager
> is to my understanding.
> 2. My nodetype definitions are in CND-Format. If I want to change my node types
> I could parse them with CompactNodeTypeDefReader. But as far as I can see there
> is no possibility to get the namespaces defined in the CND file and register
> them before my nodetypes.
> 3. A lot of people are asking for such a feature and I think my proposed
> solution is an easy way for everyone to change nodetypes.

unfortunately supporting node type modifications requires more than just adding
a method... see http://issues.apache.org/jira/browse/JCR-322

cheers
stefan

>
> Cheers,
> Christoph
>
>

Re: Reregistering Nodetypes

Posted by Christoph Kiehl <ki...@subshell.com>.
Nicolas wrote:

> Why not use  
> EffectiveNodeType<file:///home/ntoper/ebooks/jackrabbit/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.html> 
> 
> *reregisterNodeType<file:///home/ntoper/ebooks/jackrabbit/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.html#reregisterNodeType%28org.apache.jackrabbit.core.nodetype.NodeTypeDef%29> 
> 
> *(NodeTypeDef<file:///home/ntoper/ebooks/jackrabbit/org/apache/jackrabbit/core/nodetype/NodeTypeDef.html> 
> 
> ntd) from the NodeTypeRegistry?.

Because of three things:

1. NodeTypeRegistry is no part of the public API, but JackrabbitNodeTypeManager 
is to my understanding.
2. My nodetype definitions are in CND-Format. If I want to change my node types 
I could parse them with CompactNodeTypeDefReader. But as far as I can see there 
is no possibility to get the namespaces defined in the CND file and register 
them before my nodetypes.
3. A lot of people are asking for such a feature and I think my proposed 
solution is an easy way for everyone to change nodetypes.

Cheers,
Christoph


Re: Reregistering Nodetypes

Posted by Nicolas <nt...@gmail.com>.
Hi,

Why not use  EffectiveNodeType<file:///home/ntoper/ebooks/jackrabbit/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.html>
*reregisterNodeType<file:///home/ntoper/ebooks/jackrabbit/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.html#reregisterNodeType%28org.apache.jackrabbit.core.nodetype.NodeTypeDef%29>
*(NodeTypeDef<file:///home/ntoper/ebooks/jackrabbit/org/apache/jackrabbit/core/nodetype/NodeTypeDef.html>
 ntd) from the NodeTypeRegistry?.

Nico

On 8/18/06, Christoph Kiehl <ki...@subshell.com> wrote:
>
> Hi,
>
> currently there are only API methods to register new nodetypes but not to
> modify
>   aka reregister nodetypes.
> I would like to add the following methods to JackrabbitNodeTypeManager:
>
> NodeType[] registerNodeTypes(InputSource in, boolean reregisterExistent)
> NodeType[] registerNodeTypes(InputStream in, String contentType, boolean
> reregisterExistent)
>
> If the parameter reregisterExistent is true, already existent nodetypes
> will be
> reregistered.
> What do you think about that? Did I miss anything?
>
> Cheers,
> Christoph
>
>


-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Reregistering Nodetypes

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 8/18/06, Christoph Kiehl <ki...@subshell.com> wrote:
> Ok. May be we could add a
>
> reregisterNodeTypes(InputStream in, String contentType)
>
> to NodeTypeManagerImpl? I just want to avoid to c&p the code from
> NodeTypeManagerImpl and save everyone else the hassle to reinvent that code ;)

Sounds good, I'd be happy to apply a patch for that. :-) I'm fine as
long as it's not in o.a.j.api causing backwards compatibility issues.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Re: Reregistering Nodetypes

Posted by Christoph Kiehl <ki...@subshell.com>.
Jukka Zitting wrote:

>> currently there are only API methods to register new nodetypes but not 
>> to modify
>> aka reregister nodetypes. I would like to add the following methods to
>> JackrabbitNodeTypeManager:
> 
> The current reregister functionality is quite limited in the kinds of
> node type modifications it can do, and there's also been some concern
> on how node type modifications relate to content consistency. One of
> the JSR 283 goals is to specify a node type management API and our
> plan is to implement that API once it's public.

Yeah, I read the current JSR 283 and I like the choosen approach. But I fear 
that I might take some time before JSR 283 is final and integrated in Jackrabbit?!
In our case I only need support for trivial nodetype changes since our content 
database is too huge anyway to effectively check for content consistency.

> Thus at least I am a bit reluctant on publishing any more of the
> current node type management functionality in the o.a.j.api
> interfaces, i.e. I wouldn't want to commit to maintaining backwards
> compatibility for them, especially since the current functionality is
> too limited for many common use cases.

Ok. May be we could add a

reregisterNodeTypes(InputStream in, String contentType)

to NodeTypeManagerImpl? I just want to avoid to c&p the code from 
NodeTypeManagerImpl and save everyone else the hassle to reinvent that code ;)

Cheers,
Christoph


Re: Reregistering Nodetypes

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 8/18/06, Christoph Kiehl <ki...@subshell.com> wrote:
> currently there are only API methods to register new nodetypes but not to modify
> aka reregister nodetypes. I would like to add the following methods to
> JackrabbitNodeTypeManager:

The current reregister functionality is quite limited in the kinds of
node type modifications it can do, and there's also been some concern
on how node type modifications relate to content consistency. One of
the JSR 283 goals is to specify a node type management API and our
plan is to implement that API once it's public.

Thus at least I am a bit reluctant on publishing any more of the
current node type management functionality in the o.a.j.api
interfaces, i.e. I wouldn't want to commit to maintaining backwards
compatibility for them, especially since the current functionality is
too limited for many common use cases.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development