jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: Create nodetype through API
Date Fri, 13 Feb 2009 12:33:35 GMT
hi patrick

On Fri, Feb 13, 2009 at 8:27 AM, Patrick Plaatje <patrick@ipros.nl> wrote:
> Hi all,
> i'm very new to Jackrabbit, and working myslef through the posiiblities of
> it. I came across the part on nodetypes and learned that nodetypes can be
> created by making a XML file of a CND file, and feed that to
> nodeTypeManager. All fine, but i didn't come across any class that could
> create this nodetpye programmatically. Is there an class which does this
> or is there a reason for it that it doesn't exist?

node type creation is not covered by jcr 1.0. jcr 2.0 (jsr 283) will however
include an api for programmatic node type creation. the node type management
api is not finalized yet but there's already an experimental implementation
available in jackrabbit.

for more information please see


sample code:

NodeTypeManagerImpl ntMgr =
        (NodeTypeManagerImpl) session.getWorkspace().getNodeTypeManager();
NodeTypeTemplate t = ntMgr.createNodeTypeTemplate();
NodeType newNodeType = ntMgr.registerNodeType(t, false);


> Best,
> Patrick

View raw message