You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Stefan Kurla <st...@gmail.com> on 2007/04/02 21:46:11 UTC

convert existing custom_nodetypes.xml to cnd

Is there any tool anywhere to convert custom_nodetypes.xml (which I
have read is for internal purposes of jackrabbit only) to cnd format?

If not, is there any tool to export existing nodetype definitions to cnd format?

Re: convert existing custom_nodetypes.xml to cnd

Posted by Stefan Kurla <st...@gmail.com>.
Thanks
On 4/3/07, Christoph Kiehl <ch...@sulu3000.de> wrote:
> Stefan Kurla wrote:
>
> > Is there any tool anywhere to convert custom_nodetypes.xml (which I
> > have read is for internal purposes of jackrabbit only) to cnd format?
>
> First: Why do you need to do this?
>
> Second: Something like this should do the trick:
>
> NodeTypeDef[] nodeTypeDefs = NodeTypeReader.read(new FileInputStream("foo/bar"));
> NamespaceResolver resolver = (NamespaceResolver)
> session.getWorkspace().getNamespaceRegistry();
> StringWriter writer = new StringWriter();
> CompactNodeTypeDefWriter.write(Arrays.asList(nodeTypeDefs), resolver, writer);
> System.out.println(writer.toString());
>
> Cheers
> Christoph
>
>

Re: convert existing custom_nodetypes.xml to cnd

Posted by Christoph Kiehl <ch...@sulu3000.de>.
Stefan Kurla wrote:

> Is there any tool anywhere to convert custom_nodetypes.xml (which I
> have read is for internal purposes of jackrabbit only) to cnd format?

First: Why do you need to do this?

Second: Something like this should do the trick:

NodeTypeDef[] nodeTypeDefs = NodeTypeReader.read(new FileInputStream("foo/bar"));
NamespaceResolver resolver = (NamespaceResolver) 
session.getWorkspace().getNamespaceRegistry();
StringWriter writer = new StringWriter();
CompactNodeTypeDefWriter.write(Arrays.asList(nodeTypeDefs), resolver, writer);
System.out.println(writer.toString());

Cheers
Christoph


Re: convert existing custom_nodetypes.xml to cnd

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
Hi,
   I'm new to jackrabbit, so I'm not so familiar with the problem domain.
But can't we write XSLT template to convert older xml format type notation
to CND format ? Is that a feasible task ?

BR,
Nandana

On 4/2/07, Stefan Kurla <st...@gmail.com> wrote:
>
> Is there any tool anywhere to convert custom_nodetypes.xml (which I
> have read is for internal purposes of jackrabbit only) to cnd format?
>
> If not, is there any tool to export existing nodetype definitions to cnd
> format?
>