Author: smumford
Date: 2011-11-09 23:45:11 -0500 (Wed, 09 Nov 2011)
New Revision: 8020
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/Reference_Guide_eXo_JCR_1.14.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/Foundations/Config_Retrieval.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/Foundations/Specific_Services.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/PortletDevelopment/Global_Portlet.xml
epp/docs/branches/5.2/Reference_Guide/en-US/modules/PortletDevelopment/Global_Portlet.xml
Log:
Further edits and feedback from theute
Modified:
epp/docs/branches/5.2/Reference_Guide/en-US/modules/PortletDevelopment/Global_Portlet.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide/en-US/modules/PortletDevelopment/Global_Portlet.xml 2011-11-10
03:29:26 UTC (rev 8019)
+++
epp/docs/branches/5.2/Reference_Guide/en-US/modules/PortletDevelopment/Global_Portlet.xml 2011-11-10
04:45:11 UTC (rev 8020)
@@ -3,10 +3,8 @@
<!ENTITY % BOOK_ENTITIES SYSTEM "../../Reference_Guide.ent">
%BOOK_ENTITIES;
]>
-<chapter id="chap-Reference_Guide-Global_Portlet_Data">
- <title><remark>Global Portlet Data</remark></title>
- <section
id="sect-Reference_Guide-Global_Portlet_Data-The_Global_Data_File">
- <title>The Global Data File</title>
+<chapter id="chap-Reference_Guide_eXo_JCR_1.14-Shared_portlet.xml">
+ <title><remark>Shared
<filename>portlet.xml</filename></remark></title>
<para>
The Java Portlet Specification introduces
<literal>PortletFilter</literal> as a standard approach to extend the
behaviors of portlet objects. For example, a filter can transform the content of portlet
requests and portlet responses.
</para>
@@ -15,63 +13,70 @@
</para>
<procedure>
<step>
- <para>Implement a <literal>PortletFilter</literal>
object.</para>
+ <para>
+ Implement a <literal>PortletFilter</literal> object.
+ </para>
</step>
<step>
- <para>Define the filter in portlet application deployment
descriptor.</para>
+ <para>
+ Define the filter in portlet application deployment descriptor.
+ </para>
</step>
<step>
- <para>Define the filter mapping in portlet definitions.</para>
+ <para>
+ Define the filter mapping in portlet definitions.
+ </para>
</step>
</procedure>
<para>
While the first two steps are quite straightforward, the third requires
developers or administrators to replicate the filter mapping in many portlet definitions.
This can be tedious and opens the potential for input errors. The global portlet feature
is designed to mitigate these concerns.
</para>
- </section>
- <section
id="sect-Reference_Guide-Global_Portlet_Data-Global_Metadata">
- <title>Global Metadata</title>
+
<para>
Global portlet metadata is declared in the
<filename>portlet.xml</filename> file and conforms with the Portlet 2.0 XSD.
</para>
-<programlisting role="XML"
language="XML"><![CDATA[<portlet-app version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd&am...
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-a...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+<programlisting language="XML" role="XML"><portlet-app
version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+</portlet-app>
+</programlisting>
-</portlet-app>
-]]></programlisting>
-
- <section id="sect-Reference_Guide-Global_Portlet_Data-Location">
- <title>Location</title>
<para>
- The path to the global <filename>portlet.xml</filename> is the
value of <literal>gatein.portlet.config</literal> in the
<filename>configuration.properties.xml</filename> file (this can vary
depending on the hosting application server).
+ The path to the global <filename>portlet.xml</filename> is
the value of <literal>gatein.portlet.config</literal> in the
<filename>configuration.properties.xml</filename> file. By default The file
path is
<filename>/<replaceable><JBOSS_HOME></replaceable>/server/<replaceable><PROFILE></replaceable>/conf/gatein/portlet.xml</filename>
</para>
<para>
<emphasis role="bold">For JBoss</emphasis>: The file path
is
<filename><replaceable><JBOSS_HOME></replaceable>/server/default/conf/gatein/portlet.xml</filename>.
</para>
- </section>
-
- <section
id="sect-Reference_Guide-Global_Portlet_Data-Global_Metadata_Elements">
+
+ <section
id="sect-Reference_Guide-Global_Metadata-Global_Metadata_Elements">
<title>Global Metadata Elements</title>
<para>
The global <filename>portlet.xml</filename> file conforms, with
some restrictions, to the portlet deployment descriptor schema defined in the Portlet
Specification. In this file, the following elements are supported:
</para>
<orderedlist>
<listitem>
- <para>Portlet Filter</para>
+ <para>
+ <xref
linkend="form-Reference_Guide_eXo_JCR_1.14-Global_Metadata_Elements-Portlet_Filter"/>
+ </para>
</listitem>
<listitem>
- <para>Portlet Mode</para>
+ <para>
+ Portlet Mode
+ </para>
</listitem>
<listitem>
- <para>Window State</para>
+ <para>
+ Window State
+ </para>
</listitem>
</orderedlist>
- <section
id="sect-Reference_Guide-Global_Portlet_Data-Global_Metadata_Elements-Portlet_Filter">
+ <formalpara
id="form-Reference_Guide_eXo_JCR_1.14-Global_Metadata_Elements-Portlet_Filter">
<title>Portlet Filter</title>
<para>
Portlet filter mappings declared in the global
<filename>portlet.xml</filename> file are applied across portlet
applications.
</para>
+ </formalpara>
<para>
With the XML configuration below, the filter
<literal>ApplicationMonitoringFilter</literal> involves in request handling on
any deployed portlet.
</para>
@@ -110,9 +115,7 @@
</listitem>
</orderedlist>
<para>
- It also records statistic information on deployed portlets. The filter
alternates the actual monitoring mechanism in WebUI Framework.
+ The Application Monitoring Filter records statistic information about
deployed portlets. The filter alternates the actual monitoring mechanism in WebUI
Framework.
</para>
</section>
- </section>
- </section>
</chapter>
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/Reference_Guide_eXo_JCR_1.14.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/Reference_Guide_eXo_JCR_1.14.xml 2011-11-10
03:29:26 UTC (rev 8019)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/Reference_Guide_eXo_JCR_1.14.xml 2011-11-10
04:45:11 UTC (rev 8020)
@@ -4,14 +4,15 @@
%BOOK_ENTITIES;
]>
<book>
- <xi:include href="Book_Info.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Preface.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/Introduction.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/PortalDevelopment.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/PortletDevelopment.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!-- <xi:include href="modules/GadgetDevelopment.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" /> --> <xi:include
href="modules/AuthenticationAndIdentity.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/WSRP.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/Advanced.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Revision_History.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Book_Info.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Preface.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/Introduction.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/PortalDevelopment.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/PortletDevelopment.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- <xi:include href="modules/GadgetDevelopment.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" /> -->
+ <xi:include href="modules/AuthenticationAndIdentity.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/WSRP.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/Advanced.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Revision_History.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/Foundations/Config_Retrieval.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/Foundations/Config_Retrieval.xml 2011-11-10
03:29:26 UTC (rev 8019)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/Foundations/Config_Retrieval.xml 2011-11-10
04:45:11 UTC (rev 8020)
@@ -4,155 +4,77 @@
%BOOK_ENTITIES;
]>
<section>
- <title></title>
- <para>
- The container performs the following steps to make eXo Container configuration
retrieval, depending on the container type.
- </para>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Configuration_retrieval_order_for_the_PortalContainer">
- <title>Configuration retrieval order for the
<envar>PortalContainer</envar></title>
- <para>
- The container is initialized by looking into different locations. This container is
used by portal applications. Configurations are overloaded in the following lookup
sequence:
- </para>
- <orderedlist>
- <listitem>
- <para>
- Services default <envar>RootContainer</envar> configurations from JAR
files <emphasis>/conf/configuration.xml</emphasis>
- </para>
+ <title>Configuration Retrieval</title>
+ <para>
+ The container performs the following steps for configuration retrieval,
depending on the container type.
+ </para>
+ <para>
+ The container is initialized by looking into different locations. This
container is used by portal applications. Configurations are overloaded in the following
lookup sequence:
+ </para>
+ <procedure>
+ <step>
+ <para>
+ Services default <envar>RootContainer</envar>
configurations from JAR files
<filename><replaceable><JBOSS_HOME></replaceable>/conf/gatein/configuration.xml</filename>.
+ </para>
- </listitem>
- <listitem>
- <para>
- External <envar>RootContainer</envar> configuration can be found at
<emphasis>$AS_HOME/exo-conf/configuration.xml</emphasis>
- </para>
+ </step>
+ <step>
+ <para>
+ External <envar>RootContainer</envar> configuration can
be found at
<filename><replaceable><JBOSS_HOME></replaceable>/conf/gatein/configuration.xml</filename>.
+ </para>
- </listitem>
- <listitem>
- <para>
- Services default <envar>PortalContainer</envar> configurations from JAR
files <emphasis>/conf/portal/configuration.xml</emphasis>
- </para>
+ </step>
+ <step>
+ <para>
+ Services default <envar>PortalContainer</envar>
configurations from JAR files
<filename>/conf/portal/configuration.xml</filename>.
+ </para>
- </listitem>
- <listitem>
- <para>
- Web applications configurations from WAR files
<emphasis>/WEB-INF/conf/configuration.xml</emphasis>
- </para>
+ </step>
+ <step>
+ <para>
+ Web applications configurations from WAR files
<filename>/WEB-INF/conf/configuration.xml</filename>
+ </para>
- </listitem>
- <listitem>
- <para>
- External configuration for services of named portal can be found at
<emphasis>$AS_HOME/exo-conf/portal/$PORTAL_NAME/configuration.xml</emphasis>
- </para>
+ </step>
+ <step>
+ <para>
+ External configuration for services of named portal can be found at
<filename><replaceable><JBOSS_HOME></replaceable>/conf/gatein/configuration.xml</filename>.
+ </para>
- </listitem>
+ </step>
- </orderedlist>
+ </procedure>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-General_notes_about_the_configuration_retrieval">
- <title>General notes about the configuration retrieval</title>
- <note>
- <para>
- <emphasis>$AS_HOME</emphasis> - application server home directory, or
<emphasis>user.dir</emphasis> JVM system property value in case of Java
Standalone application. The application server home is:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- For <envar>Jonas</envar>, the value of the variable
<emphasis>${jonas.base}.</emphasis>
- </para>
+ <note>
+ <para>
+ The search looks for a configuration file in each JAR/WAR available from
the classpath using the current thread context classloader. During the search these
configurations are added to a set. If the service was configured previously and the
current JAR contains a new configuration of that service the latest (from the current
JAR/WAR) will replace the previous one. The last one will be applied to the service during
the services start phase.
+ </para>
- </listitem>
- <listitem>
- <para>
- For <envar>Jetty</envar>, the value of the variable
<emphasis>${jetty.home}.</emphasis>
- </para>
+ </note>
+ <warning>
+ <para>
+ Take care to have no dependencies between configurations from JAR files
(<filename>/conf/portal/configuration.xml</filename> and
<filename>/conf/configuration.xml</filename>) since we have no way to know in
advance the loading order of those configurations. In other words, if you want to overload
some configuration located in the file
<filename>/conf/portal/configuration.xml</filename> of a given JAR file, you
must not do it from the file
<filename>/conf/portal/configuration.xml</filename> of another JAR file but
from another configuration file loaded after configurations from JAR files
<filename>/conf/portal/configuration.xml.</filename>
+ </para>
- </listitem>
- <listitem>
- <para>
- For <envar>Websphere</envar>, the value of the variable
<emphasis>${was.install.root}.</emphasis>
- </para>
+ </warning>
+ <para>
+ After the processing of all configurations available in system, the container
will initialize it and start each service in order of the dependency injection (DI).
+ </para>
+ <para>
+ The user/developer should be careful when configuring the same service in
different configuration files. It's recommended to configure a service in its own JAR
only. Or, in case of a portal configuration, strictly reconfigure the services in portal
WAR files or in an external configuration.
+ </para>
+ <para>
+ There are services that can be (or should be) configured more than one time.
This depends on business logic of the service. A service may initialize the same resource
(shared with other services) or may add a particular object to a set of objects (shared
with other services too). In the first case, it's critical who will be the last, i.e.
whose configuration will be used. In the second case, it's no matter who is the first
and who is the last (if the parameter objects are independent).
+ </para>
- </listitem>
- <listitem>
- <para>
- For <envar>Weblogic</envar>, the value of the variable
<emphasis>${wls.home}</emphasis>.
- </para>
-
- </listitem>
- <listitem>
- <para>
- For <envar>Glassfish</envar>, the value of the variable
<emphasis>${com.sun.aas.instanceRoot}</emphasis>.
- </para>
-
- </listitem>
- <listitem>
- <para>
- For <envar>Tomcat</envar>, the value of the variable
<emphasis>${catalina.home}</emphasis>.
- </para>
-
- </listitem>
- <listitem>
- <para>
- For <envar>JBoss AS</envar>, the value of the variable
<emphasis>${jboss.server.config.url}</emphasis> if the exo-conf directory can
be found there otherwise it will be the value of the variable
<emphasis>${jboss.home.dir}</emphasis>.
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </note>
- <note>
- <para>
- <emphasis>$PORTAL_NAME</emphasis> - portal web application name.
- </para>
-
- </note>
- <note>
- <para>
- External configuration location can be overridden with System property
<emphasis>exo.conf.dir</emphasis>. If the property exists, its value will be
used as path to eXo configuration directory, i.e. to
<emphasis>$AS_HOME/exo-conf</emphasis> alternative. E.g. put property in
command line java <emphasis>-Dexo.conf.dir=/path/to/exo/conf</emphasis>. In
this particular use case, you do not need to use any prefix to import other files. For
instance, if your configuration file is
<emphasis>$AS_HOME/exo-conf/portal/PORTAL_NAME/configuration.xml</emphasis>
and you want to import the configuration file
<emphasis>$AS_HOME/exo-conf/portal/PORTAL_NAME/mySubConfDir/myConfig.xml</emphasis>,
you can do it by adding
<emphasis><import>mySubConfDir/myConfig.xml</import></emphasis>
to your configuration file.
- </para>
-
- </note>
- <note>
- <para>
- The name of the configuration folder that is by default
<emphasis>"exo-conf"</emphasis>, can be changed thanks to the System
property <emphasis>exo.conf.dir.name</emphasis>.
- </para>
-
- </note>
- <note>
- <para>
- The search looks for a configuration file in each JAR/WAR available from the
classpath using the current thread context classloader. During the search these
configurations are added to a set. If the service was configured previously and the
current JAR contains a new configuration of that service the latest (from the current
JAR/WAR) will replace the previous one. The last one will be applied to the service during
the services start phase.
- </para>
-
- </note>
- <warning>
- <para>
- Take care to have no dependencies between configurations from JAR files
(<emphasis>/conf/portal/configuration.xml</emphasis> and
<emphasis>/conf/configuration.xml</emphasis>) since we have no way to know in
advance the loading order of those configurations. In other words, if you want to overload
some configuration located in the file
<emphasis>/conf/portal/configuration.xml</emphasis> of a given JAR file, you
must not do it from the file
<emphasis>/conf/portal/configuration.xml</emphasis> of another JAR file but
from another configuration file loaded after configurations from JAR files
<emphasis>/conf/portal/configuration.xml.</emphasis>
- </para>
-
- </warning>
- <para>
- After the processing of all configurations available in system, the container will
initialize it and start each service in order of the dependency injection (DI).
- </para>
- <para>
- The user/developer should be careful when configuring the same service in different
configuration files. It's recommended to configure a service in its own JAR only. Or,
in case of a portal configuration, strictly reconfigure the services in portal WAR files
or in an external configuration.
- </para>
- <para>
- There are services that can be (or should be) configured more than one time. This
depends on business logic of the service. A service may initialize the same resource
(shared with other services) or may add a particular object to a set of objects (shared
with other services too). In the first case, it's critical who will be the last, i.e.
whose configuration will be used. In the second case, it's no matter who is the first
and who is the last (if the parameter objects are independent).
- </para>
-
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Configuration_retrieval_log">
- <title>Configuration retrieval log</title>
- <para>
- In case of problems with service configuration, it's important to know from which
JAR/WAR it comes. For that purpose, the JVM system property
<emphasis>org.exoplatform.container.configuration.debug</emphasis> can be
used.
+ <para>
+ In case of problems with service configuration, it's important to know
from which JAR/WAR it comes. For that purpose, the JVM system property
<literal>org.exoplatform.container.configuration.debug</literal> can be used.
+ </para>
<programlisting>java -Dorg.exoplatform.container.configuration.debug
...</programlisting>
- </para>
- <para>
- If the property is enabled, the container configuration manager will log the
configuration adding process at <emphasis>INFO</emphasis> level.
+ <para>
+ If the property is enabled, the container configuration manager will log the
configuration adding process at <emphasis>INFO</emphasis> level.
+ </para>
<programlisting>......
Add configuration
jar:file:/D:/Projects/eXo/dev/exo-working/exo-tomcat/lib/exo.kernel.container-trunk.jar!/conf/portal/configuration.xml
Add configuration
jar:file:/D:/Projects/eXo/dev/exo-working/exo-tomcat/lib/exo.kernel.component.cache-trunk.jar!/conf/portal/configuration.xml
@@ -163,19 +85,8 @@
import jndi:/localhost/portal/WEB-INF/conf/jcr/jcr-configuration.xml
......</programlisting>
- </para>
+ <para>
+ The effective configuration of the StandaloneContainer, RootContainer and/or
PortalContainer can be known thanks to the method
<emphasis>getConfigurationXML</emphasis>() that is exposed through JMX at the
container's level. This method will give you the effective configuration in XML format
that has been really interpreted by the kernel. This could be helpful to understand how a
given component or plugin has been initialized.
+ </para>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Getting_the_effective_configuration_at_Runtime">
- <title>Getting the effective configuration at Runtime</title>
- <para>
- The effective configuration of the StandaloneContainer, RootContainer and/or
PortalContainer can be known thanks to the method
<emphasis>getConfigurationXML</emphasis>() that is exposed through JMX at the
container's level. This method will give you the effective configuration in XML format
that has been really interpreted by the kernel. This could be helpful to understand how a
given component or plugin has been initialized.
- </para>
-
- </section>
-
-
-</section>
-
-
+</section>
\ No newline at end of file
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/Foundations/Specific_Services.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/Foundations/Specific_Services.xml 2011-11-10
03:29:26 UTC (rev 8019)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/Foundations/Specific_Services.xml 2011-11-10
04:45:11 UTC (rev 8020)
@@ -4,30 +4,30 @@
%BOOK_ENTITIES;
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Specific_Services">
- <title>Specific Services</title>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Specific_Services-ListenerService">
- <title>ListenerService</title>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-ListenerService-Asynchronous_Event_Broadcast">
- <title>Asynchronous Event Broadcast</title>
- <para>
- Basically, ListenerService used to store Listeners and broadcast events to them.
- </para>
- <para>
- ListenerService event broadcasting works in next way - it takes a destination
listeners and executes event on those listeners.
- </para>
- <para>
- But, some events may take a lot of time, so idea to make event processing
asynchronous is useful.
- </para>
- <blockquote>
- <para>
- What do I need to make my listener asynchronous?
- </para>
+ <title>Specific Services</title>
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Specific_Services-ListenerService">
+ <title>ListenerService</title>
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-ListenerService-Asynchronous_Event_Broadcast">
+ <title>Asynchronous Event Broadcast</title>
+ <para>
+ Basically, ListenerService used to store Listeners and broadcast events
to them.
+ </para>
+ <para>
+ ListenerService event broadcasting works in next way - it takes a
destination listeners and executes event on those listeners.
+ </para>
+ <para>
+ But, some events may take a lot of time, so idea to make event processing
asynchronous is useful.
+ </para>
+ <blockquote>
+ <para>
+ What do I need to make my listener asynchronous?
+ </para>
- </blockquote>
- <para>
- - It's very simple, just mark your Listener implementation as
<classname>@Asynchronous</classname>.
- </para>
-
+ </blockquote>
+ <para>
+ - It's very simple, just mark your Listener implementation as
<classname>@Asynchronous</classname>.
+ </para>
+
<programlisting language="Java" role="Java">@Asynchronous
class AsynchListenerWithException<S,D> extends Listener<S,D>
{
@@ -37,13 +37,13 @@
// some expensive operation
}
}</programlisting>
- <para>
- Now, our AsynchListener will be executed in separate thread by
<classname>ExecutorService</classname>.
- </para>
- <para>
- By default, <classname>ExecutoreService</classname> configured with
thread pool size 1, you can change it in configuration:
- </para>
-
+ <para>
+ Now, our AsynchListener will be executed in separate thread by
<classname>ExecutorService</classname>.
+ </para>
+ <para>
+ By default, <classname>ExecutoreService</classname>
configured with thread pool size 1, you can change it in configuration:
+ </para>
+
<programlisting language="XML" role="XML">
<component>
<key>org.exoplatform.services.listener.ListenerService</key>
<type>org.exoplatform.services.listener.ListenerService</type>
@@ -57,40 +57,40 @@
</component></programlisting>
- </section>
-
+ </section>
+
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Specific_Services-Understanding_the_ListenerService">
- <title>Understanding the ListenerService</title>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-Objectives">
- <title>Objectives</title>
- <para>
- This article will first describe how the ListenerService works and then it will show
you how to configure the ListenerService.
- </para>
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Specific_Services-Understanding_the_ListenerService">
+ <title>Understanding the ListenerService</title>
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-Objectives">
+ <title>Objectives</title>
+ <para>
+ This article will first describe how the ListenerService works and then
it will show you how to configure the ListenerService.
+ </para>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-What_is_the_ListenerService_">
- <title>What is the ListenerService ?</title>
- <para>
- Inside eXo, an event mechanism allows to trigger and listen to events under specific
conditions. This mechanism is used in several places in eXo such as login/logout time.
- </para>
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-What_is_the_ListenerService_">
+ <title>What is the ListenerService ?</title>
+ <para>
+ Inside eXo, an event mechanism allows to trigger and listen to events
under specific conditions. This mechanism is used in several places in eXo such as
login/logout time.
+ </para>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-How_does_it_work">
- <title>How does it work?</title>
- <para>
- Listeners must be subclasses of org.exoplatform.services.listener.Listener registered
by the ListenerService.
- </para>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-How_does_it_work-Registering_a_listener">
- <title>Registering a listener</title>
- <para>
- To register a listener, you need to call the addListener() method.
- </para>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-How_does_it_work">
+ <title>How does it work?</title>
+ <para>
+ Listeners must be subclasses of
org.exoplatform.services.listener.Listener registered by the ListenerService.
+ </para>
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-How_does_it_work-Registering_a_listener">
+ <title>Registering a listener</title>
+ <para>
+ To register a listener, you need to call the addListener() method.
+ </para>
+
<programlisting language="Java" role="Java">/**
* This method is used to register a listener with the service. The method
* should: 1. Check to see if there is a list of listener with the listener
@@ -102,18 +102,18 @@
public void addListener(Listener listener) {
...
}</programlisting>
- <para>
- By convention, we use the listener name as the name of the event to listen to.
- </para>
+ <para>
+ By convention, we use the listener name as the name of the event to
listen to.
+ </para>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-How_does_it_work-Triggering_an_event">
- <title>Triggering an event</title>
- <para>
- To trigger an event, an application can call one of the broadcast() methods of
ListenerService.
- </para>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-How_does_it_work-Triggering_an_event">
+ <title>Triggering an event</title>
+ <para>
+ To trigger an event, an application can call one of the broadcast()
methods of ListenerService.
+ </para>
+
<programlisting language="Java" role="Java">/**
* This method is used to broadcast an event. This method should: 1. Check if
* there is a list of listener that listen to the event name. 2. If there is a
@@ -147,13 +147,13 @@
public <T extends Event> void broadcast(T event) throws Exception {
...
}</programlisting>
- <para>
- The broadcast() methods retrieve the name of the event and find the registered
listeners with the same name and call the method onEvent() on each listener found.
- </para>
- <para>
- Each listener is a class that extends org.exoplatform.services.listener.Listener, as
you can see below:
- </para>
-
+ <para>
+ The broadcast() methods retrieve the name of the event and find the
registered listeners with the same name and call the method onEvent() on each listener
found.
+ </para>
+ <para>
+ Each listener is a class that extends
org.exoplatform.services.listener.Listener, as you can see below:
+ </para>
+
<programlisting language="Java" role="Java">public abstract
class Listener<S, D> extends BaseComponentPlugin {
/**
@@ -162,16 +162,16 @@
*/
public abstract void onEvent(Event<S, D> event) throws Exception;
}</programlisting>
- <warning>
- <para>
- As you can see we use generics to limit the source of the event to the type
'S' and the data of the event to the type 'D', so we expect that listeners
implement the method onEvent() with the corresponding types
- </para>
+ <warning>
+ <para>
+ As you can see we use generics to limit the source of the event
to the type 'S' and the data of the event to the type 'D', so we expect
that listeners implement the method onEvent() with the corresponding types
+ </para>
- </warning>
- <para>
- Each listener is also a ComponentPlugin with a name and a description, in other
words, the name of the listener will be the name given in the configuration file, for more
details see the next section.
- </para>
-
+ </warning>
+ <para>
+ Each listener is also a ComponentPlugin with a name and a
description, in other words, the name of the listener will be the name given in the
configuration file, for more details see the next section.
+ </para>
+
<programlisting language="Java" role="Java">public interface
ComponentPlugin {
public String getName();
@@ -182,17 +182,17 @@
public void setDescription(String description);
}</programlisting>
- </section>
-
+ </section>
+
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-How_to_configure_a_listener">
- <title>How to configure a listener?</title>
- <para>
- All listeners are in fact a ComponentPlugin so it must be configured as below:
- </para>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-How_to_configure_a_listener">
+ <title>How to configure a listener?</title>
+ <para>
+ All listeners are in fact a ComponentPlugin so it must be configured as
below:
+ </para>
+
<programlisting language="XML" role="XML"><?xml
version="1.0" encoding="ISO-8859-1"?>
<configuration>
...
@@ -212,22 +212,22 @@
</external-component-plugins>
</configuration></programlisting>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-Concrete_Example">
- <title>Concrete Example</title>
- <para>
- The org.exoplatform.services.security.ConversationRegistry uses the ListenerService
to notify that a user has just signed in or just left the application. For example, when a
new user signs in, the following code is called:
- </para>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Understanding_the_ListenerService-Concrete_Example">
+ <title>Concrete Example</title>
+ <para>
+ The org.exoplatform.services.security.ConversationRegistry uses the
ListenerService to notify that a user has just signed in or just left the application. For
example, when a new user signs in, the following code is called:
+ </para>
+
<programlisting language="Java"
role="Java">listenerService.broadcast("exo.core.security.ConversationRegistry.register",
this, state);</programlisting>
- <para>
- This code will in fact create a new Event which name is
"exo.core.security.ConversationRegistry.register", which source is the current
instance of ConversationRegistry and which data is the given state. The ListenerService
will call the method onEvent(Event<ConversationRegistry, ConversationState>
event) on all the listeners which name is
"exo.core.security.ConversationRegistry.register".
- </para>
- <para>
- In the example below, we define a Listener that will listen the event
"exo.core.security.ConversationRegistry.register".
- </para>
-
+ <para>
+ This code will in fact create a new Event which name is
"exo.core.security.ConversationRegistry.register", which source is the current
instance of ConversationRegistry and which data is the given state. The ListenerService
will call the method onEvent(Event<ConversationRegistry, ConversationState>
event) on all the listeners which name is
"exo.core.security.ConversationRegistry.register".
+ </para>
+ <para>
+ In the example below, we define a Listener that will listen the event
"exo.core.security.ConversationRegistry.register".
+ </para>
+
<programlisting language="XML" role="XML"><?xml
version="1.0" encoding="ISO-8859-1"?>
<configuration>
...
@@ -248,169 +248,111 @@
</configuration>
...</programlisting>
- </section>
-
+ </section>
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Specific_Services-Job_Schedule">
+ <title>Job Schedule</title>
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Job_Schedule-What_is_Job_Scheduler">
+ <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
id="sect-Reference_Guide_eXo_JCR_1.14-Specific_Services-Job_Schedule">
- <!-- This document was created with Syntext Serna Free. -->
<title>Job Schedule</title>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Job_Schedule-What_is_Job_Scheduler">
- <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
id="sect-Reference_Guide_eXo_JCR_1.14-Job_Schedule-How_does_Job_Scheduler_work">
+ <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>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Job_Schedule-Where_is_Job_Scheduler_Service_used_in_eXo_Products">
- <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>
- Automatically send notification, such as task/event reminder in the Calendar
application of eXo Collaboration.
- </para>
+ </listitem>
+ <listitem>
+ <para>
+ on certain days of the week
+ </para>
- </listitem>
- <listitem>
- <para>
- Automatically save chat messages from Openfire Server to History in the Chat
application of eXo Collaboration.
- </para>
+ </listitem>
- </listitem>
- <listitem>
- <para>
- Inactivate topics in the Forum application of eXo Knowledge.
- </para>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ on certain days of the month
+ </para>
- </listitem>
- <listitem>
- <para>
- Calculate the number of active and online users in the Forum application of eXo
Knowledge.
- </para>
+ </listitem>
+ <listitem>
+ <para>
+ on certain days of the year
+ </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>
- <listitem>
- <para>
- Automatically send Newsletters to users in WCM.
- </para>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ not on certain days listed within a registered Calendar (such as
business holidays)
+ </para>
- </listitem>
+ </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>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ repeated a specific number of times
+ </para>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Job_Schedule-How_does_Job_Scheduler_work">
- <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>
- <listitem>
- <para>
- on certain days of the week
- </para>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ repeated until a specific time/date
+ </para>
- </listitem>
+ </listitem>
+ <listitem>
+ <para>
+ repeated indefinitely
+ </para>
- </itemizedlist>
- <itemizedlist>
- <listitem>
- <para>
- on certain days of the month
- </para>
+ </listitem>
- </listitem>
- <listitem>
- <para>
- on certain days of the year
- </para>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ repeated with a delay interval
+ </para>
- </listitem>
+ </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
id="sect-Reference_Guide_eXo_JCR_1.14-How_does_Job_Scheduler_work-How_can_Job_Scheduler_Service_be_used_in_Kernel">
- <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
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 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>
-
+ </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
id="sect-Reference_Guide_eXo_JCR_1.14-How_does_Job_Scheduler_work-How_can_Job_Scheduler_Service_be_used_in_Kernel">
+ <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
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 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 language="XML" role="XML"><?xml
version="1.0" encoding="UTF-8"?>
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -432,62 +374,62 @@
</configuration></programlisting>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-How_does_Job_Scheduler_work-Samples">
- <title>Samples</title>
- <note>
- <para>
- You can download the project code from <ulink
url="https://github.com/hoatle/job-scheduler-service-tutorial"&...
- </para>
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-How_does_Job_Scheduler_work-Samples">
+ <title>Samples</title>
+ <note>
+ <para>
+ You can download the project code from <ulink
url="https://github.com/hoatle/job-scheduler-service-tutorial"&...
+ </para>
- </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 by using maven archetype plugin:
- </para>
-
+ </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 by using maven archetype plugin:
+ </para>
+
<programlisting>mvn archetype:generate
</programlisting>
- <itemizedlist>
- <listitem>
- <para>
- For project type: select <emphasis
role="bold">maven-archetype-quickstart </emphasis>
- </para>
+ <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 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 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 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>
+ <listitem>
+ <para>
+ For package: select <emphasis
role="bold">org.exoplatform.samples.scheduler</emphasis>
+ </para>
- </listitem>
+ </listitem>
- </itemizedlist>
- <para>
- Edit the pom.xml as follows:
- </para>
-
+ </itemizedlist>
+ <para>
+ Edit the pom.xml as follows:
+ </para>
+
<programlisting language="XML" role="XML"><project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -507,23 +449,23 @@
<name>eXo Samples For Scheduler</name>
<description>eXo Samples Code For Scheduler</description>
</project></programlisting>
- <para>
- Generate an eclipse project by using maven eclipse plugin and then import into
eclipse:
- </para>
-
+ <para>
+ Generate an eclipse project by using maven eclipse plugin and then
import into eclipse:
+ </para>
+
<programlisting>mvn eclipse:eclipse</programlisting>
- <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
id="sect-Reference_Guide_eXo_JCR_1.14-Samples-Define_a_job">
- <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>
-
+ <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
id="sect-Reference_Guide_eXo_JCR_1.14-Samples-Define_a_job">
+ <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 language="Java" role="Java">package
org.exoplatform.samples.scheduler.jobs;
import org.exoplatform.services.log.ExoLogger;
@@ -552,23 +494,23 @@
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 log message: "DumbJob is
executing..."
- </para>
+ <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 log message: "DumbJob is
executing..."
+ </para>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Samples-Job_configuration">
- <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>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Samples-Job_configuration">
+ <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 language="Java" role="Java">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>
-
+ <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 language="XML"
role="XML"><external-component-plugins>
<target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>
<component-plugin>
@@ -591,12 +533,12 @@
</init-params>
</component-plugin>
</external-component-plugins></programlisting>
-
+
<programlisting language="Java" role="Java">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: <ulink
url="http://en.wikipedia.org/wiki/CRON_expression">CRON
expression</ulink>. See the configuration sample below to understand more clearly:
- </para>
-
+ <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: <ulink
url="http://en.wikipedia.org/wiki/CRON_expression">CRON
expression</ulink>. See the configuration sample below to understand more clearly:
+ </para>
+
<programlisting language="XML"
role="XML"><external-component-plugins>
<target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>
<component-plugin>
@@ -617,29 +559,29 @@
</init-params>
</component-plugin>
</external-component-plugins></programlisting>
-
+
<programlisting language="Java" role="Java">public void
addGlobalJobListener(ComponentPlugin plugin) throws Exception;</programlisting>
-
+
<programlisting language="Java" role="Java">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>
-
+ <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 language="Java" role="Java">public void
addGlobalTriggerListener(ComponentPlugin plugin) throws Exception;</programlisting>
-
+
<programlisting language="Java" role="Java">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>
+ <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
id="sect-Reference_Guide_eXo_JCR_1.14-Samples-Run_the_project">
- <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>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Samples-Run_the_project">
+ <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 language="XML" role="XML"><?xml
version="1.0" encoding="UTF-8"?>
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -680,106 +622,106 @@
</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.
- </para>
+ <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.
+ </para>
- </section>
-
+ </section>
+
- </section>
-
+ </section>
+
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Job_Schedule-Reference">
- <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>
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Job_Schedule-Reference">
+ <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>
- </listitem>
- <listitem>
- <para>
- <ulink
url="http://en.wikipedia.org/wiki/Job_scheduler">http://en.w...
- </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink
url="http://en.wikipedia.org/wiki/Job_scheduler">http://en.w...
+ </para>
- </listitem>
- <listitem>
- <para>
- <ulink
url="http://www.theserverside.com/news/1364726/Job-Scheduling-in-J2E...
- </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink
url="http://www.theserverside.com/news/1364726/Job-Scheduling-in-J2E...
+ </para>
- </listitem>
- <listitem>
- <para>
- <ulink
url="http://technet.microsoft.com/en-us/library/cc720070%28WS.10%29....
- </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink
url="http://technet.microsoft.com/en-us/library/cc720070%28WS.10%29....
+ </para>
- </listitem>
+ </listitem>
- </itemizedlist>
+ </itemizedlist>
- </section>
-
+ </section>
+
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Specific_Services-The_data_source_provider">
- <title>The data source provider</title>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-The_data_source_provider-Description">
- <title>Description</title>
- <para>
- The <emphasis>DataSourceProvider</emphasis> is a service used to give
access to a data source in an uniform manner in order to be able to support data sources
that are managed by the application server.
- </para>
- <para>
- <table
id="tabl-Reference_Guide_eXo_JCR_1.14-Description-List_methods">
- <title>List methods</title>
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>
- getDataSource(String dataSourceName)
- </entry>
- <entry>
- Tries to get the data source from a JNDI lookup. If it can be found and the data
source is defined as managed, the service will wrap the original
<emphasis>DataSource</emphasis> instance in a new
<emphasis>DataSource</emphasis> instance that is aware of its
<emphasis>managed</emphasis> state otherwise it will return the original
<emphasis>DataSource</emphasis> instance.
- </entry>
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Specific_Services-The_data_source_provider">
+ <title>The data source provider</title>
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-The_data_source_provider-Description">
+ <title>Description</title>
+ <para>
+ The <emphasis>DataSourceProvider</emphasis> is a service used
to give access to a data source in an uniform manner in order to be able to support data
sources that are managed by the application server.
+ </para>
+ <para>
+ <table
id="tabl-Reference_Guide_eXo_JCR_1.14-Description-List_methods">
+ <title>List methods</title>
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>
+ getDataSource(String dataSourceName)
+ </entry>
+ <entry>
+ Tries to get the data source from a JNDI lookup. If
it can be found and the data source is defined as managed, the service will wrap the
original <emphasis>DataSource</emphasis> instance in a new
<emphasis>DataSource</emphasis> instance that is aware of its
<emphasis>managed</emphasis> state otherwise it will return the original
<emphasis>DataSource</emphasis> instance.
+ </entry>
- </row>
- <row>
- <entry>
- isManaged(String dataSourceName)
- </entry>
- <entry>
- Indicates whether or not the given data source is managed.
- </entry>
+ </row>
+ <row>
+ <entry>
+ isManaged(String dataSourceName)
+ </entry>
+ <entry>
+ Indicates whether or not the given data source is
managed.
+ </entry>
- </row>
+ </row>
- </tbody>
+ </tbody>
- </tgroup>
+ </tgroup>
- </table>
+ </table>
- </para>
+ </para>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-The_data_source_provider-Configuration">
- <title>Configuration</title>
- <para>
- The configuration of the <emphasis>DataSourceProvider</emphasis> should
be defined only if you use managed data sources since by default all the data sources are
considered as not managed. See below the default configuration
- </para>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-The_data_source_provider-Configuration">
+ <title>Configuration</title>
+ <para>
+ The configuration of the
<emphasis>DataSourceProvider</emphasis> should be defined only if you use
managed data sources since by default all the data sources are considered as not managed.
See below the default configuration
+ </para>
+
<programlisting><configuration>
....
<component>
@@ -816,49 +758,49 @@
</component>
...
</configuration></programlisting>
- <table
id="tabl-Reference_Guide_eXo_JCR_1.14-Configuration-Fields_description">
- <title>Fields description</title>
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>
- <emphasis>check-tx-active</emphasis>
- </entry>
- <entry>
- This parameter indicates that the data source needs to check if a transaction is
active to decide if the provided connection needs to be managed or not. If it is set to
<emphasis>false</emphasis>, the data source will provide only managed
connections if the data source itself is managed. By default, this parameter is set to
<emphasis>true</emphasis>. If this parameter is set to
<emphasis>true</emphasis>, it will need the
<emphasis>TransactionService</emphasis> to work properly, so please ensure
that the <emphasis>TransactionService</emphasis> is defined in your
configuration.
- </entry>
+ <table
id="tabl-Reference_Guide_eXo_JCR_1.14-Configuration-Fields_description">
+ <title>Fields description</title>
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>
+ <emphasis>check-tx-active</emphasis>
+ </entry>
+ <entry>
+ This parameter indicates that the data source needs to
check if a transaction is active to decide if the provided connection needs to be managed
or not. If it is set to <emphasis>false</emphasis>, the data source will
provide only managed connections if the data source itself is managed. By default, this
parameter is set to <emphasis>true</emphasis>. If this parameter is set to
<emphasis>true</emphasis>, it will need the
<emphasis>TransactionService</emphasis> to work properly, so please ensure
that the <emphasis>TransactionService</emphasis> is defined in your
configuration.
+ </entry>
- </row>
- <row>
- <entry>
- <emphasis>always-managed</emphasis>
- </entry>
- <entry>
- This parameter indicates that all the data sources are managed. If set to
<emphasis>true</emphasis> the parameter
<emphasis>never-managed</emphasis> and
<emphasis>managed-data-sources</emphasis> will be ignored, so it will consider
all the data sources as managed. By default, this parameter is set to
<emphasis>false</emphasis>.
- </entry>
+ </row>
+ <row>
+ <entry>
+ <emphasis>always-managed</emphasis>
+ </entry>
+ <entry>
+ This parameter indicates that all the data sources are
managed. If set to <emphasis>true</emphasis> the parameter
<emphasis>never-managed</emphasis> and
<emphasis>managed-data-sources</emphasis> will be ignored, so it will consider
all the data sources as managed. By default, this parameter is set to
<emphasis>false</emphasis>.
+ </entry>
- </row>
- <row>
- <entry>
- <emphasis>managed-data-sources</emphasis>
- </entry>
- <entry>
- This parameter indicates the list of all the data sources that are managed, each
value tag can contain a list of data source names separated by a comma. If
<emphasis>always-managed</emphasis> and/or
<emphasis>never-managed</emphasis> is set
<emphasis>true</emphasis> this parameter is ignored.
- </entry>
+ </row>
+ <row>
+ <entry>
+ <emphasis>managed-data-sources</emphasis>
+ </entry>
+ <entry>
+ This parameter indicates the list of all the data sources
that are managed, each value tag can contain a list of data source names separated by a
comma. If <emphasis>always-managed</emphasis> and/or
<emphasis>never-managed</emphasis> is set
<emphasis>true</emphasis> this parameter is ignored.
+ </entry>
- </row>
+ </row>
- </tbody>
+ </tbody>
- </tgroup>
+ </tgroup>
- </table>
+ </table>
- </section>
-
+ </section>
+
- </section>
-
+ </section>
+
</section>
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/PortletDevelopment/Global_Portlet.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/PortletDevelopment/Global_Portlet.xml 2011-11-10
03:29:26 UTC (rev 8019)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/PortletDevelopment/Global_Portlet.xml 2011-11-10
04:45:11 UTC (rev 8020)
@@ -46,19 +46,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
</portlet-app>
-</programlisting>
+</programlisting>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Global_Metadata-Location">
- <title>Location</title>
- <para>
- The path to the global <filename>portlet.xml</filename> is
the value of <literal>gatein.portlet.config</literal> in the
<filename>configuration.properties.xml</filename> file. By default The file
path is
<filename>/<replaceable><JBOSS_HOME></replaceable>/server/<replaceable><PROFILE></replaceable>/conf/gatein/portlet.xml</filename>
- </para>
- <para>
- <emphasis role="bold">For JBoss</emphasis>: The
file path is
<filename><replaceable><JBOSS_HOME></replaceable>/server/default/conf/gatein/portlet.xml</filename>.
- </para>
+ <para>
+ The path to the global <filename>portlet.xml</filename> is the
value of <literal>gatein.portlet.config</literal> in the
<filename>configuration.properties.xml</filename> file. By default The file
path is
<filename>/<replaceable><JBOSS_HOME></replaceable>/server/<replaceable><PROFILE></replaceable>/conf/gatein/portlet.xml</filename>
+ </para>
+ <para>
+ <emphasis role="bold">For JBoss</emphasis>: The file
path is
<filename><replaceable><JBOSS_HOME></replaceable>/server/default/conf/gatein/portlet.xml</filename>.
+ </para>
- </section>
-
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Global_Metadata-Global_Metadata_Elements">
<title>Global Metadata Elements</title>
<para>
@@ -67,7 +63,7 @@
<orderedlist>
<listitem>
<para>
- Portlet Filter
+ <xref
linkend="form-Reference_Guide_eXo_JCR_1.14-Global_Metadata_Elements-Portlet_Filter"/>
</para>
</listitem>
@@ -85,24 +81,25 @@
</listitem>
</orderedlist>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Global_Metadata_Elements-Portlet_Filter">
+ <formalpara
id="form-Reference_Guide_eXo_JCR_1.14-Global_Metadata_Elements-Portlet_Filter">
<title>Portlet Filter</title>
<para>
Portlet filter mappings declared in the global
<filename>portlet.xml</filename> file are applied across portlet
applications.
</para>
+ </formalpara>
<para>
With the XML configuration below, the filter
<literal>ApplicationMonitoringFilter</literal> involves in request handling on
any deployed portlet.
</para>
-<programlisting language="XML"
role="XML"><filter>
-<filter-name>org.exoplatform.portal.application.ApplicationMonitoringFilter</filter-name>
-<filter-class>org.exoplatform.portal.application.ApplicationMonitoringFilter</filter-class>
- <lifecycle>ACTION_PHASE</lifecycle>
- <lifecycle>RENDER_PHASE</lifecycle>
- <lifecycle>EVENT_PHASE</lifecycle>
- <lifecycle>RESOURCE_PHASE</lifecycle>
-</filter>
-</programlisting>
+<programlisting role="XML"
language="XML"><![CDATA[<filter>
+<filter-name>org.exoplatform.portal.application.ApplicationMonitoringFilter</filter-name>
+<filter-class>org.exoplatform.portal.application.ApplicationMonitoringFilter</filter-class>
+ <lifecycle>ACTION_PHASE</lifecycle>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ <lifecycle>EVENT_PHASE</lifecycle>
+ <lifecycle>RESOURCE_PHASE</lifecycle>
+</filter>
+]]></programlisting>
<para>
<emphasis role="bold">Application Monitoring
Filter</emphasis> supports four lifecycle phases in the order below:
</para>
@@ -137,14 +134,7 @@
The Application Monitoring Filter records statistic information about
deployed portlets. The filter alternates the actual monitoring mechanism in WebUI
Framework.
</para>
- </section>
-
+ </section>
- </section>
-
-
- </section>
-
-
</chapter>