gatein SVN: r7916 - in components/wsrp/trunk/common/src: test/java/org/gatein/wsrp and 1 other directory.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-10-31 16:30:56 -0400 (Mon, 31 Oct 2011)
New Revision: 7916
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/WSRPPortletURLTestCase.java
Log:
PBR-207: updating the behaviour of the WSRPPortletURL so that it will handle a doubly encoded ampersand as a singly encoded ampersand instead of throwing an error. There appears to be an issue with how the Sun JSF implementation handles url encoding inside an html attribute. See PBR-207 for more details.
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java 2011-10-31 13:07:43 UTC (rev 7915)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java 2011-10-31 20:30:56 UTC (rev 7916)
@@ -215,10 +215,16 @@
}
// standardize parameter separators
- if (encodedURL.contains(AMP_AMP))
- {
- throw new IllegalArgumentException(encodedURL + " contains a doubly encoded &!");
- }
+
+ //NOTE: this is an error here, we should not be getting AMP_AMP, but if makes more sense for
+ // now to handle the situation right now than to throw an error.
+ // If we reneable this check, make sure to uncomment testDoublyEncodedAmpersand in WSRPPortletURLTestCase
+ //if (encodedURL.contains(AMP_AMP))
+ //{
+ // throw new IllegalArgumentException(encodedURL + " contains a doubly encoded &!");
+ //}
+
+ encodedURL = TextTools.replace(encodedURL, AMP_AMP, PARAM_SEPARATOR);
encodedURL = TextTools.replace(encodedURL, ENCODED_AMPERSAND, PARAM_SEPARATOR);
encodedURL = TextTools.replace(encodedURL, AMPERSAND, PARAM_SEPARATOR);
Modified: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/WSRPPortletURLTestCase.java
===================================================================
--- components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/WSRPPortletURLTestCase.java 2011-10-31 13:07:43 UTC (rev 7915)
+++ components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/WSRPPortletURLTestCase.java 2011-10-31 20:30:56 UTC (rev 7916)
@@ -266,19 +266,20 @@
checkInvalidURL(invalid, message, "foo");
}
- public void testDoublyEncodedAmpersand()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=wsrp:help&wsrp-windowState=wsrp:maximized/wsrp_rewrite";
- try
- {
- WSRPPortletURL.create(expected);
- fail("Should have thrown an exception on doubly encoded &!");
- }
- catch (Exception e)
- {
- // expected
- }
- }
+// Disable this test for now as we handle the doubly encoded ampersand.
+// public void testDoublyEncodedAmpersand()
+// {
+// String expected = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=wsrp:help&wsrp-windowState=wsrp:maximized/wsrp_rewrite";
+// try
+// {
+// WSRPPortletURL.create(expected);
+// fail("Should have thrown an exception on doubly encoded &!");
+// }
+// catch (Exception e)
+// {
+// // expected
+// }
+// }
/** Relax validation and test that we now accept normally invalid URLs. */
public void testExtraParametersRelaxedValidation()
13 years, 1 month
gatein SVN: r7915 - in epp/portal/branches/EPP_5_2_Branch/web: portal/src/main/webapp/groovy/portal/webui/page and 1 other directory.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-31 09:07:43 -0400 (Mon, 31 Oct 2011)
New Revision: 7915
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageSelector2.gtmpl
Log:
JBEPP-1321: Can't do any action after open 3 Popup Windown
Modified: epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2011-10-31 08:42:14 UTC (rev 7914)
+++ epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2011-10-31 13:07:43 UTC (rev 7915)
@@ -69,17 +69,20 @@
UIPopupWindow.prototype.showMask = function(popup, isShowPopup) {
var mask = popup.previousSibling;
+ //Make sure mask is not TextNode because of previousSibling property
+ if (mask && mask.className != "MaskLayer") {
+ mask = null;
+ }
if(isShowPopup) {
//Modal if popup is portal component
if (eXo.core.DOMUtil.findAncestorByClass(popup, "PORTLET-FRAGMENT") == null) {
- eXo.core.UIMaskLayer.createMask(popup.parentNode, popup, 1) ;
+ if(!mask) eXo.core.UIMaskLayer.createMask(popup.parentNode, popup, 1) ;
} else {
- //If popup is portlet's component, modal with just its parent
- eXo.core.UIMaskLayer.createMaskForFrame(popup.parentNode, popup, 1) ;
+ //If popup is portlet's component, modal with just its parent
+ if(!mask) eXo.core.UIMaskLayer.createMaskForFrame(popup.parentNode, popup, 1) ;
}
- } else {
- //Make sure mask is not TextNode because of previousSibling property
- if(mask != null && mask.className == "MaskLayer") eXo.core.UIMaskLayer.removeMask(mask) ;
+ } else {
+ if(mask) eXo.core.UIMaskLayer.removeMask(mask) ;
}
} ;
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageSelector2.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageSelector2.gtmpl 2011-10-31 08:42:14 UTC (rev 7914)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageSelector2.gtmpl 2011-10-31 13:07:43 UTC (rev 7915)
@@ -108,7 +108,7 @@
</div>
<% } %>
- <div class="ActionButton SimpleStyle" onclick="javascript: eXo.webui.UIPopupWindow.show('<%=uicomponent.getChild(UIPopupWindow.class).getId();%>');">
+ <div class="ActionButton SimpleStyle" onclick="javascript: eXo.webui.UIPopupWindow.show('<%=uicomponent.getChild(UIPopupWindow.class).getId();%>', true);">
<div class="ButtonLeft">
<div class="ButtonRight">
<div class="ButtonMiddle">
13 years, 1 month
gatein SVN: r7914 - portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form.
by do-not-reply@jboss.org
Author: haint
Date: 2011-10-31 04:42:14 -0400 (Mon, 31 Oct 2011)
New Revision: 7914
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java
Log:
GTNPORTAL-2243 cannot set editable and orther HTML attributes to UIFormDateTimeInput
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java 2011-10-31 04:56:12 UTC (rev 7913)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java 2011-10-31 08:42:14 UTC (rev 7914)
@@ -241,6 +241,15 @@
w.write(" value=\"");
w.write(value);
w.write('\"');
- w.write(" onclick='event.cancelBubble = true' onkeydown='eXo.webui.UICalendar.onTabOut(event)'/>");
+ w.write(" onclick='event.cancelBubble = true' onkeydown='eXo.webui.UICalendar.onTabOut(event)'");
+ if(!isEditable())
+ {
+ w.write(" readonly ");
+ }
+ if(hasHTMLAttribute())
+ {
+ renderHTMLAttribute(w);
+ }
+ w.write("/>");
}
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java 2011-10-31 04:56:12 UTC (rev 7913)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java 2011-10-31 08:42:14 UTC (rev 7914)
@@ -266,6 +266,15 @@
attribute.put(name, value);
}
+ public boolean hasHTMLAttribute()
+ {
+ if(attribute == null)
+ {
+ return false;
+ }
+ return attribute.size() > 0 ;
+ }
+
protected void renderHTMLAttribute(Writer w) throws IOException
{
if (attribute != null)
13 years, 1 month
gatein SVN: r7913 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page.
by do-not-reply@jboss.org
Author: kien_nguyen
Date: 2011-10-31 00:56:12 -0400 (Mon, 31 Oct 2011)
New Revision: 7913
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
Log:
GTNPORTAL-2242 Page Management Exception when search with space character in 'Site Name' field
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-10-31 03:38:39 UTC (rev 7912)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-10-31 04:56:12 UTC (rev 7913)
@@ -148,11 +148,11 @@
String siteName = siteNameInput.getValue();
String title = titleInput.getValue();
String ownerType = select.getValue();
- if (title != null && title != "")
+ if (title != null)
{
query.setTitle(title.trim());
}
- if (siteName != null && siteName != "")
+ if (siteName != null && !siteName.trim().equals(""))
{
query.setOwnerId(siteName.trim());
}
13 years, 1 month
gatein SVN: r7912 - portal/trunk.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-10-30 23:38:39 -0400 (Sun, 30 Oct 2011)
New Revision: 7912
Modified:
portal/trunk/pom.xml
Log:
GTNPORTAL-2228 Upgrade JCR 1.14.2-GA
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2011-10-28 16:11:47 UTC (rev 7911)
+++ portal/trunk/pom.xml 2011-10-31 03:38:39 UTC (rev 7912)
@@ -37,10 +37,10 @@
<name>GateIn - Portal</name>
<properties>
- <org.exoplatform.kernel.version>2.3.1-GA</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.4.1-GA</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.2.1-GA</org.exoplatform.ws.version>
- <org.exoplatform.jcr.version>1.14.1-GA</org.exoplatform.jcr.version>
+ <org.exoplatform.kernel.version>2.3.2-GA</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.4.2-GA</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.2.2-GA</org.exoplatform.ws.version>
+ <org.exoplatform.jcr.version>1.14.2-GA</org.exoplatform.jcr.version>
<org.shindig.version>2.0.2-Beta03</org.shindig.version>
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
<org.gatein.common.version>2.0.4-GA</org.gatein.common.version>
13 years, 1 month
gatein SVN: r7911 - in epp/portal/branches/EPP_5_2_Branch/wsrp-integration: extension-war/src/main/webapp/WEB-INF/conf/wsrp and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-10-28 12:11:47 -0400 (Fri, 28 Oct 2011)
New Revision: 7911
Modified:
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Log:
- JBEPP-1319: Delayed start of ConsumerRegistry to allow for proper publication of WSDL and avoid deadlock. Delay is configurable in wsrp-configuration.xml.
Modified: epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java 2011-10-28 16:05:37 UTC (rev 7910)
+++ epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java 2011-10-28 16:11:47 UTC (rev 7911)
@@ -78,6 +78,9 @@
import javax.servlet.ServletContext;
import java.io.InputStream;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -90,6 +93,8 @@
private static final String CLASSPATH = "classpath:/";
private static final String PRODUCER_CONFIG_LOCATION = "producerConfigLocation";
private static final String CONSUMERS_CONFIG_LOCATION = "consumersConfigLocation";
+ public static final String CONSUMERS_INIT_DELAY = "consumersInitDelay";
+ public static final int DEFAULT_DELAY = 2;
private final InputStream producerConfigurationIS;
private final String producerConfigLocation;
@@ -102,6 +107,7 @@
private final ExoKernelIntegration exoKernelIntegration;
private final boolean bypass;
private static final String WSRP_ADMIN_GUI_CONTEXT_PATH = "/wsrp-admin-gui";
+ private int consumersInitDelay;
public WSRPServiceIntegration(ExoContainerContext context, InitParams params, ConfigurationManager configurationManager,
ExoKernelIntegration pc, NodeHierarchyCreator nhc) throws Exception
@@ -117,6 +123,15 @@
{
producerConfigLocation = params.getValueParam(PRODUCER_CONFIG_LOCATION).getValue();
consumersConfigLocation = params.getValueParam(CONSUMERS_CONFIG_LOCATION).getValue();
+ String delayString = params.getValueParam(CONSUMERS_INIT_DELAY).getValue();
+ try
+ {
+ consumersInitDelay = Integer.parseInt(delayString);
+ }
+ catch (NumberFormatException e)
+ {
+ consumersInitDelay = DEFAULT_DELAY;
+ }
}
else
{
@@ -330,7 +345,22 @@
migrationService.setStructureProvider(structureprovider);
consumerRegistry.setMigrationService(migrationService);
- consumerRegistry.start();
+ // wait 'delay' seconds before starting the consumers to give JBoss WS a chance to publish the WSDL and not deadlock
+ ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);
+ scheduledExecutorService.schedule(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ consumerRegistry.start();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }, consumersInitDelay, TimeUnit.SECONDS);
// set up a PortletInvokerResolver so that when a remote producer is queried, we can start it if needed
RegisteringPortletInvokerResolver resolver = new RegisteringPortletInvokerResolver();
Modified: epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2011-10-28 16:05:37 UTC (rev 7910)
+++ epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2011-10-28 16:11:47 UTC (rev 7911)
@@ -41,6 +41,11 @@
<description>Location of the default consumers configuration file</description>
<value>conf/wsrp-consumers-config.xml</value>
</value-param>
+ <value-param>
+ <name>consumersInitDelay</name>
+ <description>Time (in seconds) after the start of the WSRP extension, waited before the consumers are started</description>
+ <value>2</value>
+ </value-param>
</init-params>
</component>
13 years, 2 months
gatein SVN: r7910 - in portal/trunk/wsrp-integration: extension-war/src/main/webapp/WEB-INF/conf/wsrp and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-10-28 12:05:37 -0400 (Fri, 28 Oct 2011)
New Revision: 7910
Modified:
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java
portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Log:
- GTNPORTAL-2241: Delayed start of ConsumerRegistry to allow for proper publication of WSDL and avoid deadlock. Delay is configurable in wsrp-configuration.xml.
Modified: portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java
===================================================================
--- portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java 2011-10-28 15:06:07 UTC (rev 7909)
+++ portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java 2011-10-28 16:05:37 UTC (rev 7910)
@@ -78,6 +78,9 @@
import javax.servlet.ServletContext;
import java.io.InputStream;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -90,6 +93,8 @@
private static final String CLASSPATH = "classpath:/";
private static final String PRODUCER_CONFIG_LOCATION = "producerConfigLocation";
private static final String CONSUMERS_CONFIG_LOCATION = "consumersConfigLocation";
+ public static final String CONSUMERS_INIT_DELAY = "consumersInitDelay";
+ public static final int DEFAULT_DELAY = 2;
private final InputStream producerConfigurationIS;
private final String producerConfigLocation;
@@ -102,6 +107,7 @@
private final ExoKernelIntegration exoKernelIntegration;
private final boolean bypass;
private static final String WSRP_ADMIN_GUI_CONTEXT_PATH = "/wsrp-admin-gui";
+ private int consumersInitDelay;
public WSRPServiceIntegration(ExoContainerContext context, InitParams params, ConfigurationManager configurationManager,
ExoKernelIntegration pc, NodeHierarchyCreator nhc) throws Exception
@@ -117,6 +123,15 @@
{
producerConfigLocation = params.getValueParam(PRODUCER_CONFIG_LOCATION).getValue();
consumersConfigLocation = params.getValueParam(CONSUMERS_CONFIG_LOCATION).getValue();
+ String delayString = params.getValueParam(CONSUMERS_INIT_DELAY).getValue();
+ try
+ {
+ consumersInitDelay = Integer.parseInt(delayString);
+ }
+ catch (NumberFormatException e)
+ {
+ consumersInitDelay = DEFAULT_DELAY;
+ }
}
else
{
@@ -338,7 +353,22 @@
migrationService.setStructureProvider(structureprovider);
consumerRegistry.setMigrationService(migrationService);
- consumerRegistry.start();
+ // wait 'delay' seconds before starting the consumers to give JBoss WS a chance to publish the WSDL and not deadlock
+ ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);
+ scheduledExecutorService.schedule(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ consumerRegistry.start();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }, consumersInitDelay, TimeUnit.SECONDS);
// set up a PortletInvokerResolver so that when a remote producer is queried, we can start it if needed
RegisteringPortletInvokerResolver resolver = new RegisteringPortletInvokerResolver();
Modified: portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
===================================================================
--- portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2011-10-28 15:06:07 UTC (rev 7909)
+++ portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2011-10-28 16:05:37 UTC (rev 7910)
@@ -41,6 +41,11 @@
<description>Location of the default consumers configuration file</description>
<value>conf/wsrp-consumers-config.xml</value>
</value-param>
+ <value-param>
+ <name>consumersInitDelay</name>
+ <description>Time (in seconds) after the start of the WSRP extension, waited before the consumers are started</description>
+ <value>2</value>
+ </value-param>
</init-params>
</component>
13 years, 2 months
gatein SVN: r7909 - portal/trunk/packaging/jboss-as7.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-10-28 11:06:07 -0400 (Fri, 28 Oct 2011)
New Revision: 7909
Modified:
portal/trunk/packaging/jboss-as7/README.txt
Log:
Clarify support for AS7 versions
Modified: portal/trunk/packaging/jboss-as7/README.txt
===================================================================
--- portal/trunk/packaging/jboss-as7/README.txt 2011-10-28 12:08:31 UTC (rev 7908)
+++ portal/trunk/packaging/jboss-as7/README.txt 2011-10-28 15:06:07 UTC (rev 7909)
@@ -30,7 +30,7 @@
Known Issues
============
-- JBoss AS 7.0.2.Final and higher are supported. It does not work with JBoss AS 7.0.0.Final.
+- Only JBoss AS 7.0.2.Final is supported at the moment. It does not work with JBoss AS 7.0.0.Final or with more recent JBoss AS 7.1.0-Alpha versions.
- WSRP is not yet supported
- <distributable/> is not yet supported
- Sample ears have been repackaged as their current default packaging is not supported
13 years, 2 months
gatein SVN: r7908 - in epp/portal/branches/EPP_5_2_Branch: component and 20 other directories.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-28 08:08:31 -0400 (Fri, 28 Oct 2011)
New Revision: 7908
Added:
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UICaptcha.java
Removed:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java
Modified:
epp/portal/branches/EPP_5_2_Branch/
epp/portal/branches/EPP_5_2_Branch/component/
epp/portal/branches/EPP_5_2_Branch/component/portal/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterEditMode.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java
epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISamplePopupMessage.java
epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISamplePortlet.gtmpl
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/UIFormLifecycle.java
epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java
epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java
epp/portal/branches/EPP_5_2_Branch/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java
epp/portal/branches/EPP_5_2_Branch/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java
epp/portal/branches/EPP_5_2_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIApplication.java
epp/portal/branches/EPP_5_2_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/
Log:
JBEPP-1320: All WebUI portlets should send messages to Portal instead of handling by themselves
Property changes on: epp/portal/branches/EPP_5_2_Branch
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4868,4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/branches/xss:7377-7595,7597
/portal/branches/xss-issues:7350-7351,7358
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450,7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7741,7748,7780
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4868,4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/branches/xss:7377-7595,7597
/portal/branches/xss-issues:7350-7351,7358
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450,7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7741,7748,7780,7877
Property changes on: epp/portal/branches/EPP_5_2_Branch/component
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7748,7780
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7748,7780,7877
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal
___________________________________________________________________
Modified: svn:mergeinfo
- /portal/branches/branch-GTNPORTAL-1592/component/portal:4868
/portal/trunk:7451
/portal/trunk/component/portal:7085,7412,7451,7500,7570-7571,7573,7577,7614-7615,7748,7780
+ /portal/branches/branch-GTNPORTAL-1592/component/portal:4868
/portal/trunk:7451
/portal/trunk/component/portal:7085,7412,7451,7500,7570-7571,7573,7577,7614-7615,7695-7696,7701-7704,7748,7780,7877
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7741,7748,7780
/portal/trunk/src/main/java/org:7451
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7741,7748,7780,7877
/portal/trunk/src/main/java/org:7451
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -19,7 +19,13 @@
package org.exoplatform.web.application;
+import org.exoplatform.commons.utils.PropertyManager;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.Serializable;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
/**
* Created by The eXo Platform SARL
@@ -29,11 +35,15 @@
*/
public class ApplicationMessage implements Serializable
{
+ private static Log log = ExoLogger.getLogger(ApplicationMessage.class);
+
final public static int ERROR = 0, WARNING = 1, INFO = 2;
private int type_ = INFO;
-
+
private String messageKey_;
+
+ private ResourceBundle resourceBundle;
private Object[] messageArgs_;
@@ -51,6 +61,30 @@
type_ = type;
}
+ public String getMessage()
+ {
+ String msg = resolveMessage(messageKey_);
+ if (msg != null && messageArgs_ != null)
+ {
+ for(int i = 0; i < messageArgs_.length; i++)
+ {
+ String arg = messageArgs_ [i].toString();
+ if (isArgsLocalized())
+ {
+ arg = resolveMessage(arg);
+ }
+ msg = msg.replace("{" + i + "}", arg);
+ }
+ }
+
+ return msg;
+ }
+
+ public void setResourceBundle(ResourceBundle resourceBundle)
+ {
+ this.resourceBundle = resourceBundle;
+ }
+
public String getMessageKey()
{
return messageKey_;
@@ -81,4 +115,26 @@
return argsLocalized;
}
+ private String resolveMessage(String key)
+ {
+ if (key == null && resourceBundle == null)
+ {
+ return key;
+ }
+
+ String value;
+ try
+ {
+ value = resourceBundle.getString(key);
+ }
+ catch (MissingResourceException ex)
+ {
+ if (PropertyManager.isDevelopping())
+ {
+ log.warn("Can not find resource bundle for key : " + key);
+ }
+ value = key.substring(key.lastIndexOf('.') + 1);
+ }
+ return value;
+ }
}
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl 2011-10-28 12:08:31 UTC (rev 7908)
@@ -5,7 +5,6 @@
import org.exoplatform.dashboard.webui.component.UIDashboardEditForm;
def rcontext = _ctx.getRequestContext() ;
- def popupMsgs = uicomponent.getUIPopupMessages();
%>
<div id="$uicomponent.id" class="UIDashboardPortlet">
<% if(rcontext.getApplicationMode() == PortletMode.VIEW) {
@@ -15,6 +14,5 @@
uiEditForm.getUIStringInput(UIDashboardEditForm.TOTAL_COLUMNS).setValue(uicomponent.getNumberOfCols() + "");
uicomponent.renderUIComponent(uiEditForm) ;
}
- if(popupMsgs != null) popupMsgs.processRender(rcontext);
%>
</div>
\ No newline at end of file
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl 2011-10-28 12:08:31 UTC (rev 7908)
@@ -1,7 +1,6 @@
<% import javax.portlet.PortletMode ;
import org.exoplatform.gadget.webui.component.UIGadgetViewMode;
def rcontext = _ctx.getRequestContext() ;
- def popupMsgs = uicomponent.getUIPopupMessages();
%>
<div class="UIGadgetPortlet" id="$uicomponent.id">
<%
@@ -9,5 +8,5 @@
uicomponent.renderChild(UIGadgetViewMode.class) ;
}
- if(popupMsgs != null) popupMsgs.processRender(rcontext); %>
+%>
</div>
\ No newline at end of file
Copied: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UICaptcha.java (from rev 7877, portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UICaptcha.java)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UICaptcha.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UICaptcha.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss by Red Hat *
+ * Copyright 2010, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.account.webui.component;
+
+import java.util.Calendar;
+
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.form.UIFormStringInput;
+
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceURL;
+
+/**
+ * @author <a href="mailto:theute@redhat.com">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class UICaptcha extends UIFormStringInput
+{
+
+ public UICaptcha(String name, String bindingExpression, String value)
+ {
+ super(name, bindingExpression, value);
+ }
+
+ public void processRender(WebuiRequestContext context) throws Exception
+ {
+
+ RenderResponse resp = context.getResponse();
+
+ //
+ ResourceURL url = resp.createResourceURL();
+
+ // context.getPortalContextPath() + "/captcha?v=" + Calendar.getInstance().getTimeInMillis()
+
+ String random = "&v=" + Calendar.getInstance().getTimeInMillis();
+
+ context.getWriter().write("<div id='" + getId() + "'><img src=\"" + url.toString() + random + "\" /><br/>");
+ super.processRender(context);
+ context.getWriter().write("</div>");
+ }
+
+}
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterEditMode.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterEditMode.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterEditMode.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -19,7 +19,6 @@
package org.exoplatform.account.webui.component;
import org.exoplatform.portal.webui.CaptchaValidator;
-import org.exoplatform.portal.webui.UICaptcha;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.account.webui.component;
+
+import java.util.ArrayList;
+import java.util.List;
import org.exoplatform.portal.registration.PostRegistrationService;
import org.exoplatform.services.organization.OrganizationService;
@@ -29,7 +32,6 @@
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
-import org.exoplatform.webui.core.UIPopupMessages;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
@@ -41,9 +43,6 @@
import org.exoplatform.webui.form.UIFormInputWithActions.ActionData;
import org.exoplatform.webui.form.validator.MandatoryValidator;
-import java.util.ArrayList;
-import java.util.List;
-
import nl.captcha.Captcha;
/**
@@ -92,9 +91,7 @@
// TODO Auto-generated method stub
super.processAction(context);
- UIApplication uiApp = context.getUIApplication();
- UIPopupMessages popupMessages = uiApp.getUIPopupMessages();
- if(popupMessages.getWarnings().size() > 0 || popupMessages.getErrors().size() > 0)
+ if(context.getProcessRender())
{
//Invalidate the capcha
if (context instanceof PortletRequestContext)
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -21,7 +21,6 @@
import javax.portlet.PortletPreferences;
import org.exoplatform.portal.webui.CaptchaValidator;
-import org.exoplatform.portal.webui.UICaptcha;
import org.exoplatform.services.organization.Query;
import org.exoplatform.services.organization.User;
import org.exoplatform.services.organization.UserHandler;
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -238,7 +238,6 @@
{
UIApplication uiApp = event.getRequestContext().getUIApplication();
uiApp.addMessage(new ApplicationMessage("UIAddApplicationForm.msg.typeNoApps", null));
- event.getRequestContext().addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
uiForm.getChild(UIFormTableIteratorInputSet.class).setRendered(false);
}
event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -101,7 +101,6 @@
uiOrganizer.reload();
uiOrganizer.setSelectedCategory(application.getCategoryName());
ctx.addUIComponentToUpdateByAjax(uiOrganizer);
- ctx.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
return;
}
uiForm.invokeSetBindingBean(application);
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -733,7 +733,6 @@
if (existPage != null)
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
- pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
Modified: epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISamplePopupMessage.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISamplePopupMessage.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISamplePopupMessage.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -5,8 +5,8 @@
import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIContainer;
-import org.exoplatform.webui.core.UIPopupMessages;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
@@ -21,10 +21,9 @@
{
int popupType = Integer.parseInt(event.getRequestContext().getRequestParameter(OBJECTID));
- UIPopupMessages uiPopupMessages =
- ((PortletRequestContext)WebuiRequestContext.getCurrentInstance()).getUIApplication().getUIPopupMessages();
- uiPopupMessages.addMessage(new ApplicationMessage("Test Message", null, popupType));
- uiPopupMessages.setShow(true);
+ UIApplication uiApp =
+ ((PortletRequestContext)WebuiRequestContext.getCurrentInstance()).getUIApplication();
+ uiApp.addMessage(new ApplicationMessage("Test Message", null, popupType));
}
}
Modified: epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISamplePortlet.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISamplePortlet.gtmpl 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISamplePortlet.gtmpl 2011-10-28 12:08:31 UTC (rev 7908)
@@ -23,8 +23,4 @@
</td>
</tr>
</table>
- <%
- UIPopupMessages uiPopupMessages = uicomponent.getUIPopupMessages();
- uiPopupMessages.processRender(_ctx.getRequestContext());
- %>
</div>
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2011-10-28 12:08:31 UTC (rev 7908)
@@ -51,31 +51,17 @@
}
println " <ul class=\"UITabContent PopupMessageBox $messType\" $style>";
for(mess in messages) {
- if(mess.messageKey == null) continue;
- println " <li class=\"MessageContainer\">";
- println " <span class=\"PopupIcon ${messType}Icon\">";
- String msgValue = _ctx.appRes(mess.messageKey);
- Object[] msgArguments = mess.getMessageAruments();
- if(msgArguments != null && msgArguments.length > 0) {
- if (mess.isArgsLocalized()) {
- for(i in 0..msgArguments.length-1) {
- msgValue = msgValue.replace("{" + i + "}", _ctx.appRes(msgArguments [i]));
- }
- } else {
- for(i in 0..msgArguments.length-1) {
- msgValue = msgValue.replace("{" + i + "}", msgArguments [i]);
- }
- }
- }
- EntityEncoder encoder = HTMLEntityEncoder.getInstance();
- msgValue = encoder.encode(msgValue);
- println msgValue;
-
- println " </span>";
- println " </li>";
- }
- println " </ul>";
- return isSelected;
+ if(mess.messageKey == null) continue;
+ println " <li class=\"MessageContainer\">";
+ println " <span class=\"PopupIcon ${messType}Icon\">";
+ String msgValue = mess.getMessage();
+ EntityEncoder entityEncoder = EntityEncoder.FULL;
+ println entityEncoder.encode(msgValue);
+ println " </span>";
+ println " </li>";
+ }
+ println " </ul>";
+ return isSelected;
}
%>
Modified: epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/UIFormLifecycle.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/UIFormLifecycle.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/UIFormLifecycle.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -117,7 +117,6 @@
if (context.getProcessRender())
{
- context.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
return;
}
event.broadcast();
Modified: epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -51,11 +51,13 @@
public static String GADGET_POPUP_ID = "UIAddGadgetPopup";
+ public static String APP_NOT_EXIST = "APP_NOT_EXIT";
+
private boolean isShowSelectPopup = false;
private String aggregatorId;
- private UIGadget maximizedGadget;
+ private UIGadget maximizedGadget;
public UIDashboard() throws Exception
{
@@ -70,14 +72,10 @@
UIGadget uiGadget = this.getMaximizedGadget();
if (uiGadget != null)
{
- UIPopupMessages uiPopupMessages = getAncestorOfType(UIPortletApplication.class).getUIPopupMessages();
- for (ApplicationMessage msg : uiPopupMessages.getErrors())
+ if (context.getAttribute(APP_NOT_EXIST) != null ||
+ context.getAttribute(UIGadget.SAVE_PREF_FAIL) != null)
{
- if (msg.getMessageKey().equals("UIDashboard.msg.ApplicationNotExisted"))
- {
- this.setMaximizedGadget(null);
- break;
- }
+ this.setMaximizedGadget(null);
}
}
@@ -168,14 +166,14 @@
{
UIPortalApplication uiApp = Util.getUIPortalApplication();
uiApp.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
- uiDashboardCont.removeUIGadget(uiGadget.getId());
+ context.setAttribute(APP_NOT_EXIST, true);
context.addUIComponentToUpdateByAjax(uiDashboard);
}
else
{
uiGadget.getProperties().setProperty("minimized", minimized);
uiDashboardCont.save();
- if (uiDashboard.getAncestorOfType(UIPortletApplication.class).getUIPopupMessages().hasMessage())
+ if (context.getAttribute(UIDashboardContainer.SAVE_FAIL) != null)
{
return;
}
@@ -198,9 +196,7 @@
{
UIPortalApplication uiApp = Util.getUIPortalApplication();
uiApp.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
- if (uiGadget != null)
- uiDashboardCont.removeUIGadget(uiGadget.getId());
- uiDashboardCont.save();
+ context.setAttribute(APP_NOT_EXIST, true);
context.addUIComponentToUpdateByAjax(uiDashboard);
return;
}
@@ -211,9 +207,8 @@
uiGadget.getProperties().setProperty("minimized", "false");
uiDashboardCont.save();
- UIPortletApplication uiDashboarPortlet = uiDashboard.getAncestorOfType(UIPortletApplication.class);
if (maximize.equals("maximize")
- && !uiDashboarPortlet.getUIPopupMessages().hasMessage())
+ && context.getAttribute(UIDashboardContainer.SAVE_FAIL) == null)
{
uiGadget.setView(UIGadget.CANVAS_VIEW);
uiDashboard.setMaximizedGadget(uiGadget);
Modified: epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -92,6 +92,8 @@
public static final String COLINDEX = "colIndex";
public static final String ROWINDEX = "rowIndex";
+
+ public static String SAVE_FAIL = "UIDashboardContainer.saveFail";
/**
* Constructs new UIDashboardContainer which belongs to a UIDashboardPortlet
@@ -490,8 +492,10 @@
}
catch (StaleModelException e)
{
- getAncestorOfType(UIPortletApplication.class).addMessage(
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ context.getUIApplication().addMessage(
new ApplicationMessage("UIDashboard.msg.StaleData", null, ApplicationMessage.ERROR));
+ context.setAttribute(SAVE_FAIL, true);
}
}
}
@@ -517,6 +521,7 @@
{
UIApplication uiApplication = context.getUIApplication();
uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
+ context.setAttribute(UIDashboard.APP_NOT_EXIST, true);
return;
}
UIGadget uiGadget = event.getSource().createUIComponent(context, UIGadget.class, null, null);
@@ -546,7 +551,7 @@
uiDashboardContainer.moveUIGadget(objectId, col, row);
uiDashboardContainer.save();
- if (uiDashboard.getAncestorOfType(UIPortletApplication.class).getUIPopupMessages().hasMessage())
+ if (context.getAttribute(SAVE_FAIL) != null)
{
return;
}
@@ -577,9 +582,7 @@
isMaximized = true;
}
uiDashboardContainer.save();
- UIPopupMessages uiPopupMessages =
- uiDashboard.getAncestorOfType(UIPortletApplication.class).getUIPopupMessages();
- if (!isMaximized && !uiPopupMessages.hasMessage())
+ if (!isMaximized && context.getAttribute(SAVE_FAIL) == null)
{
Util.getPortalRequestContext().setResponseComplete(true);
}
Modified: epp/portal/branches/EPP_5_2_Branch/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -197,7 +197,6 @@
{
UIApplication uiApp = pcontext.getUIApplication();
uiApp.addMessage(new ApplicationMessage("UIGroupSelector.msg.selectGroup", null));
- pcontext.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
uiPopup.setShow(true);
return;
}
Modified: epp/portal/branches/EPP_5_2_Branch/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -336,7 +336,6 @@
{
UIApplication uiApp = uiForm.getAncestorOfType(UIApplication.class);
uiApp.addMessage(new ApplicationMessage("UIUserSelector.msg.user-required", null));
- event.getRequestContext().addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
return;
}
String[] arrItems = items.toArray(new String[items.size()]);
Modified: epp/portal/branches/EPP_5_2_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIApplication.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIApplication.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIApplication.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -46,9 +46,7 @@
private static final String UIAPPLICATION = "uiapplication";
public UIApplication() throws Exception
- {
- uiPopupMessages_ = createUIComponent(UIPopupMessages.class, null, null);
- uiPopupMessages_.setId("_" + uiPopupMessages_.hashCode());
+ {
}
//TODO this looks like not to be used anymore
@@ -65,11 +63,22 @@
/**
* Return the common UIPopupMessages
- * UIPortletApplication will override this method an return difference UIPopupMessage for difference Portlet modes
* @return UIPopupMessages
*/
public UIPopupMessages getUIPopupMessages()
{
+ if (uiPopupMessages_ == null)
+ {
+ try
+ {
+ uiPopupMessages_ = createUIComponent(UIPopupMessages.class, null, null);
+ uiPopupMessages_.setId("_" + uiPopupMessages_.hashCode());
+ }
+ catch (Exception e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ }
return uiPopupMessages_;
}
@@ -123,13 +132,13 @@
}
catch (MessageException ex)
{
- getUIPopupMessages().addMessage(ex.getDetailMessage());
+ addMessage(ex.getDetailMessage());
}
catch (Throwable t)
{
ApplicationMessage msg =
new ApplicationMessage("UIApplication.msg.unknown-error", null, ApplicationMessage.ERROR);
- uiPopupMessages_.addMessage(msg);
+ addMessage(msg);
log.error("Error during the processAction phase", t);
}
}
Modified: epp/portal/branches/EPP_5_2_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.core;
import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.web.application.RequestContext;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -29,6 +30,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.ResourceBundle;
/**
* Created by The eXo Platform SARL
@@ -104,6 +106,7 @@
public void addMessage(ApplicationMessage msg)
{
+ msg.setResourceBundle(getResourceBundle());
switch (msg.getType())
{
case ApplicationMessage.ERROR :
@@ -116,6 +119,16 @@
infos_.add(msg);
}
}
+
+ private ResourceBundle getResourceBundle()
+ {
+ RequestContext context = RequestContext.getCurrentInstance();
+ if (context == null)
+ {
+ return null;
+ }
+ return context.getApplicationResourceBundle();
+ }
public boolean hasMessage()
{
Deleted: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -1,62 +0,0 @@
-/******************************************************************************
- * JBoss by Red Hat *
- * Copyright 2010, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * 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.portal.webui;
-
-import java.util.Calendar;
-
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.form.UIFormStringInput;
-
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceURL;
-
-/**
- * @author <a href="mailto:theute@redhat.com">Thomas Heute</a>
- * @version $Revision$
- */
-public class UICaptcha extends UIFormStringInput
-{
-
- public UICaptcha(String name, String bindingExpression, String value)
- {
- super(name, bindingExpression, value);
- }
-
- public void processRender(WebuiRequestContext context) throws Exception
- {
-
- RenderResponse resp = context.getResponse();
-
- //
- ResourceURL url = resp.createResourceURL();
-
- // context.getPortalContextPath() + "/captcha?v=" + Calendar.getInstance().getTimeInMillis()
-
- String random = "&v=" + Calendar.getInstance().getTimeInMillis();
-
- context.getWriter().write("<div id='" + getId() + "'><img src=\"" + url.toString() + random + "\" /><br/>");
- super.processRender(context);
- context.getWriter().write("</div>");
- }
-
-}
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -105,6 +105,8 @@
public static final String METADATA_USERPREFS_TYPE_LIST = "list";
public String view = HOME_VIEW;
+
+ public static String SAVE_PREF_FAIL = "UIGadget.savePrefFail";
/**
* Initializes a newly created <code>UIGadget</code> object
@@ -457,6 +459,7 @@
{
UIPortletApplication uiPortlet = uiGadget.getAncestorOfType(UIPortletApplication.class);
context.addUIComponentToUpdateByAjax(uiPortlet);
+ context.setAttribute(UIGadget.SAVE_PREF_FAIL, true);
throw new MessageException(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null, ApplicationMessage.ERROR));
}
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -206,7 +206,6 @@
{
UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
uiApp.addMessage(new ApplicationMessage("UISearchForm.msg.empty", null));
- Util.getPortalRequestContext().addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
}
public void quickSearch(UIFormInputSet quickSearchInput) throws Exception
@@ -273,7 +272,6 @@
if (service.getPage(id) == null)
{
uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[]{id}, 1));
- context.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
return;
}
Page page = service.getPage(id, context.getRemoteUser());
@@ -282,7 +280,6 @@
(page.getOwnerType().equals(SiteType.USER.getName()) && !page.getOwnerId().equals(context.getRemoteUser())))
{
uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.delete.NotDelete", new String[]{id}, 1));
- context.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
return;
}
@@ -399,7 +396,6 @@
if (page == null)
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[]{id}, 1));
- context.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
@@ -408,7 +404,6 @@
if (!userACL.hasEditPermission(page))
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.edit.NotEditPage", new String[]{id}, 1));
- context.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
@@ -467,7 +462,6 @@
if (existPage != null)
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
- pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
page.setModifiable(true);
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java 2011-10-28 11:08:02 UTC (rev 7907)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java 2011-10-28 12:08:31 UTC (rev 7908)
@@ -19,28 +19,24 @@
package org.exoplatform.webui.core;
+import org.exoplatform.commons.serialization.api.annotations.Serialized;
+import org.exoplatform.webui.application.WebuiApplication;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.portlet.PortletRequestContext;
+
import java.io.Writer;
-import java.util.Map;
import java.util.Set;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
import javax.portlet.WindowState;
-import org.apache.commons.collections.map.HashedMap;
-import org.exoplatform.commons.serialization.api.annotations.Serialized;
-import org.exoplatform.webui.application.WebuiApplication;
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.application.portlet.PortletRequestContext;
-
@Serialized
abstract public class UIPortletApplication extends UIApplication
{
private int minWidth = 300;
- private int minHeight = 300;
-
- private Map<String, UIPopupMessages> _uiPopupMessages;
+ private int minHeight = 300;
static public String VIEW_MODE = "ViewMode";
@@ -52,29 +48,14 @@
public UIPortletApplication() throws Exception
{
- _uiPopupMessages = new HashedMap();
}
@Override
public UIPopupMessages getUIPopupMessages()
{
- PortletRequestContext pContext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
- String currMode = pContext.getApplicationMode().toString();
-
- if (!_uiPopupMessages.containsKey(currMode)) {
- try
- {
- UIPopupMessages popMsg = createUIComponent(UIPopupMessages.class, null, null);
- popMsg.setId("_" + popMsg.hashCode());
- _uiPopupMessages.put(currMode, popMsg);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- return _uiPopupMessages.get(currMode);
+ WebuiRequestContext context = PortletRequestContext.getCurrentInstance();
+ WebuiRequestContext portalContext = (WebuiRequestContext)context.getParentAppRequestContext();
+ return portalContext.getUIApplication().getUIPopupMessages();
}
@Deprecated
@@ -101,6 +82,14 @@
this.minHeight = minHeight;
}
+ //
+ @Override
+ public void renderChildren() throws Exception
+ {
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ super.renderChildren(context);
+ }
+
/**
* The default processRender for an UIPortletApplication does nothing if the current WindowState in the
* render request is MINIMIZED. Otherwise, it handles two cases:
@@ -136,8 +125,6 @@
// if(list == null) list = app.getDefaultUIComponentToUpdateByAjax(context) ;
if (list != null)
{
- if (getUIPopupMessages().hasMessage())
- context.addUIComponentToUpdateByAjax(getUIPopupMessages());
for (UIComponent uicomponent : list)
{
renderBlockToUpdate(uicomponent, context, w);
Property changes on: epp/portal/branches/EPP_5_2_Branch/wsrp-integration
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4868,4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7748,7780
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4868,4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7748,7780,7877
13 years, 2 months
gatein SVN: r7907 - components/pc/trunk/api/src/main/java/org/gatein/pc/api.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-10-28 07:08:02 -0400 (Fri, 28 Oct 2011)
New Revision: 7907
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
components/pc/trunk/api/src/main/java/org/gatein/pc/api/StatefulPortletContext.java
Log:
- GTNPC-77: StatefulPortletContext now properly honors requests to not interpret its String identifier into components.
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-10-28 08:05:15 UTC (rev 7906)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-10-28 11:08:02 UTC (rev 7907)
@@ -320,7 +320,7 @@
@Deprecated
public static StatefulPortletContext<byte[]> createStatefulPortletContext(String id, byte[] state)
{
- return new StatefulPortletContext<byte[]>(id, PortletStateType.OPAQUE, state);
+ return new StatefulPortletContext<byte[]>(id, PortletStateType.OPAQUE, state, true);
}
/**
@@ -348,7 +348,7 @@
{
if (state != null && state.length > 0)
{
- return new StatefulPortletContext<byte[]>(portletId, PortletStateType.OPAQUE, state);
+ return new StatefulPortletContext<byte[]>(portletId, PortletStateType.OPAQUE, state, interpret);
}
else
{
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/StatefulPortletContext.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/StatefulPortletContext.java 2011-10-28 08:05:15 UTC (rev 7906)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/StatefulPortletContext.java 2011-10-28 11:08:02 UTC (rev 7907)
@@ -37,7 +37,7 @@
public static <S extends Serializable> StatefulPortletContext<S> create(String id, StatefulPortletContext<S> spc)
{
- return new StatefulPortletContext<S>(id, spc.type, spc.state);
+ return new StatefulPortletContext<S>(id, spc.type, spc.state, true);
}
static <S extends Serializable> StatefulPortletContext<S> create(Components components, StatefulPortletContext<S> spc)
@@ -45,12 +45,9 @@
return new StatefulPortletContext<S>(components, spc.type, spc.state);
}
- public static <S extends Serializable> StatefulPortletContext<S> create(
- String id,
- PortletStateType<S> type,
- S state)
+ public static <S extends Serializable> StatefulPortletContext<S> create(String id, PortletStateType<S> type, S state)
{
- return new StatefulPortletContext<S>(id, type, state);
+ return new StatefulPortletContext<S>(id, type, state, true);
}
/** . */
@@ -59,9 +56,9 @@
/** . */
private final PortletStateType<S> type;
- StatefulPortletContext(String id, PortletStateType<S> type, S state) throws IllegalArgumentException
+ StatefulPortletContext(String id, PortletStateType<S> type, S state, boolean interpret) throws IllegalArgumentException
{
- super(id);
+ super(id, interpret);
ParameterValidation.throwIllegalArgExceptionIfNull(type, "Portlet type");
ParameterValidation.throwIllegalArgExceptionIfNull(state, "Portlet state");
13 years, 2 months