JBoss Community Archive (Read Only)

ModeShape 5

Import and export

The JCR API includes mechanisms for importing and exporting all or some of the content of a JCR workspace from/to XML files. But the API also defines two XML formats to choose from: the Document View and System View.

Document View

The Document View maps each JCR node to an XML element, and each JCR property to an XML attribute. The advantage of this format is that the XML structure looks very similar to the JCR content.

However, there are several disadvantages. First, because JCR properties are mapped to XML attributes (which can only have a single value), this format is not capable of properly accurately representing multi-valued properties. Most implementations basically just export the first value of a multi-valued property.

The second disadvantage is that Document View does not handle large binary values well. Again, this is because the Document View maps properties to XML attributes, and very large XML attribute values generally pose problems for many XML libraries.

In general, avoid using the Document View for reliable exporting content unless your application requires this view. Never use it for backups of a repository.

System View

The System View treats all JCR nodes and properties as XML elements. So although this is generally more verbose than the Document View, it is the only view that can accurately and efficiently represent any repository content, including large binary values and multi-valued properties.

Always use the System View when transferring content from one repository to another. See the ModeShape backup utility for backing up repository content.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:12:24 UTC, last content change 2016-04-04 10:15:06 UTC.