gatein SVN: r1985 - components/shindig.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-03-04 13:21:47 -0500 (Thu, 04 Mar 2010)
New Revision: 1985
Added:
components/shindig/tags/
Log:
Adding tags directory
14 years, 10 months
gatein SVN: r1983 - portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-03-04 12:52:26 -0500 (Thu, 04 Mar 2010)
New Revision: 1983
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
Log:
actually use an explicit size for the template service cache config
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2010-03-04 17:38:40 UTC (rev 1982)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2010-03-04 17:52:26 UTC (rev 1983)
@@ -211,6 +211,9 @@
<field name="liveTime">
<long>600000</long>
</field>
+ <field name="maxSize">
+ <int>1000</int>
+ </field>
</object>
</object-param>
</init-params>
14 years, 10 months
gatein SVN: r1982 - portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-04 12:38:40 -0500 (Thu, 04 Mar 2010)
New Revision: 1982
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
Log:
- Changed SLASH_REPLACEMENT constant value so that it's not as ambiguous.
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-03-04 17:34:26 UTC (rev 1981)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-03-04 17:38:40 UTC (rev 1982)
@@ -242,7 +242,7 @@
public static class PortletNameFormatter implements ObjectFormatter
{
- public static final String SLASH_REPLACEMENT = "___";
+ public static final String SLASH_REPLACEMENT = "-_-";
private static final String SLASH = "/";
public String decodeNodeName(FormatterContext formatterContext, String s)
14 years, 10 months
gatein SVN: r1981 - portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-03-04 12:34:26 -0500 (Thu, 04 Mar 2010)
New Revision: 1981
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
Log:
need to add the ResourceBundleManager at the right place (that used to be in a jar)
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2010-03-04 17:27:12 UTC (rev 1980)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2010-03-04 17:34:26 UTC (rev 1981)
@@ -98,6 +98,11 @@
</component>
<component>
+ <key>org.exoplatform.services.resources.ResourceBundleManager</key>
+ <type>org.exoplatform.services.resources.ResourceBundleManager</type>
+ </component>
+
+ <component>
<key>org.exoplatform.services.cache.CacheService</key>
<jmx-name>cache:type=CacheService</jmx-name>
<type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
14 years, 10 months
gatein SVN: r1980 - in portal/trunk/component/resources: src/main/java and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-03-04 12:27:12 -0500 (Thu, 04 Mar 2010)
New Revision: 1980
Added:
portal/trunk/component/resources/src/test/java/conf/exo.portal.component.resources-configuration.xml
portal/trunk/component/resources/src/test/java/conf/locales-config.xml
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/AbstractResourceBundleTest.java
Removed:
portal/trunk/component/resources/src/main/java/conf/
portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml
portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml
portal/trunk/component/resources/src/test/java/conf/portal/testjcr/
Modified:
portal/trunk/component/resources/pom.xml
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestExoResourceBundle.java
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestLocaleConfigService.java
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestLocaleConfig.java
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
Log:
- fix resource bundle unit test that were having issues with cache configuration
Modified: portal/trunk/component/resources/pom.xml
===================================================================
--- portal/trunk/component/resources/pom.xml 2010-03-04 17:18:43 UTC (rev 1979)
+++ portal/trunk/component/resources/pom.xml 2010-03-04 17:27:12 UTC (rev 1980)
@@ -26,10 +26,6 @@
<version>3.0.0-CR02-SNAPSHOT</version>
</parent>
- <properties>
- <maven.test.skip>true</maven.test.skip>
- </properties>
-
<modelVersion>4.0.0</modelVersion>
<artifactId>exo.portal.component.resources</artifactId>
<packaging>jar</packaging>
Added: portal/trunk/component/resources/src/test/java/conf/exo.portal.component.resources-configuration.xml
===================================================================
--- portal/trunk/component/resources/src/test/java/conf/exo.portal.component.resources-configuration.xml (rev 0)
+++ portal/trunk/component/resources/src/test/java/conf/exo.portal.component.resources-configuration.xml 2010-03-04 17:27:12 UTC (rev 1980)
@@ -0,0 +1,89 @@
+<?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_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <jmx-name>cache:type=CacheService</jmx-name>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>cache.config.default</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>default</string></field>
+ <field name="maxSize"><int>300</int></field>
+ <field name="liveTime"><long>60</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.resources.LocaleConfigService</key>
+ <type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>locale.config.file</name>
+ <value>jar:/conf/locales-config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.resources.ResourceBundleManager</key>
+ <type>org.exoplatform.services.resources.ResourceBundleManager</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.resources.ResourceBundleService</key>
+ <type>org.exoplatform.services.resources.impl.SimpleResourceBundleService</type>
+ <init-params>
+ <values-param>
+ <name>classpath.resources</name>
+ <description>The resources that start with the following package name should be load from file system</description>
+ <value>locale.portlet</value>
+ </values-param>
+
+ <values-param>
+ <name>init.resources</name>
+ <description>Store the following resources into the db for the first launch </description>
+ <value>locale.test.resources.test</value>
+ </values-param>
+
+ <values-param>
+ <name>portal.resource.names</name>
+ <description>The properties files of the portal , those file will be merged
+ into one ResourceBundle properties </description>
+ <value>local.portal.portal</value>
+ <value>local.portal.custom</value>
+ </values-param>
+ </init-params>
+ </component>
+
+</configuration>
Copied: portal/trunk/component/resources/src/test/java/conf/locales-config.xml (from rev 1974, portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml)
===================================================================
--- portal/trunk/component/resources/src/test/java/conf/locales-config.xml (rev 0)
+++ portal/trunk/component/resources/src/test/java/conf/locales-config.xml 2010-03-04 17:27:12 UTC (rev 1980)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<locales-config>
+ <!--
+ Check http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt for locale code
+ The encoding parameter will be used for the request response stream.
+ The input-encoding parameter will be used for request setCharacterEncoding(..)
+
+ encoding: ISO-8859-1
+ -->
+
+ <locale-config>
+ <locale>en</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for english locale</description>
+ </locale-config>
+
+ <locale-config>
+ <locale>fr</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for the french locale</description>
+ </locale-config>
+
+ <locale-config>
+ <locale>ar</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for the arabic locale</description>
+ <orientation>rt</orientation>
+ </locale-config>
+
+ <locale-config>
+ <locale>vi</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for the vietnam locale</description>
+ </locale-config>
+</locales-config>
Deleted: portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml
===================================================================
--- portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml 2010-03-04 17:18:43 UTC (rev 1979)
+++ portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml 2010-03-04 17:27:12 UTC (rev 1980)
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<locales-config>
- <!--
- Check http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt for locale code
- The encoding parameter will be used for the request response stream.
- The input-encoding parameter will be used for request setCharacterEncoding(..)
-
- encoding: ISO-8859-1
- -->
-
- <locale-config>
- <locale>en</locale>
- <output-encoding>UTF-8</output-encoding>
- <input-encoding>UTF-8</input-encoding>
- <description>Default configuration for english locale</description>
- </locale-config>
-
- <locale-config>
- <locale>fr</locale>
- <output-encoding>UTF-8</output-encoding>
- <input-encoding>UTF-8</input-encoding>
- <description>Default configuration for the french locale</description>
- </locale-config>
-
- <locale-config>
- <locale>ar</locale>
- <output-encoding>UTF-8</output-encoding>
- <input-encoding>UTF-8</input-encoding>
- <description>Default configuration for the arabic locale</description>
- <orientation>rt</orientation>
- </locale-config>
-
- <locale-config>
- <locale>vi</locale>
- <output-encoding>UTF-8</output-encoding>
- <input-encoding>UTF-8</input-encoding>
- <description>Default configuration for the vietnam locale</description>
- </locale-config>
-</locales-config>
Deleted: portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml
===================================================================
--- portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml 2010-03-04 17:18:43 UTC (rev 1979)
+++ portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml 2010-03-04 17:27:12 UTC (rev 1980)
@@ -1,90 +0,0 @@
-<?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_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <component>
- <key>org.exoplatform.services.cache.CacheService</key>
- <jmx-name>cache:type=CacheService</jmx-name>
- <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
- <init-params>
- <object-param>
- <name>cache.config.default</name>
- <description>The default cache configuration</description>
- <object type="org.exoplatform.services.cache.ExoCacheConfig">
- <field name="name"><string>default</string></field>
- <field name="maxSize"><int>300</int></field>
- <field name="liveTime"><long>60</long></field>
- <field name="distributed"><boolean>false</boolean></field>
- <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
- </object>
- </object-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.resources.LocaleConfigService</key>
- <type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
- <init-params>
- <value-param>
- <name>locale.config.file</name>
- <value>jar:/conf/portal/locales-config.xml</value>
- </value-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.resources.ResourceBundleManager</key>
- <type>org.exoplatform.services.resources.ResourceBundleManager</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.resources.ResourceBundleService</key>
- <type>org.exoplatform.services.resources.impl.SimpleResourceBundleService</type>
- <init-params>
- <values-param>
- <name>classpath.resources</name>
- <description>The resources that start with the following package name should be load from file system</description>
- <value>locale.portlet</value>
- </values-param>
-
- <values-param>
- <name>init.resources</name>
- <description>Store the following resources into the db for the first launch </description>
- <value>locale.test.resources.test</value>
- </values-param>
-
- <values-param>
- <name>portal.resource.names</name>
- <description>The properties files of the portal , those file will be merged
- into one ResoruceBundle properties </description>
- <value>local.portal.portal</value>
- <value>local.portal.custom</value>
- </values-param>
- </init-params>
- </component>
-
- <import>jar:/conf/portal/testjcr/test-jcr-configuration.xml</import>
-</configuration>
Added: portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/AbstractResourceBundleTest.java
===================================================================
--- portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/AbstractResourceBundleTest.java (rev 0)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/AbstractResourceBundleTest.java 2010-03-04 17:27:12 UTC (rev 1980)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+package org.exoplatform.services.resources;
+
+import org.exoplatform.component.test.AbstractKernelTest;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.resources-configuration.xml")
+})
+public abstract class AbstractResourceBundleTest extends AbstractKernelTest {
+ protected AbstractResourceBundleTest() {
+ }
+
+ protected AbstractResourceBundleTest(String name) {
+ super(name);
+ }
+}
Modified: portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestExoResourceBundle.java
===================================================================
--- portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestExoResourceBundle.java 2010-03-04 17:18:43 UTC (rev 1979)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestExoResourceBundle.java 2010-03-04 17:27:12 UTC (rev 1980)
@@ -19,9 +19,7 @@
package org.exoplatform.services.resources;
-import org.exoplatform.component.test.AbstractGateInTest;
-
-public class TestExoResourceBundle extends AbstractGateInTest
+public class TestExoResourceBundle extends AbstractResourceBundleTest
{
public void testConstructor()
Modified: portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestLocaleConfigService.java
===================================================================
--- portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestLocaleConfigService.java 2010-03-04 17:18:43 UTC (rev 1979)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestLocaleConfigService.java 2010-03-04 17:27:12 UTC (rev 1980)
@@ -20,7 +20,6 @@
package org.exoplatform.services.resources;
import org.exoplatform.commons.utils.PropertyManager;
-import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.configuration.ConfigurationManagerImpl;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -35,7 +34,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestLocaleConfigService extends AbstractGateInTest
+public class TestLocaleConfigService extends AbstractResourceBundleTest
{
public TestLocaleConfigService()
Modified: portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestLocaleConfig.java
===================================================================
--- portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestLocaleConfig.java 2010-03-04 17:18:43 UTC (rev 1979)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestLocaleConfig.java 2010-03-04 17:27:12 UTC (rev 1980)
@@ -19,8 +19,8 @@
package org.exoplatform.services.resources.test;
-import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.resources.AbstractResourceBundleTest;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
@@ -33,7 +33,7 @@
* @version: $Id: TestLocaleConfig.java 5799 2006-05-28 17:55:42Z geaz $
* @email: tuan08(a)yahoo.com
*/
-public class TestLocaleConfig extends AbstractGateInTest
+public class TestLocaleConfig extends AbstractResourceBundleTest
{
private LocaleConfigService service_;
@@ -45,8 +45,7 @@
public void setUp() throws Exception
{
- service_ =
- (LocaleConfigService)PortalContainer.getInstance().getComponentInstanceOfType(LocaleConfigService.class);
+ service_ = (LocaleConfigService)PortalContainer.getInstance().getComponentInstanceOfType(LocaleConfigService.class);
}
public void tearDown() throws Exception
Modified: portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
===================================================================
--- portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2010-03-04 17:18:43 UTC (rev 1979)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2010-03-04 17:27:12 UTC (rev 1980)
@@ -19,12 +19,8 @@
package org.exoplatform.services.resources.test;
-import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.services.resources.LocaleConfigService;
-import org.exoplatform.services.resources.Query;
-import org.exoplatform.services.resources.ResourceBundleData;
-import org.exoplatform.services.resources.ResourceBundleService;
+import org.exoplatform.services.resources.*;
import java.util.List;
import java.util.Locale;
@@ -37,7 +33,7 @@
* @since: 0.0
* @email: tuan08(a)yahoo.com
*/
-public class TestResourceBundleService extends AbstractGateInTest
+public class TestResourceBundleService extends AbstractResourceBundleTest
{
final static private String PROPERTIES = "language=en\nproperty=property";
14 years, 10 months
gatein SVN: r1978 - in portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state: consumer and 3 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-04 11:52:59 -0500 (Thu, 04 Mar 2010)
New Revision: 1978
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java
Log:
- GTNPORTAL-737:
+ JCRPortletStatePersistenceManager was not using the specially defined workspace.
+ JCRPortletStatePersistenceManager was not properly persisting updates to states.
+ Added a new SessionLifeCycle implementation as it is currently not possible to pass the workspace name at
runtime to the SessionLifeCycle implementation used by Chromattic.
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-03-04 16:51:12 UTC (rev 1977)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-03-04 16:52:59 UTC (rev 1978)
@@ -46,18 +46,32 @@
public class JCRPersister
{
private Chromattic chrome;
- private static final String WORKSPACE_NAME = "wsrp-system";
+ public static final String WSRP_WORKSPACE_NAME = "wsrp-system";
+ public static final String PORTLET_STATES_WORKSPACE_NAME = "portlet-states-system";
private static final String REPOSITORY_NAME = "repository";
+ private String workspaceName;
- public JCRPersister(ExoContainer container)
+ public JCRPersister(ExoContainer container, String workspaceName)
{
+ this.workspaceName = workspaceName;
}
public void initializeBuilderFor(List<Class> mappingClasses) throws Exception
{
ChromatticBuilder builder = ChromatticBuilder.create();
builder.setOptionValue(ChromatticBuilder.INSTRUMENTOR_CLASSNAME, "org.chromattic.apt.InstrumentorImpl");
- builder.setOptionValue(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME, WSRPSessionLifeCycle.class.getName());
+ if (PORTLET_STATES_WORKSPACE_NAME.equals(workspaceName))
+ {
+ builder.setOptionValue(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME, PortletStatesSessionLifeCycle.class.getName());
+ }
+ else if (WSRP_WORKSPACE_NAME.equals(workspaceName))
+ {
+ builder.setOptionValue(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME, WSRPSessionLifeCycle.class.getName());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown workspace name: '" + workspaceName + "'");
+ }
for (Class mappingClass : mappingClasses)
{
@@ -105,7 +119,7 @@
public Session login() throws RepositoryException
{
- return provider.getSession(WORKSPACE_NAME, repository);
+ return provider.getSession(WSRP_WORKSPACE_NAME, repository);
}
public Session login(String s) throws RepositoryException
@@ -134,6 +148,58 @@
}
}
+ public static class PortletStatesSessionLifeCycle implements SessionLifeCycle
+ {
+ private ManageableRepository repository;
+ private SessionProvider provider;
+
+ public PortletStatesSessionLifeCycle()
+ {
+ try
+ {
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ RepositoryService repoService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ repository = repoService.getRepository(REPOSITORY_NAME);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ provider = SessionProvider.createSystemProvider();
+ }
+
+ public Session login() throws RepositoryException
+ {
+ return provider.getSession(PORTLET_STATES_WORKSPACE_NAME, repository);
+ }
+
+ public Session login(String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials, String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void save(Session session) throws RepositoryException
+ {
+ session.save();
+ }
+
+ public void close(Session session)
+ {
+ session.logout();
+ }
+ }
+
public static class QNameFormatter implements ObjectFormatter
{
private static final String OPEN_BRACE_REPLACEMENT = "-__";
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-03-04 16:51:12 UTC (rev 1977)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-03-04 16:52:59 UTC (rev 1978)
@@ -59,7 +59,7 @@
EndpointInfoMapping.class, RegistrationInfoMapping.class, RegistrationPropertyMapping.class,
RegistrationPropertyDescriptionMapping.class);
- persister = new JCRPersister(container);
+ persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
persister.initializeBuilderFor(mappingClasses);
// persister = NewJCRPersister.getInstance(container);
}
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2010-03-04 16:51:12 UTC (rev 1977)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2010-03-04 16:52:59 UTC (rev 1978)
@@ -56,7 +56,7 @@
Collections.addAll(mappingClasses, ProducerConfigurationMapping.class, RegistrationRequirementsMapping.class,
RegistrationPropertyDescriptionMapping.class);
- persister = new JCRPersister(container);
+ persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
persister.initializeBuilderFor(mappingClasses);
// persister = NewJCRPersister.getInstance(container);
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-03-04 16:51:12 UTC (rev 1977)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-03-04 16:52:59 UTC (rev 1978)
@@ -57,7 +57,7 @@
public JCRRegistrationPersistenceManager(ExoContainer container) throws Exception
{
- persister = new JCRPersister(container);
+ persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
List<Class> mappingClasses = new ArrayList<Class>(6);
Collections.addAll(mappingClasses, ConsumersAndGroupsMapping.class, ConsumerMapping.class, ConsumerGroupMapping.class,
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java 2010-03-04 16:51:12 UTC (rev 1977)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java 2010-03-04 16:52:59 UTC (rev 1978)
@@ -51,7 +51,7 @@
public JCRPortletStatePersistenceManager(ExoContainer container) throws Exception
{
- persister = new JCRPersister(container);
+ persister = new JCRPersister(container, JCRPersister.PORTLET_STATES_WORKSPACE_NAME);
List<Class> mappingClasses = new ArrayList<Class>(6);
Collections.addAll(mappingClasses, PortletStateContextsMapping.class, PortletStateContextMapping.class, PortletStateMapping.class);
@@ -83,7 +83,7 @@
PortletStateMapping psm = pscm.getState();
psm.setProperties(propertyMap);
- persister.closeSession(session, false);
+ persister.closeSession(session, true);
}
@@ -94,7 +94,7 @@
PortletStateContextMapping pscm = getPortletStateContextMapping(session, stateId);
PortletStateContext context;
- if(pscm == null)
+ if (pscm == null)
{
context = null;
}
@@ -116,7 +116,7 @@
String encodedForPath = JCRPersister.PortletNameFormatter.encode(portletId);
PortletStateContextMapping pscm = session.findByPath(PortletStateContextMapping.class, PATH + encodedForPath);
- if(pscm == null)
+ if (pscm == null)
{
PortletStateContextsMapping portletStateContexts = getContexts(session);
pscm = portletStateContexts.createPortletStateContext(portletId);
14 years, 10 months
gatein SVN: r1977 - in portal/trunk: portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component and 1 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-03-04 11:51:12 -0500 (Thu, 04 Mar 2010)
New Revision: 1977
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java
Log:
GTNPORTAL-779: An enhancement in navigation node management
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2010-03-04 16:22:10 UTC (rev 1976)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2010-03-04 16:51:12 UTC (rev 1977)
@@ -252,6 +252,11 @@
{
this.visibility = visibility;
}
+
+ public Visibility getVisibility()
+ {
+ return this.visibility;
+ }
private boolean isInPublicationDate()
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2010-03-04 16:22:10 UTC (rev 1976)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2010-03-04 16:51:12 UTC (rev 1977)
@@ -29,6 +29,7 @@
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.webui.navigation.PageNavigationUtils;
import org.exoplatform.portal.webui.navigation.UINavigationManagement;
import org.exoplatform.portal.webui.navigation.UINavigationNodeSelector;
import org.exoplatform.portal.webui.page.UIPageNodeForm2;
@@ -338,6 +339,8 @@
naviManager.setOwnerType(PortalConfig.PORTAL_TYPE);
PageNavigation navi = dataService.getPageNavigation(PortalConfig.PORTAL_TYPE, portalName);
+ //Filter the navigation
+ navi = PageNavigationUtils.filterNavigation(navi, context.getRemoteUser(), true);
uicomp.setSelectedNavigation(navi);
UINavigationNodeSelector selector = naviManager.getChild(UINavigationNodeSelector.class);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java 2010-03-04 16:22:10 UTC (rev 1976)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java 2010-03-04 16:51:12 UTC (rev 1977)
@@ -20,10 +20,13 @@
package org.exoplatform.portal.webui.navigation;
import org.exoplatform.container.ExoContainer;
+import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.mop.Visibility;
+import org.exoplatform.services.organization.User;
import org.exoplatform.services.resources.ResourceBundleManager;
import org.exoplatform.webui.application.WebuiRequestContext;
@@ -137,58 +140,123 @@
return searchPageNodeByUri(nav, parentUri);
}
+ // Still keep this method to have compatibility with legacy code
public static PageNavigation filter(PageNavigation nav, String userName) throws Exception
{
+ return filterNavigation(nav, userName, false);
+ }
+
+ /**
+ *
+ * @param nav
+ * @param userName
+ * @param acceptNonDisplayedNode
+ * @return
+ * @throws Exception
+ */
+ public static PageNavigation filterNavigation(PageNavigation nav, String userName, boolean acceptNonDisplayedNode) throws Exception
+ {
PageNavigation filter = nav.clone();
filter.setNodes(new ArrayList<PageNode>());
- // if(nav.getNodes() == null || nav.getNodes().size() < 1) return null;
+
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ ExoContainer container = context.getApplication().getApplicationServiceContainer();
+ UserPortalConfigService userService =
+ (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
+ UserACL userACL = (UserACL)container.getComponentInstanceOfType(UserACL.class);
+
for (PageNode node : nav.getNodes())
{
- PageNode newNode = filter(node, userName);
+ PageNode newNode = filterNodeNavigation(node, userName, acceptNonDisplayedNode, userService, userACL);
if (newNode != null)
filter.addNode(newNode);
}
return filter;
}
- public static PageNode filter(PageNode node, String userName) throws Exception
+ /**
+ * PageNode won't be processed in following cases:
+ *
+ * Case 1: Node 's visibility is SYSTEM and the user is not superuser or he is superuser but acceptNonDisplayNode = false
+ *
+ * Case 2: Node 's visibility is not SYSTEM but the node is not display and the acceptNonDisplayedNode = false
+ *
+ * Case 3: Node has non null pageReference but the associated Page does not exist
+ *
+ *
+ * @param startNode
+ * @param userName
+ * @param userService
+ * @return
+ * @throws Exception
+ */
+ private static PageNode filterNodeNavigation(PageNode startNode, String userName, boolean acceptNonDisplayedNode,
+ UserPortalConfigService userService, UserACL userACL) throws Exception
{
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
- ExoContainer container = context.getApplication().getApplicationServiceContainer();
- UserPortalConfigService userService =
- (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
- if (!node.isDisplay()
- || (node.getPageReference() != null && userService.getPage(node.getPageReference(), userName) == null))
+
+ Visibility nodeVisibility = startNode.getVisibility();
+ String pageReference = startNode.getPageReference();
+
+ boolean doNothingCase_1 = nodeVisibility == Visibility.SYSTEM && (!userACL.getSuperUser().equals(userName) || !acceptNonDisplayedNode);
+ boolean doNothingCase_2 = nodeVisibility != Visibility.SYSTEM && !startNode.isDisplay() && !acceptNonDisplayedNode;
+ boolean doNothingCase_3 = (pageReference != null) && (userService.getPage(pageReference, userName) == null);
+
+
+
+ if (doNothingCase_1 || doNothingCase_2 || doNothingCase_3)
+ {
return null;
- PageNode copyNode = node.clone();
- copyNode.setChildren(new ArrayList<PageNode>());
- List<PageNode> children = node.getChildren();
+ }
+
+ PageNode cloneStartNode = startNode.clone();
+ ArrayList<PageNode> filteredChildren = new ArrayList<PageNode>();
+
+ List<PageNode> children = startNode.getChildren();
+
if (children != null)
{
for (PageNode child : children)
{
- PageNode newNode = filter(child, userName);
- if (newNode != null)
- copyNode.getChildren().add(newNode);
+ PageNode filteredChildNode = filterNodeNavigation(child, userName, acceptNonDisplayedNode, userService, userACL);
+ if (filteredChildNode != null)
+ {
+ filteredChildren.add(filteredChildNode);
+ }
}
}
- if ((copyNode.getChildren() == null || copyNode.getChildren().size() == 0)
- && (copyNode.getPageReference() == null))
+
+ //If the node has no child and it does not point to any Page, then null is return
+ if (filteredChildren.size() == 0 && cloneStartNode.getPageReference() == null)
+ {
return null;
- return copyNode;
+ }
+ cloneStartNode.setChildren(filteredChildren);
+ return cloneStartNode;
}
-
- public static void localizePageNavigation(PageNavigation nav,Locale locale, ResourceBundleManager i18nManager)
+
+ public static PageNode filter(PageNode node, String userName, boolean acceptNonDisplayedNode) throws Exception
{
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ ExoContainer container = context.getApplication().getApplicationServiceContainer();
+ UserPortalConfigService userService =
+ (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
+ UserACL userACL = (UserACL)container.getComponentInstanceOfType(UserACL.class);
+
+ return filterNodeNavigation(node, userName, acceptNonDisplayedNode, userService, userACL);
+ }
+
+ public static void localizePageNavigation(PageNavigation nav, Locale locale, ResourceBundleManager i18nManager)
+ {
if (nav.getOwnerType().equals(PortalConfig.USER_TYPE))
return;
- ResourceBundle res = i18nManager.getNavigationResourceBundle(locale.getLanguage(), nav.getOwnerType(), nav.getOwnerId());
+ ResourceBundle res =
+ i18nManager.getNavigationResourceBundle(locale.getLanguage(), nav.getOwnerType(), nav.getOwnerId());
for (PageNode node : nav.getNodes())
{
resolveLabel(res, node);
}
}
-
+
private static void resolveLabel(ResourceBundle res, PageNode node)
{
node.setResolvedLabel(res);
@@ -199,12 +267,12 @@
resolveLabel(res, childNode);
}
}
-
+
public static PageNavigation findNavigationByID(List<PageNavigation> all_Navigations, int id)
{
- for(PageNavigation nav : all_Navigations)
+ for (PageNavigation nav : all_Navigations)
{
- if(nav.getId() == id)
+ if (nav.getId() == id)
{
return nav;
}
14 years, 10 months
gatein SVN: r1976 - portal/trunk/component/resources/src/main/java/org/exoplatform/services/resources/impl.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-03-04 11:22:10 -0500 (Thu, 04 Mar 2010)
New Revision: 1976
Modified:
portal/trunk/component/resources/src/main/java/org/exoplatform/services/resources/impl/SimpleResourceBundleService.java
Log:
null means null
Modified: portal/trunk/component/resources/src/main/java/org/exoplatform/services/resources/impl/SimpleResourceBundleService.java
===================================================================
--- portal/trunk/component/resources/src/main/java/org/exoplatform/services/resources/impl/SimpleResourceBundleService.java 2010-03-04 16:04:44 UTC (rev 1975)
+++ portal/trunk/component/resources/src/main/java/org/exoplatform/services/resources/impl/SimpleResourceBundleService.java 2010-03-04 16:22:10 UTC (rev 1976)
@@ -113,7 +113,7 @@
}
else
{
- return l1 == null ? -1 : l1.compareTo(l2);
+ return l1.compareTo(l2);
}
}
});
14 years, 10 months
gatein SVN: r1975 - in portal/trunk: server/tomcat/patch/src/main/tomcat/conf and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-03-04 11:04:44 -0500 (Thu, 04 Mar 2010)
New Revision: 1975
Modified:
portal/trunk/component/resources/pom.xml
portal/trunk/server/tomcat/patch/src/main/tomcat/conf/logging.properties
Log:
temporarily disable resource unit tests
Modified: portal/trunk/component/resources/pom.xml
===================================================================
--- portal/trunk/component/resources/pom.xml 2010-03-04 15:54:51 UTC (rev 1974)
+++ portal/trunk/component/resources/pom.xml 2010-03-04 16:04:44 UTC (rev 1975)
@@ -26,6 +26,10 @@
<version>3.0.0-CR02-SNAPSHOT</version>
</parent>
+ <properties>
+ <maven.test.skip>true</maven.test.skip>
+ </properties>
+
<modelVersion>4.0.0</modelVersion>
<artifactId>exo.portal.component.resources</artifactId>
<packaging>jar</packaging>
Modified: portal/trunk/server/tomcat/patch/src/main/tomcat/conf/logging.properties
===================================================================
--- portal/trunk/server/tomcat/patch/src/main/tomcat/conf/logging.properties 2010-03-04 15:54:51 UTC (rev 1974)
+++ portal/trunk/server/tomcat/patch/src/main/tomcat/conf/logging.properties 2010-03-04 16:04:44 UTC (rev 1975)
@@ -77,12 +77,12 @@
# GateIn log configuration
############################################################
-org.exoplatform.level = FINE
+org.exoplatform.level = INFO
org.exoplatform.handlers = 6gatein.org.apache.juli.FileHandler
-org.gatein.level = FINE
+org.gatein.level = INFO
org.gatein.handlers = 6gatein.org.apache.juli.FileHandler
-org.chromattic.level = FINE
+org.chromattic.level = INFO
org.chromattic.handlers = 6gatein.org.apache.juli.FileHandler
14 years, 10 months
gatein SVN: r1974 - in portal/trunk: component/common and 6 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-03-04 10:54:51 -0500 (Thu, 04 Mar 2010)
New Revision: 1974
Added:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/cache/
portal/trunk/component/common/src/main/java/org/exoplatform/commons/cache/SimpleExoCacheCreator.java
Removed:
portal/trunk/component/scripting/src/main/java/conf/
Modified:
portal/trunk/component/common/pom.xml
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
better cache confriguration
Modified: portal/trunk/component/common/pom.xml
===================================================================
--- portal/trunk/component/common/pom.xml 2010-03-04 14:37:07 UTC (rev 1973)
+++ portal/trunk/component/common/pom.xml 2010-03-04 15:54:51 UTC (rev 1974)
@@ -44,6 +44,10 @@
<artifactId>exo.kernel.commons</artifactId>
</dependency>
<dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.database</artifactId>
</dependency>
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/cache/SimpleExoCacheCreator.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/cache/SimpleExoCacheCreator.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/cache/SimpleExoCacheCreator.java 2010-03-04 15:54:51 UTC (rev 1974)
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.cache;
+
+import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.cache.ExoCacheConfig;
+import org.exoplatform.services.cache.ExoCacheInitException;
+import org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache;
+import org.exoplatform.services.cache.impl.jboss.ExoCacheCreator;
+import org.jboss.cache.Cache;
+
+import java.io.Serializable;
+
+/**
+ * Gives more flexibility in GateIn cache usage.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class SimpleExoCacheCreator implements ExoCacheCreator
+{
+ public ExoCache<Serializable, Object> create(ExoCacheConfig config, Cache<Serializable, Object> jbossCache) throws ExoCacheInitException
+ {
+ ExoCache<Serializable, Object> simple = new ConcurrentFIFOExoCache<Serializable, Object>();
+ simple.setName(config.getName());
+ simple.setLabel(config.getLabel());
+ simple.setMaxSize(config.getMaxSize());
+ simple.setLiveTime(config.getLiveTime());
+ return simple;
+ }
+
+ public Class<? extends ExoCacheConfig> getExpectedConfigType()
+ {
+ return ExoCacheConfig.class;
+ }
+
+ public String getExpectedImplementation()
+ {
+ return "simple";
+ }
+}
Modified: portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java
===================================================================
--- portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java 2010-03-04 14:37:07 UTC (rev 1973)
+++ portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java 2010-03-04 15:54:51 UTC (rev 1974)
@@ -60,13 +60,11 @@
private boolean cacheTemplate_ = true;
- public TemplateService(InitParams params, TemplateStatisticService statisticService, CacheService cservice)
- throws Exception
+ public TemplateService(TemplateStatisticService statisticService, CacheService cservice) throws Exception
{
- engine_ = new GroovyTemplateEngine();
+ this.engine_ = new GroovyTemplateEngine();
this.statisticService = statisticService;
- templatesCache_ = cservice.getCacheInstance(TemplateService.class.getName());
- getTemplatesCache().setLiveTime(10000);
+ this.templatesCache_ = cservice.getCacheInstance(TemplateService.class.getSimpleName());
}
public void merge(String name, BindingContext context) throws Exception
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-03-04 14:37:07 UTC (rev 1973)
+++ portal/trunk/pom.xml 2010-03-04 15:54:51 UTC (rev 1974)
@@ -127,6 +127,11 @@
<version>${org.exoplatform.kernel.version}</version>
</dependency>
<dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.component.command</artifactId>
<version>${org.exoplatform.kernel.version}</version>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2010-03-04 14:37:07 UTC (rev 1973)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2010-03-04 15:54:51 UTC (rev 1974)
@@ -117,6 +117,17 @@
</component>
<component>
+ <key>org.exoplatform.services.cache.ExoCacheFactory</key>
+ <type>org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryImpl</type>
+ <init-params>
+ <value-param>
+ <name>cache.config.template</name>
+ <value>classpath:/conf/jcr/jbosscache/cluster/config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
<key>org.exoplatform.commons.chromattic.ChromatticManager</key>
<type>org.exoplatform.commons.chromattic.ChromatticManager</type>
</component>
@@ -135,4 +146,70 @@
<type>org.exoplatform.management.RestManagementProvider</type>
</component>
+ <component>
+ <type>org.exoplatform.groovyscript.text.TemplateStatisticService</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>false</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.groovyscript.text.TemplateService</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>false</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.cache.ExoCacheFactory</target-component>
+ <component-plugin>
+ <name>addCreator</name>
+ <set-method>addCreator</set-method>
+ <type>org.exoplatform.services.cache.impl.jboss.ExoCacheCreatorPlugin</type>
+ <description>add Exo Cache Creator</description>
+ <init-params>
+ <object-param>
+ <name>LRU</name>
+ <description>The LRU cache creator</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheCreator"></object>
+ </object-param>
+ <object-param>
+ <name>simple</name>
+ <description>The Simple cache creator</description>
+ <object type="org.exoplatform.commons.cache.SimpleExoCacheCreator"></object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.cache.CacheService</target-component>
+ <component-plugin>
+ <name>addExoCacheConfig</name>
+ <set-method>addExoCacheConfig</set-method>
+ <type>org.exoplatform.services.cache.ExoCacheConfigPlugin</type>
+ <description>add Exo Cache Config</description>
+ <init-params>
+ <object-param>
+ <name>cache.config.TemplateService</name>
+ <description>The JBoss Cache LRU configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name">
+ <string>TemplateService</string>
+ </field>
+ <field name="liveTime">
+ <long>600000</long>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
</configuration>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2010-03-04 14:37:07 UTC (rev 1973)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2010-03-04 15:54:51 UTC (rev 1974)
@@ -194,17 +194,6 @@
</component-plugins>
</component>
- <component>
- <key>org.exoplatform.services.cache.ExoCacheFactory</key>
- <type>org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryImpl</type>
- <init-params>
- <value-param>
- <name>cache.config.template</name>
- <value>classpath:/conf/jcr/jbosscache/cluster/config.xml</value>
- </value-param>
- </init-params>
- </component>
-
<external-component-plugins>
<target-component>org.exoplatform.services.organization.OrganizationService</target-component>
<component-plugin>
@@ -276,23 +265,6 @@
</external-component-plugins>
<external-component-plugins>
- <target-component>org.exoplatform.services.cache.ExoCacheFactory</target-component>
- <component-plugin>
- <name>addCreator</name>
- <set-method>addCreator</set-method>
- <type>org.exoplatform.services.cache.impl.jboss.ExoCacheCreatorPlugin</type>
- <description>add Exo Cache Creator</description>
- <init-params>
- <object-param>
- <name>LRU</name>
- <description>The LRU cache creator</description>
- <object type="org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheCreator"></object>
- </object-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
- <external-component-plugins>
<target-component>org.exoplatform.services.cache.CacheService</target-component>
<component-plugin>
<name>addExoCacheConfig</name>
@@ -319,6 +291,4 @@
</component-plugin>
</external-component-plugins>
-
-
</configuration>
14 years, 10 months