2.1.2. JCR configuration persister

JCR allows using persister to store configuration. In this section, you will understand how to use and configure JCR persister.

On startup RepositoryServiceConfiguration component checks if a configuration persister was configured. In that case, it uses the provided ConfigurationPersister implementation class to instantiate the persister object.

The configuration file is located in portal/WEB-INF/conf/jcr/jcr-configuration.xml in the portal web application.

Configuration with persister:

    <description>JCR configuration file</description>
(1)    <description>working-conf</description>
(2)    <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister" />
(3)    <property name="source-name" value="${gatein.jcr.datasource.name}${container.name.suffix}"/>
    <property name="dialect" value="${gatein.jcr.datasource.dialect}"/>


persister-class-name - Class name of ConfigurationPersister interface implementation.


source-name: JNDI source name configured in InitialContextInitializer component. Find more in database configuration.


dialect: SQL dialect which will be used with database fromsource-name. Find more in database configuration.

If you want to customize, you can implement ConfigurationPersister interface as follows:


   * Init persister.
   * Used by RepositoryServiceConfiguration on init. 
   * @return - config data stream
  void init(PropertiesParam params) throws RepositoryConfigurationException;
   * Read config data.
   * @return - config data stream
  InputStream read() throws RepositoryConfigurationException;
   * Create table, write data.
   * @param confData - config data stream
  void write(InputStream confData) throws RepositoryConfigurationException;
   * Tell if the config exists.
   * @return - flag
  boolean hasConfig() throws RepositoryConfigurationException;
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus