You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Joshna Reddy <jo...@gmail.com> on 2008/05/23 12:08:02 UTC
jcr:uuid property is not created when XML is imported
Hii
I have exported a node structure using exportDocumentView(....) and written
it a file.
In the exported xml document jcr:mixintypes property is not present i.e
mixin types of the node are not exported
Later when i tried to import the same node structure using importXML(...)
I see that jcr:uuid property is not created . I have tried out using
ImportUUIDBehaviour.CREATE_NEW
Why does export and import take care of mixin types.
Is there any thing obvious that i am missing .
Please help me out ....
Thanks
K.Joshna
Re: jcr:uuid property is not created when XML is imported
Posted by Stefan Guggisberg <st...@day.com>.
btw: please *don't* cross-post...
thanks
stefan
On Fri, May 23, 2008 at 12:08 PM, Joshna Reddy <jo...@gmail.com> wrote:
> Hii
>
> I have exported a node structure using exportDocumentView(....) and written
> it a file.
>
> In the exported xml document jcr:mixintypes property is not present i.e
> mixin types of the node are not exported
>
> Later when i tried to import the same node structure using importXML(...)
>
> I see that jcr:uuid property is not created . I have tried out using
> ImportUUIDBehaviour.CREATE_NEW
>
> Why does export and import take care of mixin types.
>
> Is there any thing obvious that i am missing .
>
> Please help me out ....
>
> Thanks
> K.Joshna
>
Re: jcr:uuid property is not created when XML is imported
Posted by Matej Knopp <ma...@gmail.com>.
Hi,
it happens to my once that the jcr:mixintypes property of nodes went
out of sync with the actual node mixins. However, i didn't report this
as i wasn't able to reproduce it. It could also cause your problem. I
looked at the implementation and it seeem that the mixintypes property
is actually a real property, not just generated on fly which seems a
bit weird thing to to.
-Matej
On Fri, May 23, 2008 at 12:08 PM, Joshna Reddy <jo...@gmail.com> wrote:
> Hii
>
> I have exported a node structure using exportDocumentView(....) and written
> it a file.
>
> In the exported xml document jcr:mixintypes property is not present i.e
> mixin types of the node are not exported
>
> Later when i tried to import the same node structure using importXML(...)
>
> I see that jcr:uuid property is not created . I have tried out using
> ImportUUIDBehaviour.CREATE_NEW
>
> Why does export and import take care of mixin types.
>
> Is there any thing obvious that i am missing .
>
> Please help me out ....
>
> Thanks
> K.Joshna
>
Re: jcr:uuid property is not created when XML is imported
Posted by Stefan Guggisberg <st...@day.com>.
On Tue, May 27, 2008 at 2:07 PM, Joshna Reddy <jo...@gmail.com> wrote:
> Hi
>
> Thanks for the help.I have tried out using System View and it works fine for
> non versionable content.
>
> I am able to export and import the content.
>
> But with versionable content , jcr:isCheckedOut property is changed to
> "true" for the node .
>
> Exported Xml has <sv:property sv:name="jcr:isCheckedOut"
> sv:type="Boolean"><sv:value>false</sv:value></sv:property>
>
> When the same xml is imported why is jcr:isCheckedOut made "true" .It is
> supposed to be "false" according to xml. Because of this i am running in to
> versioning issues in my application.
jcr:isCheckedOut represents 'meta' data which is controled by the repository.
AFAIK a new versionable node is always checked-out initially, hence
jcr:isCheckedOut=true.
cheers
stefan
>
> Any help would be appreciated.
>
> -Thanks
> K.Joshna
>
> On Mon, May 26, 2008 at 5:30 PM, Stefan Guggisberg <
> stefan.guggisberg@day.com> wrote:
>
>> hi
>>
>> On Fri, May 23, 2008 at 12:08 PM, Joshna Reddy <jo...@gmail.com>
>> wrote:
>> > Hii
>> >
>> > I have exported a node structure using exportDocumentView(....) and
>> written
>> > it a file.
>> >
>> > In the exported xml document jcr:mixintypes property is not present i.e
>> > mixin types of the node are not exported
>>
>> that's a known limitation of the document view xml mapping.
>> multi-valued properties, incl. jcr:mixinTypes, are omitted on document
>> view export. see http://issues.apache.org/jira/browse/JCR-325 for a
>> discussion of multi-valued property representation in the document view
>> xml mapping.
>>
>> please see also section 6.4.2.5 in the JSR 170 spec.
>>
>> please note that the document view xml mapping is per definition 'lossy'
>> and not guaruanteed to roundtrip properly. if you need xml roundtripping
>> you should use system view export instead.
>>
>> cheers
>> stefan
>>
>> >
>> > Later when i tried to import the same node structure using importXML(...)
>> >
>> > I see that jcr:uuid property is not created . I have tried out using
>> > ImportUUIDBehaviour.CREATE_NEW
>> >
>> > Why does export and import take care of mixin types.
>> >
>> > Is there any thing obvious that i am missing .
>> >
>> > Please help me out ....
>> >
>> > Thanks
>> > K.Joshna
>> >
>>
>
Re: jcr:uuid property is not created when XML is imported
Posted by Joshna Reddy <jo...@gmail.com>.
Hi
Thanks for the help.I have tried out using System View and it works fine for
non versionable content.
I am able to export and import the content.
But with versionable content , jcr:isCheckedOut property is changed to
"true" for the node .
Exported Xml has <sv:property sv:name="jcr:isCheckedOut"
sv:type="Boolean"><sv:value>false</sv:value></sv:property>
When the same xml is imported why is jcr:isCheckedOut made "true" .It is
supposed to be "false" according to xml. Because of this i am running in to
versioning issues in my application.
Any help would be appreciated.
-Thanks
K.Joshna
On Mon, May 26, 2008 at 5:30 PM, Stefan Guggisberg <
stefan.guggisberg@day.com> wrote:
> hi
>
> On Fri, May 23, 2008 at 12:08 PM, Joshna Reddy <jo...@gmail.com>
> wrote:
> > Hii
> >
> > I have exported a node structure using exportDocumentView(....) and
> written
> > it a file.
> >
> > In the exported xml document jcr:mixintypes property is not present i.e
> > mixin types of the node are not exported
>
> that's a known limitation of the document view xml mapping.
> multi-valued properties, incl. jcr:mixinTypes, are omitted on document
> view export. see http://issues.apache.org/jira/browse/JCR-325 for a
> discussion of multi-valued property representation in the document view
> xml mapping.
>
> please see also section 6.4.2.5 in the JSR 170 spec.
>
> please note that the document view xml mapping is per definition 'lossy'
> and not guaruanteed to roundtrip properly. if you need xml roundtripping
> you should use system view export instead.
>
> cheers
> stefan
>
> >
> > Later when i tried to import the same node structure using importXML(...)
> >
> > I see that jcr:uuid property is not created . I have tried out using
> > ImportUUIDBehaviour.CREATE_NEW
> >
> > Why does export and import take care of mixin types.
> >
> > Is there any thing obvious that i am missing .
> >
> > Please help me out ....
> >
> > Thanks
> > K.Joshna
> >
>
Re: jcr:uuid property is not created when XML is imported
Posted by Stefan Guggisberg <st...@day.com>.
hi
On Fri, May 23, 2008 at 12:08 PM, Joshna Reddy <jo...@gmail.com> wrote:
> Hii
>
> I have exported a node structure using exportDocumentView(....) and written
> it a file.
>
> In the exported xml document jcr:mixintypes property is not present i.e
> mixin types of the node are not exported
that's a known limitation of the document view xml mapping.
multi-valued properties, incl. jcr:mixinTypes, are omitted on document
view export. see http://issues.apache.org/jira/browse/JCR-325 for a
discussion of multi-valued property representation in the document view
xml mapping.
please see also section 6.4.2.5 in the JSR 170 spec.
please note that the document view xml mapping is per definition 'lossy'
and not guaruanteed to roundtrip properly. if you need xml roundtripping
you should use system view export instead.
cheers
stefan
>
> Later when i tried to import the same node structure using importXML(...)
>
> I see that jcr:uuid property is not created . I have tried out using
> ImportUUIDBehaviour.CREATE_NEW
>
> Why does export and import take care of mixin types.
>
> Is there any thing obvious that i am missing .
>
> Please help me out ....
>
> Thanks
> K.Joshna
>
Re: jcr:uuid property is not created when XML is imported
Posted by Matej Knopp <ma...@gmail.com>.
I think the problem here is when the node mixins are not exported (but
the original node has the mixin types associated). If that happens the
uuid property can't be properly imported because the newly create node
lacks the mix:referenceable mixin.
-Matej
On Fri, May 23, 2008 at 11:24 PM, Alexander Klimetschek
<ak...@day.com> wrote:
> On Fri, May 23, 2008 at 11:11 PM, Matej Knopp <ma...@gmail.com> wrote:
>> So the document view export omits autocreated or propected properties?
>
>> On Fri, May 23, 2008 at 9:23 PM, Alexander Klimetschek <ak...@day.com> wrote:
>>> The document view export does not contain repository meta information
>>> (like node types and mixins), so you "loose" the UUIDs here. To keep
>>> UUIDs you have to use system view export.
>
> Ups, sorry, I was wrong here. Of course all properties are exported as
> attributes in document view (special case for multi-value props,
> though). From the JCR 1.0 spec, section 6.4.2.1 (General Structure of
> Document View):
>
> 5. Each property P of node becomes an XML attribute of XML element N.
>
> If uuids are present in your original nodes, you export via document
> view and import back the same (or similar) document view XML, you
> should have the uuids back in the repository. Care has to be taken if
> nodes are already present and collisions might occur. That's what
> ImportUUIDBehaviour is all about.
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>
Re: jcr:uuid property is not created when XML is imported
Posted by Alexander Klimetschek <ak...@day.com>.
On Fri, May 23, 2008 at 11:11 PM, Matej Knopp <ma...@gmail.com> wrote:
> So the document view export omits autocreated or propected properties?
> On Fri, May 23, 2008 at 9:23 PM, Alexander Klimetschek <ak...@day.com> wrote:
>> The document view export does not contain repository meta information
>> (like node types and mixins), so you "loose" the UUIDs here. To keep
>> UUIDs you have to use system view export.
Ups, sorry, I was wrong here. Of course all properties are exported as
attributes in document view (special case for multi-value props,
though). From the JCR 1.0 spec, section 6.4.2.1 (General Structure of
Document View):
5. Each property P of node becomes an XML attribute of XML element N.
If uuids are present in your original nodes, you export via document
view and import back the same (or similar) document view XML, you
should have the uuids back in the repository. Care has to be taken if
nodes are already present and collisions might occur. That's what
ImportUUIDBehaviour is all about.
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com
Re: jcr:uuid property is not created when XML is imported
Posted by Matej Knopp <ma...@gmail.com>.
So the document view export omits autocreated or propected properties?
-Matej
On Fri, May 23, 2008 at 9:23 PM, Alexander Klimetschek <ak...@day.com> wrote:
> Hi!
>
> The document view export does not contain repository meta information
> (like node types and mixins), so you "loose" the UUIDs here. To keep
> UUIDs you have to use system view export.
>
> During import of document view, Jackrabbit supports jcr:primaryType,
> jcr:mixinTypes and jcr:uuid attributes, though (note that this is not
> mandatory in JCR 1.0). The ImportUUIDBehaviour.CREATE_NEW is only
> taken into account if the incoming XML contains UUIDs or mixin
> referenceable information - in case of system view or in case of a
> document view with the mentioned 3 attributes.
>
> You could annotate your document view XML before import with
> jcr:mixinTypes="mix:referenceable" attributes to get UUIDs generated.
>
> Regards,
> Alex
>
> On Fri, May 23, 2008 at 12:08 PM, Joshna Reddy <jo...@gmail.com> wrote:
>> Hii
>>
>> I have exported a node structure using exportDocumentView(....) and written
>> it a file.
>>
>> In the exported xml document jcr:mixintypes property is not present i.e
>> mixin types of the node are not exported
>>
>> Later when i tried to import the same node structure using importXML(...)
>>
>> I see that jcr:uuid property is not created . I have tried out using
>> ImportUUIDBehaviour.CREATE_NEW
>>
>> Why does export and import take care of mixin types.
>>
>> Is there any thing obvious that i am missing .
>>
>> Please help me out ....
>>
>> Thanks
>> K.Joshna
>>
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>
Re: jcr:uuid property is not created when XML is imported
Posted by Alexander Klimetschek <ak...@day.com>.
Hi!
The document view export does not contain repository meta information
(like node types and mixins), so you "loose" the UUIDs here. To keep
UUIDs you have to use system view export.
During import of document view, Jackrabbit supports jcr:primaryType,
jcr:mixinTypes and jcr:uuid attributes, though (note that this is not
mandatory in JCR 1.0). The ImportUUIDBehaviour.CREATE_NEW is only
taken into account if the incoming XML contains UUIDs or mixin
referenceable information - in case of system view or in case of a
document view with the mentioned 3 attributes.
You could annotate your document view XML before import with
jcr:mixinTypes="mix:referenceable" attributes to get UUIDs generated.
Regards,
Alex
On Fri, May 23, 2008 at 12:08 PM, Joshna Reddy <jo...@gmail.com> wrote:
> Hii
>
> I have exported a node structure using exportDocumentView(....) and written
> it a file.
>
> In the exported xml document jcr:mixintypes property is not present i.e
> mixin types of the node are not exported
>
> Later when i tried to import the same node structure using importXML(...)
>
> I see that jcr:uuid property is not created . I have tried out using
> ImportUUIDBehaviour.CREATE_NEW
>
> Why does export and import take care of mixin types.
>
> Is there any thing obvious that i am missing .
>
> Please help me out ....
>
> Thanks
> K.Joshna
>
--
Alexander Klimetschek
alexander.klimetschek@day.com