CRX Connector

CRX connector

CRX connector is an implementation of Provider interface of magnolia EE which enables it to use Content Repository Extreme (CRX) as a data source.

Installation

  • Copy magnolia-crx-Can't resolve link to: VERSION.jar to WEB-INF/lib
  • Remove jcr*.jar since it will be available together with other CRX API jars in shared libraries of the container.
  • You need to make sure that you have CRX api jars and jndi jars in proper place so that it can be shared between CRX and other applications like magnolia in this context (please refer to CRX documentation).

Configuration

Modify WEB-INF/config/default/repositories.xml to use magnolia-CRX provider.

<!-- magnolia default repository -->
 <Repository name="magnolia" provider="info.magnolia.crx.ProviderImpl" loadOnStartup="true">
 .......
     <param name="contextFactoryClass"      value="com.day.util.jndi.provider.MemoryInitialContextFactory" />
     <param name="providerURL" value="http://jcr.day.com" />
     <param name="bindName" value="crx" />
     <workspace name="website" />
     <workspace name="config" />
     <workspace name="users" />
     <workspace name="userroles" />
     .......
 </Repository>

As you can see you need to configure :

  1. contextFactoryClass, this is always the same unless you decide to use your own jndi provider
  2. providerURL, this must match to the URL as registered by your crx server (by default its http://jcr.day.com)
  3. bindName, as registered by CRX

Sharing repository between multiple apps

If you are sharing single CRX instance to host multiple magnolia repositories you need to configure unique workspace name across all instances. To do so, configure in repositories.xml

Warning

You can share single repository between any number of "unrelated" magnolia instances. Its not possible to share single repository for Author and Public or any other stages in between.

<RepositoryMapping>
     <Map name="website" repositoryName="magnolia" workspaceName="legalWebsite" />
     <Map name="config" repositoryName="magnolia" workspaceName="legalConfig" />
     …
 </RepositoryMapping>

<!-- magnolia default repository --> <Repository name="magnolia" provider="info.magnolia.crx.ProviderImpl" loadOnStartup="true"> ....... <workspace name="legalWebsite" /> <workspace name="legalConfig" /> <workspace name="legalUsers" /> <workspace name="legalUserroles" /> ....... </Repository>