incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi goel <Ruchi.G...@Sun.COM>
Subject Re: dtd for custom_nodetypes.xml
Date Fri, 23 Feb 2007 09:11:21 GMT
I am using the following to register node types from RMIserver:
*private static void registerNodeTypes(Session session)throws
            InvalidNodeTypeDefException, javax.jcr.RepositoryException, 
IOException {
        InputStream xml = new FileInputStream(CUSTOM_NODETYPE_CONFIG);

        // HINT: throws InvalidNodeTypeDefException, IOException
        NodeTypeDef[] types = NodeTypeReader.read(xml);

        Workspace workspace = session.getWorkspace();
        NodeTypeManager ntMgr = workspace.getNodeTypeManager();
        NodeTypeRegistry ntReg = ((NodeTypeManagerImpl) 
ntMgr).getNodeTypeRegistry();

        for (int j = 0; j < types.length; j++) {
            NodeTypeDef def = types[j];

            try {
                ntReg.getNodeTypeDef(def.getName());
            }
            catch (NoSuchNodeTypeException nsne) {
                // HINT: if not already registered than register custom 
node type
                ntReg.registerNodeType(def);
            }

        }
    }


*where CUSTOM_NODETYPE_CONFIG  is custom_nodetypes.xml
Is this not a standard way to register nodetypes ? This is only 
dependent o Jackrabbit1.2 API !!


Thanks,
Ruchi
Christophe Lombart wrote:
> If you want to register new node type, I advise you to read the following
> page : http://jackrabbit.apache.org/doc/nodetype/index.html.
> We are using the custom_nodestypes.xml only for the unit test. Later, we
> have to think about a more robust solution to register node types from 
> the
> ocm tools. Anyway, I didn't find  the dtd but it is quite simple to 
> use it -
> sorry
>
>
>
> On 2/22/07, ruchi goel <Ruchi.Goel@sun.com> wrote:
>>
>> Hi,
>>    Where  can I find    dtd for   custom_nodetypes.xml  used  for
>> registering   custom nodetypes ?
>>
>> Thanks,
>> Ruchi
>>
>


Mime
View raw message