gatein SVN: r5393 - exo/portal/branches.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2010-11-30 21:40:31 -0500 (Tue, 30 Nov 2010)
New Revision: 5393
Added:
exo/portal/branches/webos-gatein-branch/
Log:
Create a branch for WebOS works from GateIn trunk at revision 4406
Copied: exo/portal/branches/webos-gatein-branch (from rev 4406, portal/trunk)
14 years
gatein SVN: r5392 - in portal/branches/branch-GTNPORTAL-1700/component/resources/src: test/java/org/exoplatform/services/resources/test and 1 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-11-30 21:05:32 -0500 (Tue, 30 Nov 2010)
New Revision: 5392
Added:
portal/branches/branch-GTNPORTAL-1700/component/resources/src/test/resources/locale/portlet_en.properties
Modified:
portal/branches/branch-GTNPORTAL-1700/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
portal/branches/branch-GTNPORTAL-1700/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
Log:
GTNPORTAL-1665: Store the classpath resource bundle on cache while running portal in non-dev mode
Modified: portal/branches/branch-GTNPORTAL-1700/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-12-01 01:58:28 UTC (rev 5391)
+++ portal/branches/branch-GTNPORTAL-1700/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-12-01 02:05:32 UTC (rev 5392)
@@ -22,6 +22,7 @@
import org.exoplatform.commons.utils.IOUtil;
import org.exoplatform.commons.utils.MapResourceBundle;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.services.cache.ExoCache;
import org.exoplatform.services.log.Log;
@@ -42,12 +43,10 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
-import java.util.Set;
/**
* Created by The eXo Platform SAS Mar 9, 2007
@@ -383,11 +382,6 @@
return IdentityResourceBundle.getInstance();
}
- // Case 1: ResourceBundle of portlets, standard java API is used
- if (isClasspathResource(name))
- return ResourceBundleLoader.load(name, locale, cl);
-
- // Case 2: ResourceBundle of portal
String country = locale.getCountry();
String id;
if (country != null && country.length() > 0)
@@ -399,18 +393,39 @@
id = name + "_" + locale.getLanguage();
}
- try
+ boolean isClasspathResource = isClasspathResource(name);
+ boolean isCacheable = !isClasspathResource || !PropertyManager.isDevelopping();
+ if (isCacheable)
{
- ResourceBundle rb = cache_.get(id);
- if (rb != null)
+ if (isClasspathResource)
{
- return rb;
+ // Avoid naming collision
+ id += "_" + cl.getClass() + "_" + cl.hashCode();
}
+ try
+ {
+ ResourceBundle rb = cache_.get(id);
+ if (rb != null)
+ {
+ return rb;
+ }
+ }
+ catch (Exception ex)
+ {
+ }
}
- catch (Exception ex)
+
+ // Case 1: ResourceBundle of portlets, standard java API is used
+ if (isClasspathResource)
{
+ ResourceBundle res = ResourceBundleLoader.load(name, locale, cl);
+ //Cache classpath resource bundle while running portal in non-dev mode
+ if (isCacheable)
+ cache_.put(id, res);
+ return res;
}
+ // Case 2: ResourceBundle of portal
try
{
ResourceBundle res = null;
Modified: portal/branches/branch-GTNPORTAL-1700/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2010-12-01 01:58:28 UTC (rev 5391)
+++ portal/branches/branch-GTNPORTAL-1700/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2010-12-01 02:05:32 UTC (rev 5392)
@@ -19,8 +19,13 @@
package org.exoplatform.services.resources.test;
+import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.services.resources.*;
+import org.exoplatform.services.resources.AbstractResourceBundleTest;
+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 java.util.List;
import java.util.Locale;
@@ -178,4 +183,33 @@
{
return "Test Resource Bundle Service";
}
+
+ public void testClasspathResourceCache()
+ {
+ String oldValue = PropertyManager.getProperty(PropertyManager.DEVELOPING);
+ try
+ {
+ PropertyManager.setProperty(PropertyManager.DEVELOPING, "false");
+ assertFalse(PropertyManager.isDevelopping());
+ MyClassLoader cl1 = new MyClassLoader();
+ ResourceBundle res = service_.getResourceBundle("locale.portlet", Locale.ENGLISH, cl1);
+ assertNotNull(res);
+ assertTrue(res == service_.getResourceBundle("locale.portlet", Locale.ENGLISH, cl1));
+ assertFalse(res == service_.getResourceBundle("locale.portlet", Locale.ENGLISH, new MyClassLoader()));
+ }
+ finally
+ {
+ PropertyManager.setProperty(PropertyManager.DEVELOPING, oldValue);
+ }
+ }
+
+ private static class MyClassLoader extends ClassLoader
+ {
+
+ @Override
+ public String toString()
+ {
+ return "MyClassLoader";
+ }
+ }
}
Added: portal/branches/branch-GTNPORTAL-1700/component/resources/src/test/resources/locale/portlet_en.properties
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/component/resources/src/test/resources/locale/portlet_en.properties (rev 0)
+++ portal/branches/branch-GTNPORTAL-1700/component/resources/src/test/resources/locale/portlet_en.properties 2010-12-01 02:05:32 UTC (rev 5392)
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+language.language=English
14 years
gatein SVN: r5391 - epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-11-30 20:58:28 -0500 (Tue, 30 Nov 2010)
New Revision: 5391
Modified:
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Add-ons.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Installation.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Introduction.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Test_Your_Installation.xml
Log:
JBEPP-515: Removed references to EPP 5.0 version
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Add-ons.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Add-ons.xml 2010-11-30 21:12:07 UTC (rev 5390)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Add-ons.xml 2010-12-01 01:58:28 UTC (rev 5391)
@@ -7,15 +7,17 @@
<chapter id="Installing_Add-ons">
<title>Installing Add-ons</title>
<important>
- <title>Important:</title>
+ <title>Important</title>
<para>
- Do not read further in this guide if you are intending to install the &JBSP; add-on.
+ Do not read further in this guide if you intend to install the &JBSP; add-on. The Site Publisher add-on must be deployed into a data-free &PRODUCT; environment to install successfully.
</para>
</important>
+
<para>
- The Site Publisher add-on must be deployed into a data-free &PRODUCT; environment to install successfully.
+ You shoud refer to the Site Publisher Installation Guide available at <ulink type="http" url="http://docs.redhat.com/docs/en-US/JBoss_Site_Publisher/index.html"></ulink> and install the add-on before making any changes to the underlying &PRODUCT; &VERSION_MINOR; installation.
</para>
<para>
- You shoud refer to the Site Publisher Installation Guide available at <ulink type="http" url="http://docs.redhat.com/docs/en-US/JBoss_Site_Publisher/index.html"></ulink> and install the add-on before making any changes to the base &PRODUCT; &VERSION_MINOR; installation.
+ Once you have completed the installation for the &JBSP; extension, you should return to this document and continue this process.
</para>
+
</chapter>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml 2010-11-30 21:12:07 UTC (rev 5390)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml 2010-12-01 01:58:28 UTC (rev 5391)
@@ -8,13 +8,16 @@
<title>Getting Started</title>
<section id="sect-Installation_Guide-Getting_Started-Upgrading_Previous_Installations">
- <title>Upgrading Previous Installations</title>
- <para>
- Unfortunately existing &PRODUCT; 5.0 or 5.0.1 installations cannot be upgraded in order to deploy &PRODUCT; &VERSION_MICRO;.
- </para>
- <para>
- If you have an existing installation of &PRODUCT; 5.0 or 5.0.1 (including installations that include the technical preview release of the &PRODUCT; extension) you must either replace this installation or deploy a new instance of &PRODUCT;.
- </para>
+ <title>Upgrading to &PRODUCT; &VERSION_MICRO;</title>
+ <important>
+ <title></title>
+ <para>
+ Unfortunately existing &PRODUCT; 5.0 or 5.0.1 installations cannot be upgraded in order to deploy &PRODUCT; &VERSION_MICRO;.
+ </para>
+ <para>
+ If you have an existing installation of &PRODUCT; 5.0 or 5.0.1 (including installations that include the technical preview release of the &PRODUCT; Site Publisher extension) you must either replace this installation or deploy a new instance of &PRODUCT;.
+ </para>
+ </important>
</section>
<section id="Getting_Started-Pre_Requisites">
@@ -24,9 +27,8 @@
</para>
<section id="Pre_Requisites-EAP">
<title>Enterprise Application Platform</title>
- <para>The Enterprise Portal Platform 5.0 is built upon the Enterprise Application Platform 5.0.
- For more details about the underlying platform such as the difference between the 4.3 and 5.0 versions, please refer to
- the EAP installation guide available at: <ulink url="http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/"></ulink>
+ <para>&PRODUCT; is built upon &JBEAP;. For more details about the underlying platform please refer to
+ the EAP installation guide available at: <ulink url="http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/i..."></ulink>
</para>
</section>
<section id="Pre_Requisites-Hardware_and_Operating_System_Requirements">
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Installation.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Installation.xml 2010-11-30 21:12:07 UTC (rev 5390)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Installation.xml 2010-12-01 01:58:28 UTC (rev 5391)
@@ -11,7 +11,7 @@
<title>Downloading</title>
<para>
- The officially supported versions are available from the JBoss Customer Support Portal (CSP) located at <ulink url="https://support.redhat.com/jbossnetwork/restricted/main.html">https://support.redhat.com/jbossnetwork/restricted/main.html</ulink>. Platforms including in your Support subscription are listed in the <literal>Software</literal> section.
+ The officially supported versions are available from the JBoss Customer Support Portal (CSP) located at <ulink url="https://access.redhat.com/home">https://access.redhat.com/home</ulink>. Platforms including in your Support subscription are listed in the <literal>Software</literal> section.
</para>
</section>
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Introduction.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Introduction.xml 2010-11-30 21:12:07 UTC (rev 5390)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Introduction.xml 2010-12-01 01:58:28 UTC (rev 5391)
@@ -18,7 +18,7 @@
<section id="Introduction-Other_Manuals">
<title>Other Manuals</title>
<para>
- If you are looking for detailed information about other JBoss middleware products such as JBoss Enterprise Applications Platform please refer to the manuals available online at <ulink url="http://www.redhat.com/docs/manuals/jboss"></ulink>.
+ If you are looking for detailed information about other JBoss middleware products such as JBoss Enterprise Applications Platform please refer to the manuals available online at <ulink url="http://docs.redhat.com/docs/en-US/index.html"></ulink>.
</para>
</section>
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Test_Your_Installation.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Test_Your_Installation.xml 2010-11-30 21:12:07 UTC (rev 5390)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Test_Your_Installation.xml 2010-12-01 01:58:28 UTC (rev 5391)
@@ -78,7 +78,7 @@
Ensure that port 8080 is not already in use and open <literal>http://localhost:8080/portal</literal> in your web browser.
<footnote>
<para>
- Note that on some machines, the name localhost won’t resolve properly and you should use the local loopback address 127.0.0.1 instead.
+ Note that on some machines, the name localhost won’t resolve properly and you should use the local loopback address <ulink type="http" url="127.0.0.1">127.0.0.1</ulink> instead.
</para>
</footnote>
The contents of your page should look similar to this: <xref linkend="Test_your_Installation-Test_your_Installation" />.
@@ -97,7 +97,7 @@
</figure>
</para>
<para>
- You are now ready to use &PRODUCT; 5.0. Refer to the User Guide and Reference Guide for more information about the product's feature set and example applications showcasing &PRODUCT; in action.
+ You are now ready to use &PRODUCT;. Refer to the User Guide and Reference Guide for more information about the product's feature set and example applications showcasing &PRODUCT; in action.
</para>
</chapter>
14 years