gatein SVN: r5169 - exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal.
by do-not-reply@jboss.org
Author: kien_nguyen
Date: 2010-11-19 01:46:12 -0500 (Fri, 19 Nov 2010)
New Revision: 5169
Modified:
exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
EXOGTN-133[PLF] Performance improvements (GTNPORTAL-1575)
Modified: exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
--- exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2010-11-19 04:57:48 UTC (rev 5168)
+++ exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2010-11-19 06:46:12 UTC (rev 5169)
@@ -274,6 +274,29 @@
<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.MOPSessionManager</name>
+ <description>The JBoss Cache configuration for the MOP session Manager</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name">
+ <string>MOPSessionManager</string>
+ </field>
+ <field name="maxSize">
+ <int>5000</int>
+ </field>
+ <field name="liveTime">
+ <long>600</long>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
<component-plugin profiles="cluster">
<name>addExoCacheConfig</name>
<set-method>addExoCacheConfig</set-method>
15 years, 5 months
gatein SVN: r5168 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-11-18 23:57:48 -0500 (Thu, 18 Nov 2010)
New Revision: 5168
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_17_ManageRemoteGadget.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_49_ChangeApplicationWhenEditPagePropertiesOfNode.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_51_ManageGadget.html
Log:
TestVN-356:Clean and Improve existing Selenium for GateIn
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_17_ManageRemoteGadget.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_17_ManageRemoteGadget.html 2010-11-19 04:25:34 UTC (rev 5167)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_17_ManageRemoteGadget.html 2010-11-19 04:57:48 UTC (rev 5168)
@@ -112,6 +112,11 @@
<td></td>
</tr>
<tr>
+ <td>pause</td>
+ <td>1000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForTextPresent</td>
<td>Phonebook</td>
<td></td>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_49_ChangeApplicationWhenEditPagePropertiesOfNode.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_49_ChangeApplicationWhenEditPagePropertiesOfNode.html 2010-11-19 04:25:34 UTC (rev 5167)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_49_ChangeApplicationWhenEditPagePropertiesOfNode.html 2010-11-19 04:57:48 UTC (rev 5168)
@@ -437,6 +437,11 @@
<td></td>
</tr>
<tr>
+ <td>mouseOver</td>
+ <td>//div[2]/div/div/div/div/div/div/div/div[1]/div/div[2]/div/div/div[2]/div/div/div/div/div/div/div[2]</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForTextPresent</td>
<td>Test_SNF_PRL_49</td>
<td></td>
@@ -497,16 +502,26 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>UIPortalApplication</td>
+ <td>mouseOver</td>
+ <td>//div[2]/div/div[2]/div/div/div[2]/div/div/div/div/div/div/div[2]</td>
+ <td>Test_SNF_PRL_49</td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Test_SNF_PRL_49</td>
<td></td>
</tr>
<tr>
- <td>click</td>
- <td>UIPortalApplication</td>
+ <td>verifyTextPresent</td>
+ <td>Test_SNF_PRL_49</td>
<td></td>
</tr>
<tr>
+ <td>pause</td>
+ <td>1000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
<td>link=Switch View mode</td>
<td></td>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_51_ManageGadget.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_51_ManageGadget.html 2010-11-19 04:25:34 UTC (rev 5167)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_51_ManageGadget.html 2010-11-19 04:57:48 UTC (rev 5168)
@@ -87,6 +87,11 @@
<td>http://www.labpixies.com/campaigns/dates/dates.xml</td>
</tr>
<tr>
+ <td>pause</td>
+ <td>1000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
<td>//img[@title='Add Gadget']</td>
<td></td>
@@ -97,11 +102,6 @@
<td></td>
</tr>
<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
<td>echo</td>
<td>-- Close Dashboard Workspace--</td>
<td></td>
@@ -117,6 +117,11 @@
<td></td>
</tr>
<tr>
+ <td>pause</td>
+ <td>1000</td>
+ <td></td>
+</tr>
+<tr>
<td>echo</td>
<td>--Delete gadget--</td>
<td></td>
@@ -142,7 +147,42 @@
<td></td>
</tr>
<tr>
+ <td>echo</td>
+ <td>-- Go to Application Registry to delete gadget --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
+ <td>link=Gadget</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Gadget</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGadgetManagement']/div[2]/div[1]/div/div/div/div[1]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGadgetManagement']/div[2]/div[1]/div/div/div/div[1]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure to delete this gadget?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
<td>link=Sign out</td>
<td></td>
</tr>
15 years, 5 months
gatein SVN: r5167 - portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-11-18 23:25:34 -0500 (Thu, 18 Nov 2010)
New Revision: 5167
Added:
portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/AbstractCodec.java
portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/ToThrowAwayCodec.java
Modified:
portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java
portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenContainer.java
Log:
GTNPORTAL-1533: Passwords saved by CookieTokenService are in JCR DB in plain form
Added: portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/AbstractCodec.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/AbstractCodec.java (rev 0)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/AbstractCodec.java 2010-11-19 04:25:34 UTC (rev 5167)
@@ -0,0 +1,42 @@
+/*
+ * 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.web.security.security;
+
+import org.exoplatform.container.component.BaseComponentPlugin;
+
+/**
+ * Abstract codec used to encode/decode password stored/loaded on/from token entry
+ *
+ * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
+ * Nov 19, 2010
+ */
+
+public abstract class AbstractCodec extends BaseComponentPlugin
+{
+
+ public String getName()
+ {
+ return this.getClass().toString();
+ }
+
+ public abstract String encode(String plainInput);
+
+ public abstract String decode(String encodedInput);
+
+}
Modified: portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java 2010-11-19 03:05:25 UTC (rev 5166)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java 2010-11-19 04:25:34 UTC (rev 5167)
@@ -24,6 +24,7 @@
import org.exoplatform.commons.chromattic.ChromatticManager;
import org.exoplatform.commons.chromattic.ContextualTask;
import org.exoplatform.commons.chromattic.SessionContext;
+import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.GateInToken;
@@ -47,6 +48,9 @@
/** . */
private String lifecycleName="autologin";
+ //TODO: Introduce the concept of priority and store the plugins in a map structure
+ private AbstractCodec codec;
+
public CookieTokenService(InitParams initParams, ChromatticManager chromatticManager)
{
super(initParams);
@@ -56,8 +60,19 @@
lifecycleName = (String)initParams.getValuesParam(SERVICE_CONFIG).getValues().get(3);
}
this.chromatticLifeCycle = chromatticManager.getLifeCycle(lifecycleName);
+
+ //Set the default codec
+ this.codec = new ToThrowAwayCodec();
}
+ public final void setupCodec(ComponentPlugin codecPlugin)
+ {
+ if(codecPlugin instanceof AbstractCodec)
+ {
+ this.codec = (AbstractCodec)codecPlugin;
+ }
+ }
+
public String createToken(final Credentials credentials)
{
if (validityMillis < 0)
@@ -76,7 +91,9 @@
long expirationTimeMillis = System.currentTimeMillis() + validityMillis;
GateInToken token = new GateInToken(expirationTimeMillis, credentials);
TokenContainer container = getTokenContainer();
- container.saveToken(tokenId, token.getPayload(), new Date(token.getExpirationTimeMillis()));
+
+ //Save the token, password is encoded thanks to the codec
+ container.encodeAndSaveToken(tokenId, token.getPayload(), new Date(expirationTimeMillis), codec);
return tokenId;
}
}.executeWith(chromatticLifeCycle);
@@ -89,7 +106,8 @@
@Override
protected GateInToken execute()
{
- return getTokenContainer().getToken((String)id);
+ //Get the token, encoded password is decoded thanks to codec
+ return getTokenContainer().getTokenAndDecode(id, codec);
}
}.executeWith(chromatticLifeCycle);
}
Added: portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/ToThrowAwayCodec.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/ToThrowAwayCodec.java (rev 0)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/ToThrowAwayCodec.java 2010-11-19 04:25:34 UTC (rev 5167)
@@ -0,0 +1,41 @@
+/*
+ * 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.web.security.security;
+
+/**
+ * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
+ * Nov 19, 2010
+ */
+
+public class ToThrowAwayCodec extends AbstractCodec
+{
+
+ @Override
+ public String decode(String encodedInput)
+ {
+ return encodedInput;
+ }
+
+ @Override
+ public String encode(String plainInput)
+ {
+ return plainInput;
+ }
+
+}
Modified: portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenContainer.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenContainer.java 2010-11-19 03:05:25 UTC (rev 5166)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenContainer.java 2010-11-19 04:25:34 UTC (rev 5167)
@@ -84,5 +84,37 @@
entry.setExpirationTime(expirationTime);
return entry.getToken();
}
+
+ public GateInToken encodeAndSaveToken(String tokenId, Credentials credentials, Date expirationTime, AbstractCodec codec)
+ {
+ Map<String, TokenEntry> tokens = getTokens();
+ TokenEntry entry = tokens.get(tokenId);
+ if (entry == null)
+ {
+ entry = createToken();
+ tokens.put(tokenId, entry);
+ entry.setUserName(credentials.getUsername());
+ entry.setPassword(codec.encode(credentials.getPassword()));
+ }
+ entry.setExpirationTime(expirationTime);
+ return entry.getToken();
+ }
+
+ public GateInToken getTokenAndDecode(String tokenId, AbstractCodec codec)
+ {
+ Map<String, TokenEntry> tokens = getTokens();
+ TokenEntry entry = tokens.get(tokenId);
+ if(entry != null)
+ {
+ GateInToken gateInToken = entry.getToken();
+ Credentials payload = gateInToken.getPayload();
+
+ //Return a cloned GateInToken
+ return new GateInToken(gateInToken.getExpirationTimeMillis(), new Credentials(payload.getUsername(), codec
+ .decode(payload.getPassword())));
+ }
+ return null;
+ }
+
}
15 years, 5 months
gatein SVN: r5166 - portal/branches/branch-GTNPORTAL-1643/component/resources/src/main/java/org/exoplatform/services/resources/impl.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2010-11-18 22:05:25 -0500 (Thu, 18 Nov 2010)
New Revision: 5166
Modified:
portal/branches/branch-GTNPORTAL-1643/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
Log:
GTNPORTAL-1665 Revert all commit at r@1521
Modified: portal/branches/branch-GTNPORTAL-1643/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-11-19 02:49:56 UTC (rev 5165)
+++ portal/branches/branch-GTNPORTAL-1643/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-11-19 03:05:25 UTC (rev 5166)
@@ -22,7 +22,6 @@
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;
@@ -384,6 +383,11 @@
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)
@@ -407,17 +411,6 @@
{
}
- // Case 1: ResourceBundle of portlets, standard java API is used
- if (isClasspathResource(name))
- {
- ResourceBundle res = ResourceBundleLoader.load(name, locale, cl);
- //Cache the classpath resource bundle if portal is running in non-developing mode
- if(!PropertyManager.isDevelopping())
- cache_.put(id, res);
- return res;
- }
-
- // Case 2: ResourceBundle of portal
try
{
ResourceBundle res = null;
15 years, 5 months
gatein SVN: r5165 - portal/branches/branch-GTNPORTAL-1643/component/web/server/src/main/java/org/exoplatform/upload.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2010-11-18 21:49:56 -0500 (Thu, 18 Nov 2010)
New Revision: 5165
Modified:
portal/branches/branch-GTNPORTAL-1643/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
Log:
GTNPORTAL-1671 IE7: name of uploaded file is its local path
Modified: portal/branches/branch-GTNPORTAL-1643/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2010-11-19 02:15:56 UTC (rev 5164)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2010-11-19 02:49:56 UTC (rev 5165)
@@ -104,6 +104,9 @@
DiskFileItem fileItem = (DiskFileItem)itemList.get(0);
String fileName = fileItem.getName();
+ if (fileName == null)
+ fileName = uploadId;
+ fileName = fileName.substring(fileName.lastIndexOf('\\') + 1);
String storeLocation = uploadLocation_ + "/" + uploadId + "." + fileName;
// commons-fileupload will store the temp file with name *.tmp
15 years, 5 months
gatein SVN: r5164 - exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2010-11-18 21:15:56 -0500 (Thu, 18 Nov 2010)
New Revision: 5164
Modified:
exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
Log:
EXOGTN-131 Revert all commitment
Modified: exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
===================================================================
--- exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-11-18 18:32:30 UTC (rev 5163)
+++ exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-11-19 02:15:56 UTC (rev 5164)
@@ -22,7 +22,6 @@
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;
@@ -384,6 +383,11 @@
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)
@@ -395,15 +399,6 @@
id = name + "_" + locale.getLanguage();
}
- boolean isClasspathResource = isClasspathResource(name);
- boolean isCacheable = !isClasspathResource || !PropertyManager.isDevelopping();
-
- if(isClasspathResource)
- {
- //Avoid naming collision
- id += "_" + cl.toString();
- }
-
try
{
ResourceBundle rb = cache_.get(id);
@@ -416,17 +411,6 @@
{
}
- // 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;
15 years, 5 months
gatein SVN: r5163 - in portal/trunk/docs/reference-guide/en: modules and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-11-18 13:32:30 -0500 (Thu, 18 Nov 2010)
New Revision: 5163
Added:
portal/trunk/docs/reference-guide/en/images/WSRP/export_done.png
portal/trunk/docs/reference-guide/en/images/WSRP/export_list.png
portal/trunk/docs/reference-guide/en/images/WSRP/export_portlet_list.png
portal/trunk/docs/reference-guide/en/images/WSRP/import_modified_page.png
portal/trunk/docs/reference-guide/en/images/WSRP/import_original_page.png
portal/trunk/docs/reference-guide/en/images/WSRP/import_selected_page.png
portal/trunk/docs/reference-guide/en/images/WSRP/import_start.png
portal/trunk/docs/reference-guide/en/images/WSRP/import_success.png
Modified:
portal/trunk/docs/reference-guide/en/modules/WSRP.xml
Log:
- Added import/export walkthrough.
- Fixed improper package name for RegistrationPolicy and RegistrationPropertyValidator.
Added: portal/trunk/docs/reference-guide/en/images/WSRP/export_done.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/WSRP/export_done.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/WSRP/export_list.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/WSRP/export_list.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/WSRP/export_portlet_list.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/WSRP/export_portlet_list.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/WSRP/import_modified_page.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/WSRP/import_modified_page.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/WSRP/import_original_page.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/WSRP/import_original_page.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/WSRP/import_selected_page.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/WSRP/import_selected_page.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/WSRP/import_start.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/WSRP/import_start.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/WSRP/import_success.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/WSRP/import_success.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: portal/trunk/docs/reference-guide/en/modules/WSRP.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/WSRP.xml 2010-11-18 14:48:39 UTC (rev 5162)
+++ portal/trunk/docs/reference-guide/en/modules/WSRP.xml 2010-11-18 18:32:30 UTC (rev 5163)
@@ -941,7 +941,106 @@
then import them back to replace existing portlets assigned to windows on pages by the previously exported
portlets. Let us walk through an example to make things clearer.
</para>
- <para>***** TODO: walk-through exporting portlets and then importing them</para>
+ <para>Clicking on the "Export" action for a given consumer will display the list of portlets currently made
+ available by this specific consumer, as shown below:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/WSRP/export_portlet_list.png" format="PNG" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <para>Once you have selected portlets to export, you can then click on the "Export" button to export the selected
+ portlets, which will then be made available for later import:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/WSRP/export_done.png" format="PNG" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <para>You can re-import the portlets directly by pressing the "Use for import" button or, on the Consumers list
+ page, using the "Import" action for a given consumer. Let's assume that you used that second option and that
+ you currently have several available sets of previously exported portlets to import from. After clicking the
+ action link, you should see a screen similar to the one below:</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/WSRP/export_list.png" format="PNG" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <para>As you can see this screen presents the list of available exports with available operations for each.
+ <itemizedlist>
+ <listitem>
+ <para>View: displays the export details as previously seen when the export was first performed</para>
+ </listitem>
+ <listitem>
+ <para>Delete: deletes the selected export, asking you for confirmation first</para>
+ </listitem>
+ <listitem>
+ <para>Use for import: selects the export to import portlets from</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>Once you've selected an export to import from, you will see a screen similar to the one below:</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/WSRP/import_start.png" format="PNG" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <para>The screen displays the list of available exported portlets for the previously selected export. You can
+ select which portlet you want to import by checking the checkbox next to its name. Next, you need to select
+ the content of which window the imported portlet will replace. This process is done in three steps. Let's
+ assume in this example that you have the following page called
+ <literal>page1</literal>
+ and containing two windows called
+ <literal>NetUnity WSRP 2 Interop - Cache Markup (remote)</literal>
+ and
+ <literal>/samples-remotecontroller-portlet.RemoteControl (remote)</literal>
+ as shown below:</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/WSRP/import_original_page.png" format="PNG" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <para>In this example, we want to replace the content of the
+ <literal>/samples-remotecontroller-portlet.RemoteControl (remote)</literal>
+ by the content of the
+ <literal>/ajaxPortlet.JSFAJAXPortlet</literal>
+ portlet that we previously exported. To do so, we will check the checkbox next to the
+ <literal>/ajaxPortlet.JSFAJAXPortlet</literal>
+ portlet name to indicate that we want to import its data and then select the
+ <literal>page1</literal>
+ in the list of available pages. The screen will then refresh to display the list of available windows on
+ that page, as seen below:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/WSRP/import_selected_page.png" format="PNG" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <para>Note that, at this point, we still need to select the window which content we want to replace before
+ being able to complete the import operation. Let's select the
+ <literal>/samples-remotecontroller-portlet.RemoteControl (remote)</literal>
+ window, at which point the "Import" button will become enabled, indicating that we now have all the
+ necessary data to perform the import. If all goes well, pressing that button should result in the following
+ screen:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/WSRP/import_success.png" format="PNG" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <para>If you now take a look at the
+ <literal>page1</literal>
+ page, you should now see that the content
+ <literal>/samples-remotecontroller-portlet.RemoteControl (remote)</literal>
+ window has been replaced by the content of the
+ <literal>/ajaxPortlet.JSFAJAXPortlet</literal>
+ imported portlet and the window renamed appropriately:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/WSRP/import_modified_page.png" format="PNG" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
</sect2>
<sect2>
@@ -1105,9 +1204,9 @@
Please refer to the
<trademark class="trade">Javadoc</trademark>
for
- <classname>org.jboss.portal.registration.RegistrationPolicy</classname>
+ <classname>org.gatein.registration.RegistrationPolicy</classname>
and
- <classname>org.jboss.portal.Registration.policies.RegistrationPropertyValidator</classname>
+ <classname>org.gatein.registration.policies.RegistrationPropertyValidator</classname>
for more
details on what is expected of each method.
</para>
15 years, 5 months
gatein SVN: r5162 - portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-11-18 09:48:39 -0500 (Thu, 18 Nov 2010)
New Revision: 5162
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
Log:
- GTNWSRP-158, GTNWSRP-161, GTNWSRP-163: Synchronize update of the ProducerInfo since it can be called concurrently when portlet invocations trigger a ProducerInfo refresh.
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-11-18 14:45:07 UTC (rev 5161)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-11-18 14:48:39 UTC (rev 5162)
@@ -68,10 +68,11 @@
@Override
protected void save(ProducerInfo info, String messageOnError)
{
- ChromatticSession session = persister.getSession();
try
{
+ ChromatticSession session = persister.getSession();
+
ProducerInfosMapping pims = getProducerInfosMapping(session);
ProducerInfoMapping pim = pims.createProducerInfo(info.getId());
String key = session.persist(pims, pim, info.getId());
@@ -103,18 +104,23 @@
+ "' hasn't been persisted and thus cannot be updated.");
}
- ChromatticSession session = persister.getSession();
- ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, key);
- if (pim == null)
+ String oldId;
+ String newId;
+ synchronized (this)
{
- throw new IllegalArgumentException("Couldn't find ProducerInfoMapping associated with key " + key);
+ ChromatticSession session = persister.getSession();
+ ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, key);
+ if (pim == null)
+ {
+ throw new IllegalArgumentException("Couldn't find ProducerInfoMapping associated with key " + key);
+ }
+ oldId = pim.getId();
+ newId = producerInfo.getId();
+ pim.initFrom(producerInfo);
+
+ persister.closeSession(true);
}
- String oldId = pim.getId();
- String newId = producerInfo.getId();
- pim.initFrom(producerInfo);
- persister.closeSession(true);
-
// if the consumer's id has changed, return the old one so that state can be updated
return (oldId.equals(newId)) ? null : oldId;
}
15 years, 5 months
gatein SVN: r5161 - components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-11-18 09:45:07 -0500 (Thu, 18 Nov 2010)
New Revision: 5161
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
Log:
- GTNWSRP-164: Reworked how and when the ProducerInfo is persisted to reduce the number of calls to the persistence layer.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2010-11-18 14:43:00 UTC (rev 5160)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2010-11-18 14:45:07 UTC (rev 5161)
@@ -396,10 +396,9 @@
RefreshResult result = new RefreshResult(); // success by default!
- boolean didJustRefresh = false;
try
{
- didJustRefresh = persistentEndpointInfo.refresh();
+ persistentEndpointInfo.refresh();
}
catch (InvokerUnavailableException e)
{
@@ -408,25 +407,14 @@
// try again as refresh on a failed service factory will fail without attempting the refresh
try
{
- didJustRefresh = persistentEndpointInfo.forceRefresh();
+ persistentEndpointInfo.forceRefresh();
}
catch (InvokerUnavailableException e1)
{
result.setStatus(RefreshResult.Status.FAILURE);
return result;
}
-
- // todo: should we fail fast here?
- // throw new PortletInvokerException("Couldn't refresh endpoint information: " + e.getLocalizedMessage());
}
- finally
- {
- // save changes to endpoint only if we just refreshed, otherwise unneeded
- if (didJustRefresh)
- {
- registry.updateProducerInfo(this);
- }
- }
// get the service description from the producer
try
@@ -490,7 +478,7 @@
{
// if the registration validation has issues, we need to modify our local information
setModifyRegistrationRequired(true);
- setActiveAndSave(false);
+ setActive(false);
}
else
{
@@ -553,7 +541,6 @@
// refresh and force check for extra props if the registered SD failed
// todo: deal with forcing check of extra registration properties properly (if needed)
RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, true, forceRefresh, false);
- registry.updateProducerInfo(this);
// attempt to register and determine if the current service description can be used to extract POPs
if (!registrationResult.hasIssues())
@@ -1031,7 +1018,15 @@
public void register() throws PortletInvokerException
{
- register(null, false);
+ try
+ {
+ register(null, false);
+ }
+ catch (PortletInvokerException e)
+ {
+ registry.updateProducerInfo(this);
+ throw e;
+ }
}
/**
@@ -1102,15 +1097,11 @@
setActive(false);
throw new PortletInvokerException("Couldn't register with producer '" + persistentId + "'", e);
}
- finally
- {
- registry.updateProducerInfo(this);
- }
}
else
{
log.debug(result.getStatus().toString());
- setActiveAndSave(false);
+ setActive(false);
throw new PortletInvokerException("Consumer is not ready to be registered with producer because of missing or invalid registration information.");
}
}
@@ -1149,7 +1140,14 @@
public void modifyRegistration() throws PortletInvokerException
{
- modifyRegistration(false);
+ try
+ {
+ modifyRegistration(false);
+ }
+ finally
+ {
+ registry.updateProducerInfo(this);
+ }
}
private void modifyRegistration(boolean force) throws PortletInvokerException
@@ -1192,10 +1190,6 @@
{
throw new PortletInvokerException("Couldn't modify registration with producer '" + persistentId + "'", e);
}
- finally
- {
- registry.updateProducerInfo(this);
- }
}
}
else
15 years, 5 months
gatein SVN: r5160 - components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-11-18 09:43:00 -0500 (Thu, 18 Nov 2010)
New Revision: 5160
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ActivatingNullInvokerHandler.java
Log:
- GTNWSRP-165: Synchronize customer activation to avoid double registrations with federating invoker when multiple portlets try to access to that specific producer.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ActivatingNullInvokerHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ActivatingNullInvokerHandler.java 2010-11-18 14:36:34 UTC (rev 5159)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ActivatingNullInvokerHandler.java 2010-11-18 14:43:00 UTC (rev 5160)
@@ -62,9 +62,12 @@
else
{
// activate the consumer which should register it with this FederatingPortletInvoker
- consumerRegistry.activateConsumerWith(invokerId);
+ synchronized (this)
+ {
+ consumerRegistry.activateConsumerWith(invokerId);
- federated = callingInvoker.getFederatedInvoker(invokerId);
+ federated = callingInvoker.getFederatedInvoker(invokerId);
+ }
}
//
15 years, 5 months