-
1. Re: Problem with jcr:versionStorage
rhauch Jun 16, 2010 11:08 AM (in response to manuel.gentile)You are correct, that unless otherwise specified, the content under "/jcr:system" is not persisted. We should make that much clearer in the documentation, and I'll log a JIRA about this.
However, it's very easy to configure. Each repository configuration has a SYSTEM_SOURCE_NAME option to specify the particular workspace name and source name in which this "/jcr:system" content should be stored. The format for the option value is "workspaceName@sourceName" (or just "sourceName" if the source's default workspace name should be used for the system workspace).
For many cases, you'll probably use the same source that your JCR repository uses, but you'll want to specify a workspace name that won't clash with your other workspace names. But sometimes it is desirable to store the system content in another source altogether.
If you're using an XML file for your configuration, specifying this option is via a "mode:option" element under the "mode:options" element inside the "mode:repository", or something like:
{code:xml}
<configuration xmlns:mode="http://www.modeshape.org/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<mode:sources>
...
<mode:source jcr:name="Store" mode:classname="org.modeshape.connector.store.jpa.JpaSource" ... >
...
</mode:sources>
...
<mode:repositories>
<mode:repository jcr:name="My Repository" mode:source="MySource">
<mode:options>
...
<mode:option jcr:name="systemSourceName" mode:value="systemWorkspace@Store"/>
...
</mode:options>
</mode:repository>
...
</mode:repositories>
</configuration>
{code:xml}
If you're defining your configuration programmatically, you simply use the constant:
{code}
JcrConfiguration configuration = new JcrConfiguration();
configuration.repositorySource("Store").usingClass(JpaSource.class);
configuration.repository("My Repository")
.setSource("Store")
.setOption(Option.SYSTEM_STORE_NAME, "systemWorkspace@Store");
engine = configuration.build();
engine.start();
{code}
(Note some of the other configuration details were ommitted.)
-
2. Re: Problem with jcr:versionStorage
manuel.gentile Jun 16, 2010 11:58 AM (in response to rhauch)It works!
Thanks a lot!