On Tue, Mar 11, 2008 at 7:12 PM, Tobias Bocanegra
<[EMAIL PROTECTED]> wrote:
> ...yes. in jackrabbit 1.4 the api exposes the import nodetypes
>  capabilities of the nodetype manager. this is also available in
>  jackrabbit:...(over RMI)...

Thanks Toby, the code that you suggest is very similar to our current
NodeTypeLoader.registerNodeType(), except that we don't check first if
the nodetype is already defined.

So I'm not sure why that fails over RMI in Vidar's case (haven't tried
it myself yet).

-Bertrand


>
>     private void initNodeTypes() throws RepositoryException {
>         // check if node types are registered
>         try {
>             
> session.getWorkspace().getNodeTypeManager().getNodeType("my:HierarchyNode");
>             return;
>         } catch (RepositoryException e) {
>             // ignore
>         }
>         NodeTypeManager ntMgr = session.getWorkspace().getNodeTypeManager();
>         if (ntMgr instanceof JackrabbitNodeTypeManager) {
>             InputStream in = 
> getClass().getResourceAsStream(DEFAULT_NODETYPES);
>             try {
>                 ((JackrabbitNodeTypeManager)
>  ntMgr).registerNodeTypes(in,
>  JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
>                 in.close();
>             } catch (IOException e) {
>                 throw new RepositoryException("Error while importing
>  nodetypes.", e);
>             }
>         }
>     }
>
>  regards, toby

Reply via email to