You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Juanjo Vázquez <jv...@apache.org> on 2008/05/11 19:47:36 UTC
Import nodes with XML
Hi all,
I´m working with import and export issues last days. My first goal is to
import a primary set of nodes to the repository using XML. The XML block to
import is something like this:
<?xml version="1.0" encoding="UTF-8"?>
<myRoot xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:ocm="http://jackrabbit.apache.org/ocm"
jcr:mixinTypes="ocm:discriminator"
ocm:classname="MyComplexType"
stringProperty="stringValue"
booleanProperty="true">
<.....></....>
</myRoot>
And my code:
session.importXML("/", initContentInputStream,
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
where "session" is obviously the JCR session.
The problem is that I´m not able to find the way to specify the boolean
property as a real BOOLEAN JCR property. When I import the above XML, all
the properties are treated as STRING properties.
Can anyone help me?.
Thanks in advance,
BR,
Juanjo.
Re: Import nodes with XML
Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
Hi,
Finally, this has been resolved using the system view format instead the
document view one. See the jsr-170 spec [1].
BR,
Juanjo.
[1] http://jcp.org/en/jsr/detail?id=170
On Sun, May 11, 2008 at 7:47 PM, Juanjo Vázquez <jv...@apache.org> wrote:
> Hi all,
>
> I´m working with import and export issues last days. My first goal is to
> import a primary set of nodes to the repository using XML. The XML block to
> import is something like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <myRoot xmlns:jcr="http://www.jcp.org/jcr/1.0"
> xmlns:ocm="http://jackrabbit.apache.org/ocm"
> jcr:mixinTypes="ocm:discriminator"
> ocm:classname="MyComplexType"
> stringProperty="stringValue"
> booleanProperty="true">
> <.....></....>
> </myRoot>
>
> And my code:
>
> session.importXML("/", initContentInputStream,
> ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
>
> where "session" is obviously the JCR session.
>
> The problem is that I´m not able to find the way to specify the boolean
> property as a real BOOLEAN JCR property. When I import the above XML, all
> the properties are treated as STRING properties.
>
> Can anyone help me?.
>
> Thanks in advance,
>
> BR,
>
> Juanjo.