Author: sergiykarpenko
Date: 2010-02-18 09:05:25 -0500 (Thu, 18 Feb 2010)
New Revision: 1900
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/configuration.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jdbc-data-container-config.xml
Log:
EXOJCR-490: jdbc-data-container-config.xml updated; links updated
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml 2010-02-18 13:26:13 UTC
(rev 1899)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml 2010-02-18 14:05:25 UTC
(rev 1900)
@@ -60,9 +60,22 @@
<xi:include href="modules/architecture.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- common configs -->
+
<xi:include href="modules/configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/jdbc-data-container-config.xml"
+
xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <xi:include href="modules/external-value-storages.xml"
+
xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <xi:include href="modules/search-configuration.xml"
+
xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <!-- cluster configs -->
+
<xi:include href="modules/cluster-config.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
@@ -75,14 +88,8 @@
<xi:include href="modules/query-handler-config.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/jdbc-data-container-config.xml"
-
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/external-value-storages.xml"
-
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/search-configuration.xml"
-
xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/configuration.xml
===================================================================
---
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/configuration.xml 2010-02-18
13:26:13 UTC (rev 1899)
+++
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/configuration.xml 2010-02-18
14:05:25 UTC (rev 1900)
@@ -1,436 +1,436 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="configuration.html"?>
-
- <title>eXo JCR configuration</title>
-
- <section>
- <title>Related documents</title>
-
- <itemizedlist>
- <listitem>
- <para><link linkend="ch_search_configuration">Search
- Configuration</link></para>
- </listitem>
-
- <listitem>
- <para><link linkend="ch_jdbc_data_container">JDBC Data
Container
- config</link></para>
- </listitem>
-
- <listitem>
- <para><link linkend="ch_external_value_storages">External
Value
- Storages</link></para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Portal and Standalone configuration</title>
-
- <para>Like other eXo services eXo JCR can be configured and used in portal
- or embedded mode (as a service embedded in eXo Portal) and in standalone
- mode.</para>
-
- <para>In Embedded mode, JCR services are registered in the Portal
- container and the second option is to use a Standalone container. The main
- difference between these container types is that the first one is intended
- to be used in a Portal (Web) environment, while the second one can be used
- standalone (TODO see the comprehensive page Service Configuration for
- Beginners for more details).</para>
-
- <para>The following setup procedure is used to obtain a Standalone
- configuration (TODO find more in Container configuration):</para>
-
- <itemizedlist>
- <listitem>
- <para>Configuration that is set explicitly using
- StandaloneContainer.addConfigurationURL(String url) or
- StandaloneContainer.addConfigurationPath(String path) before
- getInstance()</para>
- </listitem>
-
- <listitem>
- <para>Configuration from $base:directory/exo-configuration.xml or
- $base:directory/conf/exo-configuration.xml file. Where $base:directory
- is either AS's home directory in case of J2EE AS environment or just
- the current directory in case of a standalone application.</para>
- </listitem>
-
- <listitem>
- <para>/conf/exo-configuration.xml in the current classloader (e.g.
- war, ear archive)</para>
- </listitem>
-
- <listitem>
- <para>Configuration from
- $service_jar_file/conf/portal/configuration.xml. WARNING: do not rely
- on some concrete jar's configuration if you have more than one jar
- containing conf/portal/configuration.xml file. In this case choosing a
- configuration is unpredictable.</para>
- </listitem>
- </itemizedlist>
-
- <para>JCR service configuration looks like:</para>
-
- <programlisting><component>
-
<key>org.exoplatform.services.jcr.RepositoryService</key>
-
<type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- </component>
- <component>
-
<key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
-
<type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR repositories configuration
file</description>
-
<value>jar:/conf/standalone/exo-jcr-config.xml</value>
- </value-param>
- <properties-param>
- <name>working-conf</name>
- <description>working-conf</description>
- <property name="source-name" value="jdbcjcr"
/>
- <property name="dialect" value="hsqldb" />
- <property name="persister-class-name"
value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"
/>
- </properties-param>
- </init-params>
- </component></programlisting>
-
- <para>conf-path : a path to a RepositoryService JCR Configuration</para>
-
- <para>working-conf : optional; JCR configuration persister configuration.
- If there isn't a working-conf the persister will be disabled</para>
-
- <section>
- <title>JCR Configuration</title>
-
- <para>The Configuration is defined in an XML file (see DTD
- below).</para>
-
- <para>JCR Service can use multiple Repositories and each repository can
- have multiple Workspaces.</para>
-
- <para>Repositories configuration parameters support human-readable
- formats of values. They are all case-insensitive:</para>
-
- <itemizedlist>
- <listitem>
- <para>Numbers formats: K,KB - kilobytes, M,MB - megabytes, G,GB -
- gigabytes, T,TB - terabytes.</para>
-
- <para>Examples: 100.5 - digit 100.5, 200k - 200 Kbytes, 4m - 4
- Mbytes, 1.4G - 1.4 Gbytes, 10T - 10 Tbytes</para>
- </listitem>
-
- <listitem>
- <para>Time format endings: ms - milliseconds, s - seconds, m -
- minutes, h - hours, d - days, w - weeks, if no ending -
- seconds.</para>
-
- <para>Examples: 500ms - 500 milliseconds, 20 or 20s - 20 seconds,
- 30m - 30 minutes, 12h - 12 hours, 5d - 5 days, 4w - 4 weeks.</para>
- </listitem>
- </itemizedlist>
-
- <para></para>
- </section>
-
- <section id="sect_repository_service_configuration">
- <title>Repository service configuration</title>
-
- <para>Default configuration of the Repository Service located in
- jar:/conf/portal/exo-jcr-config.xml, it will be available for portal and
- standalone modes.</para>
-
- <para>In portal mode it is overriden and located in the portal web
- application portal/WEB-INF/conf/jcr/repository-configuration.xml.</para>
-
- <para>Example of Repository Service configuration for standalone
- mode:</para>
-
- <programlisting><repository-service
default-repository="repository">
- <repositories>
- <repository name="db1" system-workspace="ws"
default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <access-control>optional</access-control>
- <session-max-age>1h</session-max-age>
-
<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="production">
- <!-- for system storage -->
- <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name"
value="jdbcjcr" />
- <property name="multi-db" value="false"
/>
- <property name="update-storage"
value="false" />
- <property name="max-buffer-size"
value="200k" />
- <property name="swap-directory"
value="../temp/swap/production" />
- </properties>
- <value-storages>
- <value-storage id="system"
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path"
value="../temp/values/production" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer
class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype"
value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="true"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="10k"
/>
- <property name="live-time" value="1h"
/>
- </properties>
- </cache>
- <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir"
value="../temp/jcrlucenedb/production" />
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister
class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path"
value="../temp/lock/system" />
- </properties>
- </persister>
- </lock-manager>
- </workspace>
-
- <workspace name="backup">
- <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name"
value="jdbcjcr" />
- <property name="multi-db" value="false"
/>
- <property name="update-storage"
value="false" />
- <property name="max-buffer-size"
value="200k" />
- <property name="swap-directory"
value="../temp/swap/backup" />
- </properties>
- <value-storages>
- <value-storage id="draft"
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path"
value="../temp/values/backup" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer
class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype"
value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="true"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="10k"
/>
- <property name="live-time" value="1h"
/>
- </properties>
- </cache>
- <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir"
value="../temp/jcrlucenedb/backup" />
- </properties>
- </query-handler>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
-</repository-service>
-</programlisting>
-
- <para>Repository Service configuration:</para>
-
- <para>default-repository - the name of a default repository (one
- returned by RepositoryService.getRepository())</para>
-
- <para>repositories - the list of repositories</para>
-
- <para>Repository configuration:</para>
-
- <para>name - the name of a repository</para>
-
- <para>default-workspace - the name of a workspace obtained using
- Session's login() or login(Credentials) methods (ones without an
- explicit workspace name)</para>
-
- <para>system-workspace - name of workspace where /jcr:system node is
- placed</para>
-
- <para>security-domain - the name of a security domain for JAAS
- authentication</para>
-
- <para>access-control - the name of an access control policy. There can
- be 3 types: optional - ACL is created on-demand(default), disable - no
- access control, mandatory - an ACL is created for each added node(not
- supported yet)</para>
-
- <para>authentication-policy - the name of an authentication policy
- class</para>
-
- <para>workspaces - the list of workspaces</para>
-
- <para>session-max-age - the time after which an idle session will be
- removed (called logout). If not set, the idle session will never be
- removed.</para>
-
- <para>Workspace configuration:</para>
-
- <para>name - the name of a workspace</para>
-
- <para>auto-init-root-nodetype - DEPRECATED in JCR 1.9 (use initializer).
- The node type for root node initialization</para>
-
- <para>container - workspace data container (physical storage)
- configuration</para>
-
- <para>initializer - workspace initializer configuration</para>
-
- <para>cache - workspace storage cache configuration</para>
-
- <para>query-handler - query handler configuration</para>
-
- <para>Workspace data container configuration:</para>
-
- <para>class - A workspace data container class name</para>
-
- <para>properties - the list of properties (name-value pairs) for the
- concrete Workspace data container</para>
-
- <para>value-storages - the list of value storage plugins</para>
-
- <para>Value Storage plugin configuration (optional feature):</para>
-
- <note>
- <para>The value-storage element is optional. If you don't include it,
- the values will be stored as BLOBs inside the database.</para>
- </note>
-
- <para>value-storage - Optional value Storage plugin definition</para>
-
- <para>class- a value storage plugin class name (attribute)</para>
-
- <para>properties - the list of properties (name-value pairs) for a
- concrete Value Storage plugin</para>
-
- <para>filters - the list of filters defining conditions when this plugin
- is applicable</para>
-
- <para>Initializer configuration (optional):</para>
-
- <para>class - initializer implementation class.</para>
-
- <para>properties - the list of properties (name-value pairs). Properties
- are supported:</para>
-
- <para>root-nodetype - The node type for root node
initialization</para>
-
- <para>root-permissions - Default permissions of the root node. It is
- defined as a set of semicolon-delimited permissions containing a group
- of space-delimited identities (user, group etc, see Organization service
- documentation for details) and the type of permission. For example any
- read;:/admin read;:/admin add_node;:/admin set_property;:/admin remove
- means that users from group admin have all permissions and other users
- have only a 'read' permission.</para>
-
- <para>Configurable initializer adds a capability to override workspace
- initial startup procedure.</para>
-
- <para>Cache configuration:</para>
-
- <para>enabled - if workspace cache is enabled</para>
-
- <para>class - cache implementation class, optional from 1.9. Default
- value is
-
org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl.</para>
-
- <para>Cache can be configured to use concrete implementation of
- WorkspaceStorageCache interface. JCR core has two implementation to use:
- * LinkedWorkspaceStorageCacheImpl - default, with configurable read
- behavior and statistic. * WorkspaceStorageCacheImpl - pre 1.9, still can
- be used.</para>
-
- <para>properties - the list of properties (name-value pairs) for
- Workspace cache:</para>
-
- <para>max-size - cache maximum size.</para>
-
- <para>live-time - cached item live time.</para>
-
- <para>LinkedWorkspaceStorageCacheImpl supports additional optional
- parameters TODO</para>
-
- <para>Query Handler configuration:</para>
-
- <para>class - A Query Handler class name</para>
-
- <para>properties - the list of properties (name-value pairs) for a Query
- Handler (indexDir) properties and advanced features described in *Search
- Configuration*</para>
-
- <para>Lock Manager configuration:</para>
-
- <para>time-out - time after which the unused global lock will be
- removed.</para>
-
- <para>persister - a class for storing lock information for future use.
- For example, remove lock after jcr restart.</para>
-
- <para>path - a lock folder, each workspace has its own.</para>
-
- <para></para>
-
- <para>Configuration definition:</para>
-
- <programlisting><!ELEMENT repository-service (repositories)>
- <!ATTLIST repository-service default-repository NMTOKEN #REQUIRED>
- <!ELEMENT repositories (repository)>
- <!ELEMENT repository
(security-domain,access-control,session-max-age,authentication-policy,workspaces)>
- <!ATTLIST repository
- default-workspace NMTOKEN #REQUIRED
- name NMTOKEN #REQUIRED
- system-workspace NMTOKEN #REQUIRED
- >
- <!ELEMENT security-domain (#PCDATA)>
- <!ELEMENT access-control (#PCDATA)>
- <!ELEMENT session-max-age (#PCDATA)>
- <!ELEMENT authentication-policy (#PCDATA)>
- <!ELEMENT workspaces (workspace+)>
- <!ELEMENT workspace (container,initializer,cache,query-handler)>
- <!ATTLIST workspace name NMTOKEN #REQUIRED>
- <!ELEMENT container (properties,value-storages)>
- <!ATTLIST container class NMTOKEN #REQUIRED>
- <!ELEMENT value-storages (value-storage+)>
- <!ELEMENT value-storage (properties,filters)>
- <!ATTLIST value-storage class NMTOKEN #REQUIRED>
- <!ELEMENT filters (filter+)>
- <!ELEMENT filter EMPTY>
- <!ATTLIST filter property-type NMTOKEN #REQUIRED>
- <!ELEMENT initializer (properties)>
- <!ATTLIST initializer class NMTOKEN #REQUIRED>
- <!ELEMENT cache (properties)>
- <!ATTLIST cache
- enabled NMTOKEN #REQUIRED
- class NMTOKEN #REQUIRED
- >
- <!ELEMENT query-handler (properties)>
- <!ATTLIST query-handler class NMTOKEN #REQUIRED>
- <!ELEMENT access-manager (properties)>
- <!ATTLIST access-manager class NMTOKEN #REQUIRED>
- <!ELEMENT lock-manager (time-out,persister)>
- <!ELEMENT time-out (#PCDATA)>
- <!ELEMENT persister (properties)>
- <!ELEMENT properties (property+)>
- <!ELEMENT property EMPTY></programlisting>
- </section>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="ch_configuration">
+ <?dbhtml filename="configuration.html"?>
+
+ <title>eXo JCR configuration</title>
+
+ <section>
+ <title>Related documents</title>
+
+ <itemizedlist>
+ <listitem>
+ <para><link linkend="ch_search_configuration">Search
+ Configuration</link></para>
+ </listitem>
+
+ <listitem>
+ <para><link linkend="ch_jdbc_data_container">JDBC Data
Container
+ config</link></para>
+ </listitem>
+
+ <listitem>
+ <para><link linkend="ch_external_value_storages">External
Value
+ Storages</link></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Portal and Standalone configuration</title>
+
+ <para>Like other eXo services eXo JCR can be configured and used in portal
+ or embedded mode (as a service embedded in eXo Portal) and in standalone
+ mode.</para>
+
+ <para>In Embedded mode, JCR services are registered in the Portal
+ container and the second option is to use a Standalone container. The main
+ difference between these container types is that the first one is intended
+ to be used in a Portal (Web) environment, while the second one can be used
+ standalone (TODO see the comprehensive page Service Configuration for
+ Beginners for more details).</para>
+
+ <para>The following setup procedure is used to obtain a Standalone
+ configuration (TODO find more in Container configuration):</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Configuration that is set explicitly using
+ StandaloneContainer.addConfigurationURL(String url) or
+ StandaloneContainer.addConfigurationPath(String path) before
+ getInstance()</para>
+ </listitem>
+
+ <listitem>
+ <para>Configuration from $base:directory/exo-configuration.xml or
+ $base:directory/conf/exo-configuration.xml file. Where $base:directory
+ is either AS's home directory in case of J2EE AS environment or just
+ the current directory in case of a standalone application.</para>
+ </listitem>
+
+ <listitem>
+ <para>/conf/exo-configuration.xml in the current classloader (e.g.
+ war, ear archive)</para>
+ </listitem>
+
+ <listitem>
+ <para>Configuration from
+ $service_jar_file/conf/portal/configuration.xml. WARNING: do not rely
+ on some concrete jar's configuration if you have more than one jar
+ containing conf/portal/configuration.xml file. In this case choosing a
+ configuration is unpredictable.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>JCR service configuration looks like:</para>
+
+ <programlisting><component>
+
<key>org.exoplatform.services.jcr.RepositoryService</key>
+
<type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ </component>
+ <component>
+
<key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+
<type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR repositories configuration
file</description>
+
<value>jar:/conf/standalone/exo-jcr-config.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="source-name" value="jdbcjcr"
/>
+ <property name="dialect" value="hsqldb" />
+ <property name="persister-class-name"
value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"
/>
+ </properties-param>
+ </init-params>
+ </component></programlisting>
+
+ <para>conf-path : a path to a RepositoryService JCR Configuration</para>
+
+ <para>working-conf : optional; JCR configuration persister configuration.
+ If there isn't a working-conf the persister will be disabled</para>
+
+ <section>
+ <title>JCR Configuration</title>
+
+ <para>The Configuration is defined in an XML file (see DTD
+ below).</para>
+
+ <para>JCR Service can use multiple Repositories and each repository can
+ have multiple Workspaces.</para>
+
+ <para>Repositories configuration parameters support human-readable
+ formats of values. They are all case-insensitive:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Numbers formats: K,KB - kilobytes, M,MB - megabytes, G,GB -
+ gigabytes, T,TB - terabytes.</para>
+
+ <para>Examples: 100.5 - digit 100.5, 200k - 200 Kbytes, 4m - 4
+ Mbytes, 1.4G - 1.4 Gbytes, 10T - 10 Tbytes</para>
+ </listitem>
+
+ <listitem>
+ <para>Time format endings: ms - milliseconds, s - seconds, m -
+ minutes, h - hours, d - days, w - weeks, if no ending -
+ seconds.</para>
+
+ <para>Examples: 500ms - 500 milliseconds, 20 or 20s - 20 seconds,
+ 30m - 30 minutes, 12h - 12 hours, 5d - 5 days, 4w - 4 weeks.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para></para>
+ </section>
+
+ <section id="sect_repository_service_configuration">
+ <title>Repository service configuration</title>
+
+ <para>Default configuration of the Repository Service located in
+ jar:/conf/portal/exo-jcr-config.xml, it will be available for portal and
+ standalone modes.</para>
+
+ <para>In portal mode it is overriden and located in the portal web
+ application portal/WEB-INF/conf/jcr/repository-configuration.xml.</para>
+
+ <para>Example of Repository Service configuration for standalone
+ mode:</para>
+
+ <programlisting><repository-service
default-repository="repository">
+ <repositories>
+ <repository name="db1" system-workspace="ws"
default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <access-control>optional</access-control>
+ <session-max-age>1h</session-max-age>
+
<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="production">
+ <!-- for system storage -->
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name"
value="jdbcjcr" />
+ <property name="multi-db" value="false"
/>
+ <property name="update-storage"
value="false" />
+ <property name="max-buffer-size"
value="200k" />
+ <property name="swap-directory"
value="../temp/swap/production" />
+ </properties>
+ <value-storages>
+ <value-storage id="system"
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path"
value="../temp/values/production" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype"
value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="10k"
/>
+ <property name="live-time" value="1h"
/>
+ </properties>
+ </cache>
+ <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir"
value="../temp/jcrlucenedb/production" />
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path"
value="../temp/lock/system" />
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="backup">
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name"
value="jdbcjcr" />
+ <property name="multi-db" value="false"
/>
+ <property name="update-storage"
value="false" />
+ <property name="max-buffer-size"
value="200k" />
+ <property name="swap-directory"
value="../temp/swap/backup" />
+ </properties>
+ <value-storages>
+ <value-storage id="draft"
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path"
value="../temp/values/backup" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype"
value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="10k"
/>
+ <property name="live-time" value="1h"
/>
+ </properties>
+ </cache>
+ <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir"
value="../temp/jcrlucenedb/backup" />
+ </properties>
+ </query-handler>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service>
+</programlisting>
+
+ <para>Repository Service configuration:</para>
+
+ <para>default-repository - the name of a default repository (one
+ returned by RepositoryService.getRepository())</para>
+
+ <para>repositories - the list of repositories</para>
+
+ <para>Repository configuration:</para>
+
+ <para>name - the name of a repository</para>
+
+ <para>default-workspace - the name of a workspace obtained using
+ Session's login() or login(Credentials) methods (ones without an
+ explicit workspace name)</para>
+
+ <para>system-workspace - name of workspace where /jcr:system node is
+ placed</para>
+
+ <para>security-domain - the name of a security domain for JAAS
+ authentication</para>
+
+ <para>access-control - the name of an access control policy. There can
+ be 3 types: optional - ACL is created on-demand(default), disable - no
+ access control, mandatory - an ACL is created for each added node(not
+ supported yet)</para>
+
+ <para>authentication-policy - the name of an authentication policy
+ class</para>
+
+ <para>workspaces - the list of workspaces</para>
+
+ <para>session-max-age - the time after which an idle session will be
+ removed (called logout). If not set, the idle session will never be
+ removed.</para>
+
+ <para>Workspace configuration:</para>
+
+ <para>name - the name of a workspace</para>
+
+ <para>auto-init-root-nodetype - DEPRECATED in JCR 1.9 (use initializer).
+ The node type for root node initialization</para>
+
+ <para>container - workspace data container (physical storage)
+ configuration</para>
+
+ <para>initializer - workspace initializer configuration</para>
+
+ <para>cache - workspace storage cache configuration</para>
+
+ <para>query-handler - query handler configuration</para>
+
+ <para>Workspace data container configuration:</para>
+
+ <para>class - A workspace data container class name</para>
+
+ <para>properties - the list of properties (name-value pairs) for the
+ concrete Workspace data container</para>
+
+ <para>value-storages - the list of value storage plugins</para>
+
+ <para>Value Storage plugin configuration (optional feature):</para>
+
+ <note>
+ <para>The value-storage element is optional. If you don't include it,
+ the values will be stored as BLOBs inside the database.</para>
+ </note>
+
+ <para>value-storage - Optional value Storage plugin definition</para>
+
+ <para>class- a value storage plugin class name (attribute)</para>
+
+ <para>properties - the list of properties (name-value pairs) for a
+ concrete Value Storage plugin</para>
+
+ <para>filters - the list of filters defining conditions when this plugin
+ is applicable</para>
+
+ <para>Initializer configuration (optional):</para>
+
+ <para>class - initializer implementation class.</para>
+
+ <para>properties - the list of properties (name-value pairs). Properties
+ are supported:</para>
+
+ <para>root-nodetype - The node type for root node
initialization</para>
+
+ <para>root-permissions - Default permissions of the root node. It is
+ defined as a set of semicolon-delimited permissions containing a group
+ of space-delimited identities (user, group etc, see Organization service
+ documentation for details) and the type of permission. For example any
+ read;:/admin read;:/admin add_node;:/admin set_property;:/admin remove
+ means that users from group admin have all permissions and other users
+ have only a 'read' permission.</para>
+
+ <para>Configurable initializer adds a capability to override workspace
+ initial startup procedure.</para>
+
+ <para>Cache configuration:</para>
+
+ <para>enabled - if workspace cache is enabled</para>
+
+ <para>class - cache implementation class, optional from 1.9. Default
+ value is
+
org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl.</para>
+
+ <para>Cache can be configured to use concrete implementation of
+ WorkspaceStorageCache interface. JCR core has two implementation to use:
+ * LinkedWorkspaceStorageCacheImpl - default, with configurable read
+ behavior and statistic. * WorkspaceStorageCacheImpl - pre 1.9, still can
+ be used.</para>
+
+ <para>properties - the list of properties (name-value pairs) for
+ Workspace cache:</para>
+
+ <para>max-size - cache maximum size.</para>
+
+ <para>live-time - cached item live time.</para>
+
+ <para>LinkedWorkspaceStorageCacheImpl supports additional optional
+ parameters TODO</para>
+
+ <para>Query Handler configuration:</para>
+
+ <para>class - A Query Handler class name</para>
+
+ <para>properties - the list of properties (name-value pairs) for a Query
+ Handler (indexDir) properties and advanced features described in *Search
+ Configuration*</para>
+
+ <para>Lock Manager configuration:</para>
+
+ <para>time-out - time after which the unused global lock will be
+ removed.</para>
+
+ <para>persister - a class for storing lock information for future use.
+ For example, remove lock after jcr restart.</para>
+
+ <para>path - a lock folder, each workspace has its own.</para>
+
+ <para></para>
+
+ <para>Configuration definition:</para>
+
+ <programlisting><!ELEMENT repository-service (repositories)>
+ <!ATTLIST repository-service default-repository NMTOKEN #REQUIRED>
+ <!ELEMENT repositories (repository)>
+ <!ELEMENT repository
(security-domain,access-control,session-max-age,authentication-policy,workspaces)>
+ <!ATTLIST repository
+ default-workspace NMTOKEN #REQUIRED
+ name NMTOKEN #REQUIRED
+ system-workspace NMTOKEN #REQUIRED
+ >
+ <!ELEMENT security-domain (#PCDATA)>
+ <!ELEMENT access-control (#PCDATA)>
+ <!ELEMENT session-max-age (#PCDATA)>
+ <!ELEMENT authentication-policy (#PCDATA)>
+ <!ELEMENT workspaces (workspace+)>
+ <!ELEMENT workspace (container,initializer,cache,query-handler)>
+ <!ATTLIST workspace name NMTOKEN #REQUIRED>
+ <!ELEMENT container (properties,value-storages)>
+ <!ATTLIST container class NMTOKEN #REQUIRED>
+ <!ELEMENT value-storages (value-storage+)>
+ <!ELEMENT value-storage (properties,filters)>
+ <!ATTLIST value-storage class NMTOKEN #REQUIRED>
+ <!ELEMENT filters (filter+)>
+ <!ELEMENT filter EMPTY>
+ <!ATTLIST filter property-type NMTOKEN #REQUIRED>
+ <!ELEMENT initializer (properties)>
+ <!ATTLIST initializer class NMTOKEN #REQUIRED>
+ <!ELEMENT cache (properties)>
+ <!ATTLIST cache
+ enabled NMTOKEN #REQUIRED
+ class NMTOKEN #REQUIRED
+ >
+ <!ELEMENT query-handler (properties)>
+ <!ATTLIST query-handler class NMTOKEN #REQUIRED>
+ <!ELEMENT access-manager (properties)>
+ <!ATTLIST access-manager class NMTOKEN #REQUIRED>
+ <!ELEMENT lock-manager (time-out,persister)>
+ <!ELEMENT time-out (#PCDATA)>
+ <!ELEMENT persister (properties)>
+ <!ELEMENT properties (property+)>
+ <!ELEMENT property EMPTY></programlisting>
+ </section>
+ </section>
+</chapter>
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jdbc-data-container-config.xml
===================================================================
---
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jdbc-data-container-config.xml 2010-02-18
13:26:13 UTC (rev 1899)
+++
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jdbc-data-container-config.xml 2010-02-18
14:05:25 UTC (rev 1900)
@@ -1,14 +1,533 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="ch_jdbc_data_container">
- <?dbhtml filename="jdbc-data-container-config.html"?>
-
- <title>JDBC Data Container Config</title>
-
- <section>
- <title>Introduction</title>
-
- <para></para>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="ch_jdbc_data_container">
+ <?dbhtml filename="jdbc-data-container-config.html"?>
+
+ <title>JDBC Data Container Config</title>
+
+ <section>
+ <title>Introduction</title>
+
+ <para>eXo JCR persistent data container can work in two configuration
+ modes:<itemizedlist>
+ <listitem>
+ <para><phrase>Multi-database</phrase>: one database for each
+ workspace (used in standalone eXo JCR service mode)</para>
+ </listitem>
+
+ <listitem>
+ <para><phrase>Single-database</phrase>: all workspaces
persisted in
+ one database (used in embedded eXo JCR service mode, e.g. in eXo
+ portal)</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>The data container uses the JDBC driver to communicate with the
+ actual database software, i.e. any JDBC-enabled data storage can be used
+ with eXo JCR implementation.</para>
+
+ <para>Currently the data container is tested with the following
+ RDBMS:<itemizedlist>
+ <listitem>
+ <para>MySQL (5.x including UTF8 support)</para>
+ </listitem>
+
+ <listitem>
+ <para>PostgreSQL (8.x)</para>
+ </listitem>
+
+ <listitem>
+ <para>Oracle Database (9i, 10g)</para>
+ </listitem>
+
+ <listitem>
+ <para>Microsoft SQL Server (2005)</para>
+ </listitem>
+
+ <listitem>
+ <para>Sybase ASE (15.0)</para>
+ </listitem>
+
+ <listitem>
+ <para>Apache Derby/Java DB (10.1.x, 10.2.x)</para>
+ </listitem>
+
+ <listitem>
+ <para>IBM DB2 (8.x, 9.x)</para>
+ </listitem>
+
+ <listitem>
+ <para>HSQLDB (1.8.0.7)</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>Each database software supports ANSI SQL standards but has its own
+ specifics too. So, each database has its own configuration in eXo JCR as a
+ database dialect parameter. If you need a more detailed configuration of
+ the database it's possible to do that by editing the metadata SQL-script
+ files.</para>
+
+ <para>In case the non-ANSI node name is used it's necessary to use a
+ database with MultiLanguage support[TODO link to MultiLanguage]. Some JDBC
+ drivers need additional parameters for establishing a Unicode friendly
+ connection. E.g. under mysql it's necessary to add an additional parameter
+ for the JDBC driver at the end of JDBC URL. For instance:
+
<
code>jdbc:mysql://exoua.dnsalias.net/portal?characterEncoding=utf8<...
+
+ <para>There are preconfigured configuration files for HSQLDB. Look for
+ these files in /conf/portal and /conf/standalone folders of the jar-file
+ <package>exo.jcr.component.core-XXX.XXX.jar</package> or
+ source-distribution of eXo JCR implementation.</para>
+
+ <para>By default the configuration files are located in service jars
+ <filename>/conf/portal/configuration.xml</filename> (eXo services
+ including JCR Repository Service) and
+ <filename>exo-jcr-config.xml</filename> (repositories configuration). In
+ eXo portal product JCR is configured in portal web application
+ <filename>portal/WEB-INF/conf/jcr/jcr-configuration.xml</filename> (JCR
+ Repository Service and related serivces) and repository-configuration.xml
+ (repositories configuration).</para>
+
+ <para>Read more about <link
linkend="ch_configuration">Repository
+ configuration</link>.</para>
+ </section>
+
+ <section>
+ <title>Multi-database Configuration</title>
+
+ <para>You need to configure each workspace in a repository. You may have
+ each one on different remote servers as far as you need.</para>
+
+ <para>First of all configure the data containers in the
+
<classname>org.exoplatform.services.naming.InitialContextInitializer</classname>
+ service. It's the JNDI context initializer which registers (binds) naming
+ resources (DataSources) for data containers.</para>
+
+ <para>Example (standalone mode, two data containers
+ <parameter>jdbcjcr</parameter> - local HSQLDB,
+ <parameter>jdbcjcr1</parameter> - remote
MySQL):<programlisting><component>
+
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
+
<type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ <component-plugins>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+
<type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName"
value="org.hsqldb.jdbcDriver"/>
+ <property name="url"
value="jdbc:hsqldb:file:target/temp/data/portal"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+
<type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName"
value="com.mysql.jdbc.Driver"/>
+ <property name="url"
value="jdbc:mysql://exoua.dnsalias.net/jcr"/>
+ <property name="username"
value="exoadmin"/>
+ <property name="password"
value="exo12321"/>
+ <property name="maxActive" value="50"/>
+ <property name="maxIdle" value="5"/>
+ <property name="initialSize" value="5"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugins>
+ <init-params>
+ <value-param>
+ <name>default-context-factory</name>
+
<value>org.exoplatform.services.naming.SimpleContextFactory</value>
+ </value-param>
+ </init-params>
+ </component></programlisting></para>
+
+ <para>We configure the database connection parameters:<itemizedlist>
+ <listitem>
+ <para><parameter>driverClassName</parameter>, e.g.
+ "org.hsqldb.jdbcDriver", "com.mysql.jdbc.Driver",
+ "org.postgresql.Driver"</para>
+ </listitem>
+
+ <listitem>
+ <para><parameter>url</parameter>, e.g.
+ "jdbc:hsqldb:file:target/temp/data/portal",
+ "jdbc:mysql://exoua.dnsalias.net/jcr"</para>
+ </listitem>
+
+ <listitem>
+ <para><parameter>username</parameter>, e.g. "sa",
"exoadmin"</para>
+ </listitem>
+
+ <listitem>
+ <para><parameter>password</parameter>, e.g. "",
"exo12321"</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>There can be connection pool configuration parameters
+ (org.apache.commons.dbcp.BasicDataSourceFactory):<itemizedlist>
+ <listitem>
+ <para><parameter>maxActive</parameter>, e.g. 50</para>
+ </listitem>
+
+ <listitem>
+ <para><parameter>maxIdle</parameter>, e.g. 5</para>
+ </listitem>
+
+ <listitem>
+ <para><parameter>initialSize</parameter>, e.g.
5</para>
+ </listitem>
+
+ <listitem>
+ <para>and other according to <ulink
+
url="http://jakarta.apache.org/commons/dbcp/configuration.html"...
+ DBCP configuration</ulink></para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>When the data container configuration is done we can configure the
+ repository service. Each workspace will be configured for its own data
+ container.</para>
+
+ <para>Example (two workspaces <parameter>ws</parameter> - jdbcjcr,
+ <parameter>ws1</parameter> -
jdbcjcr1):<programlisting><workspaces>
+ <workspace name="ws"
auto-init-root-nodetype="nt:unstructured">
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="true"/>
+ <property name="max-buffer-size" value="200K"/>
+ <property name="swap-directory"
value="target/temp/swap/ws"/>
+ </properties>
+ </container>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size"
value="10K"/><!-- 10Kbytes -->
+ <property name="live-time"
value="30m"/><!-- 30 min -->
+ </properties>
+ </cache>
+ <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir"
value="target/temp/index"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15 min -->
+ <persister
class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path"
value="target/temp/lock/ws"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="ws1"
auto-init-root-nodetype="nt:unstructured">
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1"/>
+ <property name="dialect" value="mysql"/>
+ <property name="multi-db" value="true"/>
+ <property name="max-buffer-size" value="200K"/>
+ <property name="swap-directory"
value="target/temp/swap/ws1"/>
+ </properties>
+ </container>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="10K"/>
+ <property name="live-time" value="5m"/>
+ </properties>
+ </cache>
+ <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir"
value="target/temp/index"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15 min -->
+ <persister
class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path"
value="target/temp/lock/ws1"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+</workspaces></programlisting><itemizedlist>
+ <listitem>
+ <para><parameter>source-name</parameter> - a
javax.sql.DataSource
+ name configured in InitialContextInitializer component (was
+ <parameter>sourceName</parameter> prior JCR 1.9);</para>
+ </listitem>
+
+ <listitem>
+ <para><parameter>dialect</parameter> - a database dialect,
one of
+ "hsqldb", "mysql", "mysql-utf8",
"pgsql", "oracle", "oracle-oci",
+ "mssql", "sybase", "derby", "db2",
"db2v8".</para>
+ </listitem>
+
+ <listitem>
+ <para><parameter>multi-db</parameter> - enable
multi-database
+ container with this parameter (set value "true");</para>
+ </listitem>
+
+ <listitem>
+ <para><parameter>max-buffer-size</parameter> - a threshold
(in
+ bytes) after which a javax.jcr.Value content will be swapped to a
+ file in a temporary storage. I.e. swap for pending changes.</para>
+ </listitem>
+
+ <listitem>
+ <para><parameter>swap-directory</parameter> - a path in the
file
+ system used to swap the pending changes.</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>In this way we have configured two workspace which will be persisted
+ in two different databases (ws in HSQLDB, ws1 in MySQL).</para>
+
+ <note>
+ <para> Starting from v.1.9 <link
linkend="ch_configuration">repository
+ configuration</link> parameters supports human-readable formats of
+ values (e.g. 200K - 200 Kbytes, 30m - 30 minutes etc)</para>
+ </note>
+ </section>
+
+ <section>
+ <title>Single-database configuration</title>
+
+ <para>It's more simple to configure a single-database data container. We
+ have to configure one naming resource.</para>
+
+ <para>Example (embedded mode for <parameter>jdbcjcr</parameter>
data
+ container):<programlisting><external-component-plugins>
+
<target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+
<type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName"
value="org.postgresql.Driver"/>
+ <property name="url"
value="jdbc:postgresql://exoua.dnsalias.net/portal"/>
+ <property name="username"
value="exoadmin"/>
+ <property name="password"
value="exo12321"/>
+ <property name="maxActive" value="50"/>
+ <property name="maxIdle" value="5"/>
+ <property name="initialSize" value="5"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins></programlisting></para>
+
+ <para>And configure repository workspaces in repositories configuration
+ with this one database. Parameter "multi-db" must be switched off (set
+ value "false").</para>
+
+ <para>Example (two workspaces <parameter>ws</parameter> - jdbcjcr,
+ <parameter>ws1</parameter> -
jdbcjcr):<programlisting><workspaces>
+ <workspace name="ws"
auto-init-root-nodetype="nt:unstructured">
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="dialect" value="pgsql"/>
+ <property name="multi-db" value="false"/>
+ <property name="max-buffer-size" value="200K"/>
+ <property name="swap-directory"
value="target/temp/swap/ws"/>
+ </properties>
+ </container>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="10K"/>
+ <property name="live-time" value="30m"/>
+ </properties>
+ </cache>
+ <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir"
value="../temp/index"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path"
value="target/temp/lock/ws"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="ws1"
auto-init-root-nodetype="nt:unstructured">
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="dialect" value="pgsql"/>
+ <property name="multi-db" value="false"/>
+ <property name="max-buffer-size" value="200K"/>
+ <property name="swap-directory"
value="target/temp/swap/ws1"/>
+ </properties>
+ </container>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="10K"/>
+ <property name="live-time" value="5m"/>
+ </properties>
+ </cache>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path"
value="target/temp/lock/ws1"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+</workspaces></programlisting></para>
+
+ <para>In this way we have configured two workspaces which will be
+ persisted in one database (PostgreSQL).</para>
+
+ <section>
+ <title>Configuration without DataSource</title>
+
+ <para>Repository configuration without using of the
+ <classname>javax.sql.DataSource</classname> bounded in
JNDI.</para>
+
+ <para>This case may be usable if you have a dedicated JDBC driver
+ implementation with special features like XA transactions,
+ statements/connections pooling etc:<itemizedlist>
+ <listitem>
+ <para>You have to remove the configuration in
+ <classname>InitialContextInitializer</classname> for your
database
+ and configure a new one directly in the workspace
+ container.</para>
+ </listitem>
+
+ <listitem>
+ <para>Remove parameter "source-name" and add next lines
instead.
+ Describe your values for a JDBC driver, database url and
+ username.</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <note>
+ <para>But be careful in this case JDBC driver should implement and
+ provide connection pooling. Connection pooling is very recommended for
+ use with JCR to prevent a database overload.</para>
+ </note>
+
+ <programlisting><workspace name="ws"
auto-init-root-nodetype="nt:unstructured">
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="dialect" value="hsqldb"/>
+ <property name="driverClassName"
value="org.hsqldb.jdbcDriver"/>
+ <property name="url"
value="jdbc:hsqldb:file:target/temp/data/portal"/>
+ <property name="username" value="su"/>
+ <property name="password" value=""/>
+ ......</programlisting>
+ </section>
+
+ <section>
+ <title>Dynamic Workspace Creation</title>
+
+ <para>Workspaces can be added dynamically during runtime.</para>
+
+ <para>This can be performed in two steps:<itemizedlist>
+ <listitem>
+ <para>Firstly,
+ <classname>ManageableRepository.configWorkspace(WorkspaceEntry
+ wsConfig)</classname> - register a new configuration in
+ RepositoryContainer and create a WorkspaceContainer.</para>
+ </listitem>
+
+ <listitem>
+ <para>Secondly, the main step,
+ <classname>ManageableRepository.createWorkspace(String
+ workspaceName)</classname> - creation of a new workspace.</para>
+ </listitem>
+ </itemizedlist></para>
+ </section>
+ </section>
+
+ <section>
+ <title>Notes for Microsoft Windows users</title>
+
+ <para>The current configuration of eXo JCR uses Apache DBCP connection
+ pool
+ (<classname>org.apache.commons.dbcp.BasicDataSourceFactory</classname>).
+ It's possible to set a big value for maxActive parameter in
+ <filename>configuration.xml</filename>. That means usage of lots of
TCP/IP
+ ports from a client machine inside the pool (i.e. JDBC driver). As a
+ result the data container can throw exceptions like "Address already in
+ use". To solve this problem you have to configure the client's machine
+ networking software for the usage of shorter timeouts for opened TCP/IP
+ ports.</para>
+
+ <para>Microsoft Windows has <parameter>MaxUserPort</parameter>,
+ <parameter>TcpTimedWaitDelay</parameter> registry keys in the node
+
<parameter>HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters</parameter>,
+ by default these keys are unset, set each one with values like
+ these:<itemizedlist>
+ <listitem>
+ <para>"TcpTimedWaitDelay"=dword:0000001e, sets TIME_WAIT
parameter
+ to 30 seconds, default is 240.</para>
+ </listitem>
+
+ <listitem>
+ <para>"MaxUserPort"=dword:00001b58, sets the maximum of open
ports
+ to 7000 or higher, default is 5000.</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>A sample registry file is below:<programlisting>Windows Registry
Editor Version 5.00
+
+[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
+"MaxUserPort"=dword:00001b58
+"TcpTimedWaitDelay"=dword:0000001e</programlisting></para>
+ </section>
+</chapter>