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