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 <ck...@sulu3000.de> on 2007/08/11 22:06:07 UTC

Nodetype reregistration and JackrabbitNodeTypeManager

Hi,

on the user list the question arose whether it is possible to reregister 
node types via RMI. Currently JackrabbitNodeTypeManager doesn't expose 
NodeTypeManagerImpl.registerNodeTypes(InputStream, String, boolean) 
which allows to enable reregistration.
There are two options to implement this feature:

1. Extend JackrabbitNodeTypeManager with another method (might be the 
signature from above or a "reregister()" methode)
2. Change the default behaviour of 
NodeTypeManagerImpl.registerNodeTypes(InputStream, String) to always try 
to reregister node types.

I'm in favour of option two because

a) I don't want to add more methods to JackrabbitNodeTypeManager if 
avoidable because node type registration will change anyway with JCR 2.0.
b) I think it's more natural. If I try to register a node type I do this 
because I want this node type to be registered and not because I want to 
check if it is already registered and get an exception back if it is. 
There are other ways to find out if a node type is registered. Is there 
any reason not just try to reregister existing nodetypes by default?

Cheers,
Christoph


Re: Nodetype reregistration and JackrabbitNodeTypeManager

Posted by Christoph Kiehl <ch...@sulu3000.de>.
Stefan Guggisberg wrote:
> On 8/13/07, Felix Meschberger <fm...@gmail.com> wrote:
>> Hi,
>>
>> Am Montag, den 13.08.2007, 10:31 +0200 schrieb Christoph Kiehl:
>>> What do you think of option two in my original mail, regardless of when the new
>>> nodetype management API is available?
>> Honestly, while I agree to not grow the API, I favor the first option,
>> as modifying the implementation to re-register node types would change
>> the API (contract) - and this I dislike even more than growing the
>> API...
> 
> -1 for option 2.
> 
> i agree with felix. after all there's a clear distinction between registering a
> new type vs modifying an existing type, like e.g. in sql dml: 'create table'
> vs 'alter table'.

In general I agree with not changing the contract etc. but I thought in this 
context it might be feasible. I of course know that there is a difference 
between create and alter but I was unsure if someone really relies on this 
contract in the context of node type registration.
But because you both dislike option 2, I would rather not change the API (option 
1) but wait for the new node type management API of JCR 2.0 to be available 
since it's already possible to reregister nodetypes just not through RMI.

Cheers,
Christoph


Re: Nodetype reregistration and JackrabbitNodeTypeManager

Posted by Stefan Guggisberg <st...@gmail.com>.
On 8/13/07, Felix Meschberger <fm...@gmail.com> wrote:
> Hi,
>
> Am Montag, den 13.08.2007, 10:31 +0200 schrieb Christoph Kiehl:
> > What do you think of option two in my original mail, regardless of when the new
> > nodetype management API is available?
>
> Honestly, while I agree to not grow the API, I favor the first option,
> as modifying the implementation to re-register node types would change
> the API (contract) - and this I dislike even more than growing the
> API...

-1 for option 2.

i agree with felix. after all there's a clear distinction between registering a
new type vs modifying an existing type, like e.g. in sql dml: 'create table'
vs 'alter table'.

cheers
stefan

>
> Regards
> Felix
>
>

Re: Nodetype reregistration and JackrabbitNodeTypeManager

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am Montag, den 13.08.2007, 10:31 +0200 schrieb Christoph Kiehl:
> What do you think of option two in my original mail, regardless of when the new 
> nodetype management API is available?

Honestly, while I agree to not grow the API, I favor the first option,
as modifying the implementation to re-register node types would change
the API (contract) - and this I dislike even more than growing the
API...

Regards
Felix


Re: Nodetype reregistration and JackrabbitNodeTypeManager

Posted by Christoph Kiehl <ch...@sulu3000.de>.
Felix Meschberger wrote:

> I favour neither of both :-) I would favor a real node type management
> API, which would allow more fine grained control over the node type
> registration process (such an API will be coming with JCR 2).

I see ;) I definitely like to see this happening, but this sound like a rather 
big undertaken (which of course has to be done anyway for Jackrabbit 2.0).

But I still see the need for something like CND-based registration, because as 
you said it really eases starting up. It is helpful as well for registering 
default nodetypes which are not be managed by the application. It's much easier 
to maintenance a CND than some java code using an API.

What do you think of option two in my original mail, regardless of when the new 
nodetype management API is available?

Cheers,
Christoph


Re: Nodetype reregistration and JackrabbitNodeTypeManager

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

I favour neither of both :-) I would favor a real node type management
API, which would allow more fine grained control over the node type
registration process (such an API will be coming with JCR 2).

The Stream based (CND or XML) API is too clunky: I registers all or part
or whatever node types in the file, it throws an exception, whose
message must be decoded to try to find out what is actually going on. As
a result, I like this method for simple first-time node type
registration, but it does not suffice it for real-world node type
management.

So, I would rather like to see some transitional Jackrabbit API, which
mimicks, what is currently proposed for JCR 2.0 and may later be easily
migrated. Yes, I am in desperate need for real node type management,
too :-)

Regards
Felix

Am Samstag, den 11.08.2007, 22:06 +0200 schrieb Christoph Kiehl:
> Hi,
> 
> on the user list the question arose whether it is possible to reregister 
> node types via RMI. Currently JackrabbitNodeTypeManager doesn't expose 
> NodeTypeManagerImpl.registerNodeTypes(InputStream, String, boolean) 
> which allows to enable reregistration.
> There are two options to implement this feature:
> 
> 1. Extend JackrabbitNodeTypeManager with another method (might be the 
> signature from above or a "reregister()" methode)
> 2. Change the default behaviour of 
> NodeTypeManagerImpl.registerNodeTypes(InputStream, String) to always try 
> to reregister node types.
> 
> I'm in favour of option two because
> 
> a) I don't want to add more methods to JackrabbitNodeTypeManager if 
> avoidable because node type registration will change anyway with JCR 2.0.
> b) I think it's more natural. If I try to register a node type I do this 
> because I want this node type to be registered and not because I want to 
> check if it is already registered and get an exception back if it is. 
> There are other ways to find out if a node type is registered. Is there 
> any reason not just try to reregister existing nodetypes by default?
> 
> Cheers,
> Christoph
> 


Re: Nodetype reregistration and JackrabbitNodeTypeManager

Posted by Christoph Kiehl <ck...@sulu3000.de>.
qcfireball wrote:

> Please refer to:  
> http://www.nabble.com/Reregistering-Node-Types-in-RMI-tf4253117.html
> to see how to setup the ability to create new NodeTypes via RMI.  Please
> post any questions there.  Thanks.

Please see my reply on the user list.

Cheers,
Christoph


Re: Nodetype reregistration and JackrabbitNodeTypeManager

Posted by qcfireball <qc...@yahoo.com>.
This is not entirely true.  You can enable the ability to register new
nodetypes via RMI.  For jackrabbit 1.3, it requires a little extra work on
the part of setting up the RMI server in Jackrabbit.  For Jackrabbit 1.3.1,
the may have already done what is necessary to enable these features.  I
have not tested this in 1.3.1 yet.

Please refer to:  
http://www.nabble.com/Reregistering-Node-Types-in-RMI-tf4253117.html
to see how to setup the ability to create new NodeTypes via RMI.  Please
post any questions there.  Thanks.


Christoph Kiehl wrote:
> 
> Hi,
> 
> on the user list the question arose whether it is possible to reregister 
> node types via RMI. Currently JackrabbitNodeTypeManager doesn't expose 
> NodeTypeManagerImpl.registerNodeTypes(InputStream, String, boolean) 
> which allows to enable reregistration.
> There are two options to implement this feature:
> 
> 1. Extend JackrabbitNodeTypeManager with another method (might be the 
> signature from above or a "reregister()" methode)
> 2. Change the default behaviour of 
> NodeTypeManagerImpl.registerNodeTypes(InputStream, String) to always try 
> to reregister node types.
> 
> I'm in favour of option two because
> 
> a) I don't want to add more methods to JackrabbitNodeTypeManager if 
> avoidable because node type registration will change anyway with JCR 2.0.
> b) I think it's more natural. If I try to register a node type I do this 
> because I want this node type to be registered and not because I want to 
> check if it is already registered and get an exception back if it is. 
> There are other ways to find out if a node type is registered. Is there 
> any reason not just try to reregister existing nodetypes by default?
> 
> Cheers,
> Christoph
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Nodetype-reregistration-and-JackrabbitNodeTypeManager-tf4254590.html#a12114957
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.