On Mon, Nov 23, 2009 at 07:30, Sunil Dhage <sunil.dh...@coreobjects.com> wrote:
> xyz.cnd contains these node type definitions.
>
> [lc:account] > nt:folder, mix:lockable
> -lc:accountid (string) mandatory primary
>
>  /**
>     * Registers custom node types for the application
>     */
>    protected void registerCustomNodeTypes(Workspace workspace) throws 
> RepositoryException
>    {   try
>        {   ClassLoader loader = 
> Thread.currentThread().getContextClassLoader();
>            InputStream in = loader.getResourceAsStream("xyz.cnd");
>            NodeTypeManagerImpl nodeTypeManager = (NodeTypeManagerImpl) 
> workspace.getNodeTypeManager();
>            // Registors the custom node types and namespaces
>            nodeTypeManager.registerNodeTypes(in, 
> JackrabbitNodeTypeManager.TEXT_X_JCR_CND, true);
>        }catch (NamespaceException nse)
>        {   log.error("[contentCallback] Namespace registration issue : " + 
> nse.getMessage());
>        }catch (RepositoryException repse)
>        {   log.error("[contentCallback] Repository registeration issue : " + 
> repse.getMessage());
>        } catch (IOException ex)
>        {  log.error("[contentCallback] Error reading custom node definitions. 
> Check dms-lc.cnd is in classpath: " + ex.getMessage());
>        }
>    }

Looks good to me, if you didn't get any errors here. Maybe you changed
the nodetype (adding mix:lockable) and restarted your repository and
the above code failed with an cannot update nodetypes exception (or
similar)?

>           Node account = 
> verifyAndAddNode(session,candidatedocs,path,"lc:account");

What about this method? We can only help when seeing what exact JCR
API calls you are doing. (I can imagine what that method does, but
maybe there is a slight error there).

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetsc...@day.com

Reply via email to