exo-jcr SVN: r1918 - jcr/trunk/applications.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-02-19 03:53:30 -0500 (Fri, 19 Feb 2010)
New Revision: 1918
Modified:
jcr/trunk/applications/pom.xml
Log:
EXOJCR-521 cluster.test.client moved to exo.jcr.component.cluster.test.client according to Maven best practice : module name = artifactId
Modified: jcr/trunk/applications/pom.xml
===================================================================
--- jcr/trunk/applications/pom.xml 2010-02-19 08:38:42 UTC (rev 1917)
+++ jcr/trunk/applications/pom.xml 2010-02-19 08:53:30 UTC (rev 1918)
@@ -35,7 +35,7 @@
<description>eXo JCR Applications Reactor</description>
<modules>
- <module>cluster.test.client</module>
+ <module>exo.jcr.component.cluster.test.client</module>
<module>exo.jcr.applications.backupconsole</module>
<module>exo.jcr.applications.browser</module>
<module>exo.jcr.applications.config</module>
16 years, 2 months
exo-jcr SVN: r1917 - jcr/trunk/applications.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-02-19 03:38:42 -0500 (Fri, 19 Feb 2010)
New Revision: 1917
Added:
jcr/trunk/applications/exo.jcr.component.cluster.test.client/
Removed:
jcr/trunk/applications/cluster.test.client/
Log:
EXOJCR-521 cluster.test.client moved to exo.jcr.component.cluster.test.client according to Maven best practice : module name = artifactId
Copied: jcr/trunk/applications/exo.jcr.component.cluster.test.client (from rev 1916, jcr/trunk/applications/cluster.test.client)
16 years, 2 months
exo-jcr SVN: r1916 - in kernel/trunk/exo.kernel.container/src: main/java/org/exoplatform/container/definition and 3 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-02-18 15:52:14 -0500 (Thu, 18 Feb 2010)
New Revision: 1916
Added:
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/portal-container-config-with-settings.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/portal-container-test-settings-configuration.xml
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
Log:
EXOJCR-528: Unit tests for the PortalContainer has been added
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java 2010-02-18 17:56:36 UTC (rev 1915)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java 2010-02-18 20:52:14 UTC (rev 1916)
@@ -154,6 +154,7 @@
{
MockServletContext scontext = new MockServletContext(name);
pcontainer = new PortalContainer(this, scontext);
+ PortalContainer.setInstance(pcontainer);
ConfigurationManagerImpl cService = new MockConfigurationManagerImpl(scontext);
cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/configuration.xml"));
cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/test-configuration.xml"));
@@ -161,7 +162,6 @@
pcontainer.registerComponentInstance(ConfigurationManager.class, cService);
pcontainer.initContainer();
registerComponentInstance(name, pcontainer);
- PortalContainer.setInstance(pcontainer);
pcontainer.start();
}
catch (Exception ex)
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-02-18 17:56:36 UTC (rev 1915)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-02-18 20:52:14 UTC (rev 1916)
@@ -66,7 +66,7 @@
/**
* The name of the setting corresponding to the rest context name
*/
- public static final String REST_CONTEXT_SETTING_NAME = "rest.context";
+ public static final String REST_CONTEXT_SETTING_NAME = "rest";
/**
* The name of the setting corresponding to the relam name
Added: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java 2010-02-18 20:52:14 UTC (rev 1916)
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.container;
+
+import org.exoplatform.container.jmx.AbstractTestContainer;
+import org.exoplatform.container.support.ContainerBuilder;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+
+import java.net.URL;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 18 f�vr. 2010
+ */
+public class TestPortalContainer extends AbstractTestContainer
+{
+ public void testInitValues()
+ {
+ createRootContainer("portal-container-config-with-settings.xml");
+ assertEquals("myPortal", PortalContainer.DEFAULT_PORTAL_CONTAINER_NAME);
+ assertEquals("myRest", PortalContainer.DEFAULT_REST_CONTEXT_NAME);
+ assertEquals("my-exo-domain", PortalContainer.DEFAULT_REALM_NAME);
+ // With portal container with no portal container
+ PortalContainer portal = PortalContainer.getInstance();
+ assertEquals("myPortal", portal.getName());
+ assertEquals("myRest", portal.getRestContextName());
+ assertEquals("my-exo-domain", portal.getRealmName());
+
+ assertTrue(PortalContainer.isPortalContainerName("myPortal"));
+ assertTrue(PortalContainer.isPortalContainerName("portal"));
+ assertFalse(PortalContainer.isPortalContainerName("foo"));
+
+ URL rootURL = getClass().getResource("portal-container-config-with-settings.xml");
+ URL portalURL = getClass().getResource("portal-container-test-settings-configuration.xml");
+ assertNotNull(rootURL);
+ assertNotNull(portalURL);
+ //
+ new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
+ // With portal container with no portal container
+ portal = PortalContainer.getInstance();
+ assertEquals("portal", portal.getName());
+ assertEquals("myRest-pcdef", portal.getRestContextName());
+ assertEquals("my-exo-domain-pcdef", portal.getRealmName());
+
+ assertNotNull(portal.getContext());
+ assertEquals("portal", portal.getContext().getPortalContainerName());
+ assertEquals("myRest-pcdef", portal.getContext().getRestContextName());
+ assertEquals("my-exo-domain-pcdef", portal.getContext().getRealmName());
+
+ assertEquals("portal", PortalContainer.getCurrentPortalContainerName());
+ assertEquals("myRest-pcdef", PortalContainer.getCurrentRestContextName());
+ assertEquals("my-exo-domain-pcdef", PortalContainer.getCurrentRealmName());
+
+ assertEquals("myRest-pcdef", PortalContainer.getRestContextName("portal"));
+ assertEquals("my-exo-domain-pcdef", PortalContainer.getRealmName("portal"));
+ assertEquals("myRest", PortalContainer.getRestContextName("foo"));
+ assertEquals("my-exo-domain", PortalContainer.getRealmName("foo"));
+
+ assertTrue(PortalContainer.isPortalContainerName("myPortal"));
+ assertTrue(PortalContainer.isPortalContainerName("portal"));
+ assertFalse(PortalContainer.isPortalContainerName("foo"));
+
+ // With no portal container
+ PortalContainer.setInstance(null);
+
+ assertEquals("myPortal", PortalContainer.getCurrentPortalContainerName());
+ assertEquals("myRest", PortalContainer.getCurrentRestContextName());
+ assertEquals("my-exo-domain", PortalContainer.getCurrentRealmName());
+
+ assertTrue(PortalContainer.isPortalContainerName("myPortal"));
+ assertTrue(PortalContainer.isPortalContainerName("portal"));
+ assertFalse(PortalContainer.isPortalContainerName("foo"));
+ }
+
+ public void testSettings()
+ {
+ URL rootURL = getClass().getResource("portal-container-config-with-settings.xml");
+ URL portalURL = getClass().getResource("portal-container-test-settings-configuration.xml");
+ assertNotNull(rootURL);
+ assertNotNull(portalURL);
+ //
+ new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
+ // With portal container
+ PortalContainer portal = PortalContainer.getInstance();
+ MyComponent component = (MyComponent)portal.getComponentInstanceOfType(MyComponent.class);
+ assertNotNull(component);
+ assertEquals("portal", component.getValue("portal"));
+ assertEquals("myRest-pcdef", component.getValue("rest"));
+ assertEquals("my-exo-domain-pcdef", component.getValue("realm"));
+ assertEquals("value", component.getValue("foo"));
+ assertEquals("before value after", component.getValue("before foo after"));
+
+ assertEquals("value", portal.getSetting("foo"));
+ assertNull(portal.getSetting("foo2"));
+ assertEquals("value", portal.getSetting("string"));
+ assertEquals(new Integer(10), portal.getSetting("int"));
+ assertEquals(new Long(10), portal.getSetting("long"));
+ assertEquals(new Double(10), portal.getSetting("double"));
+ assertEquals(new Boolean(true), portal.getSetting("boolean"));
+
+ assertNotNull(portal.getContext());
+ assertEquals("value", portal.getContext().getSetting("foo"));
+ assertNull(portal.getContext().getSetting("foo2"));
+ assertEquals("value", portal.getContext().getSetting("string"));
+ assertEquals(new Integer(10), portal.getContext().getSetting("int"));
+ assertEquals(new Long(10), portal.getContext().getSetting("long"));
+ assertEquals(new Double(10), portal.getContext().getSetting("double"));
+ assertEquals(new Boolean(true), portal.getContext().getSetting("boolean"));
+
+ assertEquals("value", PortalContainer.getCurrentSetting("foo"));
+ assertNull(PortalContainer.getCurrentSetting("foo2"));
+ assertEquals("value", PortalContainer.getCurrentSetting("string"));
+ assertEquals(new Integer(10), PortalContainer.getCurrentSetting("int"));
+ assertEquals(new Long(10), PortalContainer.getCurrentSetting("long"));
+ assertEquals(new Double(10), PortalContainer.getCurrentSetting("double"));
+ assertEquals(new Boolean(true), PortalContainer.getCurrentSetting("boolean"));
+
+ assertEquals("value", PortalContainer.getSetting("portal", "foo"));
+ assertNull(PortalContainer.getSetting("portal", "foo2"));
+ assertEquals("value", PortalContainer.getSetting("portal", "string"));
+ assertEquals(new Integer(10), PortalContainer.getSetting("portal", "int"));
+ assertEquals(new Long(10), PortalContainer.getSetting("portal", "long"));
+ assertEquals(new Double(10), PortalContainer.getSetting("portal", "double"));
+ assertEquals(new Boolean(true), PortalContainer.getSetting("portal", "boolean"));
+
+ assertNull(PortalContainer.getSetting("foo", "foo"));
+ assertNull(PortalContainer.getSetting("foo", "foo2"));
+ assertNull(PortalContainer.getSetting("foo", "string"));
+ assertNull(PortalContainer.getSetting("foo", "int"));
+ assertNull(PortalContainer.getSetting("foo", "long"));
+ assertNull(PortalContainer.getSetting("foo", "double"));
+ assertNull(PortalContainer.getSetting("foo", "boolean"));
+
+ // With no portal container
+ PortalContainer.setInstance(null);
+
+ assertNull(PortalContainer.getCurrentSetting("foo"));
+ assertNull(PortalContainer.getCurrentSetting("foo2"));
+ assertNull(PortalContainer.getCurrentSetting("string"));
+ assertNull(PortalContainer.getCurrentSetting("int"));
+ assertNull(PortalContainer.getCurrentSetting("long"));
+ assertNull(PortalContainer.getCurrentSetting("double"));
+ assertNull(PortalContainer.getCurrentSetting("boolean"));
+ }
+
+ public static class MyComponent
+ {
+ private final InitParams params;
+ public MyComponent(InitParams params)
+ {
+ this.params = params;
+ }
+
+ public String getValue(String name)
+ {
+ final ValueParam vp = params.getValueParam(name);
+ return vp == null ? null : vp.getValue();
+ }
+ }
+}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-02-18 17:56:36 UTC (rev 1915)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-02-18 20:52:14 UTC (rev 1916)
@@ -1,5 +1,3 @@
-package org.exoplatform.container.definition;
-
/*
* Copyright (C) 2003-2010 eXo Platform SAS.
*
@@ -16,6 +14,8 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see<http://www.gnu.org/licenses/>.
*/
+package org.exoplatform.container.definition;
+
import org.exoplatform.container.RootContainer;
import org.exoplatform.container.jmx.AbstractTestContainer;
import org.exoplatform.container.monitor.jvm.J2EEServerInfo;
@@ -31,7 +31,7 @@
public class TestPortalContainerConfig extends AbstractTestContainer
{
- public void testInitValues() throws Exception
+ public void testInitValues()
{
RootContainer rootContainer = createRootContainer("empty-config.xml");
PortalContainerConfig config =
@@ -260,8 +260,12 @@
}
finally
{
- if (oldPath != null)
+ if (oldPath == null)
{
+ System.getProperties().remove(J2EEServerInfo.EXO_CONF_PARAM);
+ }
+ else
+ {
System.setProperty(J2EEServerInfo.EXO_CONF_PARAM, oldPath);
}
}
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/portal-container-config-with-settings.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/portal-container-config-with-settings.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/portal-container-config-with-settings.xml 2010-02-18 20:52:14 UTC (rev 1916)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>portal</string>
+ </field>
+ <!-- The name of the context name of the rest web application -->
+ <field name="restContextName">
+ <string>myRest-pcdef</string>
+ </field>
+ <!-- The name of the realm -->
+ <field name="realmName">
+ <string>my-exo-domain-pcdef</string>
+ </field>
+ <!-- A map of settings tied to the portal container -->
+ <field name="settings">
+ <map type="java.util.HashMap">
+ <entry>
+ <key>
+ <string>foo</string>
+ </key>
+ <value>
+ <string>value</string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>string</string>
+ </key>
+ <value>
+ <string>value</string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>int</string>
+ </key>
+ <value>
+ <int>10</int>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>long</string>
+ </key>
+ <value>
+ <long>10</long>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>double</string>
+ </key>
+ <value>
+ <double>10</double>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>boolean</string>
+ </key>
+ <value>
+ <boolean>true</boolean>
+ </value>
+ </entry>
+ </map>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/portal-container-test-settings-configuration.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/portal-container-test-settings-configuration.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/portal-container-test-settings-configuration.xml 2010-02-18 20:52:14 UTC (rev 1916)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.TestPortalContainer$MyComponent</type>
+ <init-params>
+ <!-- The name of the portal container -->
+ <value-param>
+ <name>portal</name>
+ <value>${portal.container.name}</value>
+ </value-param>
+ <!-- The name of the rest ServletContext -->
+ <value-param>
+ <name>rest</name>
+ <value>${portal.container.rest}</value>
+ </value-param>
+ <!-- The name of the realm -->
+ <value-param>
+ <name>realm</name>
+ <value>${portal.container.realm}</value>
+ </value-param>
+ <value-param>
+ <name>foo</name>
+ <value>${portal.container.foo}</value>
+ </value-param>
+ <value-param>
+ <name>before foo after</name>
+ <value>before ${portal.container.foo} after</value>
+ </value-param>
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
16 years, 2 months
exo-jcr SVN: r1915 - in kernel/trunk/exo.kernel.container/src: main/java/org/exoplatform/container/configuration and 9 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-02-18 12:56:36 -0500 (Thu, 18 Feb 2010)
New Revision: 1915
Added:
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/empty-config.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-both-settings.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-external-settings.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-external-settings2.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-settings.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values-but-with-portal-def.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal/
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal/myPortal-pcdef/
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal/myPortal-pcdef/settings.properties
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/settings.properties
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ExoContainerContext.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PortalContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManagerImpl.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinition.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Deserializer.java
Log:
EXOJCR-528
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ExoContainerContext.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ExoContainerContext.java 2010-02-18 17:44:11 UTC (rev 1914)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ExoContainerContext.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -70,7 +70,7 @@
/**
* @return if the embedded container is a {@link PortalContainer}, it will return the name
- * of the rest context name related to the portal container otherwise it will return the default name
+ * of the rest context related to the portal container otherwise it will return the default name
*/
public String getRestContextName()
{
@@ -83,7 +83,7 @@
/**
* @return if the embedded container is a {@link PortalContainer}, it will return the name
- * of the realm name related to the portal container otherwise it will return the default name
+ * of the realm related to the portal container otherwise it will return the default name
*/
public String getRealmName()
{
@@ -94,6 +94,19 @@
return PortalContainer.DEFAULT_REALM_NAME;
}
+ /**
+ * @return if the embedded container is a {@link PortalContainer}, it will return the value
+ * of the setting related to the portal container otherwise it will return <code>null</code>
+ */
+ public Object getSetting(String settingName)
+ {
+ if (container instanceof PortalContainer)
+ {
+ return ((PortalContainer)container).getSetting(settingName);
+ }
+ return null;
+ }
+
public String getName()
{
return name;
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PortalContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PortalContainer.java 2010-02-18 17:44:11 UTC (rev 1914)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PortalContainer.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -27,8 +27,6 @@
import org.exoplatform.management.jmx.annotations.NameTemplate;
import org.exoplatform.management.jmx.annotations.NamingContext;
import org.exoplatform.management.jmx.annotations.Property;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
import java.util.Collections;
import java.util.Comparator;
@@ -47,16 +45,11 @@
*/
@Managed
@NamingContext(@Property(key = "portal", value = "{Name}"))
-@NameTemplate({@Property(key = "container", value = "portal"),@Property(key = "name", value = "{Name}")})
+@NameTemplate({@Property(key = "container", value = "portal"), @Property(key = "name", value = "{Name}")})
public class PortalContainer extends ExoContainer implements SessionManagerContainer
{
/**
- * Logger
- */
- private static final Log log = ExoLogger.getLogger(PortalContainer.class);
-
- /**
* The default name of the portal container
*/
public static final String DEFAULT_PORTAL_CONTAINER_NAME;
@@ -145,7 +138,8 @@
pinfo_ = new PortalContainerInfo(portalContext);
registerComponentInstance(PortalContainerInfo.class, pinfo_);
this.name = portalContext.getServletContextName();
- final List<String> dependencies = parent.getPortalContainerConfig().getDependencies(name);
+ final PortalContainerConfig config = parent.getPortalContainerConfig();
+ final List<String> dependencies = config == null ? null : config.getDependencies(name);
if (dependencies == null || dependencies.isEmpty())
{
// No order is required
@@ -334,7 +328,7 @@
public static PortalContainer getInstanceIfPresent()
{
ExoContainer container = ExoContainerContext.getCurrentContainerIfPresent();
- if (container instanceof PortalContainer)
+ if (container instanceof PortalContainer)
{
return (PortalContainer)container;
}
@@ -412,7 +406,7 @@
}
/**
- * We first try to get the ExoContainer that has been stored in the ThreadLocal
+ * We first try to get the ExoContainer that has been stored into the ThreadLocal
* if the value is of type PortalContainer, we return it otherwise we get the
* portal container corresponding the given servlet context
*
@@ -429,7 +423,7 @@
}
/**
- * Returns the name of the current portal container that has been stored in the ThreadLocal. If no
+ * Returns the name of the current portal container that has been stored into the ThreadLocal. If no
* value can be found the value of PortalContainer.DEFAULT_PORTAL_CONTAINER_NAME will be used
*/
public static String getCurrentPortalContainerName()
@@ -447,7 +441,7 @@
/**
* Returns the name of the current rest context corresponding to the portal container
- * that has been stored in the ThreadLocal. If no value can be found the value of
+ * that has been stored into the ThreadLocal. If no value can be found the value of
* PortalContainer.DEFAULT_REST_CONTEXT_NAME will be used
*/
public static String getCurrentRestContextName()
@@ -480,7 +474,7 @@
/**
* Returns the name of the current realm corresponding to the portal container
- * that has been stored in the ThreadLocal. If no value can be found the value of
+ * that has been stored into the ThreadLocal. If no value can be found the value of
* PortalContainer.DEFAULT_REALM_NAME will be used
*/
public static String getCurrentRealmName()
@@ -512,6 +506,43 @@
}
/**
+ * Returns the current value of the setting corresponding to the portal container
+ * that has been stored into the ThreadLocal. If no value can be found, <code>null</code> will be
+ * returned
+ * @param settingName the name of the setting wanted
+ */
+ public static Object getCurrentSetting(String settingName)
+ {
+ final String containerName = getCurrentPortalContainerName();
+ return getSetting(containerName, settingName);
+ }
+
+ /**
+ * Returns the value of the setting corresponding to the given portal container name
+ * and the given setting name
+ * @param portalContainerName the name of the portal container for which we want the
+ * name of the value of the setting
+ * @param settingName the name of the setting wanted
+ */
+ public static Object getSetting(String portalContainerName, String settingName)
+ {
+ if (CONFIG == null)
+ {
+ return null;
+ }
+ return CONFIG.getSetting(portalContainerName, settingName);
+ }
+
+ /**
+ * Returns the value of the setting corresponding to the current portal container
+ * @param settingName the name of the setting wanted
+ */
+ public Object getSetting(String settingName)
+ {
+ return getSetting(getName(), settingName);
+ }
+
+ /**
* Indicates if the given servlet context is a dependency of the given portal container
* @param container the portal container
* @param context the {@link ServletContext}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java 2010-02-18 17:44:11 UTC (rev 1914)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -18,11 +18,9 @@
*/
package org.exoplatform.container;
-import org.exoplatform.commons.utils.PropertiesLoader;
import org.exoplatform.commons.utils.PropertyManager;
-import org.exoplatform.commons.utils.Tools;
import org.exoplatform.container.configuration.ConfigurationManager;
-import org.exoplatform.container.xml.Deserializer;
+import org.exoplatform.container.util.ContainerUtil;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.PropertiesParam;
import org.exoplatform.container.xml.Property;
@@ -31,11 +29,8 @@
import org.exoplatform.services.log.Log;
import org.picocontainer.Startable;
-import java.io.IOException;
-import java.io.InputStream;
import java.net.URL;
import java.util.Iterator;
-import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
@@ -104,69 +99,24 @@
if (path != null)
{
log.debug("Found property file path " + path);
- InputStream in = null;
try
{
URL url = confManager.getURL(path);
-
- //
- if (url != null)
+ Map<String, String> props = ContainerUtil.loadProperties(url);
+ if (props != null)
{
- in = url.openStream();
- }
-
- //
- if (in != null)
- {
- LinkedHashMap<String, String> props = null;
- String fileName = url.getFile();
- if (Tools.endsWithIgnoreCase(path, ".properties"))
+ for (Map.Entry<String, String> entry : props.entrySet())
{
- log.debug("Attempt to load property file " + path);
- props = PropertiesLoader.load(in);
+ String propertyName = entry.getKey();
+ String propertyValue = entry.getValue();
+ PropertyManager.setProperty(propertyName, propertyValue);
}
- else if (Tools.endsWithIgnoreCase(fileName, ".xml"))
- {
- log.debug("Attempt to load property file " + path + " with XML format");
- props = PropertiesLoader.loadFromXML(in);
- }
- else
- {
- log.debug("Will not load property file" + path + " because its format is not recognized");
- }
- if (props != null)
- {
- for (Map.Entry<String, String> entry : props.entrySet())
- {
- String propertyName = entry.getKey();
- String propertyValue = entry.getValue();
- propertyValue = Deserializer.resolveString(propertyValue);
- PropertyManager.setProperty(propertyName, propertyValue);
- }
- }
}
- else
- {
- log.error("Could not load property file " + path);
- }
}
catch (Exception e)
{
log.error("Cannot load property file " + path, e);
}
- finally
- {
- if (in != null)
- {
- try
- {
- in.close();
- }
- catch (IOException ignore)
- {
- }
- }
- }
}
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java 2010-02-18 17:44:11 UTC (rev 1914)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -162,7 +162,6 @@
pcontainer.initContainer();
registerComponentInstance(name, pcontainer);
PortalContainer.setInstance(pcontainer);
- ExoContainerContext.setCurrentContainer(pcontainer);
pcontainer.start();
}
catch (Exception ex)
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManagerImpl.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManagerImpl.java 2010-02-18 17:44:11 UTC (rev 1914)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManagerImpl.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -18,12 +18,9 @@
*/
package org.exoplatform.container.configuration;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.RootContainer;
import org.exoplatform.container.xml.Component;
import org.exoplatform.container.xml.Configuration;
+import org.exoplatform.container.xml.Deserializer;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -55,8 +52,6 @@
final static public boolean LOG_DEBUG = System.getProperty(LOG_DEBUG_PROPERTY) != null;
- private static final String EXO_CONTAINER_PROP_NAME = "container.name.suffix";
-
private static final Log log = ExoLogger.getLogger(ConfigurationManagerImpl.class);
protected Configuration configurations_;
@@ -311,7 +306,7 @@
}
else if (url.startsWith("file:"))
{
- url = resolveSystemProperties(url);
+ url = Deserializer.resolveVariables(url);
return new URL(url);
}
else if (url.indexOf(":") < 0 && contextPath != null)
@@ -321,79 +316,6 @@
return null;
}
- /**
- *
- * @param input the input
- * @return the resolved input
- */
- public static String resolveSystemProperties(String input)
- {
- final int NORMAL = 0;
- final int SEEN_DOLLAR = 1;
- final int IN_BRACKET = 2;
- if (input == null)
- return input;
- char[] chars = input.toCharArray();
- StringBuffer buffer = new StringBuffer();
- boolean properties = false;
- int state = NORMAL;
- int start = 0;
- for (int i = 0; i < chars.length; ++i)
- {
- char c = chars[i];
- if (c == '$' && state != IN_BRACKET)
- state = SEEN_DOLLAR;
- else if (c == '{' && state == SEEN_DOLLAR)
- {
- buffer.append(input.substring(start, i - 1));
- state = IN_BRACKET;
- start = i - 1;
- }
- else if (state == SEEN_DOLLAR)
- state = NORMAL;
- else if (c == '}' && state == IN_BRACKET)
- {
- if (start + 2 == i)
- {
- buffer.append("${}");
- }
- else
- {
- String value = null;
- String key = input.substring(start + 2, i);
- if (key.equals(EXO_CONTAINER_PROP_NAME))
- {
- // The requested key is the name of current container
- ExoContainer container = ExoContainerContext.getCurrentContainerIfPresent();
- if (container instanceof PortalContainer)
- {
- // The current container is a portal container
- RootContainer rootContainer = (RootContainer)ExoContainerContext.getTopContainer();
- value = rootContainer.isPortalContainerConfigAware() ? "_" + container.getContext().getName() : "";
- }
- }
- else
- {
- value = System.getProperty(key);
- }
- if (value != null)
- {
- properties = true;
- buffer.append(value);
- }
- }
- start = i + 1;
- state = NORMAL;
- }
- }
- if (properties == false)
- return input;
- if (start != chars.length)
- buffer.append(input.substring(start, chars.length));
- return buffer.toString();
-
- }
-
public boolean isDefault(String value)
{
return value == null || value.length() == 0 || "default".equals(value);
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-02-18 17:44:11 UTC (rev 1914)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -20,10 +20,19 @@
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.monitor.jvm.J2EEServerInfo;
+import org.exoplatform.container.util.ContainerUtil;
+import org.exoplatform.container.xml.Deserializer;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import org.picocontainer.Startable;
+import java.io.File;
+import java.lang.reflect.Method;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -44,8 +53,27 @@
*/
public class PortalContainerConfig implements Startable
{
+ /**
+ * The logger
+ */
+ private static final Log log = ExoLogger.getLogger(PortalContainerConfig.class);
/**
+ * The name of the setting corresponding to the portal container name
+ */
+ public static final String PORTAL_CONTAINER_SETTING_NAME = "name";
+
+ /**
+ * The name of the setting corresponding to the rest context name
+ */
+ public static final String REST_CONTEXT_SETTING_NAME = "rest.context";
+
+ /**
+ * The name of the setting corresponding to the relam name
+ */
+ public static final String REALM_SETTING_NAME = "realm";
+
+ /**
* The default name of a portal container
*/
public static final String DEFAULT_PORTAL_CONTAINER_NAME = "portal";
@@ -96,13 +124,30 @@
private Map<String, PortalContainerDefinition> definitions =
Collections.unmodifiableMap(new HashMap<String, PortalContainerDefinition>());
- public PortalContainerConfig()
+ /**
+ * The configuration manager
+ */
+ private final ConfigurationManager cm;
+
+ /**
+ * Some info about the current server
+ */
+ private final J2EEServerInfo serverInfo;
+
+ public PortalContainerConfig(ConfigurationManager cm)
{
- this(null);
+ this(null, cm, new J2EEServerInfo());
}
- public PortalContainerConfig(InitParams params)
+ public PortalContainerConfig(ConfigurationManager cm, J2EEServerInfo serverInfo)
{
+ this(null, cm, serverInfo);
+ }
+
+ public PortalContainerConfig(InitParams params, ConfigurationManager cm, J2EEServerInfo serverInfo)
+ {
+ this.cm = cm;
+ this.serverInfo = serverInfo;
if (params == null)
{
return;
@@ -245,6 +290,7 @@
}
return result.get(0);
}
+
/**
* Gives all the dependencies related to the given portal container
* @param portalContainerName the name of the portal container for which we want the dependencies
@@ -257,6 +303,28 @@
}
/**
+ * Give the value of a given setting for a given portal container name
+ * @param portalContainerName the name of the portal container for which we want the value of the
+ * setting
+ * @param settingName the name of the setting that we seek
+ * @return the value of the setting, <code>null</code> if it cans not be found.
+ */
+ public Object getSetting(String portalContainerName, String settingName)
+ {
+ if (settingName == null)
+ {
+ throw new IllegalArgumentException("The setting name cannot be null");
+ }
+ final PortalContainerDefinition definition = definitions.get(portalContainerName);
+ if (definition == null)
+ {
+ return null;
+ }
+ final Map<String, Object> settings = definition.getSettings();
+ return settings == null ? null : settings.get(settingName);
+ }
+
+ /**
* Gives the name of the rest {@link ServletContext} related to the given portal container
* @param portalContainerName the name of the portal container for which we want the rest context name
* @return the name of the related rest context name. It tries to get it from the {@link PortalContainerDefinition}
@@ -361,7 +429,7 @@
private void registerDependencies(PortalContainerDefinition definition, Map<String, List<String>> scopes)
{
final List<String> dependencies = definition.getDependencies();
- if (definition == null || dependencies.isEmpty())
+ if (dependencies == null || dependencies.isEmpty())
{
return;
}
@@ -388,6 +456,121 @@
}
/**
+ * Initialize all the settings tied to the corresponding portal container. It will first initialize
+ * a new {@link Map} of settings from the settings retrieved from PortalContainerDefinition.getSettings(),
+ * then it will add the external settings corresponding the properties file found at the path
+ * PortalContainerDefinition.getExternalSettingsPath(), if such file exists. If the same key has been
+ * defined in both, the value defined in the external settings will be kept. Then we will add the main
+ * settings such as the portal container name, the realm name and the rest context name.
+ * @param def the {@link PortalContainerDefinition} from which we have the extract the settings and in
+ * which we have to re-inject the final settings
+ */
+ private void initializeSettings(PortalContainerDefinition def)
+ {
+ final Map<String, Object> settings = new HashMap<String, Object>();
+ // We first load the settings of the PortalContainerDefinition if they exist
+ final Map<String, Object> tmpSettings = def.getSettings();
+ if (tmpSettings != null && !tmpSettings.isEmpty())
+ {
+ settings.putAll(tmpSettings);
+ }
+ // We then load the external settings, if they exists
+ String path = def.getExternalSettingsPath();
+ if (path != null && (path = path.trim()).length() > 0)
+ {
+ try
+ {
+ URL url = null;
+ if (path.indexOf(':') == -1)
+ {
+ // We first check if the file is not in eXo configuration directory
+ String fullPath = serverInfo.getExoConfigurationDirectory() + "/portal/" + def.getName() + "/" + path;
+ File file = new File(fullPath);
+ if (file.exists())
+ {
+ // The file exists so we will use it
+ url = file.toURI().toURL();
+ }
+ }
+ if (url == null)
+ {
+ // We assume that the path is an eXo standard path
+ url = cm.getURL(path);
+ }
+ // We load the properties from the url found
+ final Map<String, String> props = ContainerUtil.loadProperties(url);
+ if (props != null && !props.isEmpty())
+ {
+ if (settings.isEmpty())
+ {
+ // No settings exist so we can add everything
+ settings.putAll(props);
+ }
+ else
+ {
+ // Some settings exists so we need to be careful if we override properties
+ // We need to try to keep the same type if possible
+ for (Map.Entry<String, String> entry : props.entrySet())
+ {
+ String propertyName = entry.getKey();
+ Object propertyValue = entry.getValue();
+ propertyValue = Deserializer.resolveString((String)propertyValue);
+ Object oldValue = settings.get(propertyName);
+ if (oldValue != null)
+ {
+ // The value is not null so we need to convert the String into
+ // the target type, we will convert thanks to the static method
+ // valueOf(String value) if it exist for the target type
+ Method m = null;
+ try
+ {
+ // First we check if the method exists
+ m = oldValue.getClass().getMethod("valueOf", String.class);
+ }
+ catch (Exception e)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("The static method valueOf(String) cannot be found for the class "
+ + oldValue.getClass(), e);
+ }
+ }
+ if (m != null)
+ {
+ // The method could be found, thus we will try to convert the value
+ try
+ {
+ propertyValue = m.invoke(null, propertyValue);
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot convert the value '" + propertyValue + "' to an Object of type "
+ + oldValue.getClass(), e);
+ }
+ }
+ }
+ // We set the new value
+ settings.put(propertyName, propertyValue);
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot load property file " + path, e);
+ }
+ }
+ // We then add the portal container name
+ settings.put(PORTAL_CONTAINER_SETTING_NAME, def.getName());
+ // We add the rest context name
+ settings.put(REST_CONTEXT_SETTING_NAME, def.getRestContextName());
+ // We add the realm name
+ settings.put(REALM_SETTING_NAME, def.getRealmName());
+ // We re-inject the settings and we make sure it is thread safe
+ def.setSettings(Collections.unmodifiableMap(settings));
+ }
+
+ /**
* Initialize the current component
* @param mDefinitions the list of all the portal container definition to treat
*/
@@ -429,6 +612,7 @@
this.defaultRealmName = definition.getRealmName();
}
registerDependencies(definition, mScopes);
+ initializeSettings(definition);
}
this.portalContainerNames = Collections.unmodifiableList(lPortalContainerNames);
this.scopes = Collections.unmodifiableMap(mScopes);
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinition.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinition.java 2010-02-18 17:44:11 UTC (rev 1914)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinition.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -21,6 +21,7 @@
import org.exoplatform.container.PortalContainer;
import java.util.List;
+import java.util.Map;
import javax.servlet.ServletContext;
@@ -46,18 +47,29 @@
* The realm name of the related {@link PortalContainer}
*/
private String realmName;
-
+
/**
* The name of the {@link ServletContext} of the rest web application
*/
private String restContextName;
-
+
/**
* The list of all the context names that are needed to initialized properly the
* {@link PortalContainer}. The order of all the dependencies will define the initialization order
*/
private List<String> dependencies;
+ /**
+ * A {@link Map} of parameters that we would like to tie the portal container. Those parameters
+ * could have any type of value.
+ */
+ private Map<String, Object> settings;
+
+ /**
+ * The path of the external properties file to load as default settings to the portal container.
+ */
+ private String externalSettingsPath;
+
public String getName()
{
return name;
@@ -97,4 +109,24 @@
{
this.restContextName = restContextName;
}
+
+ public Map<String, Object> getSettings()
+ {
+ return settings;
+ }
+
+ public void setSettings(Map<String, Object> settings)
+ {
+ this.settings = settings;
+ }
+
+ public String getExternalSettingsPath()
+ {
+ return externalSettingsPath;
+ }
+
+ public void setExternalSettingsPath(String externalSettingsPath)
+ {
+ this.externalSettingsPath = externalSettingsPath;
+ }
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java 2010-02-18 17:44:11 UTC (rev 1914)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -18,19 +18,27 @@
*/
package org.exoplatform.container.util;
+import org.exoplatform.commons.utils.PropertiesLoader;
+import org.exoplatform.commons.utils.Tools;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.xml.Component;
import org.exoplatform.container.xml.ComponentLifecyclePlugin;
import org.exoplatform.container.xml.ContainerLifecyclePlugin;
+import org.exoplatform.container.xml.Deserializer;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import org.picocontainer.defaults.ConstructorInjectionComponentAdapter;
+import java.io.IOException;
+import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.Map;
/**
@@ -40,6 +48,8 @@
*/
public class ContainerUtil
{
+ /** The logger. */
+ private static final Log log = ExoLogger.getExoLogger(ContainerUtil.class);
static public Constructor<?>[] getSortedConstructors(Class<?> clazz) throws NoClassDefFoundError
{
@@ -190,4 +200,79 @@
}
}
}
+
+ /**
+ * Loads the properties file corresponding to the given url
+ * @param url the url of the properties file
+ * @return a {@link Map} of properties
+ */
+ public static Map<String, String> loadProperties(URL url)
+ {
+ LinkedHashMap<String, String> props = null;
+ String path = null;
+ InputStream in = null;
+ try
+ {
+ //
+ if (url != null)
+ {
+ in = url.openStream();
+ path = url.getPath();
+ }
+
+ //
+ if (in != null)
+ {
+ String fileName = url.getFile();
+ if (Tools.endsWithIgnoreCase(path, ".properties"))
+ {
+ if (log.isDebugEnabled())
+ log.debug("Attempt to load property file " + path);
+ props = PropertiesLoader.load(in);
+ }
+ else if (Tools.endsWithIgnoreCase(fileName, ".xml"))
+ {
+ if (log.isDebugEnabled())
+ log.debug("Attempt to load property file " + path + " with XML format");
+ props = PropertiesLoader.loadFromXML(in);
+ }
+ else if (log.isDebugEnabled())
+ {
+ log.debug("Will not load property file" + path + " because its format is not recognized");
+ }
+ if (props != null)
+ {
+ for (Map.Entry<String, String> entry : props.entrySet())
+ {
+ String propertyName = entry.getKey();
+ String propertyValue = entry.getValue();
+ propertyValue = Deserializer.resolveString(propertyValue);
+ props.put(propertyName, propertyValue);
+ }
+ }
+ }
+ else
+ {
+ log.error("Could not load property file " + path);
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot load property file " + path, e);
+ }
+ finally
+ {
+ if (in != null)
+ {
+ try
+ {
+ in.close();
+ }
+ catch (IOException ignore)
+ {
+ }
+ }
+ }
+ return props;
+ }
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Deserializer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Deserializer.java 2010-02-18 17:44:11 UTC (rev 1914)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Deserializer.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -18,7 +18,10 @@
*/
package org.exoplatform.container.xml;
-import org.exoplatform.container.configuration.ConfigurationManagerImpl;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.RootContainer;
/**
* A deserializer used by JIBX that resolve system properties to allow runtime configuration.
@@ -28,8 +31,19 @@
*/
public class Deserializer
{
+ /**
+ * The name of the variable to use to get the current container name as a suffix
+ * if the current container is a portal container, the value of the variable
+ * will be "-${portal-container-name}", it will be an empty String otherwise
+ */
+ public static final String EXO_CONTAINER_PROP_NAME = "container.name.suffix";
/**
+ * The prefix of the name of all the variables tied to the current portal container
+ */
+ public static final String PORTAL_CONTAINER_VARIABLE_PREFIX = "portal.container.";
+
+ /**
* Resolve a string value.
* If the input value is null then the returned value is null.
*
@@ -38,7 +52,7 @@
*/
public static String resolveString(String s)
{
- return ConfigurationManagerImpl.resolveSystemProperties(s);
+ return Deserializer.resolveVariables(s);
}
/**
@@ -61,7 +75,7 @@
{
return null;
}
- s = ConfigurationManagerImpl.resolveSystemProperties(s);
+ s = Deserializer.resolveVariables(s);
if (s.equalsIgnoreCase("true"))
{
return true;
@@ -91,7 +105,7 @@
{
return null;
}
- s = ConfigurationManagerImpl.resolveSystemProperties(s);
+ s = Deserializer.resolveVariables(s);
try
{
return Integer.parseInt(s);
@@ -120,7 +134,7 @@
{
return null;
}
- s = ConfigurationManagerImpl.resolveSystemProperties(s);
+ s = Deserializer.resolveVariables(s);
try
{
return Long.parseLong(s);
@@ -149,7 +163,7 @@
{
return null;
}
- s = ConfigurationManagerImpl.resolveSystemProperties(s);
+ s = Deserializer.resolveVariables(s);
try
{
return Double.parseDouble(s);
@@ -159,4 +173,91 @@
throw new IllegalArgumentException("Cannot accept integer value " + s, e);
}
}
+
+ /**
+ * Resolve the variables of type ${my.var} for the current context which is composed
+ * of the system properties and the portal container properties
+ * @param input the input value
+ * @return the resolve value
+ */
+ public static String resolveVariables(String input)
+ {
+ final int NORMAL = 0;
+ final int SEEN_DOLLAR = 1;
+ final int IN_BRACKET = 2;
+ if (input == null)
+ return input;
+ char[] chars = input.toCharArray();
+ StringBuffer buffer = new StringBuffer();
+ boolean properties = false;
+ int state = NORMAL;
+ int start = 0;
+ for (int i = 0; i < chars.length; ++i)
+ {
+ char c = chars[i];
+ if (c == '$' && state != IN_BRACKET)
+ state = SEEN_DOLLAR;
+ else if (c == '{' && state == SEEN_DOLLAR)
+ {
+ buffer.append(input.substring(start, i - 1));
+ state = IN_BRACKET;
+ start = i - 1;
+ }
+ else if (state == SEEN_DOLLAR)
+ state = NORMAL;
+ else if (c == '}' && state == IN_BRACKET)
+ {
+ if (start + 2 == i)
+ {
+ buffer.append("${}");
+ }
+ else
+ {
+ String value = null;
+ String key = input.substring(start + 2, i);
+ if (key.equals(Deserializer.EXO_CONTAINER_PROP_NAME))
+ {
+ // The requested key is the name of current container
+ ExoContainer container = ExoContainerContext.getCurrentContainerIfPresent();
+ if (container instanceof PortalContainer)
+ {
+ // The current container is a portal container
+ RootContainer rootContainer = (RootContainer)ExoContainerContext.getTopContainer();
+ value = rootContainer.isPortalContainerConfigAware() ? "_" + container.getContext().getName() : "";
+ }
+ }
+ else if (key.startsWith(Deserializer.PORTAL_CONTAINER_VARIABLE_PREFIX))
+ {
+ // We try to get a value tied to the current portal container.
+ ExoContainer container = ExoContainerContext.getCurrentContainerIfPresent();
+ if (container instanceof PortalContainer)
+ {
+ // The current container is a portal container
+ Object oValue =
+ ((PortalContainer)container).getSetting(key
+ .substring(Deserializer.PORTAL_CONTAINER_VARIABLE_PREFIX.length()));
+ value = oValue == null ? null : oValue.toString();
+ }
+ }
+ else
+ {
+ value = System.getProperty(key);
+ }
+ if (value != null)
+ {
+ properties = true;
+ buffer.append(value);
+ }
+ }
+ start = i + 1;
+ state = NORMAL;
+ }
+ }
+ if (properties == false)
+ return input;
+ if (start != chars.length)
+ buffer.append(input.substring(start, chars.length));
+ return buffer.toString();
+
+ }
}
Added: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,294 @@
+package org.exoplatform.container.definition;
+
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.jmx.AbstractTestContainer;
+import org.exoplatform.container.monitor.jvm.J2EEServerInfo;
+
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 18 f�vr. 2010
+ */
+public class TestPortalContainerConfig extends AbstractTestContainer
+{
+
+ public void testInitValues() throws Exception
+ {
+ RootContainer rootContainer = createRootContainer("empty-config.xml");
+ PortalContainerConfig config =
+ (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config);
+
+ rootContainer = createRootContainer("portal-container-config-with-no-default-values.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME, config.getDefaultPortalContainer());
+ assertEquals(PortalContainerConfig.DEFAULT_REST_CONTEXT_NAME, config.getDefaultRestContext());
+ assertEquals(PortalContainerConfig.DEFAULT_REALM_NAME, config.getDefaultRealmName());
+ assertFalse(config.hasDefinition());
+
+ rootContainer = createRootContainer("portal-container-config-with-default-values.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+
+ assertEquals("myPortal", config.getDefaultPortalContainer());
+ assertEquals("myRest", config.getDefaultRestContext());
+ assertEquals("my-exo-domain", config.getDefaultRealmName());
+ assertFalse(config.hasDefinition());
+
+ rootContainer = createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+
+ assertEquals("myPortal", config.getDefaultPortalContainer());
+ assertEquals("myRest", config.getDefaultRestContext());
+ assertEquals("my-exo-domain", config.getDefaultRealmName());
+ assertTrue(config.hasDefinition());
+
+ rootContainer = createRootContainer("portal-container-config-with-no-default-values-but-with-portal-def.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+
+ assertEquals("myPortal-pcdef", config.getDefaultPortalContainer());
+ assertEquals("myRest-pcdef", config.getDefaultRestContext());
+ assertEquals("my-exo-domain-pcdef", config.getDefaultRealmName());
+ assertTrue(config.hasDefinition());
+ }
+
+ public void testDependencies()
+ {
+ // Without dependencies
+ RootContainer rootContainer =
+ createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml");
+ PortalContainerConfig config =
+ (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getDependencies("foo"));
+ assertNull(config.getDependencies("myPortal"));
+ assertNull(config.getDependencies("myPortal-pcdef"));
+ List<String> names = config.getPortalContainerNames("foo");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal-pcdef", names.get(0));
+ assertEquals("myPortal", config.getPortalContainerName("foo"));
+ assertEquals("myPortal", config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-pcdef", config.getPortalContainerName("myPortal-pcdef"));
+ assertEquals("myRest", config.getRestContextName("foo"));
+ assertEquals("myRest", config.getRestContextName("myPortal"));
+ assertEquals("myRest-pcdef", config.getRestContextName("myPortal-pcdef"));
+ assertEquals("my-exo-domain", config.getRealmName("foo"));
+ assertEquals("my-exo-domain", config.getRealmName("myPortal"));
+ assertEquals("my-exo-domain-pcdef", config.getRealmName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertTrue(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ // Needed for backward compatibility
+ assertTrue(config.isScopeValid("foo", "foo"));
+ assertTrue(config.isScopeValid("myPortal", "foo"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
+
+ // With dependencies
+ rootContainer = createRootContainer("portal-container-config-with-default-values-and-with-portal-def2.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getDependencies("foo"));
+ assertNull(config.getDependencies("myPortal"));
+ List<String> deps = config.getDependencies("myPortal-pcdef");
+ assertTrue(deps != null && deps.size() == 3);
+ names = config.getPortalContainerNames("foo");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal-pcdef", names.get(0));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal-pcdef", names.get(0));
+ assertEquals("myPortal-pcdef", config.getPortalContainerName("foo"));
+ assertEquals("myPortal", config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-pcdef", config.getPortalContainerName("myPortal-pcdef"));
+ assertEquals("myRest", config.getRestContextName("foo"));
+ assertEquals("myRest", config.getRestContextName("myPortal"));
+ assertEquals("myRest-pcdef", config.getRestContextName("myPortal-pcdef"));
+ assertEquals("my-exo-domain", config.getRealmName("foo"));
+ assertEquals("my-exo-domain", config.getRealmName("myPortal"));
+ assertEquals("my-exo-domain-pcdef", config.getRealmName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertTrue(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isScopeValid("foo", "foo"));
+ assertFalse(config.isScopeValid("myPortal", "foo"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
+ }
+
+ public void testSettings()
+ {
+ // Without settings and without portal definition
+ RootContainer rootContainer = createRootContainer("portal-container-config-with-default-values.xml");
+ PortalContainerConfig config =
+ (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getSetting("foo", "foo"));
+ assertNull(config.getSetting("myPortal", "foo"));
+ assertNull(config.getSetting("myPortal-pcdef", "foo"));
+ assertNull(config.getSetting("foo", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("myPortal-pcdef", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REALM_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REALM_SETTING_NAME));
+ assertNull(config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
+
+ // Without settings and with portal definition
+ rootContainer = createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getSetting("foo", "foo"));
+ assertNull(config.getSetting("myPortal", "foo"));
+ assertNull(config.getSetting("myPortal-pcdef", "foo"));
+ assertNull(config.getSetting("foo", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REALM_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
+
+ // With internal settings
+ rootContainer = createRootContainer("portal-container-config-with-default-values-and-with-settings.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getSetting("foo", "foo"));
+ assertNull(config.getSetting("myPortal", "foo"));
+ assertEquals("value", config.getSetting("myPortal-pcdef", "foo"));
+ assertNull(config.getSetting("foo", "foo2"));
+ assertNull(config.getSetting("myPortal", "foo2"));
+ assertNull(config.getSetting("myPortal-pcdef", "foo2"));
+ assertEquals("value", config.getSetting("myPortal-pcdef", "string"));
+ assertEquals(new Integer(10), config.getSetting("myPortal-pcdef", "int"));
+ assertEquals(new Long(10), config.getSetting("myPortal-pcdef", "long"));
+ assertEquals(new Double(10), config.getSetting("myPortal-pcdef", "double"));
+ assertEquals(new Boolean(true), config.getSetting("myPortal-pcdef", "boolean"));
+ assertNull(config.getSetting("foo", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REALM_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
+
+ // With external settings
+ rootContainer = createRootContainer("portal-container-config-with-default-values-and-with-external-settings.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getSetting("foo", "foo"));
+ assertNull(config.getSetting("myPortal", "foo"));
+ assertNull(config.getSetting("myPortal-pcdef", "foo"));
+ assertNull(config.getSetting("foo", "foo2"));
+ assertNull(config.getSetting("myPortal", "foo2"));
+ assertEquals("value", config.getSetting("myPortal-pcdef", "foo2"));
+ assertEquals("new value", config.getSetting("myPortal-pcdef", "string"));
+ assertEquals("20", config.getSetting("myPortal-pcdef", "int"));
+ assertEquals("20", config.getSetting("myPortal-pcdef", "long"));
+ assertEquals("20", config.getSetting("myPortal-pcdef", "double"));
+ assertEquals("false", config.getSetting("myPortal-pcdef", "boolean"));
+ assertNull(config.getSetting("foo", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REALM_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
+
+ // With external settings in exo-conf directory
+ String path = TestPortalContainerConfig.class.getResource("portal-container-config-with-default-values-and-with-external-settings2.xml").getPath();
+ path = path.substring(0, path.lastIndexOf('/'));
+ String oldPath = System.getProperty(J2EEServerInfo.EXO_CONF_PARAM);
+
+ try
+ {
+ System.setProperty(J2EEServerInfo.EXO_CONF_PARAM, path);
+ rootContainer = createRootContainer("portal-container-config-with-default-values-and-with-external-settings2.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getSetting("foo", "foo"));
+ assertNull(config.getSetting("myPortal", "foo"));
+ assertNull(config.getSetting("myPortal-pcdef", "foo"));
+ assertNull(config.getSetting("foo", "foo2"));
+ assertNull(config.getSetting("myPortal", "foo2"));
+ assertEquals("value 2", config.getSetting("myPortal-pcdef", "foo2"));
+ assertEquals("new value 2", config.getSetting("myPortal-pcdef", "string"));
+ assertEquals("22", config.getSetting("myPortal-pcdef", "int"));
+ assertEquals("22", config.getSetting("myPortal-pcdef", "long"));
+ assertEquals("22", config.getSetting("myPortal-pcdef", "double"));
+ assertEquals("true", config.getSetting("myPortal-pcdef", "boolean"));
+ assertNull(config.getSetting("foo", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REALM_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
+ }
+ finally
+ {
+ if (oldPath != null)
+ {
+ System.setProperty(J2EEServerInfo.EXO_CONF_PARAM, oldPath);
+ }
+ }
+
+ // With both settings internal and external
+ rootContainer = createRootContainer("portal-container-config-with-default-values-and-with-both-settings.xml");
+ config = (PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getSetting("foo", "foo"));
+ assertNull(config.getSetting("myPortal", "foo"));
+ assertEquals("value", config.getSetting("myPortal-pcdef", "foo"));
+ assertNull(config.getSetting("foo", "foo2"));
+ assertNull(config.getSetting("myPortal", "foo2"));
+ assertEquals("value", config.getSetting("myPortal-pcdef", "foo2"));
+ assertEquals("new value", config.getSetting("myPortal-pcdef", "string"));
+ assertEquals(new Integer(20), config.getSetting("myPortal-pcdef", "int"));
+ assertEquals(new Long(20), config.getSetting("myPortal-pcdef", "long"));
+ assertEquals(new Double(20), config.getSetting("myPortal-pcdef", "double"));
+ assertEquals(new Boolean(false), config.getSetting("myPortal-pcdef", "boolean"));
+ assertNull(config.getSetting("foo", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("foo", PortalContainerConfig.REALM_SETTING_NAME));
+ assertNull(config.getSetting("myPortal", PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
+ }
+}
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/empty-config.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/empty-config.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/empty-config.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal/myPortal-pcdef/settings.properties
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal/myPortal-pcdef/settings.properties (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal/myPortal-pcdef/settings.properties 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,6 @@
+foo2=value 2
+string=new value 2
+int=22
+long=22
+double=22
+boolean=true
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-both-settings.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-both-settings.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-both-settings.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>myPortal-pcdef</string>
+ </field>
+ <!-- The name of the context name of the rest web application -->
+ <field name="restContextName">
+ <string>myRest-pcdef</string>
+ </field>
+ <!-- The name of the realm -->
+ <field name="realmName">
+ <string>my-exo-domain-pcdef</string>
+ </field>
+ <!-- A map of settings tied to the portal container -->
+ <field name="settings">
+ <map type="java.util.HashMap">
+ <entry>
+ <key>
+ <string>foo</string>
+ </key>
+ <value>
+ <string>value</string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>string</string>
+ </key>
+ <value>
+ <string>value</string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>int</string>
+ </key>
+ <value>
+ <int>10</int>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>long</string>
+ </key>
+ <value>
+ <long>10</long>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>double</string>
+ </key>
+ <value>
+ <double>10</double>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>boolean</string>
+ </key>
+ <value>
+ <boolean>true</boolean>
+ </value>
+ </entry>
+ </map>
+ </field>
+ <!-- The path to the external properties file -->
+ <field name="externalSettingsPath">
+ <string>classpath:/org/exoplatform/container/definition/settings.properties</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-external-settings.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-external-settings.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-external-settings.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>myPortal-pcdef</string>
+ </field>
+ <!-- The name of the context name of the rest web application -->
+ <field name="restContextName">
+ <string>myRest-pcdef</string>
+ </field>
+ <!-- The name of the realm -->
+ <field name="realmName">
+ <string>my-exo-domain-pcdef</string>
+ </field>
+ <!-- The path to the external properties file -->
+ <field name="externalSettingsPath">
+ <string>classpath:/org/exoplatform/container/definition/settings.properties</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-external-settings2.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-external-settings2.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-external-settings2.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>myPortal-pcdef</string>
+ </field>
+ <!-- The name of the context name of the rest web application -->
+ <field name="restContextName">
+ <string>myRest-pcdef</string>
+ </field>
+ <!-- The name of the realm -->
+ <field name="realmName">
+ <string>my-exo-domain-pcdef</string>
+ </field>
+ <!-- The path to the external properties file -->
+ <field name="externalSettingsPath">
+ <string>settings.properties</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>myPortal-pcdef</string>
+ </field>
+ <!-- The name of the context name of the rest web application -->
+ <field name="restContextName">
+ <string>myRest-pcdef</string>
+ </field>
+ <!-- The name of the realm -->
+ <field name="realmName">
+ <string>my-exo-domain-pcdef</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>myPortal-pcdef</string>
+ </field>
+ <!-- The name of the context name of the rest web application -->
+ <field name="restContextName">
+ <string>myRest-pcdef</string>
+ </field>
+ <!-- The name of the realm -->
+ <field name="realmName">
+ <string>my-exo-domain-pcdef</string>
+ </field>
+ <!-- All the dependencies of the portal container ordered by loading priority -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ <value>
+ <string>foo2</string>
+ </value>
+ <value>
+ <string>foo3</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-settings.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-settings.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-settings.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>myPortal-pcdef</string>
+ </field>
+ <!-- The name of the context name of the rest web application -->
+ <field name="restContextName">
+ <string>myRest-pcdef</string>
+ </field>
+ <!-- The name of the realm -->
+ <field name="realmName">
+ <string>my-exo-domain-pcdef</string>
+ </field>
+ <!-- A map of settings tied to the portal container -->
+ <field name="settings">
+ <map type="java.util.HashMap">
+ <entry>
+ <key>
+ <string>foo</string>
+ </key>
+ <value>
+ <string>value</string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>string</string>
+ </key>
+ <value>
+ <string>value</string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>int</string>
+ </key>
+ <value>
+ <int>10</int>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>long</string>
+ </key>
+ <value>
+ <long>10</long>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>double</string>
+ </key>
+ <value>
+ <double>10</double>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>boolean</string>
+ </key>
+ <value>
+ <boolean>true</boolean>
+ </value>
+ </entry>
+ </map>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values-but-with-portal-def.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values-but-with-portal-def.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values-but-with-portal-def.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>myPortal-pcdef</string>
+ </field>
+ <!-- The name of the context name of the rest web application -->
+ <field name="restContextName">
+ <string>myRest-pcdef</string>
+ </field>
+ <!-- The name of the realm -->
+ <field name="realmName">
+ <string>my-exo-domain-pcdef</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values.xml 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/settings.properties
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/settings.properties (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/settings.properties 2010-02-18 17:56:36 UTC (rev 1915)
@@ -0,0 +1,6 @@
+foo2=value
+string=new value
+int=20
+long=20
+double=20
+boolean=false
\ No newline at end of file
16 years, 2 months
exo-jcr SVN: r1914 - in jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules: kernel and 1 other directory.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-02-18 12:44:11 -0500 (Thu, 18 Feb 2010)
New Revision: 1914
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/arjuna-transaction-service.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-manager-lookup.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml
Log:
EXOJCR-512 jcr configuration
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/arjuna-transaction-service.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/arjuna-transaction-service.xml 2010-02-18 17:38:37 UTC (rev 1913)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/arjuna-transaction-service.xml 2010-02-18 17:44:11 UTC (rev 1914)
@@ -1,14 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter if="ch_arjuna_transaction_service">
- <?dbhtml filename="ch-arjuna-tranasction-service.html"?>
-
- <title>ArjunaTransactionService</title>
-
- <section>
- <title>Intro</title>
-
- <para></para>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter if="ch_arjuna_transaction_service">
+ <?dbhtml filename="ch-arjuna-tranasction-service.html"?>
+
+ <title>ArjunaTransactionService</title>
+
+ <section>
+ <title>Introduction</title>
+
+ <para>ArjunaTransactionService implements eXo <link
+ linkend="ch_transaction_service">TransactionService</link> and provides
+ access to <ulink url="http://www.jboss.org/jbosstm/">JBoss Transaction
+ Service (JBossTS)</ulink> JTA implementation via eXo container
+ dependency.</para>
+
+ <para>TransactionService used in JCR cache
+ <emphasis>org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache</emphasis>
+ implementaion. See <ulink url="cluster-config.html">Cluster
+ configuration</ulink> for example.</para>
+ </section>
+
+ <section>
+ <title>Configuration</title>
+
+ <para>Example configuration:</para>
+
+ <programlisting> <component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.jbosscache.ArjunaTransactionService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component></programlisting>
+
+ <para>timeout - XA transaction timeout in seconds</para>
+ </section>
+</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-manager-lookup.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-manager-lookup.xml 2010-02-18 17:38:37 UTC (rev 1913)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-manager-lookup.xml 2010-02-18 17:44:11 UTC (rev 1914)
@@ -1,15 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="ch-transaction-manager.html"?>
-
- <title>TransactionManagerLookup</title>
-
- <section>
- <title>Intro</title>
-
- <para>Implements <link
- linkend="ch_transaction_service">TransactionService</link></para>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter>
+ <?dbhtml filename="ch-transaction-manager.html"?>
+
+ <title>TransactionManagerLookup</title>
+
+ <section>
+ <title>Configuration</title>
+
+ <para>It's JBossCache class registered as eXo container component in
+ configuration.xml file. </para>
+
+ <programlisting> <component>
+ <key>org.jboss.cache.transaction.TransactionManagerLookup</key>
+ <type>org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup</type>
+ </component></programlisting>
+
+ <para>JBossStandaloneJTAManagerLookup used in standalone environment. Bur
+ for Application Server environment use GenericTransactionManagerLookup.
+ </para>
+ </section>
+</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml 2010-02-18 17:38:37 UTC (rev 1913)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml 2010-02-18 17:44:11 UTC (rev 1914)
@@ -9,8 +9,8 @@
<section>
<title>Base information</title>
- <para>TransactionServices provides acces to JTATransactionManager nad
- UserTransaction.</para>
+ <para>TransactionServices provides acces to XA TransactionManager and
+ UserTransaction (See JTA specification for details).</para>
<table>
<title>List methods</title>
16 years, 2 months
exo-jcr SVN: r1913 - jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-02-18 12:38:37 -0500 (Thu, 18 Feb 2010)
New Revision: 1913
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml
Log:
EXOJCR-490: transaction service updated
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml 2010-02-18 17:34:02 UTC (rev 1912)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml 2010-02-18 17:38:37 UTC (rev 1913)
@@ -9,6 +9,9 @@
<section>
<title>Base information</title>
+ <para>TransactionServices provides acces to JTATransactionManager nad
+ UserTransaction.</para>
+
<table>
<title>List methods</title>
@@ -51,7 +54,7 @@
</row>
<row>
- <entry> createXid()</entry>
+ <entry>createXid()</entry>
<entry>Creates unique XA transaction identifier.</entry>
</row>
16 years, 2 months
exo-jcr SVN: r1912 - jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-02-18 12:34:02 -0500 (Thu, 18 Feb 2010)
New Revision: 1912
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml
Log:
EXOJCR-490: transaction service updated
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml 2010-02-18 17:31:51 UTC (rev 1911)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml 2010-02-18 17:34:02 UTC (rev 1912)
@@ -1,14 +1,62 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="ch_transaction_service">
- <?dbhtml filename="ch-tranasction-service.html"?>
-
- <title>TransactionService</title>
-
- <section>
- <title>Intro</title>
-
- <para></para>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="ch_transaction_service">
+ <?dbhtml filename="ch-tranasction-service.html"?>
+
+ <title>TransactionService</title>
+
+ <section>
+ <title>Base information</title>
+
+ <table>
+ <title>List methods</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>getTransactionManager()</entry>
+
+ <entry>Get used TransactionManager</entry>
+ </row>
+
+ <row>
+ <entry>getUserTransaction()</entry>
+
+ <entry>Get UserTransaction on TransactionManager</entry>
+ </row>
+
+ <row>
+ <entry>getDefaultTimeout()</entry>
+
+ <entry>Return default TimeOut</entry>
+ </row>
+
+ <row>
+ <entry>setTransactionTimeout(int seconds)</entry>
+
+ <entry>Set TimeOut in second</entry>
+ </row>
+
+ <row>
+ <entry>enlistResource(ExoResource xares)</entry>
+
+ <entry>Enlist XA resource in TransactionManager</entry>
+ </row>
+
+ <row>
+ <entry>delistResource(ExoResource xares)</entry>
+
+ <entry>Delist XA resource from TransactionManager</entry>
+ </row>
+
+ <row>
+ <entry> createXid()</entry>
+
+ <entry>Creates unique XA transaction identifier.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+</chapter>
16 years, 2 months
exo-jcr SVN: r1911 - jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-02-18 12:31:51 -0500 (Thu, 18 Feb 2010)
New Revision: 1911
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml
Log:
EXOJCR-490 cluster-config.xml updated
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml 2010-02-18 17:05:33 UTC (rev 1910)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml 2010-02-18 17:31:51 UTC (rev 1911)
@@ -1,262 +1,270 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="ch_cluster_configuration">
- <?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 As follow next steps:</para>
-
- <orderedlist>
- <listitem>
- <para>Dowload the latest version of eXo JCR ear distribution from
- [LINK THERE]</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">
- <authentication>
- <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required"></login-module>
- </authentication>
-</application-policy></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://localhost:8080/browser</uri> with
- root/exo as login/password if you have done everything right, you'll
- get access to repository browser.</para>
- </listitem>
- </orderedlist>
- </section>
-
- <section id="sect_conf_cluster_jcr">
- <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="ch_configuration">JCR Configuration</link>. Your
- configuration must look like:</para>
-
- <programlisting><repository-service default-repository="repository1">
- <repositories>
- <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">
- <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" />
- </properties>
- <value-storages>
- see "<link linkend="conf_value_storage">Value storage configuration</link>" part.
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.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>
- <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>
- <workspace name="wsN">
- ...
- </workspace>
- </workspaces>
- </repository>
- </repositories>
-</repository-service> </programlisting>
- </listitem>
-
- <listitem>
- <para>and 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>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>exo-jcr-configuration.xml</value>
- </value-param>
- </init-params>
-</component></programlisting></para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
-
- <section>
- <title>Requirements</title>
-
- <section>
- <title>Enviorenment 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>
- </listitem>
-
- <listitem>
- <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
- workspace production on all other nodes MUST have the same name
- "production_indexer_cluster" )</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Enviorenment 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">
- <properties>
- <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" />
- </filters>
- </value-storage>
-</value-storages></programlisting>
-
- <para>See more about <link
- linkend="ch_external_value_storages">ValueStorage
- configuration</link>.</para>
- </listitem>
-
- <listitem id="conf_cache">
- <para>Cache configuration:</para>
-
- <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" />
- </properties>
-</cache> </programlisting>
-
- <para>See more about <link
- linkend="ch_jbosscache_config_templates">Cache
- configuration</link>.</para>
- </listitem>
-
- <listitem id="conf_indexer">
- <para>Indexer configuration:</para>
-
- <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" />
- </properties>
-</query-handler> </programlisting>
-
- <para>See more about <link
- linkend="ch_query_handler_config">QueryHandler
- configuration</link>.</para>
- </listitem>
-
- <listitem id="conf_lock_manager">
- <para>Lock Manager configuration:</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="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"/>
- </properties>
-</lock-manager></programlisting>
-
- <para>See more about <link
- linkend="ch_lock_manager_config">LockManager
- configuration</link>.</para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter>
+ <?dbhtml filename="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 As follow next steps:</para>
+
+ <orderedlist>
+ <listitem>
+ <para>Dowload the latest version of eXo JCR ear 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">
+ <authentication>
+ <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required"></login-module>
+ </authentication>
+</application-policy></programlisting>
+ </listitem>
+
+ <listitem>
+ <para>Ensure that you use JBoss <link
+ linkend="ch_transaction_service">Transaction Service</link> (Arjuna)
+ and JBoss <link linkend="ch-arjuna-tranasction-service">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>^
+</component>
+
+<component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.jbosscache.ArjunaTransactionService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</value>
+ </value-param>
+ </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 <ulink
+ url="http://localhost:8080/browser">http://localhost:8080/browser</ulink>
+ with root/exo as login/password if you have done everything right,
+ you'll get access to repository browser.</para>
+ </listitem>
+ </orderedlist>
+ </section>
+
+ <section id="sect_conf_cluster_jcr">
+ <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 <ulink
+ url="http://wiki.exoplatform.org/xwiki/bin/view/JCR/#HConfiguration">JCR
+ Configuration</ulink>. Your configuration must look like:</para>
+
+ <programlisting><repository-service default-repository="repository1">
+ <repositories>
+ <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">
+ <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" />
+ </properties>
+ <value-storages>
+ see "<link linkend="conf_value_storage">Value storage configuration</link>" part.
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.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>
+ <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>
+ <workspace name="wsN">
+ ...
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service> </programlisting>
+ </listitem>
+
+ <listitem>
+ <para>and 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>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>exo-jcr-configuration.xml</value>
+ </value-param>
+ </init-params>
+</component></programlisting></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+
+ <section>
+ <title>Requirements</title>
+
+ <section>
+ <title>Enviorenment 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>
+ </listitem>
+
+ <listitem>
+ <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
+ workspace production on all other nodes MUST have the same name
+ "production_indexer_cluster" )</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Enviorenment 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">
+ <properties>
+ <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" />
+ </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">
+ <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" />
+ </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">
+ <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" />
+ </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">
+ <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="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>
+ </itemizedlist>
+ </section>
+ </section>
+</chapter>
16 years, 2 months
exo-jcr SVN: r1910 - in jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules: core and 1 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-02-18 12:05:33 -0500 (Thu, 18 Feb 2010)
New Revision: 1910
Added:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml
Removed:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/transaction-service.xml
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml
Log:
EXOJCR-490: transaction services moved from core to kernel
Deleted: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/transaction-service.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/transaction-service.xml 2010-02-18 16:59:45 UTC (rev 1909)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/transaction-service.xml 2010-02-18 17:05:33 UTC (rev 1910)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="ch_transaction_service">
- <?dbhtml filename="ch-tranasction-service.html"?>
-
- <title>TransactionService</title>
-
- <section>
- <title>Intro</title>
-
- <para></para>
- </section>
-</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml 2010-02-18 16:59:45 UTC (rev 1909)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml 2010-02-18 17:05:33 UTC (rev 1910)
@@ -9,7 +9,4 @@
<xi:include href="core/core.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="core/transaction-service.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
</part>
Added: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml (rev 0)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/transaction-service.xml 2010-02-18 17:05:33 UTC (rev 1910)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="ch_transaction_service">
+ <?dbhtml filename="ch-tranasction-service.html"?>
+
+ <title>TransactionService</title>
+
+ <section>
+ <title>Intro</title>
+
+ <para></para>
+ </section>
+</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml 2010-02-18 16:59:45 UTC (rev 1909)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml 2010-02-18 17:05:33 UTC (rev 1910)
@@ -9,4 +9,8 @@
<xi:include href="kernel/kernel.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="kernel/transaction-service.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+
</part>
16 years, 2 months
exo-jcr SVN: r1909 - in jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules: core and 1 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-02-18 11:59:45 -0500 (Thu, 18 Feb 2010)
New Revision: 1909
Added:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/transaction-service.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/arjuna-transaction-service.xml
Removed:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-service.xml
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-manager-lookup.xml
Log:
EXOJCR-490: transaction services updated
Added: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/transaction-service.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/transaction-service.xml (rev 0)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/transaction-service.xml 2010-02-18 16:59:45 UTC (rev 1909)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="ch_transaction_service">
+ <?dbhtml filename="ch-tranasction-service.html"?>
+
+ <title>TransactionService</title>
+
+ <section>
+ <title>Intro</title>
+
+ <para></para>
+ </section>
+</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml 2010-02-18 16:57:21 UTC (rev 1908)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml 2010-02-18 16:59:45 UTC (rev 1909)
@@ -8,4 +8,8 @@
<xi:include href="core/core.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <xi:include href="core/transaction-service.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
</part>
Added: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/arjuna-transaction-service.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/arjuna-transaction-service.xml (rev 0)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/arjuna-transaction-service.xml 2010-02-18 16:59:45 UTC (rev 1909)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter if="ch_arjuna_transaction_service">
+ <?dbhtml filename="ch-arjuna-tranasction-service.html"?>
+
+ <title>ArjunaTransactionService</title>
+
+ <section>
+ <title>Intro</title>
+
+ <para></para>
+ </section>
+</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-manager-lookup.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-manager-lookup.xml 2010-02-18 16:57:21 UTC (rev 1908)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-manager-lookup.xml 2010-02-18 16:59:45 UTC (rev 1909)
@@ -9,6 +9,7 @@
<section>
<title>Intro</title>
- <para></para>
+ <para>Implements <link
+ linkend="ch_transaction_service">TransactionService</link></para>
</section>
</chapter>
Deleted: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-service.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-service.xml 2010-02-18 16:57:21 UTC (rev 1908)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr/transaction-service.xml 2010-02-18 16:59:45 UTC (rev 1909)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="ch-tranasction-service.html"?>
-
- <title>TransactionService</title>
-
- <section>
- <title>Intro</title>
-
- <para></para>
- </section>
-</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr.xml 2010-02-18 16:57:21 UTC (rev 1908)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/jcr.xml 2010-02-18 16:59:45 UTC (rev 1909)
@@ -46,7 +46,7 @@
<xi:include href="jcr/query-handler-config.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="jcr/transaction-service.xml"
+ <xi:include href="jcr/arjuna-transaction-service.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="jcr/transaction-manager-lookup.xml"
16 years, 2 months