Author: tolusha
Date: 2011-01-31 10:51:13 -0500 (Mon, 31 Jan 2011)
New Revision: 3905
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-exo-implementation.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-namespace-altering.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/nodetype-registration.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/other/acl.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/protocols/webdav.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/job-scheduler-service.xml
Log:
EXOJCR-1177: Improve JCR Doc
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml
===================================================================
---
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml 2011-01-31
07:39:12 UTC (rev 3904)
+++
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml 2011-01-31
15:51:13 UTC (rev 3905)
@@ -1,52 +1,37 @@
-<?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">
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. --><!DOCTYPE article
PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
<chapter id="JCR.ClusterConfig">
- <?dbhtml filename="ch-cluster-config.html"?>
-
- <title>Configuring JBoss AS with eXo JCR in cluster</title>
-
+<?dbhtml filename="ch-cluster-config.html"?> <title>Configuring
JBoss AS with eXo JCR in cluster</title>
<section>
<title>Launching Cluster</title>
-
<section>
<title>Deploying eXo JCR to JBoss As</title>
-
<para>To deploy eXo JCR to JBoss, do the following steps:</para>
-
<orderedlist>
<listitem>
- <para>Dowload the latest version of eXo JCR ear
distribution.</para>
+ <para>Download the latest version of eXo JCR .ear file
distribution.</para>
</listitem>
-
<listitem>
<para>Copy <jcr.ear> into
<%jboss_home%/server/default/deploy></para>
</listitem>
-
<listitem>
<para>Put exo-configuration.xml to the root
<%jboss_home%/exo-configuration.xml></para>
</listitem>
-
<listitem>
<para>Configure JAAS by inserting XML fragment shown below into
<%jboss_home%/server/default/conf/login-config.xml></para>
-
- <programlisting><application-policy
name="exo-domain">
+ <programlisting><application-policy
name="exo-domain">
<authentication>
- <login-module
code="org.exoplatform.services.security.j2ee.JbossLoginModule"
flag="required"></login-module>
+ <login-module
code="org.exoplatform.services.security.j2ee.JbossLoginModule"
flag="required"></login-module>
</authentication>
</application-policy></programlisting>
</listitem>
-
<listitem>
- <para>Ensure that you use JBossTS <link
- linkend="Kernel.TransactionService">Transaction
Service</link> and
- JBossCache <link
linkend="JCR.JBossTransactionsService">Transaction
- Manager</link>. Your exo-configuration.xml must contain such
+ <para>Ensure that you use JBossTS <link
linkend="Kernel.TransactionService">Transaction Service</link> and
+ JBossCache <link
linkend="JCR.JBossTransactionsService">Transaction Manager</link>. Your
exo-configuration.xml must contain such
parts:</para>
-
<programlisting><component>
<key>org.jboss.cache.transaction.TransactionManagerLookup</key>
<type>org.jboss.cache.GenericTransactionManagerLookup</type>^
@@ -63,79 +48,71 @@
</init-params>
</component></programlisting>
</listitem>
-
<listitem>
<para>Start server:</para>
-
<itemizedlist>
<listitem>
<para>bin/run.sh for Unix</para>
</listitem>
-
<listitem>
<para>bin/run.bat for Windows</para>
</listitem>
</itemizedlist>
</listitem>
-
<listitem>
<para>Try accessing <uri>http://localhostu:8080/browser</uri>
with
- root/exo as login/password if you have done everything right, you'll
+ root/exo as login/password if you have done everything right, you'll
get access to repository browser.</para>
</listitem>
</orderedlist>
</section>
-
<section id="JCR.ClusterConfig.JCRExternalConfig">
<title>Configuring JCR to use external configuration</title>
-
<itemizedlist>
<listitem>
- <para>To manually configure repository create a new configuration
- file (f.e. exo-jcr-configuration.xml). For details, see <link
- linkend="JCR.eXoJCRconfiguration">JCR Configuration</link>.
Your
+ <para>To manually configure repository, create a new configuration
+ file (e.g., exo-jcr-configuration.xml). For details, see <link
linkend="JCR.eXoJCRconfiguration">JCR Configuration</link>. Your
configuration must look like:</para>
-
- <programlisting><repository-service
default-repository="repository1">
+ <programlisting><repository-service
default-repository="repository1">
<repositories>
- <repository name="repository1" system-workspace="ws1"
default-workspace="ws1">
+ <repository name="repository1"
system-workspace="ws1"
default-workspace="ws1">
<security-domain>exo-domain</security-domain>
<access-control>optional</access-control>
<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
<workspaces>
- <workspace name="ws1">
- <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <workspace name="ws1">
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
- <property name="source-name"
value="jdbcjcr" />
- <property name="dialect" value="oracle"
/>
- <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" />
+ <property name="source-name"
value="jdbcjcr" />
+ <property name="dialect"
value="oracle" />
+ <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>
- see "<link linkend="conf_value_storage">Value
storage configuration</link>" part.
+ see "<link
linkend="conf_value_storage">Value storage
configuration</link>" part.
</value-storages>
</container>
- <initializer
class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <initializer
class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
<properties>
- <property name="root-nodetype"
value="nt:unstructured" />
+ <property name="root-nodetype"
value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
- see "<link linkend="conf_cache">Cache
configuration</link>" part.
+ <cache enabled="true"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ see "<link linkend="conf_cache">Cache
configuration</link>" part.
</cache>
- <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- see "<link linkend="conf_indexer">Indexer
configuration</link>" part.
+ <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ see "<link linkend="conf_indexer">Indexer
configuration</link>" part.
</query-handler>
- <lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- see "<link linkend="conf_lock_manager">Lock
Manager configuration</link>" part.
+ <lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ see "<link linkend="conf_lock_manager">Lock
Manager configuration</link>" part.
</lock-manager>
</workspace>
- <workspace name="ws2">
+ <workspace name="ws2">
...
</workspace>
- <workspace name="wsN">
+ <workspace name="wsN">
...
</workspace>
</workspaces>
@@ -143,9 +120,8 @@
</repositories>
</repository-service> </programlisting>
</listitem>
-
<listitem>
- <para>and update RepositoryServiceConfiguration configuration in
+ <para>Then, update RepositoryServiceConfiguration configuration in
exo-configuration.xml to use this
file:<programlisting><component>
<key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
<type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
@@ -161,105 +137,89 @@
</itemizedlist>
</section>
</section>
-
<section>
<title>Requirements</title>
-
<section>
- <title>Enviorenment requirements</title>
-
+ <title>Environment requirements</title>
<itemizedlist>
<listitem>
<para>Every node of cluster MUST have the same mounted Network File
- System with read and write permissions on it.</para>
-
- <para>"/mnt/tornado" - path to the mounted Network File System
(all
- cluster nodes must use the same NFS)</para>
+ System with the read and write permissions on it.</para>
+ <para>"/mnt/tornado" - path to the mounted Network File
System (all
+ cluster nodes must use the same NFS).</para>
</listitem>
-
<listitem>
- <para>Every node of cluster MUST use the same database</para>
+ <para>Every node of cluster MUST use the same database.</para>
</listitem>
-
<listitem>
- <para>Same Clusters on different nodes MUST have the same cluster
- names (f.e if Indexer cluster in workspace production on the first
- node has name "production_indexer_cluster", then indexer clusters in
+ <para>The same Clusters on different nodes MUST have the same
+ names (e.g., if Indexer cluster in workspace production on the first
+ node has the name "production_indexer_cluster", then indexer
clusters in
workspace production on all other nodes MUST have the same name
- "production_indexer_cluster" )</para>
+ "production_indexer_cluster" ).</para>
</listitem>
</itemizedlist>
</section>
-
<section>
- <title>Enviorenment requirements</title>
-
+ <title>Configuration requirements</title>
<para>Configuration of every workspace in repository must contains of
such parts:</para>
-
<itemizedlist>
<listitem id="conf_value_storage">
<para>Value Storage configuration:</para>
-
<programlisting><value-storages>
- <value-storage id="system"
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <value-storage id="system"
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path"
value="/mnt/tornado/temp/values/production" /> <!--path within
NFS where ValueStorage will hold it's data-->
+ <property name="path"
value="/mnt/tornado/temp/values/production" /> <!--path
within NFS where ValueStorage will hold it's data-->
</properties>
<filters>
- <filter property-type="Binary" />
+ <filter property-type="Binary" />
</filters>
</value-storage>
</value-storages></programlisting>
</listitem>
-
<listitem id="conf_cache">
<para>Cache configuration:</para>
-
- <programlisting><cache enabled="true"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <programlisting><cache enabled="true"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
- <property name="jbosscache-configuration"
value="jar:/conf/portal/test-jbosscache-data.xml" /> <!--
path to JBoss Cache configuration for data storage -->
- <property name="jgroups-configuration"
value="jar:/conf/portal/udp-mux.xml" /> <!--
path to JGroups configuration -->
- <property name="jbosscache-cluster-name"
value="JCR_Cluster_cache_production" /> <!--
JBoss Cache data storage cluster name -->
- <property name="jgroups-multiplexer-stack" value="true"
/>
+ <property name="jbosscache-configuration"
value="jar:/conf/portal/test-jbosscache-data.xml" />
<!-- path to JBoss Cache configuration for data storage -->
+ <property name="jgroups-configuration"
value="jar:/conf/portal/udp-mux.xml" />
<!-- path to JGroups configuration -->
+ <property name="jbosscache-cluster-name"
value="JCR_Cluster_cache_production" />
<!-- JBoss Cache data storage cluster name -->
+ <property name="jgroups-multiplexer-stack"
value="true" />
</properties>
</cache> </programlisting>
</listitem>
-
<listitem id="conf_indexer">
<para>Indexer configuration:</para>
-
- <programlisting><query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <programlisting><query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="changesfilter-class"
value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter"
/>
- <property name="index-dir"
value="/mnt/tornado/temp/jcrlucenedb/production" />
<!-- path within NFS where ValueStorage will hold it's data -->
- <property name="jbosscache-configuration"
value="jar:/conf/portal/test-jbosscache-indexer.xml" /> <!--
path to JBoss Cache configuration for indexer -->
- <property name="jgroups-configuration"
value="jar:/conf/portal/udp-mux.xml" /> <!--
path to JGroups configuration -->
- <property name="jbosscache-cluster-name"
value="JCR_Cluster_indexer_production" /> <!--
JBoss Cache indexer cluster name -->
- <property name="jgroups-multiplexer-stack" value="true"
/>
+ <property name="changesfilter-class"
value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter"
/>
+ <property name="index-dir"
value="/mnt/tornado/temp/jcrlucenedb/production" />
<!-- path within NFS where ValueStorage will hold it's data
-->
+ <property name="jbosscache-configuration"
value="jar:/conf/portal/test-jbosscache-indexer.xml" />
<!-- path to JBoss Cache configuration for indexer -->
+ <property name="jgroups-configuration"
value="jar:/conf/portal/udp-mux.xml" />
<!-- path to JGroups configuration -->
+ <property name="jbosscache-cluster-name"
value="JCR_Cluster_indexer_production" />
<!-- JBoss Cache indexer cluster name -->
+ <property name="jgroups-multiplexer-stack"
value="true" />
</properties>
</query-handler> </programlisting>
</listitem>
-
<listitem id="conf_lock_manager">
<para>Lock Manager configuration:</para>
-
- <programlisting><lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <programlisting><lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
<properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration"
value="jar:/conf/portal/test-jbosscache-lock.xml" /> <!--
path to JBoss Cache configuration for lock manager -->
- <property name="jgroups-configuration"
value="jar:/conf/portal/udp-mux.xml" /> <!--
path to JGroups configuration -->
- <property name="jgroups-multiplexer-stack" value="true"
/>
- <property name="jbosscache-cluster-name"
value="JCR_Cluster_lock_production" /> <!--
JBoss Cache locks cluster name -->
+ <property name="time-out" value="15m"
/>
+ <property name="jbosscache-configuration"
value="jar:/conf/portal/test-jbosscache-lock.xml" />
<!-- path to JBoss Cache configuration for lock manager -->
+ <property name="jgroups-configuration"
value="jar:/conf/portal/udp-mux.xml" />
<!-- path to JGroups configuration -->
+ <property name="jgroups-multiplexer-stack"
value="true" />
+ <property name="jbosscache-cluster-name"
value="JCR_Cluster_lock_production" />
<!-- JBoss Cache locks cluster name -->
- <property name="jbosscache-cl-cache.jdbc.table.name"
value="jcrlocks_production"/> <!-- the name
of the DB table where lock's data will be stored -->
- <property name="jbosscache-cl-cache.jdbc.table.create"
value="true"/>
- <property name="jbosscache-cl-cache.jdbc.table.drop"
value="false"/>
- <property name="jbosscache-cl-cache.jdbc.table.primarykey"
value="jcrlocks_production_pk"/>
- <property name="jbosscache-cl-cache.jdbc.fqn.column"
value="fqn"/>
- <property name="jbosscache-cl-cache.jdbc.node.column"
value="node"/>
- <property name="jbosscache-cl-cache.jdbc.parent.column"
value="parent"/>
- <property name="jbosscache-cl-cache.jdbc.datasource"
value="jdbcjcr"/>
+ <property name="jbosscache-cl-cache.jdbc.table.name"
value="jcrlocks_production"/> <!--
the name of the DB table where lock's data will be stored -->
+ <property name="jbosscache-cl-cache.jdbc.table.create"
value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop"
value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey"
value="jcrlocks_production_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column"
value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column"
value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column"
value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource"
value="jdbcjcr"/>
</properties>
</lock-manager></programlisting>
</listitem>
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-exo-implementation.xml
===================================================================
---
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-exo-implementation.xml 2011-01-31
07:39:12 UTC (rev 3904)
+++
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-exo-implementation.xml 2011-01-31
15:51:13 UTC (rev 3905)
@@ -1,140 +1,105 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. --><!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
<chapter id="JCR.eXoImplementation">
- <?dbhtml filename="ch-jcr-exo-implementation.html"?>
-
- <title>eXo JCR Implementation</title>
-
+<?dbhtml filename="ch-jcr-exo-implementation.html"?> <title>eXo
JCR Implementation</title>
<section>
<title>Related Documents</title>
-
<para>Access Control Configuration, Export Import Implementation, External
Value Storages, JDBC Data Container config, Locking, Multilanguage
support, Node types and Namespaces, Repository and Workspace management,
Repository container life cycle, Workspace, Persistence Storage Workspace,
SimpleDB storage</para>
</section>
-
<section>
<title>How it works</title>
-
<para>eXo Repository Service is a standard eXo service and is a registered
- IoC component, i.e. can be deployed in some eXo Containers (see <link
- linkend="JCR.eXoJCRconfiguration.RepositoryConfiguration">Service
- configuration</link> for details). The relationships between components
+ IoC component, i.e. can be deployed in some eXo Containers (see <link
linkend="JCR.eXoJCRconfiguration.RepositoryConfiguration">Service
configuration</link> for details). The relationships between components
are shown in the picture below:</para>
-
<mediaobject>
<imageobject>
- <imagedata fileref="images/concepts/exojcr.gif" />
+ <imagedata fileref="images/concepts/exojcr.gif"/>
</imageobject>
</mediaobject>
-
<para><keycap>eXo Container: </keycap>some subclasses of
org.exoplatform.container.ExoContainer (usually
org.exoplatform.container.StandaloneContainer or
org.exoplatform.container.PortalContainer) that holds a reference to
Repository Service.</para>
-
<itemizedlist>
<listitem>
<para><emphasis role="bold">Repository
Service:</emphasis> contains
information about repositories. eXo JCR is able to manage many
Repositories.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Repository:</emphasis>
Implementation of
javax.jcr.Repository. It holds references to one or more
Workspace(s).</para>
</listitem>
-
<listitem>
<para><keycap>Workspace:</keycap> Container of a single rooted
tree of
Items. (Note that here it is not exactly the same as
javax.jcr.Workspace as it is not a per Session object).</para>
</listitem>
</itemizedlist>
-
<para>Usual JCR application use case includes two initial steps:</para>
-
<itemizedlist>
<listitem>
- <para>Obtaining Repository object by getting <emphasis
- role="bold">Repository Service</emphasis> from the current
eXo
- Container (eXo "native" way) or via JNDI lookup if eXo repository is
- bound to the naming context using (see <link
- linkend="JCR.eXoJCRconfiguration">Service configuration</link>
for
+ <para>Obtaining Repository object by getting <emphasis
role="bold">Repository Service</emphasis> from the current eXo
+ Container (eXo "native" way) or via JNDI lookup if eXo
repository is
+ bound to the naming context using (see <link
linkend="JCR.eXoJCRconfiguration">Service configuration</link> for
details).</para>
</listitem>
-
<listitem>
<para>Creating javax.jcr.Session object that calls
Repository.login(..).</para>
</listitem>
-
- <listitem>
- <para>Creating javax.jcr.Session object that calls
- Repository.login(..).</para>
- </listitem>
</itemizedlist>
</section>
-
<section>
<title>Workspace Data Model</title>
-
<para>The following diagram explains which components of eXo JCR
implementation are used in a data flow to perform operations specified in
JCR API</para>
-
<mediaobject>
<imageobject>
- <imagedata fileref="images/concepts/wsdatamodel.gif" />
+ <imagedata fileref="images/concepts/wsdatamodel.gif"/>
</imageobject>
</mediaobject>
-
- <para>The Workspace Data Model can be splitted into 4 levels by data
+ <para>The Workspace Data Model can be split into 4 levels by data
isolation and value from the JCR model point of view.</para>
-
<itemizedlist>
<listitem>
<para>eXo JCR core implements <emphasis role="bold">JCR
API</emphasis>
- intefaces such as Item, Node, Property. It contains JCR "logical" view
+ interfaces, such as Item, Node, Property. It contains JCR
"logical" view
on stored data.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Session Level</emphasis>:
isolates
transient data viewable inside one JCR Session and interacts with API
level using eXo JCR internal API.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Session Data
Manager</emphasis>: maintains
transient session data. With data access/ modification/ validation
logic, it contains Modified Items Storage to hold the data changed
between subsequent save() calling and Session Items Cache.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Transaction Data
Manager</emphasis>:
maintains session data between save() and transaction commit/ rollback
if the current session is part of a transaction.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Workspace
Level</emphasis>: operates for
particular workspace shared data. It contains per-Workspace
objects</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Workspace Storage Data
Manager:</emphasis>
maintains workspace data, including final validation, events firing,
caching.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Workspace Data
Container</emphasis>:
implements physical data storage. It allows different types of backend
@@ -142,27 +107,22 @@
the main Data Container, other storages for persisted Property Values
can be configured and used.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Indexer:</emphasis>
maintains workspace
data indexing for further queries.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Storage Level</emphasis>:
Persistent
storages for:</para>
-
<itemizedlist>
<listitem>
<para>JCR Data</para>
</listitem>
-
<listitem>
<para>Indexes (Apache Lucene)</para>
</listitem>
-
<listitem>
- <para>Values (for BLOBs for ex) if different from main Data
+ <para>Values (e.g., for BLOBs) if different from the main Data
Container</para>
</listitem>
</itemizedlist>
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-namespace-altering.xml
===================================================================
---
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-namespace-altering.xml 2011-01-31
07:39:12 UTC (rev 3904)
+++
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-namespace-altering.xml 2011-01-31
15:51:13 UTC (rev 3905)
@@ -1,41 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. --><!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
<chapter id="JCR.Namespacealtering">
- <?dbhtml filename="ch-jcr-namespace-altering.html"?>
-
- <title>Namespace altering</title>
-
- <para>eXo JCR implementation since 1.11 version have support of altering
- namespaces.</para>
-
+<?dbhtml filename="ch-jcr-namespace-altering.html"?>
<title>Namespace altering</title>
+ <para>Since version 1.11, eXo JCR implementation supports namespaces
altering.</para>
<section>
<title>Adding new namespace</title>
-
<programlisting>ExtendedNamespaceRegistry namespaceRegistry =
(ExtendedNamespaceRegistry) workspace.getNamespaceRegistry();
-namespaceRegistry.registerNamespace("newMapping",
"http://dumb.uri/jcr");</programlisting>
+namespaceRegistry.registerNamespace("newMapping",
"http://dumb.uri/jcr");</programlisting>
</section>
-
<section>
<title>Changing existing namespace</title>
-
<programlisting>ExtendedNamespaceRegistry namespaceRegistry =
(ExtendedNamespaceRegistry) workspace.getNamespaceRegistry();
-namespaceRegistry.registerNamespace("newMapping",
"http://dumb.uri/jcr");
-namespaceRegistry.registerNamespace("newMapping2",
"http://dumb.uri/jcr");
-try {
- assertNull(namespaceRegistry.getURI("newMapping"));
- fail("exception should have been thrown");
-} catch (NamespaceException e) {
-}
-assertNotNull(namespaceRegistry.getURI("newMapping2"));
-assertEquals("http://dumb.uri/jcr",
namespaceRegistry.getURI("newMapping2"));</programlisting>
+namespaceRegistry.registerNamespace("newMapping",
"http://dumb.uri/jcr");
+namespaceRegistry.registerNamespace("newMapping2",
"http://dumb.uri/jcr");</programlisting>
</section>
-
<section>
<title>Removing existing namespace</title>
-
<programlisting>ExtendedNamespaceRegistry namespaceRegistry =
(ExtendedNamespaceRegistry) workspace.getNamespaceRegistry();
-namespaceRegistry.registerNamespace("newMapping",
"http://dumb.uri/jcr");
-namespaceRegistry.unregisterNamespace("newMapping");</programlisting>
+namespaceRegistry.registerNamespace("newMapping",
"http://dumb.uri/jcr");
+namespaceRegistry.unregisterNamespace("newMapping");</programlisting>
</section>
</chapter>
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/nodetype-registration.xml
===================================================================
---
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/nodetype-registration.xml 2011-01-31
07:39:12 UTC (rev 3904)
+++
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/nodetype-registration.xml 2011-01-31
15:51:13 UTC (rev 3905)
@@ -1,33 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. --><!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
<chapter id="JCR.NodeTypeRegistration">
- <?dbhtml filename="ch-nodetype-registration.html"?>
-
- <title>NodeType Registration</title>
-
+<?dbhtml filename="ch-nodetype-registration.html"?>
<title>NodeType Registration</title>
<para>eXo JCR implementation supports two ways of Nodetypes
registration:</para>
-
<itemizedlist>
<listitem>
- <para>From a NodeTypeValue POJO and</para>
+ <para>From a NodeTypeValue POJO</para>
</listitem>
-
<listitem>
- <para>From an XML document (stream).</para>
+ <para>From an XML document (stream)</para>
</listitem>
</itemizedlist>
-
<section>
<title>Interfaces and methods</title>
-
<section>
<title>ExtendedNodeTypeManager</title>
-
<para>The ExtendedNodeTypeManager (from JCR 1.11) interface provides the
- following methods related to registering node types</para>
-
+ following methods related to registering node types:</para>
<programlisting>public static final int IGNORE_IF_EXISTS = 0;
public static final int FAIL_IF_EXISTS = 2;
@@ -75,15 +65,12 @@
NoSuchNodeTypeException,
RepositoryException;</programlisting>
</section>
-
<section>
<title>NodeTypeValue</title>
-
<para>The NodeTypeValue interface represents a simple container
structure used to define node types which are then registered through
- the ExtendedNodeTypeManager.registerNodeType method. Implementation of
- this interface doesn't contain any validation logic.</para>
-
+ the ExtendedNodeTypeManager.registerNodeType method. The implementation of
+ this interface does not contain any validation logic.</para>
<programlisting>/**
* @return Returns the declaredSupertypeNames.
*/
@@ -161,15 +148,12 @@
*/
public void
setDeclaredPropertyDefinitionValues(List<PropertyDefinitionValue>
declaredPropertyDefinitionValues);</programlisting>
</section>
-
<section>
<title>NodeDefinitionValue</title>
-
<para>The NodeDefinitionValue interface extends ItemDefinitionValue with
the addition of writing methods, enabling the characteristics of a child
- node definition to be set, after which the NodeDefinitionValue is added
+ node definition to be set, after that the NodeDefinitionValue is added
to a NodeTypeValue.</para>
-
<programlisting>/**
* @return Returns the declaredSupertypeNames.
*/
@@ -249,15 +233,12 @@
</programlisting>
</section>
-
<section>
<title>PropertyDefinitionValue</title>
-
<para>The PropertyDefinitionValue interface extends ItemDefinitionValue
with the addition of writing methods, enabling the characteristics of a
- child property definition to be set, after which the
+ child property definition to be set, after that the
PropertyDefinitionValue is added to a NodeTypeValue.</para>
-
<programlisting>/**
* @return Returns the defaultValues.
*/
@@ -298,10 +279,8 @@
*/
public void setValueConstraints(List<String>
valueConstraints);</programlisting>
</section>
-
<section>
<title>ItemDefinitionValue</title>
-
<programlisting> /**
* @return Returns the autoCreate.
*/
@@ -353,36 +332,30 @@
public void setReadOnly(boolean readOnly);</programlisting>
</section>
</section>
-
<section>
<title>Node type registration</title>
-
<para>eXo JCR implementation supports various methods of the node-type
registration.</para>
-
<section>
<title>Run time registration from xml file.</title>
-
<programlisting>ExtendedNodeTypeManager nodeTypeManager =
(ExtendedNodeTypeManager) session.getWorkspace()
.getNodeTypeManager();
-InputStream is = MyClass.class.getResourceAsStream("mynodetypes.xml");
+InputStream is = MyClass.class.getResourceAsStream("mynodetypes.xml");
nodeTypeManager.registerNodeTypes(is,ExtendedNodeTypeManager.IGNORE_IF_EXISTS
);</programlisting>
</section>
-
<section>
<title>Run time registration using NodeTypeValue.</title>
-
<programlisting>ExtendedNodeTypeManager nodeTypeManager =
(ExtendedNodeTypeManager) session.getWorkspace()
.getNodeTypeManager();
NodeTypeValue testNValue = new NodeTypeValue();
List<String> superType = new ArrayList<String>();
-superType.add("nt:base");
-testNValue.setName("exo:myNodeType");
-testNValue.setPrimaryItemName("");
+superType.add("nt:base");
+testNValue.setName("exo:myNodeType");
+testNValue.setPrimaryItemName("");
testNValue.setDeclaredSupertypeNames(superType);
List<PropertyDefinitionValue> props = new
ArrayList<PropertyDefinitionValue>();
-props.add(new PropertyDefinitionValue("*",
+props.add(new PropertyDefinitionValue("*",
false,
false,
1,
@@ -396,42 +369,33 @@
nodeTypeManager.registerNodeType(testNValue,
ExtendedNodeTypeManager.FAIL_IF_EXISTS);</programlisting>
</section>
</section>
-
<section>
<title>Changing existing node type</title>
-
<para>If you want to replace existing node type definition, you should
pass ExtendedNodeTypeManager.REPLACE_IF_EXISTS as a second parameter for
the method ExtendedNodeTypeManager.registerNodeType.</para>
-
<programlisting>ExtendedNodeTypeManager nodeTypeManager =
(ExtendedNodeTypeManager) session.getWorkspace()
.getNodeTypeManager();
-InputStream is = MyClass.class.getResourceAsStream("mynodetypes.xml");
+InputStream is = MyClass.class.getResourceAsStream("mynodetypes.xml");
.....
nodeTypeManager.registerNodeTypes(is,ExtendedNodeTypeManager.REPLACE_IF_EXISTS
);</programlisting>
</section>
-
<section>
<title>Removing node type</title>
-
<note>
- <para>: Node type is only possibly removed when repository doesn't
- contains this node type.</para>
+ <para>Node type is only possibly removed when the repository does not
+ contain this node type.</para>
</note>
-
-
<programlisting>nodeTypeManager.unregisterNodeType("myNodeType");</programlisting>
+
<programlisting>nodeTypeManager.unregisterNodeType("myNodeType");</programlisting>
</section>
-
<section>
<title>Practical How to</title>
-
<section>
<title>Adding new PropertyDefinition</title>
-
<programlisting>
NodeTypeValue myNodeTypeValue = nodeTypeManager.getNodeTypeValue(myNodeTypeName);
List<PropertyDefinitionValue> props = new
ArrayList<PropertyDefinitionValue>();
-props.add(new PropertyDefinitionValue("tt",
+props.add(new PropertyDefinitionValue("tt",
true,
true,
1,
@@ -444,87 +408,69 @@
nodeTypeManager.registerNodeType(myNodeTypeValue,
ExtendedNodeTypeManager.REPLACE_IF_EXISTS);</programlisting>
</section>
-
<section>
<title>Adding new child NodeDefinition</title>
-
<programlisting>NodeTypeValue myNodeTypeValue =
nodeTypeManager.getNodeTypeValue(myNodeTypeName);
List<NodeDefinitionValue> nodes = new
ArrayList<NodeDefinitionValue>();
-nodes.add(new NodeDefinitionValue("child",
+nodes.add(new NodeDefinitionValue("child",
false,
false,
1,
false,
- "nt:base",
+ "nt:base",
new ArrayList<String>(),
false));
testNValue.setDeclaredChildNodeDefinitionValues(nodes);
nodeTypeManager.registerNodeType(myNodeTypeValue,
ExtendedNodeTypeManager.REPLACE_IF_EXISTS);</programlisting>
</section>
-
<section>
- <title>Changing or removing existing PropertyDefinition or child
- NodeDefinition</title>
-
- <para>Note to <emphasis role="bold">consistency of the
existing
- data</emphasis> before changing or removing existing definition . JCR
+ <title>Changing or removing existing PropertyDefinition or child
NodeDefinition</title>
+ <para>Note that the existing data must be consistent before changing or
removing a existing definition . JCR
<emphasis role="bold">does not allow</emphasis> you to change
the node
- type in the way in which the the existing data would be incompatible
- with new node type. But if these changes are needed, you can do it in
+ type in the way in which the existing data would be incompatible
+ with a new node type. But if these changes are needed, you can do it in
several phases, consistently changing the node type and the existing
data.</para>
-
<para>For example:</para>
-
- <para>Add new residual property definition with name
"downloadCount" to
- the existing node type "myNodeType".</para>
-
- <para>There are two limitations that do not allow us to made the task
- with single call of registerNodeType method.</para>
-
+ <para>Add a new residual property definition with name
"downloadCount" to
+ the existing node type "myNodeType".</para>
+ <para>There are two limitations that do not allow us to make the task
+ with a single call of registerNodeType method.</para>
<itemizedlist>
<listitem>
- <para>Existing nodes of the type "myNodeType", which does not
- contain properties "downloadCount" that conflicts with node type
+ <para>Existing nodes of the type "myNodeType", which
does not
+ contain properties "downloadCount" that conflicts with node
type
what we need.</para>
</listitem>
-
<listitem>
- <para>Registered node type "myNodeType" will not allow us to
add
- properties "downloadCount" because it has no such specific
+ <para>Registered node type "myNodeType" will not allow
us to add
+ properties "downloadCount" because it has no such specific
properties.</para>
</listitem>
</itemizedlist>
-
<para>To complete the task, we need to make 3 steps:</para>
-
<itemizedlist>
<listitem>
- <para>Changing the existing node type "myNodeType" by adding
not
- mandatory property "downloadCount".</para>
+ <para>Change the existing node type "myNodeType" by
adding the
+ mandatory property "downloadCount".</para>
</listitem>
-
<listitem>
- <para>Adding to all existing nodes of the node type
"myNodeType"
- property "downloadCount".</para>
+ <para>Add the node type "myNodeType" with the property
"downloadCount" to all the existing node types.</para>
</listitem>
-
<listitem>
- <para>Changing definition of the property "downloadCount" of
the
- node type "myNodeType" to mandatory.</para>
+ <para>Change the definition of the property
"downloadCount" of the
+ node type "myNodeType" to mandatory.</para>
</listitem>
</itemizedlist>
</section>
-
<section>
<title>Changing the list of super types</title>
+ <programlisting>NodeTypeValue testNValue =
nodeTypeManager.getNodeTypeValue("exo:myNodeType");
- <programlisting>NodeTypeValue testNValue =
nodeTypeManager.getNodeTypeValue("exo:myNodeType");
-
List<String> superType = testNValue.getDeclaredSupertypeNames();
-superType.add("mix:versionable");
+superType.add("mix:versionable");
testNValue.setDeclaredSupertypeNames(superType);
nodeTypeManager.registerNodeType(testNValue,
ExtendedNodeTypeManager.REPLACE_IF_EXISTS);</programlisting>
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml
===================================================================
---
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml 2011-01-31
07:39:12 UTC (rev 3904)
+++
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml 2011-01-31
15:51:13 UTC (rev 3905)
@@ -1,183 +1,143 @@
-<?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">
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. --><!DOCTYPE article
PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
<chapter id="JCR.LockManagerConfiguration">
- <?dbhtml filename="ch-lock-manager-config.html"?>
-
- <title>LockManager configuration</title>
-
+<?dbhtml filename="ch-lock-manager-config.html"?>
<title>LockManager configuration</title>
<section>
<title>Introduction</title>
-
<para>What LockManager does?</para>
-
- <para>In general, LockManager stores lock objects, so it can give Lock
+ <para>In general, LockManager stores Lock objects, so it can give a Lock
object or can release it, etc.</para>
-
<para>Also, LockManager is responsible for removing Locks that live too
- long. This parameter may be configured with "time-out"
property.</para>
-
- <para>JCR provide two base implementation of LockManager:</para>
-
+ long. This parameter may be configured with "time-out"
property.</para>
+ <para>JCR provides two basic implementations of LockManager:</para>
<itemizedlist>
<listitem>
<para><classname>org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl</classname>;</para>
</listitem>
-
<listitem>
<para><classname>org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl</classname>;</para>
</listitem>
</itemizedlist>
-
- <para>In this article, we will talk mostly about
+ <para>In this article, we will mostly mention about
CacheableLockManagerImpl.</para>
-
<para>You can enable LockManager by adding lock-manager-configuration to
workspace-configuration.</para>
-
<para>For example:</para>
-
- <programlisting><workspace name="ws">
+ <programlisting><workspace name="ws">
...
- <lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
<properties>
- <property name="time-out" value="15m" />
+ <property name="time-out" value="15m"
/>
...
</properties>
</lock-manager>
...
</workspace></programlisting>
</section>
-
<section>
<title>LockManagerImpl</title>
-
- <para>LockManagerImpl is simple implementation of LockManager, and also
+ <para>LockManagerImpl is a simple implementation of LockManager, and also
faster than CacheableLockManager. It stores Lock objects in HashMap and
may also persist Locks if LockPersister is configured. LockManagerImpl
does not support replication in any way.</para>
-
- <para>See more about LockManager Configuration at <link
- linkend="JCR.eXoJCRconfiguration">here</link>.</para>
+ <para>See more about LockManager Configuration at <link
linkend="JCR.eXoJCRconfiguration">here</link>.</para>
</section>
-
<section>
<title>CacheableLockManagerImpl</title>
-
- <para>CacheableLockManagerImpl stores Lock object in JBoss-cache, so Locks
- are replicable and affects on cluster, not only a single node. Also
- JBoss-cache has JDBCCacheLoader, so locks will be stored to
+ <para>CacheableLockManagerImpl stores Lock objects in JBoss-cache, so Locks
+ are replicable and affect on cluster, not only a single node. Also,
+ JBoss-cache has JDBCCacheLoader, so Locks will be stored to the
database.</para>
-
- <para>Both implementation supports Expired Locks removing. There is
- LockRemover - separate thread, that periodically ask LockManager for Locks
- that live much and must be removed. So, timeout for LockRemover may be set
- as follows, default value is 30m.</para>
-
+ <para>Both of the implementations support to remove Expired Locks. LockRemover
separates threads, that periodically ask LockManager to remove Locks
+ that live so long. So, the timeout for LockRemover may be set
+ as follows, the default value is 30m.</para>
<programlisting><properties>
- <property name="time-out" value="10m" />
+ <property name="time-out" value="10m"
/>
...
</properties></programlisting>
-
<section>
<title>Configuration</title>
-
- <para>Replication requirements are the same for Cache</para>
-
- <para> You can see a full JCR configuration example at <link
-
linkend="JCR.ClusterConfig.JCRExternalConfig">here</link>.</para>
-
+ <para>Replication requirements are the same for Cache.</para>
+ <para> You can see a full JCR configuration example at <link
linkend="JCR.ClusterConfig.JCRExternalConfig">here</link>.</para>
<para>Common tips:</para>
-
<itemizedlist>
<listitem>
- <para><parameter>clusterName</parameter>
("jbosscache-cluster-name")
+ <para><parameter>clusterName</parameter>
("jbosscache-cluster-name")
must be unique;</para>
</listitem>
-
<listitem>
<para><parameter>cache.jdbc.table.name</parameter> must be
unique
per datasource;</para>
</listitem>
-
<listitem>
- <para><parameter>cache.jdbc.fqn.type</parameter> must and
+ <para><parameter>cache.jdbc.fqn.type</parameter> and
cache.jdbc.node.type must be configured according to used
database;</para>
</listitem>
</itemizedlist>
-
- <para>There is a few ways to configure CacheableLockManagerImpl, and all
+ <para>There are a few ways to configure CacheableLockManagerImpl, and all
of them configure JBoss-cache and JDBCCacheLoader.</para>
-
- <para>See <ulink
-
url="http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader"...
+ <para>See <ulink
url="http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader"...
</section>
-
<section>
- <title>Simple JbossCache Configuraion</title>
-
- <para>First one is - put JbossCache configuraion file path to
- CacheableLockManagerImpl</para>
-
+ <title>Simple JbossCache Configuration</title>
+ <para>The first one is putting JbossCache configuraion file path to
+ CacheableLockManagerImpl.</para>
<para><note>
- <para>This configuration is not so good as you can think. Because
- repository may contain many workspaces, and each workspace must
- contain LockManager configuration, and LockManager config may
- contain JbossCache config file. So total configuration is growing
- up. But it is usefull if we want a single LockManager with special
+ <para>This configuration is not so good as you think. Because
+ the repository may contain many workspaces, and each workspace must
+ contain LockManager configuration, and LockManager configuration may
+ contain the JbossCache config file. So, the total configuration will grow
+ up. But it is useful if we want to have a single LockManager with a special
configuration.</para>
</note></para>
-
- <para>Config is:</para>
-
- <programlisting><lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <para>Configuration is as follows:</para>
+ <programlisting><lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
<properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration"
value="conf/standalone/cluster/test-jbosscache-lock-config.xml" />
+ <property name="time-out" value="15m"
/>
+ <property name="jbosscache-configuration"
value="conf/standalone/cluster/test-jbosscache-lock-config.xml"
/>
</properties>
</lock-manager></programlisting>
+
<para><filename>test-jbosscache-lock-config.xml</filename><programlisting><?xml
version="1.0" encoding="UTF-8"?>
+<jbosscache
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.2">
-
<para><filename>test-jbosscache-lock-config.xml</filename><programlisting><?xml
version="1.0" encoding="UTF-8"?>
-<jbosscache
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.2">
+ <locking useLockStriping="false"
concurrencyLevel="50000"
lockParentForChildInsertRemove="false"
lockAcquisitionTimeout="20000" />
- <locking useLockStriping="false" concurrencyLevel="50000"
lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000"
/>
-
- <clustering mode="replication"
clusterName="JBoss-Cache-Lock-Cluster_Name">
- <stateRetrieval timeout="20000" fetchInMemoryState="false"
nonBlocking="true" />
+ <clustering mode="replication"
clusterName="JBoss-Cache-Lock-Cluster_Name">
+ <stateRetrieval timeout="20000"
fetchInMemoryState="false" nonBlocking="true"
/>
<jgroupsConfig>
- <TCP bind_addr="127.0.0.1" start_port="9800"
loopback="true" recv_buf_size="20000000"
send_buf_size="640000" discard_incompatible_packets="true"
- max_bundle_size="64000" max_bundle_timeout="30"
use_incoming_packet_handler="true" enable_bundling="false"
use_send_queues="false" sock_conn_timeout="300"
- skip_suspected_members="true" use_concurrent_stack="true"
thread_pool.enabled="true" thread_pool.min_threads="1"
thread_pool.max_threads="25"
- thread_pool.keep_alive_time="5000"
thread_pool.queue_enabled="false" thread_pool.queue_max_size="100"
thread_pool.rejection_policy="run"
- oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1"
oob_thread_pool.max_threads="8"
oob_thread_pool.keep_alive_time="5000"
- oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="run" />
- <MPING timeout="2000" num_initial_members="2"
mcast_port="34540" bind_addr="127.0.0.1"
mcast_addr="224.0.0.1" />
+ <TCP bind_addr="127.0.0.1"
start_port="9800" loopback="true"
recv_buf_size="20000000" send_buf_size="640000"
discard_incompatible_packets="true"
+ max_bundle_size="64000" max_bundle_timeout="30"
use_incoming_packet_handler="true"
enable_bundling="false" use_send_queues="false"
sock_conn_timeout="300"
+ skip_suspected_members="true"
use_concurrent_stack="true" thread_pool.enabled="true"
thread_pool.min_threads="1"
thread_pool.max_threads="25"
+ thread_pool.keep_alive_time="5000"
thread_pool.queue_enabled="false"
thread_pool.queue_max_size="100"
thread_pool.rejection_policy="run"
+ oob_thread_pool.enabled="true"
oob_thread_pool.min_threads="1"
oob_thread_pool.max_threads="8"
oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="run" />
+ <MPING timeout="2000"
num_initial_members="2" mcast_port="34540"
bind_addr="127.0.0.1" mcast_addr="224.0.0.1"
/>
- <MERGE2 max_interval="30000" min_interval="10000"
/>
+ <MERGE2 max_interval="30000"
min_interval="10000" />
<FD_SOCK />
- <FD max_tries="5" shun="true" timeout="10000"
/>
- <VERIFY_SUSPECT timeout="1500" />
- <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0"
retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false"
/>
- <UNICAST timeout="300,600,1200,2400,3600" />
- <pbcast.STABLE desired_avg_gossip="50000"
max_bytes="400000" stability_delay="1000" />
- <pbcast.GMS join_timeout="5000" print_local_addr="true"
shun="false" view_ack_collection_timeout="5000"
view_bundling="true" />
- <FRAG2 frag_size="60000" />
+ <FD max_tries="5" shun="true"
timeout="10000" />
+ <VERIFY_SUSPECT timeout="1500" />
+ <pbcast.NAKACK discard_delivered_msgs="true"
gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
use_mcast_xmit="false" />
+ <UNICAST timeout="300,600,1200,2400,3600" />
+ <pbcast.STABLE desired_avg_gossip="50000"
max_bytes="400000" stability_delay="1000" />
+ <pbcast.GMS join_timeout="5000"
print_local_addr="true" shun="false"
view_ack_collection_timeout="5000"
view_bundling="true" />
+ <FRAG2 frag_size="60000" />
<pbcast.STREAMING_STATE_TRANSFER />
- <pbcast.FLUSH timeout="0" />
+ <pbcast.FLUSH timeout="0" />
</jgroupsConfig
<sync />
</clustering>
- <loaders passivation="false" shared="true">
+ <loaders passivation="false"
shared="true">
<preload>
- <node fqn="/" />
+ <node fqn="/" />
</preload>
- <loader class="org.jboss.cache.loader.JDBCCacheLoader"
async="false" fetchPersistentState="false"
ignoreModifications="false" purgeOnStartup="false">
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader"
async="false" fetchPersistentState="false"
ignoreModifications="false"
purgeOnStartup="false">
<properties>
cache.jdbc.table.name=jcrlocks_ws
cache.jdbc.table.create=true
@@ -195,63 +155,53 @@
</loaders>
</jbosscache></programlisting></para>
-
<para>Configuration requirements:</para>
-
<itemizedlist>
<listitem>
- <para><clustering mode="replication"
- clusterName="JBoss-Cache-Lock-Cluster_Name"> - cluster name
must
+ <para><clustering mode="replication"
+ clusterName="JBoss-Cache-Lock-Cluster_Name"> - the
cluster name must
be unique;</para>
</listitem>
-
<listitem>
<para><parameter>cache.jdbc.table.name</parameter> must be
unique
per datasource;</para>
</listitem>
-
<listitem>
<para><parameter>cache.jdbc.node.type</parameter> and
<parameter>cache.jdbc.fqn.type</parameter> must be configured
- according to using database. See <link endterm="datatypes.title"
- linkend="datatypes"></link> .</para>
+ according to using the database. See <link
endterm="datatypes.title" linkend="datatypes"/> .</para>
</listitem>
</itemizedlist>
</section>
-
<section>
<title>Template JBossCache Configuration</title>
-
- <para>Second one is using template JBoss-cache configuration for all
- LockManagers</para>
-
+ <para>The second one is using the template JBoss-cache configuration for all
+ LockManagers.</para>
<para><citetitle>Lock template
configuration</citetitle></para>
-
<para><filename>test-jbosscache-lock.xml</filename></para>
+ <programlisting><?xml version="1.0"
encoding="UTF-8"?>
+<jbosscache
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
- <programlisting><?xml version="1.0"
encoding="UTF-8"?>
-<jbosscache
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
+ <locking useLockStriping="false"
concurrencyLevel="50000"
lockParentForChildInsertRemove="false"
+ lockAcquisitionTimeout="20000" />
- <locking useLockStriping="false" concurrencyLevel="50000"
lockParentForChildInsertRemove="false"
- lockAcquisitionTimeout="20000" />
-
- <clustering mode="replication"
clusterName="${jbosscache-cluster-name}">
- <stateRetrieval timeout="20000"
fetchInMemoryState="false" />
- <jgroupsConfig multiplexerStack="jcr.stack" />
+ <clustering mode="replication"
clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000"
fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
<sync />
</clustering>
- <loaders passivation="false" shared="true">
+ <loaders passivation="false"
shared="true">
<!-- All the data of the JCR locks needs to be loaded at startup -->
<preload>
- <node fqn="/" />
+ <node fqn="/" />
</preload>
<!--
For another cache-loader class you should use another template with
cache-loader specific parameters
->
- <loader class="org.jboss.cache.loader.JDBCCacheLoader"
async=q"false" fetchPersistentState="false"
- ignoreModifications="false" purgeOnStartup="false">
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader"
async=q"false" fetchPersistentState="false"
+ ignoreModifications="false"
purgeOnStartup="false">
<properties>
cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
@@ -267,76 +217,70 @@
</loader>
</loaders>
</jbosscache></programlisting>
-
- <para>As you see, all configurable paramaters are filled by templates
- and will be replaced by LockManagers conf parameters:</para>
-
- <programlisting><lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <para>As you see, all configurable parameters are filled by templates
+ and will be replaced by LockManagers configuration parameters:</para>
+ <programlisting><lock-manager
class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
<properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration"
value="test-jbosscache-lock.xml" />
- <property name="jgroups-configuration"
value="udp-mux.xml" />
- <property name="jgroups-multiplexer-stack" value="true"
/>
- <property name="jbosscache-cluster-name"
value="JCR-cluster-locks-ws" />
- <property name="jbosscache-cl-cache.jdbc.table.name"
value="jcrlocks_ws" />
- <property name="jbosscache-cl-cache.jdbc.table.create"
value="true" />
- <property name="jbosscache-cl-cache.jdbc.table.drop"
value="false" />
- <property name="jbosscache-cl-cache.jdbc.table.primarykey"
value="jcrlocks_ws_pk" />
- <property name="jbosscache-cl-cache.jdbc.fqn.column"
value="fqn" />
- <property name="jbosscache-cl-cache.jdbc.fqn.type"
value="AUTO"/>
- <property name="jbosscache-cl-cache.jdbc.node.column"
value="node" />
- <property name="jbosscache-cl-cache.jdbc.node.type"
value="AUTO"/>
- <property name="jbosscache-cl-cache.jdbc.parent.column"
value="parent" />
- <property name="jbosscache-cl-cache.jdbc.datasource"
value="jdbcjcr" />
+ <property name="time-out" value="15m"
/>
+ <property name="jbosscache-configuration"
value="test-jbosscache-lock.xml" />
+ <property name="jgroups-configuration"
value="udp-mux.xml" />
+ <property name="jgroups-multiplexer-stack"
value="true" />
+ <property name="jbosscache-cluster-name"
value="JCR-cluster-locks-ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.name"
value="jcrlocks_ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.create"
value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop"
value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey"
value="jcrlocks_ws_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column"
value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.type"
value="AUTO"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column"
value="node" />
+ <property name="jbosscache-cl-cache.jdbc.node.type"
value="AUTO"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column"
value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource"
value="jdbcjcr" />
</properties>
</lock-manager></programlisting>
-
<para>Configuration requirements:<itemizedlist>
<listitem>
<para><parameter>jbosscache-cl-cache.jdbc.fqn.column</parameter>
and <parameter>jbosscache-cl-cache.jdbc.node.type</parameter> is
- nothing else as cache.jdbc.fqn.type and cache.jdbc.node.type in
+ the same as cache.jdbc.fqn.type and cache.jdbc.node.type in
JBoss-Cache configuration. You can set those data types according
- to database type (See <link endterm="datatypes.title"
- linkend="datatypes"></link>) or set it as AUTO (or do not
set at
- all) and data type will by detected automaticaly.</para>
+ to database type (See <link endterm="datatypes.title"
linkend="datatypes"/>) or set it as AUTO (or do not set at
+ all) and data type will be detected automatically.</para>
</listitem>
-
<listitem>
- <para>As you see, jgroups-configuration moved to separate config
- file - udp-mux.xml; In our case udp-mux.xml is common JGroup
- config for all components (QueryHandler, cache, LockManager). But
- we can still create own config.</para>
+ <para>As you see, jgroups-configuration is moved to separate the
configuration
+ file - udp-mux.xml. In this case, the udp-mux.xml file is a common JGroup
+ configuration for all components (QueryHandler, Cache, LockManager), but
+ we can still create our own configuration.</para>
</listitem>
</itemizedlist></para>
-
<para><filename>our-udp-mux.xml</filename><programlisting><protocol_stacks>
- <stack name="jcr.stack">
+ <stack name="jcr.stack">
<config>
- <UDP mcast_addr="228.10.10.10" mcast_port="45588"
tos="8" ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
loopback="false"
- discard_incompatible_packets="true"
max_bundle_size="64000" max_bundle_timeout="30"
- use_incoming_packet_handler="true" ip_ttl="2"
enable_bundling="true" enable_diagnostics="true"
- thread_naming_pattern="cl" use_concurrent_stack="true"
thread_pool.enabled="true" thread_pool.min_threads="2"
- thread_pool.max_threads="8"
thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="true"
- thread_pool.queue_max_size="1000"
thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true"
- oob_thread_pool.min_threads="1"
oob_thread_pool.max_threads="8"
oob_thread_pool.keep_alive_time="5000"
- oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="Run" />
+ <UDP mcast_addr="228.10.10.10"
mcast_port="45588" tos="8"
ucast_recv_buf_size="20000000"
+ ucast_send_buf_size="640000"
mcast_recv_buf_size="25000000"
mcast_send_buf_size="640000" loopback="false"
+ discard_incompatible_packets="true"
max_bundle_size="64000" max_bundle_timeout="30"
+ use_incoming_packet_handler="true"
ip_ttl="2" enable_bundling="true"
enable_diagnostics="true"
+ thread_naming_pattern="cl"
use_concurrent_stack="true" thread_pool.enabled="true"
thread_pool.min_threads="2"
+ thread_pool.max_threads="8"
thread_pool.keep_alive_time="5000"
thread_pool.queue_enabled="true"
+ thread_pool.queue_max_size="1000"
thread_pool.rejection_policy="discard"
oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1"
oob_thread_pool.max_threads="8"
oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="Run" />
- <PING timeout="2000" num_initial_members="3"
/>
- <MERGE2 max_interval="30000" min_interval="10000"
/>
+ <PING timeout="2000"
num_initial_members="3" />
+ <MERGE2 max_interval="30000"
min_interval="10000" />
<FD_SOCK />
- <FD timeout="10000" max_tries="5"
shun="true" />
- <VERIFY_SUSPECT timeout="1500" />
+ <FD timeout="10000" max_tries="5"
shun="true" />
+ <VERIFY_SUSPECT timeout="1500" />
<BARRIER />
- <pbcast.NAKACK use_stats_for_retransmission="false"
exponential_backoff="150" use_mcast_xmit="true"
- gc_lag="0" retransmit_timeout="50,300,600,1200"
discard_delivered_msgs="true" />
- <UNICAST timeout="300,600,1200" />
- <pbcast.STABLE stability_delay="1000"
desired_avg_gossip="50000" max_bytes="1000000" />
- <VIEW_SYNC avg_send_interval="60000" />
- <pbcast.GMS print_local_addr="true"
join_timeout="3000" shun="false" view_bundling="true"
/>
- <FC max_credits="500000" min_threshold="0.20"
/>
- <FRAG2 frag_size="60000" />
+ <pbcast.NAKACK use_stats_for_retransmission="false"
exponential_backoff="150" use_mcast_xmit="true"
+ gc_lag="0"
retransmit_timeout="50,300,600,1200"
discard_delivered_msgs="true" />
+ <UNICAST timeout="300,600,1200" />
+ <pbcast.STABLE stability_delay="1000"
desired_avg_gossip="50000" max_bytes="1000000"
/>
+ <VIEW_SYNC avg_send_interval="60000" />
+ <pbcast.GMS print_local_addr="true"
join_timeout="3000" shun="false"
view_bundling="true" />
+ <FC max_credits="500000"
min_threshold="0.20" />
+ <FRAG2 frag_size="60000" />
<!--pbcast.STREAMING_STATE_TRANSFER /-->
<pbcast.STATE_TRANSFER />
<!-- pbcast.FLUSH /-->
@@ -344,94 +288,62 @@
</stack>
</protocol_stacks> </programlisting></para>
</section>
-
<section id="datatypes">
<title id="datatypes.title">Data Types in Different
Databases</title>
-
<table>
- <title>Fqn type and node type in different databases</title>
-
+ <title>FQN type and node type in different databases</title>
<tgroup cols="3">
<thead>
<row>
<entry>DataBase name</entry>
-
<entry>Node data type</entry>
-
<entry>FQN data type</entry>
</row>
</thead>
-
<tbody>
<row>
<entry>default</entry>
-
<entry>BLOB</entry>
-
<entry>VARCHAR(512)</entry>
</row>
-
<row>
<entry>HSSQL</entry>
-
<entry>OBJECT</entry>
-
<entry>VARCHAR(512)</entry>
</row>
-
<row>
<entry>MySQL</entry>
-
<entry>LONGBLOB</entry>
-
<entry>VARCHAR(512)</entry>
</row>
-
<row>
<entry>ORACLE</entry>
-
<entry>BLOB</entry>
-
<entry>VARCHAR2(512)</entry>
</row>
-
<row>
<entry>PostgreSQL</entry>
-
<entry>bytea</entry>
-
<entry>VARCHAR(512)</entry>
</row>
-
<row>
<entry>MSSQL</entry>
-
<entry>VARBINARY(MAX)</entry>
-
<entry>VARCHAR(512)</entry>
</row>
-
<row>
<entry>DB2</entry>
-
<entry>BLOB</entry>
-
<entry>VARCHAR(512)</entry>
</row>
-
<row>
<entry>Sybase</entry>
-
<entry>IMAGE</entry>
-
<entry>VARCHAR(512)</entry>
</row>
-
<row>
<entry>Ingres</entry>
-
<entry>long byte</entry>
-
<entry>VARCHAR(512)</entry>
</row>
</tbody>
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/other/acl.xml
===================================================================
---
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/other/acl.xml 2011-01-31
07:39:12 UTC (rev 3904)
+++
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/other/acl.xml 2011-01-31
15:51:13 UTC (rev 3905)
@@ -1,122 +1,92 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. --><!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
<chapter id="JCR.AccessControl">
- <?dbhtml filename="ch-acl.html"?>
-
- <title>Access Control</title>
-
- <para>eXo JCR is a complete implementation of the standard JSR 170: <ulink
-
url="http://jcp.org/en/jsr/detail?id=170">Content Repository for Java TM
- Technology API</ulink>, including <emphasis role="bold">Level 1,
Level 2 and
- Additional Features</emphasis> specified in the JCR Specification.</para>
-
+<?dbhtml filename="ch-acl.html"?> <title>Access
Control</title>
+ <para>eXo JCR is a complete implementation of the standard JSR 170: <ulink
url="http://jcp.org/en/jsr/detail?id=170">Content Repository for Java TM
Technology API</ulink>, including <emphasis role="bold">Level 1,
Level 2 and Additional Features</emphasis> specified in the JCR
Specification.</para>
<section>
<title>Standard Action Permissions</title>
-
<para>The JCR specification (JSR 170) does not have many requirements
about Access Control. It only requires the implementation of the
Session.checkPermission(String absPath, String actions) method. This
method checks if a current session has permissions to perform some actions
on absPath:</para>
-
<itemizedlist>
<listitem>
<para>absPath : The string representation of a JCR absolute
- path</para>
+ path.</para>
</listitem>
-
<listitem>
<para>actions : eXo JCR interprets this string as a comma separated
- the list of individual action names such as the 4 types defined in JSR
+ the list of individual action names, such as the 4 types defined in JSR
170 :</para>
-
<itemizedlist>
<listitem>
<para><emphasis role="bold">add_node</emphasis> :
Permission to
- add a node</para>
+ add a node.</para>
</listitem>
-
<listitem>
<para><emphasis
role="bold">set_property</emphasis> : Permission
- to set a property</para>
+ to set a property.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">remove</emphasis> :
Permission to
- remove an item (node or property)</para>
+ remove an item (node or property).</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">read</emphasis> :
Permission to
- retrieve a node or read a property value</para>
+ retrieve a node or read a property value.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
-
<para>For example :</para>
-
<itemizedlist>
<listitem>
- <para>session.checkPermission("/Groups/organization",
- "add_node,set_property") will check if the session is allowed to add a
- child node to "organization" and to modify its properties. If one of
+ <para>session.checkPermission("/Groups/organization",
+ "add_node,set_property") will check if the session is allowed
to add a
+ child node to "organization" and to modify its properties. If
one of
the two permissions is denied, an AccessDeniedException is
thrown.</para>
</listitem>
-
<listitem>
- <para>session.checkPermission("/Groups/organization/exo:name",
- "read,set_property") will check if the session is allowed to read and
- change the "exo:name" property of the "organization"
node.</para>
+
<para>session.checkPermission("/Groups/organization/exo:name",
+ "read,set_property") will check if the session is allowed to
read and
+ change the "exo:name" property of the
"organization" node.</para>
</listitem>
-
<listitem>
- <para>session.checkPermission("/Groups/organization/exo:name",
- "remove") will check if the session allowed to remove
"exo:name"
+
<para>session.checkPermission("/Groups/organization/exo:name",
+ "remove") will check if the session allowed to remove
"exo:name"
property or node.</para>
</listitem>
</itemizedlist>
</section>
-
<section>
<title>eXo Access Control</title>
-
<para>The JSR170 specification does not define how permissions are managed
or checked. So eXo JCR has implemented its own proprietary extension to
manage and check permissions on nodes. In essence, this extension uses an
- <ulink
url="http://en.wikipedia.org/wiki/Access_control_list">Access
- Control List (ACL)</ulink> policy model applied to eXo Organization model
+ <ulink
url="http://en.wikipedia.org/wiki/Access_control_list">Access
Control List (ACL)</ulink> policy model applied to eXo Organization model
(see eXo Platform Organization Service).</para>
-
<section>
<title>Principal and Identity</title>
-
- <para>At the heart of eXo Access Control, is the notion of the <emphasis
- role="bold">identity</emphasis> concept. Access to JCR is made
through
+ <para>At the heart of eXo Access Control, is the notion of the <emphasis
role="bold">identity</emphasis> concept. Access to JCR is made through
sessions acquired against a repository. Sessions can be authenticated
through the standard (but optional) repository login mechanism. Each
session is associated with a <emphasis
role="bold">principal</emphasis>.
The principal is an authenticated user or group that may act on JCR
- data. The identity is a string identifying this <emphasis
- role="bold">group or user</emphasis>.'</para>
-
+ data. The identity is a string identifying this <emphasis
role="bold">group or user</emphasis>.'</para>
<para>There are 3 reserved identities that have special meanings in eXo
JCR:</para>
-
<itemizedlist>
<listitem>
<para><emphasis role="bold">any</emphasis> :
represents any
authenticated session.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">anonim</emphasis> :
represents a
- principal for non authenticated sessions. (No error, it's really
- "\_\_anonim".)</para>
+ principal for non authenticated sessions. (No error, it's really
+ "\_\_anonim".)</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">system</emphasis> :
represents a
principal for system sessions, typically used for administrative
@@ -126,18 +96,14 @@
</listitem>
</itemizedlist>
</section>
-
<section>
<title>ACL</title>
-
<para>An access control list (ACL) is a list of permissions attached to
an object. An ACL specifies which users, groups or system processes are
granted access to JCR nodes, as well as what operations are allowed to
be performed on given objects.</para>
-
<para>eXo JCR Access Control is based on two facets applied to nodes
:</para>
-
<itemizedlist>
<listitem>
<para><emphasis
role="bold">Privilegeable</emphasis> : Means that
@@ -145,7 +111,6 @@
privileges to access to this node. The privileges are defined as
(positive) permissions that are granted to users or groups.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">Ownable</emphasis> :
The node has an
<emphasis role="bold">owner</emphasis>. The owner has
always
@@ -153,119 +118,93 @@
the node, independent of the privilegeable facet.</para>
</listitem>
</itemizedlist>
-
<section>
<title>Privilegeable</title>
-
<para>A privilegeable node defines the permissions required for
actions on this node. For this purpose, it contains an ACL.</para>
-
- <para>At JCR level, this is implemented by an <emphasis
- role="bold">exo:privilegeable</emphasis> mixin.</para>
-
- <programlisting><nodeType name="exo:privilegeable"
isMixin="true" hasOrderableChildNodes="false"
primaryItemName="">
+ <para>At JCR level, this is implemented by an <emphasis
role="bold">exo:privilegeable</emphasis> mixin.</para>
+ <programlisting><nodeType name="exo:privilegeable"
isMixin="true" hasOrderableChildNodes="false"
primaryItemName="">
<propertyDefinitions>
- <propertyDefinition name="exo:permissions"
requiredType="Permission" autoCreated="true"
mandatory="true"
- onParentVersion="COPY" protected="true"
multiple="true">
+ <propertyDefinition name="exo:permissions"
requiredType="Permission" autoCreated="true"
mandatory="true"
+ onParentVersion="COPY"
protected="true" multiple="true">
<valueConstraints/>
</propertyDefinition>
</propertyDefinitions>
</nodeType></programlisting>
-
<para>A privilegeable node can have multiple exo:permissions values.
- The type of these values is the eXo JCR specific type Permission. The
+ The type of these values is the eXo JCR specific Permission type. The
Permission type contains a list of ACL.</para>
-
<para>The possible values are corresponding to JCR standard
actions:</para>
-
<itemizedlist>
<listitem>
<para><emphasis role="bold">read</emphasis>: The
node or its
properties can be read.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">remove</emphasis>:
The node or its
properties can be removed.</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">add_node</emphasis> :
Child nodes can
be added to this node.</para>
</listitem>
-
<listitem>
- <para><emphasis
role="bold">set_property</emphasis> : The node's
+ <para><emphasis
role="bold">set_property</emphasis> : The node's
properties can be modified, added or removed.</para>
</listitem>
</itemizedlist>
</section>
-
<section>
<title>Ownable</title>
-
- <para>An ownable node defines an owner identity. The <emphasis
- role="bold">owner</emphasis> has always <emphasis
role="bold">full
- privileges</emphasis>. These privileges are independent of the
+ <para>An ownable node defines an owner identity. The <emphasis
role="bold">owner</emphasis> has always <emphasis
role="bold">full privileges</emphasis>. These privileges are
independent of the
permissions set by exo:permissions. At JCR level, the ownership is
implemented by an <emphasis
role="bold">exo:owneable</emphasis> mixin.
This mixin holds an owner property.</para>
-
- <programlisting><nodeType name="exo:owneable"
isMixin="true" hasOrderableChildNodes="false"
primaryItemName="">
+ <programlisting><nodeType name="exo:owneable"
isMixin="true" hasOrderableChildNodes="false"
primaryItemName="">
<propertyDefinitions>
- <propertyDefinition name="exo:owner"
requiredType="String" autoCreated="true" mandatory="true"
onParentVersion="COPY"
- protected="true" multiple="false">
+ <propertyDefinition name="exo:owner"
requiredType="String" autoCreated="true"
mandatory="true" onParentVersion="COPY"
+ protected="true"
multiple="false">
<valueConstraints/>
</propertyDefinition>
</propertyDefinitions>
</nodeType></programlisting>
-
<para>The exo:owner property value contains exactly one identity
string value. There might be a long list of different permissions for
different identities (user or groups). All permissions are always
positive permissions; denials are not possible. When checking a
- permission of an action, it's therefore perfectly sufficient that the
- principal of a session belongs to one the groups, to whom the
+ permission of an action, it's therefore perfectly sufficient that the
+ principal of a session belongs to the groups to which the
concerned action is granted.</para>
</section>
-
<section>
<title>ACL Inheritance</title>
-
- <para>In order to grant or deny access to a node, eXo JCR applies a
+ <para>To grant or deny access to a node, eXo JCR applies a
privilege resolving logic at node access time.</para>
-
<para>If a node is <emphasis
role="bold">privilegeable</emphasis>, the
- node's ACL is used exclusively. If the ACL does not match the
- principal's identity, the principal has no access (except the owner of
+ node's ACL is used exclusively. If the ACL does not match the
+ principal's identity, the principal has no access (except the owner of
the node).</para>
-
<para>Non-privilegeable nodes inherit permissions from their parent
- node. If the parent node isn't privilegeable either, the resolving
+ node. If the parent node is not privilegeable either, the resolving
logic looks further up the node hierarchy and stops with the first
privilegeable ancestor of the current node. All nodes potentially
inherit from the <emphasis role="bold">workspace</emphasis>
root
node.</para>
-
<para>The owner of a node is inherited in accordance with the same
logic: If the node has no owner, the owner information of the closest
owneable ancestor is inherited.</para>
-
- <para>This inheritance is implemented by browsing up the node's
+ <para>This inheritance is implemented by browsing up the node's
hierarchy. At access time, if the node does not have owner or
- permissions, the system looks up into the node's ancestor hierarchy
+ permissions, the system looks up into the node's ancestor hierarchy
for the <emphasis role="bold">first</emphasis>
ACL.</para>
</section>
-
<section>
<title>Default ACL of the root node</title>
-
<para>When no matching ACL is found in the ancestor hierarchy, the
- system may end up looking at the root node's ACL. As ACL are optional,
+ system may end up looking at the root node's ACL. As ACL are optional,
even for the root node, if the root node has no ACL, the following
- rule is ultimately applied to resolve privileges :</para>
-
+ rule is ultimately applied to resolve privileges:</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">any</emphasis>
identity (any
@@ -274,293 +213,200 @@
</itemizedlist>
</section>
</section>
-
<section>
<title>Notes</title>
-
- <para><emphasis role="bold">Access Control nodetypes are not
- extendible:</emphasis> The access control mechanism works for <emphasis
- role="bold">exo:owneable</emphasis> and <emphasis
- role="bold">exo:privilegeable</emphasis> nodetypes only, not for
their
- subtypes! So you can NOT extend those nodetypes.</para>
-
+ <para><emphasis role="bold">Access Control nodetypes are not
extendible:</emphasis> The access control mechanism works for <emphasis
role="bold">exo:owneable</emphasis> and <emphasis
role="bold">exo:privilegeable</emphasis> nodetypes only, not for their
+ subtypes! So you cannot extend those nodetypes.</para>
<para><emphasis role="bold">Autocreation:</emphasis> By
default, newly
- created nodes are neither <emphasis
- role="bold">exo:privilegeable</emphasis> nor <emphasis
- role="bold">exo:owneable</emphasis> but it is possible to
configure the
- repository to auto-create <emphasis
- role="bold">exo:privilegeable</emphasis> or/and <emphasis
- role="bold">exo:owneable</emphasis> thanks to eXo's JCR
interceptors
- extension (see <link linkend="JCR.Extensions">JCR
- Extensions</link>)</para>
-
+ created nodes are neither <emphasis
role="bold">exo:privilegeable</emphasis> nor <emphasis
role="bold">exo:owneable</emphasis> but it is possible to configure
the
+ repository to auto-create <emphasis
role="bold">exo:privilegeable</emphasis> or/and <emphasis
role="bold">exo:owneable</emphasis> thanks to eXo's JCR
interceptors
+ extension (see <link linkend="JCR.Extensions">JCR
Extensions</link>)</para>
<para><emphasis role="bold">OR-based Privilege
Inheritance</emphasis>:
- Note, that eXo's Access Control implementation supports a privilege
+ Note, that eXo's Access Control implementation supports a privilege
inheritance that follows a strategy of either...or/ and has only an
ALLOW privilege mechanism (there is no DENY feature). This means that a
- session is allowed to perform some operation on some nodes if its
+ session is allowed to perform some operations on some nodes if its
identity has an appropriate permission assigned to this node. Only if
there is no exo:permission property assigned to the node itself, the
- permissions of the node's ancestors are used.</para>
+ permissions of the node's ancestors are used.</para>
</section>
-
<section>
<title>Example</title>
-
<section>
<title>XML Example</title>
-
- <para>In the following example, you see a node named "Politics"
which
- contains two nodes named "Cats" and "Dogs".</para>
-
+ <para>In the following example, you see a node named
"Politics" which
+ contains two nodes named "Cats" and
"Dogs".</para>
<note>
- <para>These examples are exported from eXo DMS using the \"document
- view\" representation of JCR. Each value of a multivalue property is
+ <para>These examples are exported from eXo DMS using the
\"document
+ view\" representation of JCR. Each value of a multi-value property is
separated by a whitespace, each whitespace is escaped by
<emphasis>x0020</emphasis>.</para>
</note>
+ <programlisting><Politics
jcr:primaryType="nt:unstructured" jcr:mixinTypes="exo:owneable
exo:datetime exo:privilegeable"
exo:dateCreated="2009-10-08T18:02:43.687+02:00"
+exo:dateModified="2009-10-08T18:02:43.703+02:00"
+exo:owner="root"
+exo:permissions="any_x0020_read *:/platform/administrators_x0020_read
*:/platform/administrators_x0020_add_node *:/platform/administrators_x0020_set_property
*:/platform/administrators_x0020_remove">
- <programlisting><Politics
jcr:primaryType="nt:unstructured" jcr:mixinTypes="exo:owneable exo:datetime
exo:privilegeable" exo:dateCreated="2009-10-08T18:02:43.687+02:00"
-exo:dateModified="2009-10-08T18:02:43.703+02:00"
-exo:owner="root"
-exo:permissions="any_x0020_read *:/platform/administrators_x0020_read
*:/platform/administrators_x0020_add_node *:/platform/administrators_x0020_set_property
*:/platform/administrators_x0020_remove">
+<Cats jcr:primaryType="exo:article"
+jcr:mixinTypes="exo:owneable"
+exo:owner="marry"
+exo:summary="The_x0020_secret_x0020_power_x0020_of_x0020_cats_x0020_influences_x0020_the_x0020_leaders_x0020_of_x0020_the_x0020_world."
+exo:text=""
exo:title="Cats_x0020_rule_x0020_the_x0020_world" />
-<Cats jcr:primaryType="exo:article"
-jcr:mixinTypes="exo:owneable"
-exo:owner="marry"
-exo:summary="The_x0020_secret_x0020_power_x0020_of_x0020_cats_x0020_influences_x0020_the_x0020_leaders_x0020_of_x0020_the_x0020_world."
-exo:text="" exo:title="Cats_x0020_rule_x0020_the_x0020_world"
/>
+<Dogs jcr:primaryType="exo:article"
+jcr:mixinTypes="exo:privilegeable"
+exo:permissions="manager:/organization_x0020_read
manager:/organization_x0020_set_property"
+exo:summary="Dogs"
+exo:text="" exo:title="Dogs_x0020_are_x0020_friends"
/>
-<Dogs jcr:primaryType="exo:article"
-jcr:mixinTypes="exo:privilegeable"
-exo:permissions="manager:/organization_x0020_read
manager:/organization_x0020_set_property"
-exo:summary="Dogs"
-exo:text="" exo:title="Dogs_x0020_are_x0020_friends" />
-
</Politics></programlisting>
-
- <para>The "Politics" node is <emphasis
- role="bold">exo:owneable</emphasis> and <emphasis
- role="bold">exo:privilegeable</emphasis>. It has both an
<emphasis
- role="bold">exo:owner</emphasis> property and also an
<emphasis
- role="bold">exo:permissions</emphasis> property. There is an
<emphasis
- role="bold">exo:owner="root"</emphasis> property so
that the user root
- is the owner. In the exo:permissions value you can see the ACL, a list
- of access controls. In this example, the group <emphasis
- role="bold">\</emphasis>:/platform/administrators* has all
rights on
- this node (remember that the "\*" means any kind of membership/role).
- Furthermore, <emphasis role="bold">any</emphasis> has the
read
- permission.</para>
-
- <para>As you can see in the jcr:mixinTypes property the "Cats"
node is
- <emphasis role="bold">exo:owneable</emphasis>; hence there
is an
- <emphasis
role="bold">exo:owner="marry"</emphasis> property so that
- the user marry is the owner. The "Cats" node is <emphasis
- role="bold">not exo:privilegeable</emphasis> and has
<emphasis
- role="bold">no exo:permissions</emphasis>. In this case, the
<emphasis
- role="bold">inheritance mechanism</emphasis> enters the game:
The
- "Cats" node has the same permissions as "Politics"
node.</para>
-
- <para>Finally, the "Dogs" node is also a child node of
"Politics".
- This node is <emphasis role="bold">not
exo:owneable</emphasis> and
- inherits the owner of the "Politics" node (which is the user root).
- Otherwise, "Dogs" is <emphasis
- role="bold">exo:privilegeable</emphasis> and therefore has its
own
+ <para>The "Politics" node is <emphasis
role="bold">exo:owneable</emphasis> and <emphasis
role="bold">exo:privilegeable</emphasis>. It has both an <emphasis
role="bold">exo:owner</emphasis> property and an <emphasis
role="bold">exo:permissions</emphasis> property. There is an
<emphasis role="bold">exo:owner="root"</emphasis>
property so that the user root
+ is the owner. In the exo:permissions value, you can see the ACL that is a list
+ of access controls. In this example, the group <emphasis
role="bold">*:/platform/administrators</emphasis> has all rights on
+ this node (remember that the "<emphasis
role="bold">*</emphasis>" means any kind of membership).
+ <emphasis role="bold">any</emphasis> means that any users
also have the read
+ permission.s</para>
+ <para>As you see in the jcr:mixinTypes property, the
"Cats" node is
+ <emphasis role="bold">exo:owneable</emphasis> and there is
an
+ <emphasis
role="bold">exo:owner="marry"</emphasis> property so
that
+ the user marry is the owner. The "Cats" node is <emphasis
role="bold">not exo:privilegeable</emphasis> and has <emphasis
role="bold">no exo:permissions</emphasis>. In this case, we can see the
<emphasis role="bold">inheritance mechanism</emphasis> here is that
the
+ "Cats" node has the same permissions as
"Politics" node.</para>
+ <para>Finally, the "Dogs" node is also a child node of
"Politics".
+ This node is <emphasis role="bold">not</emphasis>
<emphasis role="bold">exo:owneable</emphasis> and
+ inherits the owner of the "Politics" node (which is the user
root).
+ Otherwise, "Dogs" is <emphasis
role="bold">exo:privilegeable</emphasis> and therefore, it has its own
<emphasis role="bold">exo:permissions</emphasis>. That
means only the
- users having a "manager" role in the group "/organization"
and the
- user "root" have the rights to access this node - all others have no
- access rights.</para>
+ users having a "manager" role in the group
"/organization" and the
+ user "root" have the rights to access this node.</para>
</section>
-
<section>
<title>Inheritance Examples</title>
-
<para>Here is an example showing the accessibility of two nodes (to
- show inheritance) for two sample users named <emphasis
- role="bold">manager</emphasis> and <emphasis
- role="bold">user</emphasis>:</para>
-
- <para>The "+" symbol means that there is a child node
- "exo:owneable".</para>
-
+ show inheritance) for two sample users named <emphasis
role="bold">manager</emphasis> and <emphasis
role="bold">user</emphasis>:</para>
+ <para>The "+" symbol means that there is a child node
+ "exo:owneable".</para>
<mediaobject>
<imageobject>
- <imagedata fileref="images/other/acl.gif" />
+ <imagedata fileref="images/other/acl.gif"/>
</imageobject>
</mediaobject>
</section>
-
<section>
<title>Permission validation</title>
-
- <para>There is a description how permission is validated for different
- jcr actions</para>
-
+ <para>This session describes how permission is validated for different
+ JCR actions.</para>
<itemizedlist>
<listitem>
- <para><emphasis role="bold">read node</emphasis>:
check read
- permission on target node.</para>
-
- <para>For example. Read /node1/<emphasis
- role="bold">subnode</emphasis> node - jcr will check
"read"
- permission exactly on "subnode".</para>
+ <para><emphasis role="bold">read node</emphasis>:
Check the read
+ permission on a target node.</para>
+ <para>For example: Read /node1/<emphasis
role="bold">subnode</emphasis> node, JCR will check the
"read"
+ permission exactly on "subnode".</para>
</listitem>
-
<listitem>
- <para><emphasis role="bold">read
property</emphasis> : check read
- permission on parent node.</para>
-
- <para>For example. Read /<emphasis
- role="bold">node1</emphasis>/myprop - jcr will check
"read"
- permission on "node1".</para>
+ <para><emphasis role="bold">read
property</emphasis> : Check the read
+ permission on a parent node.</para>
+ <para>For example: Read /<emphasis
role="bold">node1</emphasis>/myprop - JCR will check the
"read"
+ permission on "node1".</para>
</listitem>
-
<listitem>
- <para><emphasis role="bold">add node</emphasis>:
check add_node on
- parent node</para>
-
- <para>For example. Try to add /<emphasis
- role="bold">node1</emphasis>/sybnode node - jcr will
check
- "add_node" permission on "node1".</para>
+ <para><emphasis role="bold">add node</emphasis>:
Check add_node on a parent node.</para>
+ <para>For example: Add /<emphasis
role="bold">node1</emphasis>/subnode node, JCR will check the
+ "add_node" permission on
"node1".</para>
</listitem>
-
<listitem>
<para><emphasis role="bold">set
property</emphasis>: set_property
- on parent node</para>
-
- <para>For example. Try to set /<emphasis
- role="bold">node1</emphasis>/myprop property - jcr will
check
- "set_property" permission on "node1".</para>
+ on a parent node.</para>
+ <para>For example: Try to set /<emphasis
role="bold">node1</emphasis>/myprop property, JCR will check
+ the "set_property" permission on
"node1".</para>
</listitem>
-
<listitem>
- <para><emphasis role="bold">remove
node</emphasis>: check remove
- permission on target node.</para>
-
- <para>For example. Try to remove /node1/<emphasis
- role="bold">subnode</emphasis> node - jcr will check
"remove"
- permission on "subnode".</para>
+ <para><emphasis role="bold">remove
node</emphasis>: Check the remove
+ permission on a target node.</para>
+ <para>For example: Try to remove /node1/<emphasis
role="bold">subnode</emphasis> node, JCR will check the
"remove"
+ permission on "subnode".</para>
</listitem>
-
<listitem>
- <para><emphasis role="bold">remove
property</emphasis>: check
- remove permission on parent node</para>
-
- <para>For example. Try to remove /<emphasis
- role="bold">node1</emphasis>/myprop property - jcr will
check
- "remove" permission on "node1".</para>
+ <para><emphasis role="bold">remove
property</emphasis>: Check the
+ remove permission on a parent node.</para>
+ <para>For example: Try to remove /<emphasis
role="bold">node1</emphasis>/myprop property, JCR will check
+ the "remove" permission on
"node1".</para>
</listitem>
-
<listitem>
- <para><emphasis role="bold">add mixin</emphasis>:
check "add_node"
- and "set_property" permission on target node</para>
-
- <para>For example. Try add mixin to /node1/<emphasis
- role="bold">subnode</emphasis> node - jcr will check
"add_node"
- and "set_property" permission on "subnode".</para>
+ <para><emphasis role="bold">add mixin</emphasis>:
Check the "add_node"
+ and "set_property" permission on a target
node.</para>
+ <para>For example: Try to add mixin to /node1/<emphasis
role="bold">subnode</emphasis> node, JCR will check the
"add_node"
+ and "set_property" permission on
"subnode".</para>
</listitem>
</itemizedlist>
-
<note>
- <para>Behavior of the permission "remove" and "add
mixin" validation
+ <para>The behavior of the permission "remove" and
"add mixin" validation
has changed since JCR 1.12.6-GA. The old behavior is:</para>
-
<para><itemizedlist>
<listitem>
- <para><emphasis role="bold">remove
node</emphasis>: check
- remove permission on parent node</para>
-
- <para>For example. Try to remove /<emphasis
- role="bold">node1</emphasis>/subnode node - jcr will
check
- "remove" permission on "node1".</para>
+ <para><emphasis role="bold">remove
node</emphasis>: Check
+ the remove permission on a parent node.</para>
+ <para>For example: Try to remove /<emphasis
role="bold">node1</emphasis>/subnode node, JCR will check
+ the "remove" permission on
"node1".</para>
</listitem>
-
<listitem>
- <para><emphasis role="bold">add
mixin</emphasis>: check
- "add_node" and "set_property" permission on parent
node</para>
-
- <para>For example. Try add mixin to /<emphasis
- role="bold">node1</emphasis>/subnode node - jcr will
check
- "add_node" and "set_property" permission on
"node1".</para>
+ <para><emphasis role="bold">add
mixin</emphasis>: Check
+ the "add_node" and "set_property"
permission on a parent node.</para>
+ <para>For example: Try to add mixin to /<emphasis
role="bold">node1</emphasis>/subnode node, JCR will check
+ the "add_node" and "set_property"
permission on "node1".</para>
</listitem>
</itemizedlist></para>
</note>
</section>
</section>
-
<section>
<title>Java API</title>
-
- <para>eXo JCR's ExtendedNode interface which extends javax.jcr.Node
+ <para>eXo JCR's ExtendedNode interface which extends javax.jcr.Node
interface provides additional methods for Access Control
management.</para>
-
<table>
<title>Additional methods</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Method signature</entry>
-
<entry>Description</entry>
</row>
</thead>
-
<tbody>
<row>
- <entry>void setPermissions(Map<String, String[]>
- permissions)</entry>
-
+ <entry>void setPermissions(Map<String, String[]>
permissions)</entry>
<entry>Assigns a set of Permissions to a node</entry>
</row>
-
<row>
- <entry>void setPermission(String identity, String[]
- permission)</entry>
-
- <entry>Assigns some Identity's Permission to a
node</entry>
+ <entry>void setPermission(String identity, String[]
permission)</entry>
+ <entry>Assigns some Identities' Permission to a
node</entry>
</row>
-
<row>
<entry>void removePermission(String identity)</entry>
-
- <entry>Remove Identity's Permission</entry>
+ <entry>Removes an Identity's Permission</entry>
</row>
-
<row>
- <entry>void removePermission(String identity, String
- permission)</entry>
-
- <entry>Remove the specified permission for a particular
- identity</entry>
+ <entry>void removePermission(String identity, String
permission)</entry>
+ <entry>Removes the specified permission for a particular
identity</entry>
</row>
-
<row>
<entry>void clearACL()</entry>
-
<entry>Clears the current ACL so it becomes default</entry>
</row>
-
<row>
<entry>AccessControlList getACL()</entry>
-
<entry>Returns the current ACL</entry>
</row>
-
<row>
<entry>void checkPermission(String actions)</entry>
-
- <entry>Checks Permission (AccessDeniedException will be thrown
- if denied)</entry>
+ <entry>Checks Permission (AccessDeniedException will be thrown if
denied)</entry>
</row>
</tbody>
</tgroup>
</table>
-
- <para>The "identity" parameter is the user or group name. The
+ <para>The "identity" parameter is a user or a group name.
The
permissions are the literal strings of the standard action permissions
- (add_node, set_property, remove, read.</para>
+ (add_node, set_property, remove, read).</para>
</section>
</section>
</chapter>
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/protocols/webdav.xml
===================================================================
---
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/protocols/webdav.xml 2011-01-31
07:39:12 UTC (rev 3904)
+++
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/protocols/webdav.xml 2011-01-31
15:51:13 UTC (rev 3905)
@@ -1,77 +1,58 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. --><!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
<chapter id="JCR.WebDAV">
- <?dbhtml filename="ch-webdav.html"?>
-
- <title>WebDAV</title>
-
+<?dbhtml filename="ch-webdav.html"?> <title>WebDAV</title>
<section>
<title>Related documents</title>
-
<itemizedlist>
<listitem>
- <para><link linkend="JCR.LinkProducerService">Link
- Producer</link></para>
+ <para><link linkend="JCR.LinkProducerService">Link
Producer</link></para>
</listitem>
</itemizedlist>
</section>
-
<section>
<title>Introduction</title>
-
- <para>The WebDAV protocol allows you to use third party tools to
+ <para>The WebDAV protocol enables you to use the third party tools to
communicate with hierarchical content servers via HTTP. It is possible to
add and remove documents or a set of documents from a path on the server.
- DeltaV is an extension of the WebDav protocol that allows to manage
+ DeltaV is an extension of the WebDav protocol that allows managing
document versioning. Locking guarantees protection against multiple access
- when writing resources. The ordering support allows to change the position
- of the resource in the list and sort the directory for the convenience of
- viewing the directory tree. The full-text search makes it easy to find the
+ when writing resources. The ordering support allows changing the position
+ of the resource in the list and sort the directory to make the directory tree
viewed conveniently. The full-text search makes it easy to find the
necessary documents. You can search by using two languages: SQL and
XPATH.</para>
-
<para>In eXo JCR, we plug in the WebDAV layer - based on the code taken
from the extension modules of the reference implementation - on the top of
our JCR implementation so that it is possible to browse a workspace using
the third party tools (it can be Windows folders or Mac ones as well as a
- Java WebDAV client such as DAVExplorer or IE using File->Open as a Web
+ Java WebDAV client, such as DAVExplorer or IE using File->Open as a Web
Folder).</para>
-
<para>Now WebDav is an extension of the REST service. To get the WebDav
server ready, you must deploy the REST application. Then, you can access
any workspaces of your repository by using the following URL:</para>
-
<para>Standalone mode:</para>
-
<para><uri>http://host:port/rest/jcr/{RepositoryName}/{WorkspaceName}/{Path}</uri></para>
-
<para>Portal mode:</para>
-
<para><uri>http://host:port/portal/rest/private/jcr/{RepositoryName}/{WorkspaceName}/{Path}</uri></para>
-
- <para>When accessing the WebDAV server - here URL is
- <uri>http://localhost:8080/rest/jcr/repository/production</uri>, you
might
- also use "collaboration" (instead of "production") which is the
default
- workspace in eXo products - the user will be asked to enter his login and
+ <para>When accessing the WebDAV server with the
URL<uri>http://localhost:8080/rest/jcr/repository/production</uri>, you might
+ also use "collaboration" (instead of
"production") which is the default
+ workspace in eXo products. You will be asked to enter your login and
password. Those will then be checked by using the organization service
- (that can be implemented thanks to an Inmemory(dummy) module or DB module
- or LDAP one) and the JCR user session will be created with the correct JCR
+ that can be implemented thanks to an InMemory (dummy) module or a DB module
+ or an LDAP one and the JCR user session will be created with the correct JCR
Credentials.</para>
-
- <para><emphasis role="bold">NOTE:</emphasis> If you try
the "in ECM"
- option, add "@ecm" to the user's password. Alternatively, you may
modify
- jaas.conf adding the <emphasis
role="bold">domain=ecm</emphasis> option
- like:</para>
-
- <programlisting>exo-domain {
+ <note>
+ <para>If you try the "in ECM"
+ option, add "@ecm" to the user's password. Alternatively,
you may modify
+ jaas.conf by adding the <emphasis
role="bold">domain=ecm</emphasis> option
+ as follows:</para>
+ <programlisting>exo-domain {
org.exoplatform.services.security.jaas.BasicLoginModule required domain=ecm;
};</programlisting>
+ </note>
</section>
-
<section>
<title>Configuration</title>
-
<programlisting><component>
<key>org.exoplatform.services.webdav.WebDavServiceImpl</key>
<type>org.exoplatform.services.webdav.WebDavServiceImpl</type>
@@ -87,7 +68,7 @@
<!-- this is the value of WWW-Authenticate header -->
<value-param>
<name>auth-header</name>
- <value>Basic realm="eXo-Platform Webdav Server
1.6.1"</value>
+ <value>Basic realm="eXo-Platform Webdav Server
1.6.1"</value>
</value-param>
<!-- default node type which is used for the creation of collections
-->
@@ -102,7 +83,7 @@
<value>nt:file</value>
</value-param>
- <!-- if MimeTypeResolver can't find the required mime type,
+ <!-- if MimeTypeResolver can't find the required mime type,
which conforms with the file extension, and the mimeType header is absent
in the HTTP request header, this parameter is used
as the default mime type-->
@@ -112,9 +93,9 @@
</value-param>
<!-- This parameter indicates one of the three cases when you update the
content of the resource by PUT command.
- In case of "create-version", PUT command creates the new version of
the resource if this resource exists.
- In case of "replace" - if the resource exists, PUT command updates
the content of the resource and its last modification date.
- In case of "add", the PUT command tries to create the new resource
with the same name (if the parent node allows same-name siblings).-->
+ In case of "create-version", PUT command creates the new
version of the resource if this resource exists.
+ In case of "replace" - if the resource exists, PUT command
updates the content of the resource and its last modification date.
+ In case of "add", the PUT command tries to create the new
resource with the same name (if the parent node allows same-name siblings).-->
<value-param>
<name>update-policy</name>
@@ -125,8 +106,8 @@
<!--
This parameter determines how service responds to a method that attempts to
modify file content.
- In case of "checkout-checkin" value, when a modification request is
applied to a checked-in version-controlled resource, the request is automatically
preceded by a checkout and followed by a checkin operation.
- In case of "checkout" value, when a modification request is applied to
a checked-in version-controlled resource, the request is automatically preceded by a
checkout operation.
+ In case of "checkout-checkin" value, when a modification
request is applied to a checked-in version-controlled resource, the request is
automatically preceded by a checkout and followed by a checkin operation.
+ In case of "checkout" value, when a modification request is
applied to a checked-in version-controlled resource, the request is automatically preceded
by a checkout operation.
-->
<value-param>
<name>auto-version</name>
@@ -136,13 +117,13 @@
<!--
This parameter is responsible for managing Cache-Control header value which will
be returned to the client.
- You can use patterns like "text/*", "image/*" or wildcard to
define the type of content.
+ You can use patterns like "text/*", "image/*"
or wildcard to define the type of content.
-->
<value-param>
<name>cache-control</name>
<value>text/xml,text/html:max-age=3600;image/png,image/jpg:max-age=1800;*/*:no-cache;</value>
</value-param>
-
+
<!--
This parameter determines the absolute path to the folder icon file, which is
shown
during WebDAV view of the contents
@@ -155,248 +136,170 @@
</init-params
</component></programlisting>
</section>
-
<section>
<title>Screenshots</title>
-
- <para>At present, eXo JCR WebDav server was tested by using MS Internet
- Explorer, <ulink
url="http://www.ics.uci.edu/~webdav">Dav
- Explorer</ulink>, <ulink
-
url="http://www.xythos.com/home/xythos/products/xythos_drive.html&qu...
- Drive</ulink>, Microsoft Office 2003 (as client), and Ubuntu
Linux.</para>
-
+ <para>At present, eXo JCR WebDav server is tested by using MS Internet
+ Explorer, <ulink
url="http://www.ics.uci.edu/~webdav">Dav
Explorer</ulink>, <ulink
url="http://www.xythos.com/home/xythos/products/xythos_drive.html&qu...
Drive</ulink>, Microsoft Office 2003 (as client), and Ubuntu Linux.</para>
<section>
<title>MS Internet Explorer</title>
-
<para>(File -> Open as Web Folder)</para>
-
<mediaobject>
<imageobject>
- <imagedata fileref="images/protocols/webdav_explorer.jpg" />
+ <imagedata fileref="images/protocols/webdav_explorer.jpg"/>
</imageobject>
</mediaobject>
</section>
-
<section>
<title>Dav Explorer</title>
-
<mediaobject>
<imageobject>
- <imagedata fileref="images/protocols/webdav_davexplorer.jpg"
/>
+ <imagedata fileref="images/protocols/webdav_davexplorer.jpg"/>
</imageobject>
</mediaobject>
</section>
-
<section>
<title>Xythos Drive</title>
-
<mediaobject>
<imageobject>
- <imagedata fileref="images/protocols/webdav_xythosdrive.jpg"
/>
+ <imagedata fileref="images/protocols/webdav_xythosdrive.jpg"/>
</imageobject>
</mediaobject>
</section>
-
<section>
<title>Microsoft Office 2003</title>
-
<para>(as client) (File->Open with typing http://... href in the file
name box)</para>
-
<mediaobject>
<imageobject>
- <imagedata fileref="images/protocols/webdav_msoffice2003.jpg"
/>
+ <imagedata
fileref="images/protocols/webdav_msoffice2003.jpg"/>
</imageobject>
</mediaobject>
</section>
-
<section>
<title>Ubuntu Linux</title>
-
<mediaobject>
<imageobject>
- <imagedata fileref="images/protocols/webdav_ubuntulinux.jpg"
/>
+ <imagedata fileref="images/protocols/webdav_ubuntulinux.jpg"/>
</imageobject>
</mediaobject>
</section>
</section>
-
<section>
<title>Comparison table of WebDav and JCR commands</title>
-
<table>
- <title></title>
-
+ <title/>
<tgroup cols="2">
<thead>
<row>
<entry>WebDav</entry>
-
<entry>JCR</entry>
</row>
</thead>
-
<tbody>
<row>
<entry>COPY</entry>
-
<entry>Workspace.copy(...)</entry>
</row>
-
<row>
<entry>DELETE</entry>
-
<entry>Node.remove()</entry>
</row>
-
<row>
<entry>GET</entry>
-
<entry>Node.getProperty(...); Property.getValue()</entry>
</row>
-
<row>
<entry>HEAD</entry>
-
<entry>Node.getProperty(...); Property.getLength()</entry>
</row>
-
<row>
<entry>MKCOL</entry>
-
<entry>Node.addNode(...)</entry>
</row>
-
<row>
<entry>MOVE</entry>
-
<entry>Session.move(...) or Workspace.move(...)</entry>
</row>
-
<row>
<entry>PROPFIND</entry>
-
- <entry>Session.getNode(...); Node.getNode(...);
- Node.getNodes(...); Node.getProperties()</entry>
+ <entry>Session.getNode(...); Node.getNode(...); Node.getNodes(...);
Node.getProperties()</entry>
</row>
-
<row>
<entry>PROPPATCH</entry>
-
- <entry>Node.setProperty(...);
- Node.getProperty(...).remove()</entry>
+ <entry>Node.setProperty(...);
Node.getProperty(...).remove()</entry>
</row>
-
<row>
<entry>PUT</entry>
-
- <entry>Node.addNode("node","nt:file");
- Node.setProperty("jcr:data", "data")</entry>
+
<entry>Node.addNode("node","nt:file");
Node.setProperty("jcr:data", "data")</entry>
</row>
-
<row>
<entry>CHECKIN</entry>
-
<entry>Node.checkin()</entry>
</row>
-
<row>
<entry>CHECKOUT</entry>
-
<entry>Node.checkout()</entry>
</row>
-
<row>
<entry>REPORT</entry>
-
- <entry>Node.getVersionHistory(); VersionHistory.getAllVersions();
- Version.getProperties()</entry>
+ <entry>Node.getVersionHistory(); VersionHistory.getAllVersions();
Version.getProperties()</entry>
</row>
-
<row>
<entry>RESTORE</entry>
-
<entry>Node.restore(...)</entry>
</row>
-
<row>
<entry>UNCHECKOUT</entry>
-
<entry>Node.restore(...)</entry>
</row>
-
<row>
<entry>VERSION-CONTROL</entry>
-
- <entry>Node.addMixin("mix:versionable")</entry>
+
<entry>Node.addMixin("mix:versionable")</entry>
</row>
-
<row>
<entry>LOCK</entry>
-
<entry>Node.lock(...)</entry>
</row>
-
<row>
<entry>UNLOCK</entry>
-
<entry>Node.unlock()</entry>
</row>
-
<row>
<entry>ORDERPATCH</entry>
-
<entry>Node.orderBefore(...)</entry>
</row>
-
<row>
<entry>SEARCH</entry>
-
- <entry>Workspace.getQueryManager(); QueryManager.createQuery();
- Query.execute()</entry>
+ <entry>Workspace.getQueryManager(); QueryManager.createQuery();
Query.execute()</entry>
</row>
-
- <row>
- <entry>ACL</entry>
-
- <entry>Node.setPermission(...)</entry>
- </row>
</tbody>
</tgroup>
</table>
</section>
-
<section>
<title>Restrictions</title>
-
- <para>There are some restrictions for webdav in different Operating
+ <para>There are some restrictions for WebDAV in different Operating
systems.</para>
-
<section>
<title>Windows 7</title>
-
- <para>When you try to setup a web folder by “adding a network location”
+ <para>When you try to set up a web folder by “adding a network location”
or “map a network drive” through My Computer, you can get an error
- saying that either “The folder you entered does not appear to be valid.
+ message saying that either “The folder you entered does not appear to be valid.
Please choose another” or “Windows cannot access… Check the spelling of
- the name. Otherwise, there might be…”. These errors appear whether I’m
+ the name. Otherwise, there might be…”. These errors may appear when you are
using SSL or non-SSL.</para>
-
- <para>To fix this follow such steps:</para>
-
+ <para>To fix this, do as follows:</para>
<orderedlist>
<listitem>
- <para>Go to Windows Registry Editor</para>
+ <para>Go to Windows Registry Editor.</para>
</listitem>
-
<listitem>
<para>Find a key:
\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlset\services\WebClient\Parameters\BasicAuthLevel
- </para>
+ .</para>
</listitem>
-
<listitem>
- <para>Change the value to 2 </para>
+ <para>Change the value to 2.</para>
</listitem>
</orderedlist>
</section>
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/job-scheduler-service.xml
===================================================================
---
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/job-scheduler-service.xml 2011-01-31
07:39:12 UTC (rev 3904)
+++
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/job-scheduler-service.xml 2011-01-31
15:51:13 UTC (rev 3905)
@@ -1,142 +1,110 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. --><!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
<chapter id="Kernel.JobSchedulerService">
- <?dbhtml filename="ch-job-scheduler-service.html"?>
-
- <title>Job Scheduler Service</title>
-
+<?dbhtml filename="ch-job-scheduler-service.html"?> <title>Job
Scheduler Service</title>
<section>
- <title>What is Job Scheduler</title>
-
- <para><emphasis role="bold">Job scheduler</emphasis>
defines a job to
- execute a given number of times during a given period. It is a a software
- application that is in charge of unattended background executions,
- commonly known for historical reasons as batch processing.</para>
-
- <para>Today's job schedulers typically provide a graphical user interface
- and a single point of control for definition and monitoring of background
- executions in a distributed network of computers. Increasingly job
- schedulers are required to orchestrate the integration of real-time
- business activities with traditional background IT processing, across
- different operating system platforms and business application
- environments.</para>
-
- <para>Some features that may be found in a job scheduler include:</para>
-
+ <title>What is Job Scheduler?</title>
+ <para><emphasis role="bold">Job scheduler</emphasis>
defines a job to execute a given number of times during a given period. It is a service
that is in charge of unattended background executions, commonly known for historical
reasons as batch processing. It is used to create and run jobs automatically and
continuously, to schedule event-driven jobs and reports.</para>
+ </section>
+ <section>
+ <title>Where is Job Scheduler Service used in eXo Products?</title>
+ <para>Job Scheduler Service is widely used in many eXo products such as Social,
DMS, WCM, eXo Knowledge and eXo Collaboration.</para>
+ <para>In eXo products, Job Schedulers are used to do some tasks as
below:</para>
<itemizedlist>
<listitem>
- <para>Continuously automatic monitoring of jobs and completion
- notification</para>
+ <para>Automatically send notification, such as task/event reminder in the
Calendar application of eXo Collaboration. </para>
</listitem>
- </itemizedlist>
-
- <itemizedlist>
<listitem>
- <para>Event-driven job scheduling</para>
+ <para>Automatically save chat messages from Openfire Server to History in
the Chat application of eXo Collaboration. </para>
</listitem>
- </itemizedlist>
-
- <itemizedlist>
<listitem>
- <para>Performance monitoring</para>
+ <para>Inactivate topics in the Forum application of eXo
Knowledge.</para>
</listitem>
- </itemizedlist>
-
- <itemizedlist>
<listitem>
- <para>Report scheduling</para>
+ <para>Calculate the number of active and online users in the Forum
application of eXo Knowledge.</para>
</listitem>
+ <listitem>
+ <para>Automatically collect RSS items from various RSS resources to post to
the activity stream of users and spaces in eXo Social.</para>
+ </listitem>
+ <listitem>
+ <para>Automatically send Newsletters to users in WCM.</para>
+ </listitem>
</itemizedlist>
+ <para>Also, it is used in Schedule lifecycle in DMS.</para>
+ <para>By using Job Scheduler Service in eXo kernel, many kinds of job can be
configured to run, such as, addPeriodJob, addCronJob, addGlobalJobListener, addJobListener
and many more. Just write a job (a class implements Job interface of quartz library and
configures plug-in for JobSchedulerService and you're done. </para>
</section>
-
<section>
<title>How does Job Scheduler work?</title>
-
<para>Jobs are scheduled to run when a given Trigger occurs. Triggers can
be created with nearly any combination of the following directives:</para>
-
<itemizedlist>
<listitem>
<para>at a certain time of day (to the millisecond)</para>
</listitem>
-
<listitem>
<para>on certain days of the week</para>
</listitem>
</itemizedlist>
-
<itemizedlist>
<listitem>
<para>on certain days of the month</para>
</listitem>
-
<listitem>
<para>on certain days of the year</para>
</listitem>
</itemizedlist>
-
<itemizedlist>
<listitem>
<para>not on certain days listed within a registered Calendar (such as
business holidays)</para>
</listitem>
</itemizedlist>
-
<itemizedlist>
<listitem>
<para>repeated a specific number of times</para>
</listitem>
</itemizedlist>
-
<itemizedlist>
<listitem>
<para>repeated until a specific time/date</para>
</listitem>
-
<listitem>
<para>repeated indefinitely</para>
</listitem>
</itemizedlist>
-
<itemizedlist>
<listitem>
<para>repeated with a delay interval</para>
</listitem>
</itemizedlist>
-
<para>Jobs are given names by their creator and can also be organized into
named groups. Triggers may also be given names and placed into groups, in
order to easily organize them within the scheduler. Jobs can be added to
the scheduler once, but registered with multiple Triggers. Within a J2EE
environment, Jobs can perform their work as part of a distributed (XA)
transaction.</para>
-
+ <para>(Source:
quartz-scheduler.org) </para>
<section>
<title>How can Job Scheduler Service be used in Kernel?</title>
-
- <para>Kernel leverages <ulink
- url="http://www.quartz-scheduler.org">Quartz</ulink> for its
scheduler
+ <para>Kernel leverages <ulink
url="http://www.quartz-scheduler.org">Quartz</ulink> for its scheduler
service and wraps <classname>org.quartz.Scheduler</classname> in
<classname>org.exoplatform.services.scheduler.impl.QuartzSheduler</classname>
for easier service wiring and configuration like any other services. To
- work with Quartz in Kernel, you'll mostly work with
+ work with Quartz in Kernel, you will mostly work with
<classname>org.exoplatform.services.scheduler.JobSchedulerService</classname>
(implemented by
<classname>org.exoplatform.services.scheduler.impl.JobSchedulerServiceImpl</classname>.</para>
-
<para>To use <classname>JobSchedulerService</classname>, you can
configure it as a component in the configuration.xml. Because
<classname>JobSchedulerService</classname> requires
<classname>QuartzSheduler</classname> and
<classname>QueueTasks</classname>, you also have to configure these
two
components.</para>
-
- <programlisting><?xml version="1.0"
encoding="UTF-8"?>
+ <programlisting><?xml version="1.0"
encoding="UTF-8"?>
<configuration
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"...
<component>
<type>org.exoplatform.services.scheduler.impl.QuartzSheduler</type>
@@ -153,45 +121,38 @@
</configuration></programlisting>
</section>
-
<section>
<title>Samples</title>
-
- <para>We will work with
<classname>JobSchedulerService</classname> by
+ <note>
+ <para>You can download the project code from <ulink
url="https://github.com/hoatle/job-scheduler-service-tutorial"&...
+ </note>
+ <para>Work with <classname>JobSchedulerService</classname> by
creating a sample project and use GateIn-3.1.0-GA for testing.</para>
-
- <para>Firstly, create a project:</para>
-
+ <para>Firstly, create a project by using maven archetype
plugin:</para>
<programlisting>mvn archetype:generate
-//....
-Choose version:
-1: 1.0
-2: 1.0-alpha-1
-3: 1.0-alpha-2
-4: 1.0-alpha-3
-5: 1.0-alpha-4
-Choose a number: : 1
-Define value for property 'groupId': : org.exoplatform.samples
-Define value for property 'artifactId': : exo.samples.scheduler
-Define value for property 'version': 1.0-SNAPSHOT: 1.0-SNAPSHOT
-Define value for property 'package': org.exoplatform.samples: jar
-Confirm properties configuration:
-groupId: org.exoplatform.samples
-artifactId: exo.samples.scheduler
-version: 1.0-SNAPSHOT
-package: jar
-Y: Y</programlisting>
-
- <para>Choose version as <emphasis
role="bold">1.0-SNAPSHOT</emphasis>,
- groupId as <emphasis
role="bold">org.exoplatform.samples</emphasis>,
- artifactId as <emphasis
role="bold">exo.samples.scheduler</emphasis> and
- package as <emphasis role="bold">jar</emphasis>. Edit the
pom.xml as
- following:</para>
-
+</programlisting>
+ <itemizedlist>
+ <listitem>
+ <para>For project type: select <emphasis
role="bold">maven-archetype-quickstart </emphasis></para>
+ </listitem>
+ <listitem>
+ <para>For groupId: select <emphasis
role="bold">org.exoplatform.samples</emphasis></para>
+ </listitem>
+ <listitem>
+ <para>For artifactId: select <emphasis
role="bold">exo.samples.scheduler</emphasis></para>
+ </listitem>
+ <listitem>
+ <para>For version: select<emphasis role="bold">
1.0.0-SNAPSHOT</emphasis></para>
+ </listitem>
+ <listitem>
+ <para>For package: select <emphasis
role="bold">org.exoplatform.samples.scheduler</emphasis></para>
+ </listitem>
+ </itemizedlist>
+ <para>Edit the pom.xml as follows:</para>
<programlisting><project
-
xmlns="http://maven.apache.org/POM/4.0.0"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -203,274 +164,169 @@
<groupId>org.exoplatform.samples</groupId>
<artifactId>exo.samples.scheduler</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<name>eXo Samples For Scheduler</name>
<description>eXo Samples Code For Scheduler</description>
- <dependencies>
-
- <dependency>
- <groupId>quartz</groupId>
- <artifactId>quartz</artifactId>
- <version>1.5.2</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>picocontainer</groupId>
- <artifactId>picocontainer</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-</project></programlisting>
-
- <para>After that, create a eclipse project and then import into
- eclipse:</para>
-
+</project> </programlisting>
+ <para>Generate an eclipse project by using maven eclipse plugin and then
import into eclipse:</para>
<programlisting>mvn eclipse:eclipse</programlisting>
-
- <para>We'll work with this project all the time through
samples.</para>
-
+ <para>eXo Kernel makes it easier to work with job scheduler service. All you
need is just to define your "job" class to be performed by implementing
<emphasis role="italic">org.quartz.Job</emphasis> interface and add
configuration for it. </para>
<section>
- <title>StartableScheduler for DumbJob example</title>
+ <title>Define a job</title>
+ <para>To define a job, do as follows:</para>
+ <para>Define your job to be performed. For example, the job <emphasis
role="italic">DumbJob</emphasis> is defined as follows:</para>
+ <programlisting>package org.exoplatform.samples.scheduler.jobs;
- <itemizedlist>
- <listitem>
- <para>See how it works on Quartz at: <ulink
-
url="http://www.quartz-scheduler.org/docs/tutorial/TutorialLesson03....
- </listitem>
- </itemizedlist>
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
- <itemizedlist>
- <listitem>
- <para>Create a package in created project: conf/portal and add a
- configuration configuration.xml as follows:</para>
- </listitem>
- </itemizedlist>
+/**
+ * DumbJob for executing a defined dumb job.
+ */
+public class DumbJob implements Job {
- <programlisting><?xml version="1.0"
encoding="UTF-8"?>
+ /**
+ * The logger
+ */
+ private static final Log LOG = ExoLogger.getLogger(DumbJob.class);
+
+ /**
+ * The job of the DumbJob will be done by executing this method.
+ *
+ * @param context
+ * @throws JobExecutionException
+ */
+ public void execute(JobExecutionContext context) throws JobExecutionException {
+ LOG.info("DumbJob is executing...");
+ }
+}</programlisting>
+ <para>All jobs are required to implement the method <emphasis
role="italic">execute</emphasis> from <emphasis
role="italic">org.quartz.Job</emphasis> interface. This method will be
called whenever a job is performed. With <emphasis
role="italic">DumbJob</emphasis>, you just use logging to see that it
will work. By looking at the terminal, you will see the the log message: "DumbJob
is executing..."</para>
+ </section>
+ <section>
+ <title>Job configuration</title>
+ <para>After defining the "job", the only next step is to
configure it by using <emphasis
role="italic">external-component-plugin</emphasis> configuration for
<emphasis
role="italic">org.exoplatform.services.scheduler.JobSchedulerService</emphasis>.
You can use these methods below for setting component plugin:</para>
+ <programlisting>public void addPeriodJob(ComponentPlugin plugin) throws
Exception;</programlisting>
+ <para>The component plugin for this method must be the type of <emphasis
role="italic">org.exoplatform.services.scheduler.PeriodJob</emphasis>.
This type of job is used to perform actions that are executed in a period of time. You
have to define when this job is performed, when it ends, when it performs the first
action, how many times it is executed and the period of time to perform the action. See
the configuration sample below to understand more clearly:</para>
+ <programlisting><external-component-plugins>
+
<target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>
+ <component-plugin>
+ <name>PeriodJob Plugin</name>
+ <set-method>addPeriodJob</set-method>
+
<type>org.exoplatform.services.scheduler.PeriodJob</type>
+ <description>period job configuration</description>
+ <init-params>
+ <properties-param>
+ <name>job.info</name>
+ <description>dumb job executed
periodically</description>
+ <property name="jobName"
value="DumbJob"/>
+ <property name="groupName"
value="DumbJobGroup"/>
+ <property name="job"
value="org.exoplatform.samples.scheduler.jobs.DumbJob"/>
+ <property name="repeatCount"
value="0"/>
+ <property name="period"
value="60000"/>
+ <property name="startTime"
value="+45"/>
+ <property name="endTime"
value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins></programlisting>
+ <programlisting>public void addCronJob(ComponentPlugin plugin) throws
Exception;</programlisting>
+ <para>The component plugin for this method must be the type of <emphasis
role="italic">org.exoplatform.services.scheduler.CronJob</emphasis>.
This type of job is used to perform actions at specified time with Unix
'cron-like' definitions. The plugin uses "expression"
field for specifying the 'cron-like' definitions to execute the job.
This is considered as the most powerful and flexible job to define when it will execute.
For example, at 12pm every day => "0 0 12 * * ?"; or at 10:15am
every Monday, Tuesday, Wednesday, Thursday and Friday => "0 15 10 ? *
MON-FRI". To see more about Cron expression, please refer to this article:
<para><ulink
url="http://en.wikipedia.org/wiki/CRON_expression">CRON
expression</ulink>.</para>See the configuration sample below to understand
more clearly:</para>
+ <programlisting><external-component-plugins>
+
<target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>
+ <component-plugin>
+ <name>CronJob Plugin</name>
+ <set-method>addCronJob</set-method>
+
<type>org.exoplatform.services.scheduler.CronJob</type>
+ <description>cron job configuration</description>
+ <init-params>
+ <properties-param>
+ <name>job.info</name>
+ <description>dumb job executed by cron
expression</description>
+ <property name="jobName"
value="DumbJob"/>
+ <property name="groupName"
value="DumbJobGroup"/>
+ <property name="job"
value="org.exoplatform.samples.scheduler.jobs.DumbJob"/>
+ <!-- The job will be performed at 10:15am every day -->
+ <property name="expression" value="0 15 10 *
* ?"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins></programlisting>
+ <programlisting>public void addGlobalJobListener(ComponentPlugin plugin)
throws Exception;</programlisting>
+ <programlisting>public void addJobListener(ComponentPlugin plugin) throws
Exception;</programlisting>
+ <para>The component plugin for two methods above must be the type of
<emphasis role="italic">org.quartz.JobListener.</emphasis> This job
listener is used so that it will be informed when a <emphasis
role="italic">org.quartz.JobDetail</emphasis> executes.</para>
+ <programlisting>public void addGlobalTriggerListener(ComponentPlugin
plugin) throws Exception;</programlisting>
+ <programlisting>public void addTriggerListener(ComponentPlugin plugin)
throws Exception;</programlisting>
+ <para>The component plugin for two methods above must be the type of
<emphasis role="italic">org.quartz.TriggerListener</emphasis>. This
trigger listener is used so that it will be informed when a <emphasis
role="italic">org.quartz.Trigger</emphasis> fires.</para>
+ </section>
+ <section>
+ <title>Run the project</title>
+ <para>Create <emphasis
role="italic">conf.portal</emphasis> package in your sample project.
Add the configuration.xml file with the content as follows:</para>
+ <programlisting><?xml version="1.0"
encoding="UTF-8"?>
<configuration
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"...
<component>
<type>org.exoplatform.services.scheduler.impl.QuartzSheduler</type>
</component>
-
<component>
<type>org.exoplatform.services.scheduler.QueueTasks</type>
</component>
-
<component>
<key>org.exoplatform.services.scheduler.JobSchedulerService</key>
<type>org.exoplatform.services.scheduler.impl.JobSchedulerServiceImpl</type>
</component>
- <component>
-
<type>org.exoplatform.samples.scheduler.StartableScheduler</type>
- </component>
-
+ <external-component-plugins>
+
<target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>
+ <component-plugin>
+ <name>PeriodJob Plugin</name>
+ <set-method>addPeriodJob</set-method>
+
<type>org.exoplatform.services.scheduler.PeriodJob</type>
+ <description>period job configuration</description>
+ <init-params>
+ <properties-param>
+ <name>job.info</name>
+ <description>dumb job executed
periodically</description>
+ <property name="jobName"
value="DumbJob"/>
+ <property name="groupName"
value="DumbJobGroup"/>
+ <property name="job"
value="org.exoplatform.samples.scheduler.jobs.DumbJob"/>
+ <property name="repeatCount"
value="0"/>
+ <property name="period"
value="60000"/>
+ <property name="startTime"
value="+45"/>
+ <property name="endTime"
value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration></programlisting>
+ <para><emphasis role="italic">mvn clean install
</emphasis>the project. Copy .jar file to<emphasis role="italic">
lib</emphasis> in tomcat bundled with GateIn-3.1.0-GA. Run <emphasis
role="italic">bin/gatein.sh</emphasis> to see the <emphasis
role="italic">DumbJob</emphasis> to be executed on the terminal when
portal containers are initialized. Please look at the terminal to see the log message of
<emphasis role="italic">DumbJob</emphasis>.</para>
+ <para>From now on, you can easily create any job to be executed in
GateIn's portal by defining your job and configuring it.
- <itemizedlist>
- <listitem>
- <para>Note: You can see a component: StartableSheduler to be
- defined. It's a component startable when portal containers are
- initialized.</para>
- </listitem>
- </itemizedlist>
-
- <programlisting>package org.exoplatform.samples.scheduler;
-
-import java.util.Date;
-
-import org.exoplatform.samples.scheduler.jobs.DumbJob;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.scheduler.impl.QuartzSheduler;
-import org.picocontainer.Startable;
-import org.quartz.JobDetail;
-import org.quartz.Scheduler;
-import org.quartz.SchedulerException;
-import org.quartz.Trigger;
-import org.quartz.TriggerUtils;
-
-/**
- * Created by The eXo Platform SAS
- * Author : eXoPlatform
- * exo(a)exoplatform.com
- * Jul 1, 2010
- */
-public class StartableScheduler implements Startable {
- private static final Log LOG = ExoLogger.getLogger(StartableScheduler.class);
-
- public StartableScheduler(QuartzSheduler quartzScheduler) throws SchedulerException {
- LOG.info("Init StartableScheduler");
- JobDetail jobDetail = new JobDetail("myJob",
- Scheduler.DEFAULT_GROUP,
- DumbJob.class);
- Trigger trigger = TriggerUtils.makeImmediateTrigger(3, 5000);
- trigger.setStartTime(new Date());
- trigger.setName("myTrigger");
-
- Scheduler scheduler = quartzScheduler.getQuartzSheduler();
-
- scheduler.scheduleJob(jobDetail, trigger);
- }
-
- @Override
- public void start() {
- // TODO Auto-generated method stub
-
- }
- @Override
- public void stop() {
- // TODO Auto-generated method stub
-
- }
-}</programlisting>
-
- <itemizedlist>
- <listitem>
- <para>DumbJob is defined as a job:</para>
- </listitem>
- </itemizedlist>
-
- <programlisting>package org.exoplatform.samples.scheduler.jobs;
-
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-
-/**
- * DumbJob.java
- *
- * @author <a href="http://hoatle.net">hoatle (hoatlevan at
gmail dot com)</a>
- * @since Jul 1, 2010
- * @copyright eXo SAS
- */
-public class DumbJob implements Job {
- private static final Log LOG = ExoLogger.getLogger(DumbJob.class);
- @Override
- public void execute(JobExecutionContext context) throws JobExecutionException {
- LOG.info("DumbJob is executing!");
- }
-
-}</programlisting>
-
- <para>mvn clean install the project. Copy jar file to lib in tomcat
- bundled with GateIn-3.1.0-GA. Run bin/gatein.sh to see the DumbJob
- executed on the terminal when portal containers are
- initialized.</para>
+</para>
</section>
</section>
-
- <section>
- <title>Where is Job Scheduler Service used in eXo Products?</title>
-
- <para>Job Service Scheduler (JSS) is used in many eXo products such as
- Social, DMS, WCM, KS and CS.</para>
-
- <para>For example: It is used in Schedule lifecycle in DMS.</para>
-
- <para>Also, it is used for News Letter Email Job in ECM, Reminder Job
- for calendar and History Job for chat in CS, Auto-count Active Users in
- KS.</para>
-
- <para>By using Job Scheduler Service in eXo kernel, many kinds of job
- can be configured to run. You can addPeriodJob, addCronJob,
- addGlobalJobListener, addJobListener and many more. Just write a job (a
- class implements Job interface of quartz library and config plugin for
- JobSchedulerService and you're done.</para>
- </section>
</section>
-
<section>
- <title>Advantages of Job Scheduler</title>
-
- <para>It's very useful to use Job Scheduler to create schedules for a lot
- of work, especially if they are spread across multiple machines. It's a
- tool to make that task a lot easier. Job Schedule is also widely used in
- almost eXo products such as: WCM, DMS, KS, CS, Social thanks to its
- benefits and advantages.</para>
-
- <itemizedlist>
- <listitem>
- <para>The Job Scheduler provides automatically log files for running
- programs</para>
- </listitem>
-
- <listitem>
- <para>The execution status of programs is automatically checked and an
- administrator will receive protocols by eMail</para>
- </listitem>
-
- <listitem>
- <para>The sequence of job starts can be organized depending on their
- execution status</para>
- </listitem>
-
- <listitem>
- <para>Job Schedulers are controlled by a graphical user
- interface</para>
- </listitem>
-
- <listitem>
- <para>Job Schedulers can be used to create complex job chains and job
- dependencies</para>
- </listitem>
- </itemizedlist>
-
- <para>Also, a wide variety of enterprise applications can take advantage
- of job schedulers. Job schedulers can enhance the functionality of
- enterprise applications as well as simplify their design. Furthermore, job
- scheduling components allow software development teams to focus on their
- applications and not on the intricate details of scheduling. By using
- server-side components, software teams can reduce development costs and
- bring their applications to market sooner.</para>
- </section>
-
- <section>
<title>Reference</title>
-
<para>To further understand about Job Scheduler, you can refer the
following links:</para>
-
<itemizedlist>
<listitem>
- <para><ulink
-
url="http://www.quartz-scheduler.org/">http://www.quartz-sch...
+ <para><ulink
url="http://www.quartz-scheduler.org/">http://www.quartz-sch...
</listitem>
-
<listitem>
- <para><ulink
-
url="http://en.wikipedia.org/wiki/Job_scheduler">http://en.w...
+ <para><ulink
url="http://en.wikipedia.org/wiki/Job_scheduler">http://en.w...
</listitem>
-
<listitem>
- <para><ulink
-
url="http://www.theserverside.com/news/1364726/Job-Scheduling-in-J2E...
+ <para><ulink
url="http://www.theserverside.com/news/1364726/Job-Scheduling-in-J2E...
</listitem>
-
<listitem>
- <para><ulink
-
url="http://technet.microsoft.com/en-us/library/cc720070%28WS.10%29....
+ <para><ulink
url="http://technet.microsoft.com/en-us/library/cc720070%28WS.10%29....
</listitem>
</itemizedlist>
</section>