jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: How to use Node and Property DefinitionTemplates to create a NodeTypeTemplate
Date Tue, 15 Jun 2010 17:07:47 GMT
On Tue, Jun 15, 2010 at 13:27, Subash Chaturanga <subashsdm@gmail.com> wrote:
> Yes ,but my prob is where should I keep the list.Lists asks from NodeTypeTemplate .
> NodeTypeManager can create any number of NodeTypeTemplates(with or with out a definition)
.
> If i maintain a List in   NodeTypeManager then how can i return Definition List asked
from NodeTypeTemplate.getNodeDefinitionTemplates() which should be specific to that particular
NodeTypeTemplate ?

Sorry, I don't understand. If you want to define a new custom node
type, this is what you do (beware, untested code):

<snip>

NodeTypeTemplate nt = nodeTypeManager.createNodeTypeTemplate();
nt.setName("my:nodeType");
nt.set....

PropertyDefinitionTemplate prop1 = nodeTypeManager.
createPropertyDefinitionTemplate();
prop1.setName("prop");
prop1.setRequiredType(PropertyType.STRING);
prop1.set...

nt. getPropertyDefinitionTemplates().add(prop1);

nodeTypeManager.registerNodeType(nt, false);

</snap>

Regards,
Alex

--
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message