incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger" <Felix.Meschber...@day.com>
Subject Re: JCR-Mapping: Extend Bean/Collection/FieldDescriptor with support for node type management tools
Date Tue, 17 Oct 2006 12:16:57 GMT
Hi Christophe,

> is the node management tools is based on the existing one ?

Yes, actually it is based on the jackrabbit/NodeTypeManagerImpl class
with adaptions to our repository implementation. For my use case, I
just use the createSingleNodetype method, which I extended for support
for BeanDescriptors and CollectionDescriptors. I also modified the
getPropertyDefinition method to take a PropertyDefDescriptor and added
a getNodeDefinition taking a ChildNodeDefDescriptor.

In the createSingleNodetype method I apply a simple heuristic for
BeanDescriptors and CollectionDescriptors to decide whether to call
the getNodeDefinition or the getPropertyDefinition method:

    if (field.getJcrType() != null) {
        propDefs.add(getPropertyDefinition(field,
field.getFieldName(), nodeTypeName));
    } else {
        nodeDefs.add(getNodeDefinition(field, field.getFieldName(),
nodeTypeName));
    }

I also modified internal workings in that the createSingleNodeType
method does not check for super types any more and adds the node
definition to an internal list without actually registering the node
type with the repository. Only when the new registerNodeTypes() method
is called, are the node types registered. This way I can control when
to actually register node types and allow for the definition of super
types after the sub types as long as both types are registered with
the same batch.

Regards
Felix

PS: I attached the class to GRFT-111 for illustration.

Mime
View raw message