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 <[EMAIL PROTECTED]> wrote:

Hi,
   Where  can I find    dtd for   custom_nodetypes.xml  used  for
registering   custom nodetypes ?

Thanks,
Ruchi



Reply via email to