You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by tingup <ti...@gmail.com> on 2010/07/15 11:27:31 UTC

session.exportDocumentView and session.exportSystemView

Hello everyone in List,
I want to know what is the difference between session.exportDocumentView and session.exportSystemView ,
I know the format of the export file is diffrent. And any thing else?
Let's 
1:session.exportDocumentView(..)  , save file as docFile.xml;
2:session.exportSystemView (..)  , save file as sysFile.xml

Then session.importXML() each file, sysFile.xml will success, but docFile.xml failed with error info:


ERROR com.tingup.cms.portlet.CmsImportExportPortlet - Constraint has been violated; nested exception is javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://jackrabbit.apache.org/ocm}classname
org.springframework.dao.DataIntegrityViolationException: Constraint has been violated; nested exception is javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://jackrabbit.apache.org/ocm}classname
at org.springmodules.jcr.SessionFactoryUtils.translateException(SessionFactoryUtils.java:182)
at org.springmodules.jcr.JcrAccessor.convertJcrAccessException(JcrAccessor.java:58)
at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:82)
at org.springmodules.jcr.JcrTemplate.importXML(JcrTemplate.java:331)
at com.tingup.cms.service.impl.JcrNodeServiceOcmImpl.importData(JcrNodeServiceOcmImpl.java:100)
..........................
Caused by: javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://jackrabbit.apache.org/ocm}classname
at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:822)
at org.apache.jackrabbit.core.xml.PropInfo.getApplicablePropertyDef(PropInfo.java:95)
at org.apache.jackrabbit.core.xml.SessionImporter.startNode(SessionImporter.java:403)
at org.apache.jackrabbit.core.xml.DocViewImportHandler.startElement(DocViewImportHandler.java:287)
at org.apache.jackrabbit.core.xml.ImportHandler.startElement(ImportHandler.java:170)
at org.apache.jackrabbit.commons.xml.DefaultContentHandler.startElement(DefaultContentHandler.java:162)


can somebody explain it? 

Thank you!

Regards ,

Edward.

Re: Re: session.exportDocumentView and session.exportSystemView

Posted by Guo Du <mr...@duguo.org>.
On Thu, Jul 15, 2010 at 10:42 AM, tingup <ti...@gmail.com> wrote:
> So, Document view is for read porpose, and can not be used for backup/restore?
No, according the Session.importXML java doc, it should works for doc
view as well. Your exception may caused by bug or wrong data, not sure
:)

But you will lose the meta data such as node uuid and timestamp with
document view export/import.

-Guo

Re: Re: session.exportDocumentView and session.exportSystemView

Posted by tingup <ti...@gmail.com>.
On Thu, Jul 15, 2010 at 10:27 AM, tingup <ti...@gmail.com> wrote:
> Hello everyone in List,
> I want to know what is the difference between session.exportDocumentView and session.exportSystemView ,
System view contain jcr aware meta data and could be used for light
weight data exchange.
Document view doesn't content jcr metadata, the format is much easier
to read for human compare with system view.
-Guo


So, Document view is for read porpose, and can not be used for backup/restore?
Thank you, Guo!


-Edward

Re: session.exportDocumentView and session.exportSystemView

Posted by Guo Du <mr...@duguo.org>.
On Thu, Jul 15, 2010 at 10:27 AM, tingup <ti...@gmail.com> wrote:
> Hello everyone in List,
> I want to know what is the difference between session.exportDocumentView and session.exportSystemView ,
System view contain jcr aware meta data and could be used for light
weight data exchange.
Document view doesn't content jcr metadata, the format is much easier
to read for human compare with system view.

-Guo