You are viewing a plain text version of this content. The canonical link for it is here.
Posted to graffito-dev@incubator.apache.org by Sandro Böhme <sa...@gmx.de> on 2005/09/11 18:09:26 UTC
[JCR-mapping] Please vote: Custom node types in a seperate config
file?
Hello,
to register custom node types the user need to be able to specify the
JCR-properties similar to the
ItemDefinition, PropertyDefinition and NodeDefinition (see section
6.7.12-6.7.14 of the JCR-spec).
The question is: should we introduce a second config file only for the
node type registration or should
we include the properties needed for the registration in the
jcrmapping.xml file.
In case the user does not want to use custom node types at all we could
hide the complexity of the
custom node type registration in a second file. The user would only need
to deal with the mapping from
the Java classes to the build in node types of the JCR.
With a separate config file the node type registration component does
not have a relation to our
project and could be reused by other projects.
But maybe the basic question is:
Is the mapping from a Java class to a JCR node type a 1:1 mapping or is
it possible that a Java class maps
to more than one JCR node type?
I always thought it is a 1:1 mapping. Every class has a node type. Every
Java super class has a JCR super node type
and so on.
If I would like to change the name of a JCR item I need to change it in
only one config file. If I like to change
a property of the mapping - no matter if it is the Java part of the
mapping or the JCR part of the mapping I would know
at which position of the mapping graph I need to search.
But of course if there is a use case for a 1:n or a n:1 mapping a second
file would make sense.
Do you think it is possible that a custom node type is mapped to more
than one Java class?
What do you think?
Or if you already have an opinion, please vote:
[ ] +1 for a seperate config file only for the registration of custom
node types
[ ] 0 don't care
[ ] -1 for having one mapping graph in one configuration file
Best regards,
Sandro
Re: [JCR-mapping] Please vote: Custom node types in a seperate config
file?
Posted by Sandro Böhme <sa...@gmx.de>.
Sandro Böhme wrote:
>
>>> Or if you already have an opinion, please vote:
>>> [ ] +1 for a seperate config file only for the registration of custom
>>> node types
>>> [ ] 0 don't care
>>> [ ] -1 for having one mapping graph in one configuration file
>>>
>>>
>>
>>
>> It is quite difficult to vote on that now. I don't know. Let's start
>> with a prototype and we will see. See the proposal to get my
>> technical point of view. I'm going to commit it in the doc suproject.
>> By this way, you can modify it.
>>
>>
>>
>>
> It's the same for me. I also think it's difficult to decide.
> So if we use a custom_nodetypes.xml file - would it be ok for you, to
> use XMLBeans?
>
>
I can understand to not use XMLBeans or something similar for a XML file
with a small
DTD. But I afraid the definition for the custom_nodetypes.xml will be
bigger...
What do you think?
In which usecase would you use XMLBeans in general?
Re: [JCR-mapping] Please vote: Custom node types in a seperate config file?
Posted by Christophe Lombart <ch...@gmail.com>.
2005/9/13, Sandro Böhme <sa...@gmx.de>:
> It's the same for me. I also think it's difficult to decide.
> So if we use a custom_nodetypes.xml file - would it be ok for you, to
> use XMLBeans?
>
ok if it is an external tools. If needed, we can split the jcr-mapping project.
Please, centralise all XML beans related code in one class. Is there
some generated code ? if yes, add it in the target area (not in the
source code). Nevertheless, I would like to avoid class generation.
Are you agree to split the node type registration into 2 steps :
1. (optional) convert the object graph into the custom_nodetypes.xml.
the xml file proposed by Jackrabbit seems to be good for me.
2. Import the file custom_nodetypes.xml in the JCR repo by using the
server API. We can provide one import class per JCR server (because it
is not cover by the spec).
Christophe
Re: [JCR-mapping] Please vote: Custom node types in a seperate config
file?
Posted by Sandro Böhme <sa...@gmx.de>.
>>Or if you already have an opinion, please vote:
>>[ ] +1 for a seperate config file only for the registration of custom
>>node types
>>[ ] 0 don't care
>>[ ] -1 for having one mapping graph in one configuration file
>>
>>
>>
>
>It is quite difficult to vote on that now. I don't know. Let's start
>with a prototype and we will see. See the proposal to get my
>technical point of view. I'm going to commit it in the doc suproject.
>By this way, you can modify it.
>
>
>
>
It's the same for me. I also think it's difficult to decide.
So if we use a custom_nodetypes.xml file - would it be ok for you, to
use XMLBeans?
Re: [JCR-mapping] Please vote: Custom node types in a seperate config file?
Posted by Christophe Lombart <ch...@gmail.com>.
2005/9/11, Sandro Böhme <sa...@gmx.de>:
> But of course if there is a use case for a 1:n or a n:1 mapping a second
> file would make sense.
> Do you think it is possible that a custom node type is mapped to more
> than one Java class?
Until now, I don't see when it is necessary to map to more than one java class
>
> What do you think?
> Or if you already have an opinion, please vote:
> [ ] +1 for a seperate config file only for the registration of custom
> node types
> [ ] 0 don't care
> [ ] -1 for having one mapping graph in one configuration file
>
It is quite difficult to vote on that now. I don't know. Let's start
with a prototype and we will see. See the proposal to get my
technical point of view. I'm going to commit it in the doc suproject.
By this way, you can modify it.