jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Kurla" <stefan.ku...@gmail.com>
Subject Re: convert existing custom_nodetypes.xml to cnd
Date Tue, 03 Apr 2007 21:57:47 GMT
Thanks
On 4/3/07, Christoph Kiehl <christoph@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
>
>

Mime
View raw message