gatein SVN: r7886 - portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/ext.
by do-not-reply@jboss.org
Author: haint
Date: 2011-10-26 00:55:00 -0400 (Wed, 26 Oct 2011)
New Revision: 7886
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/ext/UIFormInputSetWithAction.java
Log:
GTNPORTAL-2215 Use variable in wrong context
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/ext/UIFormInputSetWithAction.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/ext/UIFormInputSetWithAction.java 2011-10-26 04:36:22 UTC (rev 7885)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/ext/UIFormInputSetWithAction.java 2011-10-26 04:55:00 UTC (rev 7886)
@@ -97,7 +97,7 @@
public void setActions(String[] actionList, String[] values)
{
actions = actionList;
- values = values;
+ this.values = values;
}
/**
@@ -148,7 +148,7 @@
*/
public void setIsShowOnly(boolean isShowOnly)
{
- isShowOnly = isShowOnly;
+ this.isShowOnly = isShowOnly;
}
/**
@@ -168,7 +168,7 @@
*/
public void setIsDeleteOnly(boolean isDeleteOnly)
{
- isDeleteOnly = isDeleteOnly;
+ this.isDeleteOnly = isDeleteOnly;
}
/**
@@ -272,7 +272,7 @@
*/
public void setIsView(boolean isView)
{
- isView = isView;
+ this.isView = isView;
}
/**
13 years, 2 months
gatein SVN: r7885 - portal/trunk/examples/skins/simpleskin/src/main/webapp/skin/SimpleSkin/portal/webui/component.
by do-not-reply@jboss.org
Author: haint
Date: 2011-10-26 00:36:22 -0400 (Wed, 26 Oct 2011)
New Revision: 7885
Modified:
portal/trunk/examples/skins/simpleskin/src/main/webapp/skin/SimpleSkin/portal/webui/component/UIPortalApplicationSkin.css
Log:
GTNPORTAL-2208 UI Error on Loading screen when use SimpleSkin
Modified: portal/trunk/examples/skins/simpleskin/src/main/webapp/skin/SimpleSkin/portal/webui/component/UIPortalApplicationSkin.css
===================================================================
--- portal/trunk/examples/skins/simpleskin/src/main/webapp/skin/SimpleSkin/portal/webui/component/UIPortalApplicationSkin.css 2011-10-26 04:24:24 UTC (rev 7884)
+++ portal/trunk/examples/skins/simpleskin/src/main/webapp/skin/SimpleSkin/portal/webui/component/UIPortalApplicationSkin.css 2011-10-26 04:36:22 UTC (rev 7885)
@@ -142,7 +142,7 @@
.AjaxLoadingMask .LoadingProgressBar {
width: 32px; height: 40px;
- background: url('../../../background/LoadingProgress.gif') no-repeat center;
+ background: url("/eXoResources/skin/DefaultSkin/background/LoadingProgress.gif") no-repeat center;
margin: auto;
display: block;
}
@@ -173,4 +173,4 @@
.ClearBoth {
clear: both;
-}
\ No newline at end of file
+}
13 years, 2 months
gatein SVN: r7884 - in portal/trunk: webui/portal/src/main/java/org/exoplatform/portal/webui/workspace and 1 other directory.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-10-26 00:24:24 -0400 (Wed, 26 Oct 2011)
New Revision: 7884
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java
Log:
GTNPORTAL-2223: Add page wizard label in French
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2011-10-26 03:33:55 UTC (rev 7883)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2011-10-26 04:24:24 UTC (rev 7884)
@@ -107,7 +107,7 @@
UIPortalComposer.action.ViewProperties=Propriétés du portail
UIPortalComposer.action.SwitchMode=Changer mode de vue
UITabPane.title.UIApplicationList=Applications
-UITabPane.title.UIContainerList=Containers
+UITabPane.title.UIContainerList=Conteneurs
#############################################################################
#Container config options #
@@ -1093,11 +1093,11 @@
################################################################################
UIDropDownControl.title.Empty=Drop Down Control
-UIDropDownPageTemp.item.normalPageConfigs=Configs Page
-UIDropDownPageTemp.item.columnPageConfigs=Configs Page en Colonnes
-UIDropDownPageTemp.item.mixPageConfigs=Configs Page Mixte
-UIDropDownPageTemp.item.rowPageConfigs=Configs Page en Lignes
-UIDropDownPageTemp.item.tabsPageConfigs=Config Page en Onglets
+UIDropDownPageTemp.item.normalPageConfigs=Configuration de la page
+UIDropDownPageTemp.item.columnPageConfigs=En colonnes
+UIDropDownPageTemp.item.mixPageConfigs=Mixte
+UIDropDownPageTemp.item.rowPageConfigs=En lignes
+UIDropDownPageTemp.item.tabsPageConfigs=En onglets
################################################################################
# org.exoplatform.portal.webui.application.UIGadgetContainerManagement
@@ -1276,3 +1276,18 @@
Locale.zh_CN=Chinois simplifié
Locale.zh_TW=Chinois traditionnel
+ #######################################################################
+ # org.exoplatform.webui.core.UIConfirmation #
+ #######################################################################
+
+UIConfirmation.title.exoMessages=Message de confirmation
+UIConfirmation.Close=Annuler
+
+ #############################################################################
+ # org.exoplatform.portal.webui.workspace.UIEditInlineWorkspace #
+ #############################################################################
+
+UIEditInlineWorkspace.confirm.close=Il y a des modifications. Etes-vous certain de fermer sans sauvegarde ?
+UIEditInlineWorkspace.confirm.yes=Oui
+UIEditInlineWorkspace.confirm.no=Non
+
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java 2011-10-26 03:33:55 UTC (rev 7883)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java 2011-10-26 04:24:24 UTC (rev 7884)
@@ -50,16 +50,10 @@
addChild(UIPortalComposer.class, null, null);
addChild(UIPortalToolPanel.class, null, null);
- ResourceBundle resourceBundle = WebuiRequestContext.getCurrentInstance().getApplicationResourceBundle();
- String yes = resourceBundle.getString("UIEditInlineWorkspace.confirm.yes");
- String no = resourceBundle.getString("UIEditInlineWorkspace.confirm.no");
-
- List<ActionConfirm> actionConfirms = new ArrayList<ActionConfirm>();
- actionConfirms.add(new ActionConfirm("ConfirmClose", yes));
- actionConfirms.add(new ActionConfirm("AbortClose", no));
UIConfirmation uiConfirmation = addChild(UIConfirmation.class, null, null);
uiConfirmation.setCaller(this);
- uiConfirmation.setActions(actionConfirms);
+
+ createActionConfirms(uiConfirmation) ;
}
public void setUIComponent(UIComponent uiComp)
@@ -81,9 +75,21 @@
{
UIConfirmation uiConfirmation = getChild(UIConfirmation.class);
uiConfirmation.setMessage(message);
+ createActionConfirms(uiConfirmation) ;
((WebuiRequestContext)WebuiRequestContext.getCurrentInstance()).addUIComponentToUpdateByAjax(uiConfirmation);
}
+ public void createActionConfirms(UIConfirmation uiConfirmation) {
+ ResourceBundle resourceBundle = WebuiRequestContext.getCurrentInstance().getApplicationResourceBundle();
+ String yes = resourceBundle.getString("UIEditInlineWorkspace.confirm.yes");
+ String no = resourceBundle.getString("UIEditInlineWorkspace.confirm.no");
+
+ List<ActionConfirm> actionConfirms = new ArrayList<ActionConfirm>();
+ actionConfirms.add(new ActionConfirm("ConfirmClose", yes));
+ actionConfirms.add(new ActionConfirm("AbortClose", no));
+ uiConfirmation.setActions(actionConfirms);
+ }
+
static public class ConfirmCloseActionListener extends EventListener<UIEditInlineWorkspace>
{
13 years, 2 months
gatein SVN: r7883 - portal/trunk/web/portal/src/main/webapp/groovy/organization/webui/component.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-10-25 23:33:55 -0400 (Tue, 25 Oct 2011)
New Revision: 7883
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/organization/webui/component/UIPermissionSelector.gtmpl
Log:
GTNPORTAL-2060 IE : show error message 'Invalid character' when Add new Portal
Modified: portal/trunk/web/portal/src/main/webapp/groovy/organization/webui/component/UIPermissionSelector.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/organization/webui/component/UIPermissionSelector.gtmpl 2011-10-26 03:29:07 UTC (rev 7882)
+++ portal/trunk/web/portal/src/main/webapp/groovy/organization/webui/component/UIPermissionSelector.gtmpl 2011-10-26 03:33:55 UTC (rev 7883)
@@ -45,7 +45,7 @@
<%/*Click on this action button will pop up the permission selector*/%>
<%
- String deletePermissionEvent = "#";
+ String deletePermissionEvent = "javascript:void(0)";
String css = "FloatBlockHidden ActionButton SimpleStyle";
if(permission.getExpression() != null && permission.getExpression().length() > 0) {
deletePermissionEvent = uiForm.event("DeletePermission", uicomponent.getId(), "");
13 years, 2 months
gatein SVN: r7882 - portal/trunk/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-10-25 23:29:07 -0400 (Tue, 25 Oct 2011)
New Revision: 7882
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarSitePortlet.gtmpl
Log:
GTNPORTAL-2198 NPE when node label's length is more than 60
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl 2011-10-26 03:23:17 UTC (rev 7881)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl 2011-10-26 03:29:07 UTC (rev 7882)
@@ -51,9 +51,9 @@
String icon = node.getIcon();
if(icon == null) icon = "DefaultPageIcon";
boolean toolong = (node.getEncodedResolvedLabel().length() > 60);
- String label = ( toolong ? node.getEncodedResolvedLabel().substring(0, 57) + "..." : node.getEncodedResolvedLabel());
- String title = "";
- if(toolong) title = "title='$node.encodedResolvedLabel'";
+ String label = ( toolong ? node.getEncodedResolvedLabel().substring(0, 57) + "..." : node.getEncodedResolvedLabel());
+ String title = "";
+ if(toolong) title = "title='" + node.getEncodedResolvedLabel() + "'";
else title = "";
def getNodeURL = "";
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarSitePortlet.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarSitePortlet.gtmpl 2011-10-26 03:23:17 UTC (rev 7881)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarSitePortlet.gtmpl 2011-10-26 03:29:07 UTC (rev 7882)
@@ -1,7 +1,7 @@
<%
import org.exoplatform.web.application.JavascriptManager;
import org.exoplatform.portal.webui.util.Util ;
- import org.gatein.common.text.EntityEncoder;
+ import org.gatein.common.text.EntityEncoder;
import org.exoplatform.commons.utils.HTMLEntityEncoder;
import org.exoplatform.portal.mop.user.UserNode;
import javax.portlet.MimeResponse;
@@ -90,8 +90,8 @@
if(icon == null) icon = "DefaultPageIcon";
boolean toolong = (node.getEncodedResolvedLabel().length() > 60);
String label = ( toolong ? node.getEncodedResolvedLabel().substring(0, 57) + "..." : node.getEncodedResolvedLabel());
- String title = "";
- if(toolong) title = "title='$node.encodedResolvedLabel()'";
+ String title = "";
+ if(toolong) title = "title='" + node.getEncodedResolvedLabel() + "'";
else title = "";
def getNodeURL = "";
13 years, 2 months
gatein SVN: r7881 - portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-10-25 23:23:17 -0400 (Tue, 25 Oct 2011)
New Revision: 7881
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIRightClickPopupMenu.js
Log:
GTNPORTAL-2199 UI error of PopUp menu when edit navigation with IE7
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIRightClickPopupMenu.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIRightClickPopupMenu.js 2011-10-26 03:12:54 UTC (rev 7880)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIRightClickPopupMenu.js 2011-10-26 03:23:17 UTC (rev 7881)
@@ -138,7 +138,7 @@
if(tmpCustomItem) {
if(customItem) {
tmpCustomItem.innerHTML = customItem.innerHTML ;
- tmpCustomItem.style.display = "block" ;
+ tmpCustomItem.style.display = "inline" ;
} else {
tmpCustomItem.style.display = "none" ;
}
13 years, 2 months
gatein SVN: r7880 - portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-10-25 23:12:54 -0400 (Tue, 25 Oct 2011)
New Revision: 7880
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
Log:
GTNPORTAL-2200 French translation error in portlet tab : Edit Mode, Access Permission
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2011-10-26 03:07:25 UTC (rev 7879)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2011-10-26 03:12:54 UTC (rev 7880)
@@ -292,8 +292,8 @@
UIPortletForm.tab.label.Decorator=#{word.decorator}
UIPortletForm.tab.label.Icon=Choisir une Icône
UIPortletForm.tab.label.Theme=Thèmes de Décoration
-UIPortletForm.tab.label.EditMode=Edit Mode
-UIPortletForm.tab.label.PortletPermission=Access Permission
+UIPortletForm.tab.label.EditMode=Mode d'édition
+UIPortletForm.tab.label.PortletPermission=Permission d'accès
UIPortletForm.Theme.title.Preview=Thèmes de Pré-visualisation
UIPortletForm.Theme.title.SetDefault=Utiliser la valeur par défaut
UIPortletForm.Icon.title.SetDefault=Utiliser la valeur par défaut
13 years, 2 months
gatein SVN: r7879 - portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-10-25 23:07:25 -0400 (Tue, 25 Oct 2011)
New Revision: 7879
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormMultiValueInputSet.java
Log:
GTNPORTAL-2201 label not translated into French in upload file
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormMultiValueInputSet.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormMultiValueInputSet.java 2011-10-26 02:54:20 UTC (rev 7878)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormMultiValueInputSet.java 2011-10-26 03:07:25 UTC (rev 7879)
@@ -24,15 +24,15 @@
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.form.validator.Validator;
import java.io.Writer;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
+import java.util.ResourceBundle;
/**
* Author : Nhu Dinh Thuan
@@ -210,8 +210,11 @@
UIForm uiForm = getAncestorOfType(UIForm.class);
int size = getChildren().size();
- // ResourceBundle res = context.getApplicationResourceBundle() ;
-
+
+ ResourceBundle res = context.getApplicationResourceBundle() ;
+ String addItem = res.getString("UIFormMultiValueInputSet.label.add");
+ String removeItem = res.getString("UIFormMultiValueInputSet.label.remove");
+
for (int i = 0; i < size; i++)
{
UIFormInputBase uiInput = getChild(i);
@@ -225,7 +228,7 @@
if ((size >= 2) || ((size == 1) && (uiInput.getValue() != null)))
{
writer.append("<img onclick=\"");
- writer.append(uiForm.event("Remove", uiInput.getId())).append("\" title=\"Remove Item\" alt=\"\"");
+ writer.append(uiForm.event("Remove", uiInput.getId())).append("\" title=\"" + removeItem + "\" alt=\"\"");
writer
.append(" class=\"MultiFieldAction Remove16x16Icon\" src=\"/eXoResources/skin/sharedImages/Blank.gif\" />");
}
@@ -233,7 +236,7 @@
{
writer.append("<img onclick=\"");
- writer.append(uiForm.event("Add", getId())).append("\" title=\"Add Item\" alt=\"\"");
+ writer.append(uiForm.event("Add", getId())).append("\" title=\"" + addItem + "\" alt=\"\"");
writer
.append(" class=\"MultiFieldAction AddNewNodeIcon\" src=\"/eXoResources/skin/sharedImages/Blank.gif\" />");
}
13 years, 2 months
gatein SVN: r7878 - in portal/trunk/webui: portal/src/main/java/org/exoplatform/portal/webui/workspace and 1 other directory.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-10-25 22:54:20 -0400 (Tue, 25 Oct 2011)
New Revision: 7878
Removed:
portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Decorator.java
Modified:
portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplicationLifecycle.java
Log:
GTNPORTAL-2221 Clean up variable bindings being used webui groovy template
Deleted: portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Decorator.java
===================================================================
--- portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Decorator.java 2011-10-26 02:47:15 UTC (rev 7877)
+++ portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Decorator.java 2011-10-26 02:54:20 UTC (rev 7878)
@@ -1,53 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.webui.core.lifecycle;
-
-import org.exoplatform.webui.application.WebuiRequestContext;
-
-/**
- * Created by The eXo Platform SAS
- * Aug 23, 2006
- *
- * Writes a decorator template with the given css class style
- */
-public class Decorator
-{
- //<%decorator.start(.., ..)%>
- final public void start(String cssClass, String style) throws Exception
- {
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
- context.getWriter().append("<div class=\"").append(cssClass).append("\">").append("<div class=\"").append(style)
- .append("\" style=\"margin: 0px\">").append("<div class=\"TopLeftCornerBoxDecorator\">").append(
- "<div class=\"TopRightCornerBoxDecorator\">").append(
- "<div class=\"TopCenterBoxDecorator\"><span></span></div>").append("</div>").append("</div>").append(
- "<div class=\"MiddleLeftSideBoxDecorator\">").append("<div class=\"MiddleRightSideBoxDecorator\">").append(
- "<div class=\"DecoratorBackground\">");
-
- }
-
- final public void end() throws Exception
- {
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
- context.getWriter().append("</div>").append("</div>").append("</div>").append(
- "<div class=\"BottomLeftCornerBoxDecorator\">").append("<div class=\"BottomRightCornerBoxDecorator\">")
- .append("<div class=\"BottomCenterBoxDecorator\"><span></span></div>").append("</div>").append("</div>")
- .append("</div>").append("</div>");
- }
-}
\ No newline at end of file
Modified: portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
===================================================================
--- portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2011-10-26 02:47:15 UTC (rev 7877)
+++ portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2011-10-26 02:54:20 UTC (rev 7878)
@@ -37,8 +37,6 @@
protected static Log log = ExoLogger.getLogger("portal:Lifecycle");
- private Decorator decorator_ = new Decorator();
-
// public void init(UIComponent uicomponent, WebuiRequestContext context)
// throws Exception {}
@@ -103,7 +101,6 @@
protected void renderTemplate(String template, WebuiBindingContext bcontext) throws Exception
{
WebuiRequestContext context = bcontext.getRequestContext();
- bcontext.put("decorator", decorator_);
bcontext.put("locale", context.getLocale());
ExoContainer pcontainer = context.getApplication().getApplicationServiceContainer();
TemplateService service = (TemplateService)pcontainer.getComponentInstanceOfType(TemplateService.class);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplicationLifecycle.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplicationLifecycle.java 2011-10-26 02:47:15 UTC (rev 7877)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplicationLifecycle.java 2011-10-26 02:54:20 UTC (rev 7878)
@@ -139,7 +139,6 @@
ResourceResolver resolver = uicomponent.getTemplateResourceResolver(context, template);
WebuiBindingContext bcontext = new WebuiBindingContext(resolver, context.getWriter(), uicomponent, context);
bcontext.put(UIComponent.UICOMPONENT, uicomponent);
- bcontext.put(uicomponent.getUIComponentName(), uicomponent);
renderTemplate(template, bcontext);
}
13 years, 2 months
gatein SVN: r7877 - in portal/trunk: portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component and 15 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-10-25 22:47:15 -0400 (Tue, 25 Oct 2011)
New Revision: 7877
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UICaptcha.java
Removed:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java
Modified:
portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
portal/trunk/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl
portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterEditMode.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISamplePopupMessage.java
portal/trunk/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISamplePortlet.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/UIFormLifecycle.java
portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java
portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java
portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIApplication.java
portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
portal/trunk/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java
Log:
GTNPORTAL-2205 All WebUI portlets should send messages to Portal instead of handling by themselves
Modified: portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
===================================================================
--- portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl
===================================================================
--- portal/trunk/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl
===================================================================
--- portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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
Added: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UICaptcha.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UICaptcha.java (rev 0)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UICaptcha.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterEditMode.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterEditMode.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterEditMode.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.account.webui.component;
+
+import java.util.ArrayList;
+import java.util.List;
import nl.captcha.Captcha;
@@ -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.Event.Phase;
@@ -41,9 +43,6 @@
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.validator.Validator;
-import java.util.ArrayList;
-import java.util.List;
-
/**
*
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
@@ -87,9 +86,7 @@
{
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: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -22,7 +22,6 @@
import org.exoplatform.portal.pom.config.Utils;
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: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -101,7 +101,6 @@
uiOrganizer.reload();
uiOrganizer.setSelectedCategory(application.getCategoryName());
ctx.addUIComponentToUpdateByAjax(uiOrganizer);
- ctx.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
return;
}
uiForm.invokeSetBindingBean(application);
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -733,7 +733,6 @@
if (existPage != null)
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
- pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
Modified: portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISamplePopupMessage.java
===================================================================
--- portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISamplePopupMessage.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISamplePopupMessage.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISamplePortlet.gtmpl
===================================================================
--- portal/trunk/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISamplePortlet.gtmpl 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISamplePortlet.gtmpl 2011-10-26 02:47:15 UTC (rev 7877)
@@ -23,8 +23,4 @@
</td>
</tr>
</table>
- <%
- UIPopupMessages uiPopupMessages = uicomponent.getUIPopupMessages();
- uiPopupMessages.processRender(_ctx.getRequestContext());
- %>
</div>
Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/UIFormLifecycle.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/UIFormLifecycle.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/UIFormLifecycle.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -117,7 +117,6 @@
if (context.getProcessRender())
{
- context.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
return;
}
event.broadcast();
Modified: portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java
===================================================================
--- portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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,13 +166,14 @@
{
UIPortalApplication uiApp = Util.getUIPortalApplication();
uiApp.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
+ 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;
}
@@ -197,6 +196,7 @@
{
UIPortalApplication uiApp = Util.getUIPortalApplication();
uiApp.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
+ context.setAttribute(APP_NOT_EXIST, true);
context.addUIComponentToUpdateByAjax(uiDashboard);
return;
}
@@ -207,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: portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java
===================================================================
--- portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java
===================================================================
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java
===================================================================
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIApplication.java
===================================================================
--- portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIApplication.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIApplication.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
===================================================================
--- portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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
@@ -438,6 +440,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: 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-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -203,7 +203,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
@@ -270,7 +269,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());
@@ -279,7 +277,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;
}
@@ -396,7 +393,6 @@
if (page == null)
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[]{id}, 1));
- context.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
@@ -405,7 +401,6 @@
if (!userACL.hasEditPermission(page))
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.edit.NotEditPage", new String[]{id}, 1));
- context.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
@@ -464,7 +459,6 @@
if (existPage != null)
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
- pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
page.setModifiable(true);
Modified: portal/trunk/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java
===================================================================
--- portal/trunk/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java 2011-10-26 02:46:46 UTC (rev 7876)
+++ portal/trunk/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java 2011-10-26 02:47:15 UTC (rev 7877)
@@ -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);
13 years, 2 months