gatein SVN: r4341 - epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:39:20 -0400 (Thu, 23 Sep 2010)
New Revision: 4341
Modified:
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js
Log:
JBEPP-499: [Chrome] Display error when re-choose another file to upload in UIFormUploadInput
Modified: epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js 2010-09-23 10:38:33 UTC (rev 4340)
+++ epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js 2010-09-23 10:39:20 UTC (rev 4341)
@@ -49,32 +49,43 @@
UIUpload.prototype.createUploadEntry = function(uploadId, isAutoUpload) {
- var iframe = document.getElementById(uploadId+'uploadFrame');
+ var iframe = document.getElementById(uploadId+'uploadFrame');
var idoc = iframe.contentWindow.document ;
var uploadAction = eXo.env.server.context + "/upload?" ;
- uploadAction += "uploadId=" + uploadId+"&action=upload" ;
- idoc.open();
- idoc.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
- idoc.write("<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='" +eXo.core.I18n.lang+ "' dir='" +eXo.core.I18n.dir+ "'>");
- idoc.write("<head>");
- idoc.write("<style type='text/css'>");
- idoc.write(".UploadButton {width: 20px; height: 20px; cursor: pointer; vertical-align: bottom;");
- idoc.write(" background: url('/eXoResources/skin/DefaultSkin/webui/component/UIUpload/background/UpArrow16x16.gif') no-repeat left; }");
- idoc.write("</style>");
- idoc.write("<script type='text/javascript'>var eXo = parent.eXo</script>");
- idoc.write("</head>");
- idoc.write("<body style='margin: 0px; border: 0px;'>");
- idoc.write(" <form id='"+uploadId+"' class='UIUploadForm' style='margin: 0px; padding: 0px' action='"+uploadAction+"' enctype='multipart/form-data' method='post'>");
+ uploadAction += "uploadId=" + uploadId+"&action=upload" ;
+
+ var uploadHTML = "";
+ uploadHTML += "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>";
+ uploadHTML += "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='" +eXo.core.I18n.lang+ "' dir='" +eXo.core.I18n.dir+ "'>";
+ uploadHTML += "<head>";
+ uploadHTML += "<style type='text/css'>";
+ uploadHTML += ".UploadButton {width: 20px; height: 20px; cursor: pointer; vertical-align: bottom;";
+ uploadHTML += " background: url('/eXoResources/skin/DefaultSkin/webui/component/UIUpload/background/UpArrow16x16.gif') no-repeat left; }";
+ uploadHTML += "</style>";
+ uploadHTML += "</head>";
+ uploadHTML += "<body style='margin: 0px; border: 0px;'>";
+ uploadHTML += " <form id='"+uploadId+"' class='UIUploadForm' style='margin: 0px; padding: 0px' action='"+uploadAction+"' enctype='multipart/form-data' method='post'>";
if(isAutoUpload){
- idoc.write(" <input type='file' name='file' id='file' value='' onchange='eXo.webui.UIUpload.upload(this, "+uploadId+")' onkeypress='return false;' />");
+ uploadHTML += " <input type='file' name='file' id='file' value='' onchange='parent.eXo.webui.UIUpload.upload(this, "+uploadId+")' onkeypress='return false;' />";
}else{
- idoc.write(" <input type='file' name='file' id='file' value='' onkeypress='return false;' />");
- idoc.write(" <img class='UploadButton' onclick='eXo.webui.UIUpload.upload(this, "+uploadId+")' alt='' src='/eXoResources/skin/sharedImages/Blank.gif'/>");
+ uploadHTML += " <input type='file' name='file' id='file' value='' onkeypress='return false;' />";
+ uploadHTML += " <img class='UploadButton' style='width: 20px; height: 20px; cursor: pointer; vertical-align: bottom; background: url(\"/eXoResources/skin/DefaultSkin/webui/component/UIUpload/background/UpArrow16x16.gif\") no-repeat left;' onclick='parent.eXo.webui.UIUpload.upload(this, "+uploadId+")' alt='' src='/eXoResources/skin/sharedImages/Blank.gif'/>";
}
- idoc.write(" </form>");
- idoc.write("</body>");
- idoc.write("</html>");
- idoc.close();
+ uploadHTML += " </form>";
+ uploadHTML += "</body>";
+ uploadHTML += "</html>";
+
+ if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
+ //workaround for Chrome
+ //When submit in iframe with Chrome, the iframe.contentWindow.document seems not be reconstructed correctly
+ idoc.open();
+ idoc.close();
+ idoc.documentElement.innerHTML = uploadHTML;
+ } else {
+ idoc.open();
+ idoc.write(uploadHTML);
+ idoc.close();
+ }
};
/**
14 years, 3 months
gatein SVN: r4340 - epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:38:33 -0400 (Thu, 23 Sep 2010)
New Revision: 4340
Modified:
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
Log:
JBEPP-498: Gadgets : UserPrefs' bool type doesn't render a checkbox
Modified: epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-23 10:35:11 UTC (rev 4339)
+++ epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-23 10:38:33 UTC (rev 4340)
@@ -669,6 +669,19 @@
}
attEl.appendChild(el);
}
+ else if (type == "bool") {
+ var el = document.createElement("input");
+ el.type = "checkbox";
+ el.name = prefix + att;
+ el.id = elID;
+ if (userPrefs[att] && userPrefs[att] == "true") {
+ el.checked = userPrefs[att];
+ } else {
+ if(prefs[att].default == "true")
+ el.checked = true;
+ }
+ attEl.appendChild(el);
+ }
formEl.appendChild(attEl);
j++;
}
@@ -745,6 +758,8 @@
var userPrefNamePrefix = 'm_' + this.id + '_up_';
var userPrefName = input.name.substring(userPrefNamePrefix.length);
var userPrefValue = input.value;
+ if(input.type == 'checkbox')
+ userPrefValue = input.checked ? "true" : "false";
prefs[userPrefName] = userPrefValue;
}
}
14 years, 3 months
gatein SVN: r4339 - epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:35:11 -0400 (Thu, 23 Sep 2010)
New Revision: 4339
Modified:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_pt_BR.properties
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
Log:
JBEPP-495: Change visisble copyright info from 2009 to 2010 for some language ( German, Portuguese - Brazil, Japanese)
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-09-23 10:32:57 UTC (rev 4338)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-09-23 10:35:11 UTC (rev 4339)
@@ -254,7 +254,7 @@
UILoginForm.label.Signin=Anmelden
UILoginForm.label.ForAccount=Jetzt ein Konto registrieren
UILoginForm.label.SigninFail=Anmeldung fehlgeschlagen. Falscher Benutzername oder falsches Passwort.
-UILoginForm.label.Copyright=Copyright © 2009. Alle Rechte vorbehalten, eXo Platform SAS und Red Hat, Inc.
+UILoginForm.label.Copyright=Copyright © 2010. Alle Rechte vorbehalten, eXo Platform SAS und Red Hat, Inc.
#############################################################################
# Message Error #
@@ -925,7 +925,7 @@
# org.exoplatform.portal.component.customization.UIPortalToolPanel #
############################################################################
-UIPortalToolPanel.label.copyrightText=Copyright © 2009. Alle Rechte vorbehalten,
+UIPortalToolPanel.label.copyrightText=Copyright © 2010. Alle Rechte vorbehalten,
UIPortalToolPanel.label.companyTitleText= eXo Platform SAS und Red Hat, Inc..
############################################################################
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-09-23 10:32:57 UTC (rev 4338)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-09-23 10:35:11 UTC (rev 4339)
@@ -922,7 +922,7 @@
############################################################################
UIPortalToolPanel.label.copyrightText=Copyright © 2010. All rights Reserved,
-UIPortalToolPanel.label.companyTitleText= eXo Platform SAS and Red Hat, Inc..
+UIPortalToolPanel.label.companyTitleText= eXo SAS Plataforma y Red Hat, Inc..
############################################################################
# org.exoplatform.portal.component.view.UIContainer #
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-09-23 10:32:57 UTC (rev 4338)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-09-23 10:35:11 UTC (rev 4339)
@@ -911,7 +911,7 @@
# org.exoplatform.portal.component.customization.UIPortalToolPanel #
############################################################################
-UIPortalToolPanel.label.copyrightText=Copyright © 2009-2010. Tous droits réservés,
+UIPortalToolPanel.label.copyrightText=Copyright © 2010. Tous droits réservés,
UIPortalToolPanel.label.companyTitleText=Red Hat, Inc. et eXo Platform SAS
############################################################################
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-09-23 10:32:57 UTC (rev 4338)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-09-23 10:35:11 UTC (rev 4339)
@@ -254,7 +254,7 @@
UILoginForm.label.Signin=\u30b5\u30a4\u30f3\u30a4\u30f3
UILoginForm.label.ForAccount=\u30a2\u30ab\u30a6\u30f3\u30c8\u767b\u9332
UILoginForm.label.SigninFail=\u30b5\u30a4\u30f3\u30a4\u30f3\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u8aa4\u3063\u305f\u30e6\u30fc\u30b6\u30fc\u540d\u307e\u305f\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u3059\u3002
-UILoginForm.label.Copyright=Copyright © 2009. All rights Reserved, eXo Platform SAS and Red Hat, Inc.
+UILoginForm.label.Copyright=Copyright © 2010. All rights Reserved, eXo Platform SAS \u3057\u3066 Red Hat, Inc.
#############################################################################
# Message Error #
@@ -926,8 +926,8 @@
# org.exoplatform.portal.component.customization.UIPortalToolPanel #
############################################################################
-UIPortalToolPanel.label.copyrightText=Copyright © 2009. All rights Reserved,
-UIPortalToolPanel.label.companyTitleText= eXo Platform SAS and Red Hat, Inc..
+UIPortalToolPanel.label.copyrightText=Copyright © 2010. All rights Reserved,
+UIPortalToolPanel.label.companyTitleText= eXo Platform SAS \u3057\u3066 Red Hat, Inc..
############################################################################
# org.exoplatform.portal.component.view.UIContainer #
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_pt_BR.properties
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_pt_BR.properties 2010-09-23 10:32:57 UTC (rev 4338)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_pt_BR.properties 2010-09-23 10:35:11 UTC (rev 4339)
@@ -922,8 +922,8 @@
# org.exoplatform.portal.component.customization.UIPortalToolPanel #
############################################################################
-UIPortalToolPanel.label.copyrightText=Copyright © 2009. All rights Reserved,
-UIPortalToolPanel.label.companyTitleText= eXo Platform SAS and Red Hat, Inc..
+UIPortalToolPanel.label.copyrightText=Copyright © 2010. All rights reserved,
+UIPortalToolPanel.label.companyTitleText= SAS eXo Platform e Red Hat, Inc..
############################################################################
# org.exoplatform.portal.component.view.UIContainer #
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2010-09-23 10:32:57 UTC (rev 4338)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2010-09-23 10:35:11 UTC (rev 4339)
@@ -898,7 +898,7 @@
############################################################################
UIPortalToolPanel.label.copyrightText=Copyright © 2010. All rights Reserved,
-UIPortalToolPanel.label.companyTitleText= eXo Platform SAS and Red Hat, Inc..
+UIPortalToolPanel.label.companyTitleText= eXo Platform SAS і Red Hat Inc..
############################################################################
# org.exoplatform.portal.component.view.UIContainer #
14 years, 3 months
gatein SVN: r4337 - in epp/portal/branches/EPP_5_1_Branch: web/eXoResources/src/main/webapp/javascript/eXo/webui and 6 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:28:53 -0400 (Thu, 23 Sep 2010)
New Revision: 4337
Modified:
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl
epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/core/UIConfirmation.java
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java
Log:
JBEPP-494: Add confirmation message when leaving page edition page without saving
Modified: epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-23 10:28:45 UTC (rev 4336)
+++ epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-23 10:28:53 UTC (rev 4337)
@@ -126,7 +126,7 @@
blockContainer.appendChild(maskLayer) ;
maskLayer.className = "MaskLayer" ;
maskLayer.id = "MaskLayer" ;
- maskLayer.maxZIndex = 4; //3 ;
+ maskLayer.maxZIndex = eXo.webui.UIPopup.zIndex + 1; //3 ;
maskLayer.style.width = Browser.getBrowserWidth() + "px";
maskLayer.style.height = Browser.getBrowserHeight() + "px";
maskLayer.style.top = "0px" ;
Modified: epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-23 10:28:45 UTC (rev 4336)
+++ epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-23 10:28:53 UTC (rev 4337)
@@ -71,7 +71,7 @@
var mask = popup.previousSibling;
if(isShowPopup) {
//Modal if popup is portal component
- if (popup.parentNode.id == "UIPortalApplication") {
+ if (eXo.core.DOMUtil.findAncestorByClass(popup, "PORTLET-FRAGMENT") == null) {
eXo.core.UIMaskLayer.createMask(popup.parentNode, popup, 1) ;
} else {
//If popup is portlet's component, modal with just its parent
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-09-23 10:28:45 UTC (rev 4336)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-09-23 10:28:53 UTC (rev 4337)
@@ -485,6 +485,14 @@
UIPageEditor.action.SwitchMode=Switch View mode
#############################################################################
+ # org.exoplatform.portal.webui.workspace.UIEditInlineWorkspace #
+ #############################################################################
+
+UIEditInlineWorkspace.confirm.close=Modifications have been made. Are you sure you want to close without saving ?
+UIEditInlineWorkspace.confirm.yes=Yes
+UIEditInlineWorkspace.confirm.no=No
+
+ #############################################################################
# org.exoplatform.portal.component.customization.UIPageForm #
#############################################################################
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl 2010-09-23 10:28:45 UTC (rev 4336)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl 2010-09-23 10:28:53 UTC (rev 4337)
@@ -14,7 +14,7 @@
<div class="OverflowContainer">
<div class="<%=uicomponent.isCollapsed ? "CollapseIcon" : "ExpandIcon"%>" onclick="eXo.portal.UIPortal.toggleComposer(this)"><span></span></div>
<% if(uicomponent.isShowControl) { %>
- <a class="CloseButton" title="<%=_ctx.appRes("word.abort")%>" href="<%=uicomponent.event("Abort")%>"><span></span></a>
+ <a class="CloseButton" title="<%=_ctx.appRes("word.abort")%>" href="<%=uicomponent.event("CloseComposer")%>"><span></span></a>
<% if (uicomponent.isUsedInWizard()) { %>
<a class="<%= isEditted ? "EdittedSaveButton" : "SaveButton" %>" title="<%=_ctx.appRes("word.finish")%>" href="<%=uicomponent.url("Finish")%>" onclick="eXo.core.DOMUtil.disableOnClick(this);" ><span></span></a>
<a class="BackButton"" title="<%=_ctx.appRes("word.back")%>" href="<%=uicomponent.event("Back")%>">
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl 2010-09-23 10:28:45 UTC (rev 4336)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl 2010-09-23 10:28:53 UTC (rev 4337)
@@ -41,7 +41,7 @@
void printMessage(String message, String messageType)
{
- println "<div class=\"UITabContent\"";
+ println "<div class=\"UITabContent\">";
println " <div class=\"PopupMessageBox\">";
println " <div class=\"$messageType\">";
println " <div class=\"PopupMessageContainer\">";
@@ -76,7 +76,7 @@
}
}
%>
- <div class="UIPopupWindow" id="$popupId" style="width: 550px; display: none;">
+ <div class="UIPopupWindow UIDragObject" id="$popupId" style="width: 550px; display: none;">
<div class="ExoMessageDecorator">
<div class="TopLeftCornerDecorator">
<div class="TopRightCornerDecorator">
@@ -136,9 +136,9 @@
</div>
<%
- rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.init('$popupId', false);");
+ rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.init('$popupId', false, null, null, $uicomponent.showMask);");
if(uicomponent.hasMessage()){
- rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.show('$popupId');");
+ rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.show('$popupId', $uicomponent.showMask);");
rcontext.getJavascriptManager().addJavascript("window.setTimeout(\"eXo.webui.UIPopupWindow.increasezIndex('$popupId')\", 100);");
}
%>
\ No newline at end of file
Modified: epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/core/UIConfirmation.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/core/UIConfirmation.java 2010-09-23 10:28:45 UTC (rev 4336)
+++ epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/core/UIConfirmation.java 2010-09-23 10:28:53 UTC (rev 4337)
@@ -24,7 +24,6 @@
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.form.UIFormInputWithActions.ActionData;
/**
* Created by The eXo Platform SAS
@@ -56,6 +55,7 @@
{
this.message_ = "";
this.caller_ = new Object();
+ setShowMask(true);
setShow(true);
}
@@ -63,6 +63,7 @@
{
this.message_ = message;
this.caller_ = caller;
+ setShowMask(true);
setShow(true);
}
@@ -116,19 +117,16 @@
return (message_!=null) && (!message_.equals(""));
}
- private void hidePopup(WebuiRequestContext context)
+ private void hidePopup(Event<UIConfirmation> event) throws Exception
{
+ WebuiRequestContext context = event.getRequestContext();
this.clearMessage();
- if(this.getParent() == null)
- {
- context.addUIComponentToUpdateByAjax(this);
- return;
- }
-
- if(!this.isShow())
- {
- return;
- }
+ context.addUIComponentToUpdateByAjax(this);
+ UIComponent uiParent = getParent();
+ Event<UIComponent> pEvent =
+ uiParent.createEvent("ClosePopup", event.getExecutionPhase(), event.getRequestContext());
+ if (pEvent != null)
+ pEvent.broadcast();
}
public static class CloseActionListener extends EventListener<UIConfirmation>
@@ -137,8 +135,7 @@
public void execute(Event<UIConfirmation> event) throws Exception
{
UIConfirmation uiConfirmation = event.getSource();
- WebuiRequestContext context = event.getRequestContext();
- uiConfirmation.hidePopup(context);
+ uiConfirmation.hidePopup(event);
}
}
@@ -158,7 +155,7 @@
xEvent.broadcast();
}
- uiConfirmation.hidePopup(context);
+ uiConfirmation.hidePopup(event);
}
}
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-09-23 10:28:45 UTC (rev 4336)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-09-23 10:28:53 UTC (rev 4337)
@@ -60,6 +60,7 @@
import org.exoplatform.webui.event.Event.Phase;
import java.util.List;
+import java.util.ResourceBundle;
import javax.servlet.http.HttpServletRequest;
@@ -67,6 +68,7 @@
@ComponentConfigs({
@ComponentConfig(template = "app:/groovy/portal/webui/portal/UIPortalComposer.gtmpl", events = {
@EventConfig(listeners = UIPortalComposer.ViewPropertiesActionListener.class),
+ @EventConfig(listeners = UIPortalComposer.CloseComposerActionListener.class),
@EventConfig(listeners = UIPortalComposer.AbortActionListener.class),
@EventConfig(listeners = UIPortalComposer.FinishActionListener.class),
@EventConfig(listeners = UIPortalComposer.SwitchModeActionListener.class),
@@ -74,6 +76,7 @@
@EventConfig(listeners = UIPortalComposer.ToggleActionListener.class)}),
@ComponentConfig(id = "UIPageEditor", template = "app:/groovy/portal/webui/portal/UIPortalComposer.gtmpl", events = {
@EventConfig(name = "ViewProperties", listeners = UIPortalComposer.ViewProperties2ActionListener.class),
+ @EventConfig(listeners = UIPortalComposer.CloseComposerActionListener.class),
@EventConfig(name = "Abort", listeners = UIPortalComposer.Abort2ActionListener.class),
@EventConfig(name = "Finish", listeners = UIPortalComposer.Finish2ActionListener.class),
@EventConfig(name = "Back", listeners = UIPortalComposer.BackActionListener.class),
@@ -95,7 +98,7 @@
UITabPane uiTabPane = addChild(UITabPane.class, "UIPortalComposerTab", null);
uiTabPane.addChild(UIApplicationList.class, null, null).setRendered(true);
uiTabPane.addChild(UIContainerList.class, null, null);
- uiTabPane.setSelectedTab(1);
+ uiTabPane.setSelectedTab(1);
}
public int getPortalMode()
@@ -619,6 +622,27 @@
event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWS);
}
}
+
+ static public class CloseComposerActionListener extends EventListener<UIPortalComposer>
+ {
+ public void execute(Event<UIPortalComposer> event) throws Exception
+ {
+ UIPortalComposer uiPortalComposer = event.getSource();
+ UIEditInlineWorkspace uiEditInlineWorkspace = uiPortalComposer.getAncestorOfType(UIEditInlineWorkspace.class);
+ if (uiPortalComposer.isEditted())
+ {
+ ResourceBundle resourceBundle = event.getRequestContext().getApplicationResourceBundle();
+ String closeMessage = resourceBundle.getString("UIEditInlineWorkspace.confirm.close");
+
+ uiEditInlineWorkspace.showConfirmWindow(closeMessage);
+ }
+ else
+ {
+ Event<UIComponent> abortEvent = uiPortalComposer.createEvent("Abort", event.getExecutionPhase(), event.getRequestContext());
+ abortEvent.broadcast();
+ }
+ }
+ }
static public class Abort2ActionListener extends EventListener<UIPortalComposer>
{
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java 2010-09-23 10:28:45 UTC (rev 4336)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java 2010-09-23 10:28:53 UTC (rev 4337)
@@ -19,19 +19,29 @@
package org.exoplatform.portal.webui.workspace;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ResourceBundle;
+
import org.exoplatform.portal.webui.portal.UIPortalComposer;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.core.UIConfirmation;
import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UIConfirmation.ActionConfirm;
import org.exoplatform.webui.core.lifecycle.UIContainerLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
/**
- * Created by The eXo Platform SAS
- * Author : Tan Pham Dinh
- * pdtanit(a)gmail.com
- * Aug 27, 2009
+ * Created by The eXo Platform SAS Author : Tan Pham Dinh pdtanit(a)gmail.com Aug
+ * 27, 2009
*/
-@ComponentConfig(lifecycle = UIContainerLifecycle.class)
+@ComponentConfig(lifecycle = UIContainerLifecycle.class, events = {
+ @EventConfig(listeners = UIEditInlineWorkspace.ConfirmCloseActionListener.class),
+ @EventConfig(listeners = UIEditInlineWorkspace.AbortCloseActionListener.class)})
public class UIEditInlineWorkspace extends UIContainer
{
@@ -39,6 +49,17 @@
{
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);
}
public void setUIComponent(UIComponent uiComp)
@@ -55,4 +76,41 @@
{
return getChild(UIPortalComposer.class);
}
+
+ public void showConfirmWindow(String message)
+ {
+ UIConfirmation uiConfirmation = getChild(UIConfirmation.class);
+ uiConfirmation.setMessage(message);
+ ((WebuiRequestContext)WebuiRequestContext.getCurrentInstance()).addUIComponentToUpdateByAjax(uiConfirmation);
+ }
+
+ static public class ConfirmCloseActionListener extends EventListener<UIEditInlineWorkspace>
+ {
+
+ @Override
+ public void execute(Event<UIEditInlineWorkspace> event) throws Exception
+ {
+ UIEditInlineWorkspace uiEditInlineWorkspace = event.getSource();
+
+ UIConfirmation uiConfirmation = uiEditInlineWorkspace.getChild(UIConfirmation.class);
+ uiConfirmation.createEvent("Close", event.getExecutionPhase(), event.getRequestContext()).broadcast();
+
+ UIPortalComposer uiPortalComposer = uiEditInlineWorkspace.getChild(UIPortalComposer.class);
+ Event<UIComponent> abortEvent =
+ uiPortalComposer.createEvent("Abort", event.getExecutionPhase(), event.getRequestContext());
+ abortEvent.broadcast();
+ }
+ }
+
+ static public class AbortCloseActionListener extends EventListener<UIEditInlineWorkspace>
+ {
+
+ @Override
+ public void execute(Event<UIEditInlineWorkspace> event) throws Exception
+ {
+ UIEditInlineWorkspace uiEditInlineWorkspace = event.getSource();
+ UIConfirmation uiConfirmation = uiEditInlineWorkspace.getChild(UIConfirmation.class);
+ uiConfirmation.createEvent("Close", event.getExecutionPhase(), event.getRequestContext()).broadcast();
+ }
+ }
}
14 years, 3 months
gatein SVN: r4336 - in epp/portal/branches/EPP_5_1_Branch: component/scripting/src/main/java/org/exoplatform/groovyscript/text and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:28:45 -0400 (Thu, 23 Sep 2010)
New Revision: 4336
Modified:
epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java
epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java
epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyTemplate.java
epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java
epp/portal/branches/EPP_5_1_Branch/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
Log:
JBEPP-493: Locale encoding in Groovy templates
Modified: epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java 2010-09-23 10:16:29 UTC (rev 4335)
+++ epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java 2010-09-23 10:28:45 UTC (rev 4336)
@@ -18,12 +18,16 @@
*/
package org.exoplatform.groovyscript;
+import groovy.lang.GString;
import groovy.lang.GroovyInterceptable;
import groovy.lang.GroovyObjectSupport;
import org.exoplatform.commons.utils.Text;
import java.io.IOException;
import java.io.Writer;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Locale;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -32,6 +36,19 @@
abstract class GroovyPrinter extends GroovyObjectSupport implements GroovyInterceptable
{
+ /** An optional locale. */
+ private Locale locale;
+
+ public Locale getLocale()
+ {
+ return locale;
+ }
+
+ public void setLocale(Locale locale)
+ {
+ this.locale = locale;
+ }
+
/**
* Optimize the call to the various print methods.
*
@@ -82,21 +99,65 @@
}
}
+ /**
+ * We handle in this method a conversion of an object to another one for formatting purposes.
+ *
+ * @param o the object to format
+ * @return the formatted object
+ */
+ private Object format(Object o)
+ {
+ if (o instanceof Date)
+ {
+ if (locale != null)
+ {
+ DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, locale);
+ o = dateFormat.format((Date)o);
+ }
+ }
+
+ //
+ return o;
+ }
+
+ private String toString(Object o)
+ {
+ Object f = format(o);
+ if (f == null)
+ {
+ return "null";
+ }
+ else if (f instanceof String)
+ {
+ return (String)f;
+ }
+ else
+ {
+ return o.toString();
+ }
+ }
+
public final void print(Object o)
{
try
{
- if (o == null)
+ if (o instanceof Text)
{
- write("null");
+ write((Text)o);
}
- else if (o instanceof Text)
+ else if (o instanceof GString)
{
- write((Text)o);
+ GString gs = (GString)o;
+ Object[] values = gs.getValues();
+ for (int i = 0;i < values.length;i++)
+ {
+ values[i] = format(values[i]);
+ }
+ write(o.toString());
}
else
{
- write(o.toString());
+ write(toString(o));
}
}
catch (IOException ignore)
Modified: epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java 2010-09-23 10:16:29 UTC (rev 4335)
+++ epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java 2010-09-23 10:28:45 UTC (rev 4336)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.Writer;
+import java.util.Locale;
import java.util.Map;
/**
@@ -70,7 +71,19 @@
return scriptClass;
}
- public void render(Map context, Writer writer) throws IOException, TemplateRuntimeException
+ /**
+ * Renders the script with the provided context and locale to the specified writer.
+ *
+ * @param context the context
+ * @param writer the writer
+ * @param locale the locale
+ * @throws IOException
+ * @throws TemplateRuntimeException
+ */
+ public void render(
+ Map context,
+ Writer writer,
+ Locale locale) throws IOException, TemplateRuntimeException
{
Binding binding = context != null ? new Binding(context) : new Binding();
@@ -86,6 +99,9 @@
}
//
+ printer.setLocale(locale);
+
+ //
BaseScript script = (BaseScript)InvokerHelper.createScript(scriptClass, binding);
script.printer = printer;
Modified: epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyTemplate.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyTemplate.java 2010-09-23 10:16:29 UTC (rev 4335)
+++ epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyTemplate.java 2010-09-23 10:28:45 UTC (rev 4336)
@@ -22,6 +22,7 @@
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
+import java.util.Locale;
import java.util.Map;
/**
@@ -104,12 +105,22 @@
public void render(Writer writer) throws IOException, TemplateRuntimeException
{
- render(writer, null);
+ render(writer, (Map)null);
}
+ public void render(Writer writer, Locale locale) throws IOException, TemplateRuntimeException
+ {
+ render(writer, null, locale);
+ }
+
+ public void render(Writer writer, Map binding, Locale locale) throws IOException, TemplateRuntimeException
+ {
+ script.render(binding, writer, locale);
+ }
+
public void render(Writer writer, Map binding) throws IOException, TemplateRuntimeException
{
- script.render(binding, writer);
+ script.render(binding, writer, null);
}
public String render() throws IOException, TemplateRuntimeException
@@ -117,10 +128,20 @@
return render((Map)null);
}
+ public String render(Locale locale) throws IOException, TemplateRuntimeException
+ {
+ return render((Map)null, locale);
+ }
+
public String render(Map binding) throws IOException, TemplateRuntimeException
{
+ return render(binding, null);
+ }
+
+ public String render(Map binding, Locale locale) throws IOException, TemplateRuntimeException
+ {
StringWriter buffer = new StringWriter();
- render(buffer, binding);
+ render(buffer, binding, locale);
buffer.close();
return buffer.toString();
}
Modified: epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java 2010-09-23 10:16:29 UTC (rev 4335)
+++ epp/portal/branches/EPP_5_1_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java 2010-09-23 10:28:45 UTC (rev 4336)
@@ -44,6 +44,7 @@
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Locale;
/**
* Created by The eXo Platform SAS Dec 26, 2005
@@ -113,8 +114,7 @@
GroovyTemplate template = getTemplate(name, context.getResourceResolver());
context.put("_ctx", context);
context.setGroovyTemplateService(this);
- template.render(context.getWriter(), context);
-
+ template.render(context.getWriter(), context, (Locale)context.get("locale"));
long endTime = System.currentTimeMillis();
TemplateStatistic templateStatistic = statisticService.getTemplateStatistic(name);
@@ -137,7 +137,7 @@
throw new Exception("Binding cannot be null");
context.put("_ctx", context);
GroovyTemplate template = getTemplate(name, context.getResourceResolver());
- template.render(context.getWriter(), context);
+ template.render(context.getWriter(), context, (Locale)context.get("locale"));
}
final public GroovyTemplate getTemplate(String name, ResourceResolver resolver) throws Exception
Modified: epp/portal/branches/EPP_5_1_Branch/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2010-09-23 10:16:29 UTC (rev 4335)
+++ epp/portal/branches/EPP_5_1_Branch/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2010-09-23 10:28:45 UTC (rev 4336)
@@ -26,6 +26,7 @@
import java.io.*;
import java.util.EmptyStackException;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
/**
@@ -45,6 +46,32 @@
assertEquals("abcde", baos.toString("UTF-8"));
}
+ public void testDate1() throws Exception
+ {
+ GroovyTemplate template = new GroovyTemplate("<% print(new Date(0)); %>");
+ assertEquals("1 janv. 1970", template.render(Locale.FRENCH));
+ assertEquals("Jan 1, 1970", template.render(Locale.ENGLISH));
+ assertEquals("Thu Jan 01 07:00:00 ICT 1970", template.render());
+ }
+
+ public void testDate2() throws Exception
+ {
+ GroovyTemplate template = new GroovyTemplate("<% def date = new Date(0) %>$date");
+ System.out.println("template.getGroovy() = " + template.getGroovy());
+ assertEquals("1 janv. 1970", template.render(Locale.FRENCH));
+ assertEquals("Jan 1, 1970", template.render(Locale.ENGLISH));
+ assertEquals("Thu Jan 01 07:00:00 ICT 1970", template.render());
+ }
+
+ public void testDate3() throws Exception
+ {
+ GroovyTemplate template = new GroovyTemplate("<%= new Date(0) %>");
+ System.out.println("template.getGroovy() = " + template.getGroovy());
+ assertEquals("1 janv. 1970", template.render(Locale.FRENCH));
+ assertEquals("Jan 1, 1970", template.render(Locale.ENGLISH));
+ assertEquals("Thu Jan 01 07:00:00 ICT 1970", template.render());
+ }
+
public void testFoo() throws Exception
{
GroovyTemplate template = new GroovyTemplate("a");
Modified: epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2010-09-23 10:16:29 UTC (rev 4335)
+++ epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2010-09-23 10:28:45 UTC (rev 4336)
@@ -101,9 +101,10 @@
*
*/
protected void renderTemplate(String template, WebuiBindingContext bcontext) throws Exception
- {
+ {
+ WebuiRequestContext context = bcontext.getRequestContext();
bcontext.put("decorator", decorator_);
- WebuiRequestContext context = bcontext.getRequestContext();
+ bcontext.put("locale", context.getLocale());
ExoContainer pcontainer = context.getApplication().getApplicationServiceContainer();
TemplateService service = (TemplateService)pcontainer.getComponentInstanceOfType(TemplateService.class);
ResourceResolver resolver = bcontext.getResourceResolver();
14 years, 3 months
gatein SVN: r4335 - epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:16:29 -0400 (Thu, 23 Sep 2010)
New Revision: 4335
Modified:
epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF/web.xml
Log:
JBEPP-492: No Graphic of Text validation in sample-portal
Modified: epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF/web.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2010-09-23 10:15:04 UTC (rev 4334)
+++ epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2010-09-23 10:16:29 UTC (rev 4335)
@@ -185,7 +185,25 @@
<servlet-class>org.gatein.wci.api.GateInServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
+
+ <servlet>
+ <servlet-name>StickyCaptcha</servlet-name>
+ <servlet-class>org.exoplatform.web.security.CaptchaServlet</servlet-class>
+ <init-param>
+ <param-name>width</param-name>
+ <param-value>200</param-value>
+ </init-param>
+ <init-param>
+ <param-name>height</param-name>
+ <param-value>75</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>StickyCaptcha</servlet-name>
+ <url-pattern>/captcha</url-pattern>
+ </servlet-mapping>
+
<!-- ================================================================= -->
<servlet-mapping>
<servlet-name>InitiateLoginServlet</servlet-name>
14 years, 3 months
gatein SVN: r4334 - epp/portal/branches/EPP_5_1_Branch/portlet/exoadmin/src/main/webapp/WEB-INF.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:15:04 -0400 (Thu, 23 Sep 2010)
New Revision: 4334
Modified:
epp/portal/branches/EPP_5_1_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
Log:
JBEPP-491: Remove the wrong configuration for supported locale
Modified: epp/portal/branches/EPP_5_1_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-09-23 10:13:58 UTC (rev 4333)
+++ epp/portal/branches/EPP_5_1_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-09-23 10:15:04 UTC (rev 4334)
@@ -235,7 +235,7 @@
<mime-type>text/html</mime-type>
<portlet-mode>help</portlet-mode>
</supports>
- <supported-locale>en,fr,vi,ar</supported-locale>
+ <supported-locale>en</supported-locale>
<resource-bundle>locale.portlet.exoadmin.AdminToolbarPortlet</resource-bundle>
<portlet-info>
<title>Administration Toolbar Portlet</title>
14 years, 3 months
gatein SVN: r4333 - in epp/portal/branches/EPP_5_1_Branch: web/eXoResources/src/main/webapp/javascript/eXo/webui and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:13:58 -0400 (Thu, 23 Sep 2010)
New Revision: 4333
Modified:
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
Log:
JBEPP-490: Still click Abort/Finish on Edit Inline Composer when pop-up mesage still is open
Modified: epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-23 10:10:23 UTC (rev 4332)
+++ epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-23 10:13:58 UTC (rev 4333)
@@ -107,7 +107,8 @@
UIMaskLayer.prototype.createMask = function(blockContainerId, object, opacity, position) {
try {
var Browser = eXo.core.Browser ;
- var blockContainer = document.getElementById(blockContainerId) ;
+ if(typeof(blockContainerId) == "string") blockContainerId = document.getElementById(blockContainerId) ;
+ var blockContainer = blockContainerId ;
var maskLayer = document.createElement("div") ;
this.object = object ;
@@ -121,11 +122,10 @@
* reference with method eXo.core.UIMaskLayer.doScroll()
*/
document.getElementById("MaskLayer").id = "subMaskLayer";
- }
- blockContainer.appendChild(maskLayer) ;
-
+ }
+ blockContainer.appendChild(maskLayer) ;
maskLayer.className = "MaskLayer" ;
- maskLayer.id = "MaskLayer" ;
+ maskLayer.id = "MaskLayer" ;
maskLayer.maxZIndex = 4; //3 ;
maskLayer.style.width = Browser.getBrowserWidth() + "px";
maskLayer.style.height = Browser.getBrowserHeight() + "px";
@@ -137,14 +137,14 @@
Browser.setOpacity(maskLayer, opacity) ;
}
- if(object != null){
- if(object.nextSibling) {
- maskLayer.nextSiblingOfObject = object.nextSibling ;
- maskLayer.parentOfObject = null ;
+ if(object != null) {
+ var tempNextSibling = document.createElement("span");
+ if(object.nextSibling) {
+ object.parentNode.insertBefore(tempNextSibling, object.nextSibling);
} else {
- maskLayer.nextSiblingOfObject = null ;
- maskLayer.parentOfObject = object.parentNode ;
+ object.parentNode.appendChild(tempNextSibling);
}
+ maskLayer.nextSiblingOfObject = tempNextSibling ;
//object.style.zIndex = maskLayer.maxZIndex + 1 ;
object.style.zIndex = maskLayer.maxZIndex;
@@ -185,27 +185,31 @@
maskLayer.id = object.id + "MaskLayer" ;
maskLayer.maxZIndex = 3 ;
maskLayer.style.width = blockContainer.offsetWidth + "px" ;
- maskLayer.style.height = blockContainer.offsetHeight + eXo.core.Browser.findPosY(blockContainer) + "px" ;
- maskLayer.style.top = "0px" ;
- maskLayer.style.left = "0px" ;
+ maskLayer.style.height = blockContainer.offsetHeight + "px" ;
+ var parentOfBlockContainer = eXo.core.DOMUtil.findAncestorById(blockContainer, "UIMaskWorkspace");
+ if (!parentOfBlockContainer) {
+ parentOfBlockContainer = document.getElementById("UIWorkingWorkspace");
+ }
+ maskLayer.style.top = eXo.core.Browser.findPosYInContainer(blockContainer, parentOfBlockContainer) + "px" ;
+ maskLayer.style.left = eXo.core.Browser.findPosXInContainer(blockContainer, parentOfBlockContainer) + "px" ;
maskLayer.style.zIndex = maskLayer.maxZIndex ;
if(opacity) {
Browser.setOpacity(maskLayer, opacity) ;
}
if(object != null){
- if(object.nextSibling) {
- maskLayer.nextSiblingOfObject = object.nextSibling ;
- maskLayer.parentOfObject = null ;
- } else {
- maskLayer.nextSiblingOfObject = null ;
- maskLayer.parentOfObject = object.parentNode ;
- }
+ var tempNextSibling = document.createElement("span");
+ if(object.nextSibling) {
+ object.parentNode.insertBefore(tempNextSibling, object.nextSibling);
+ } else {
+ object.parentNode.appendChild(tempNextSibling);
+ }
+ maskLayer.nextSiblingOfObject = tempNextSibling ;
+
+ object.style.zIndex = maskLayer.maxZIndex + 1 ;
+ object.style.display = "block" ;
- object.style.zIndex = maskLayer.maxZIndex + 1 ;
- object.style.display = "block" ;
-
- blockContainer.appendChild(object) ;
+ blockContainer.appendChild(object) ;
}
}catch(err) {}
@@ -278,17 +282,12 @@
if (maskLayer) {
var parentNode = maskLayer.parentNode ;
maskLayer.nextSibling.style.display = "none" ;
-
- if (maskLayer.nextSiblingOfObject) {
- maskLayer.nextSiblingOfObject.parentNode.insertBefore(maskLayer.nextSibling, maskLayer.nextSiblingOfObject) ;
- maskLayer.nextSiblingOfObject = null ;
- } else {
- maskLayer.parentOfObject.appendChild(maskLayer.nextSibling) ;
- maskLayer.parentOfObject = null ;
- }
-
- parentNode.removeChild(maskLayer) ;
+
+ maskLayer.nextSiblingOfObject.parentNode.insertBefore(maskLayer.nextSibling, maskLayer.nextSiblingOfObject) ;
+ maskLayer.nextSiblingOfObject.parentNode.removeChild(maskLayer.nextSiblingOfObject);
+ maskLayer.nextSiblingOfObject = null ;
+ parentNode.removeChild(maskLayer) ;
}
} ;
Modified: epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-23 10:10:23 UTC (rev 4332)
+++ epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-23 10:13:58 UTC (rev 4333)
@@ -68,12 +68,18 @@
} ;
UIPopupWindow.prototype.showMask = function(popup, isShowPopup) {
- var maskId = popup.id + "MaskLayer" ;
- var mask = document.getElementById(maskId) ;
+ var mask = popup.previousSibling;
if(isShowPopup) {
- if (mask == null) eXo.core.UIMaskLayer.createMaskForFrame(popup.parentNode, popup, 1) ;
+ //Modal if popup is portal component
+ if (popup.parentNode.id == "UIPortalApplication") {
+ eXo.core.UIMaskLayer.createMask(popup.parentNode, popup, 1) ;
+ } else {
+ //If popup is portlet's component, modal with just its parent
+ eXo.core.UIMaskLayer.createMaskForFrame(popup.parentNode, popup, 1) ;
+ }
} else {
- if(mask != null) eXo.core.UIMaskLayer.removeMask(mask) ;
+ //Make sure mask is not TextNode because of previousSibling property
+ if(mask != null && mask.className == "MaskLayer") eXo.core.UIMaskLayer.removeMask(mask) ;
}
} ;
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-09-23 10:10:23 UTC (rev 4332)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-09-23 10:13:58 UTC (rev 4333)
@@ -161,9 +161,9 @@
</div>
</div>
<%
- rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.init('$popupId', false);");
+ rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.init('$popupId', false, null, null, $uicomponent.showMask);");
if(uicomponent.hasMessage()){
- rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.show('$popupId');");
+ rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.show('$popupId', $uicomponent.showMask);");
rcontext.getJavascriptManager().addJavascript("window.setTimeout(\"eXo.webui.UIPopupWindow.increasezIndex('$popupId')\", 100);");
}
%>
\ No newline at end of file
Modified: epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2010-09-23 10:10:23 UTC (rev 4332)
+++ epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2010-09-23 10:13:58 UTC (rev 4333)
@@ -63,6 +63,7 @@
errors_ = new ArrayList<ApplicationMessage>();
warnings_ = new ArrayList<ApplicationMessage>();
infos_ = new ArrayList<ApplicationMessage>();
+ setShowMask(true);
setShow(true);
}
14 years, 3 months
gatein SVN: r4332 - in epp/portal/branches/EPP_5_1_Branch: portlet/web/src/main/webapp/groovy/portal/webui/component and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:10:23 -0400 (Thu, 23 Sep 2010)
New Revision: 4332
Removed:
epp/portal/branches/EPP_5_1_Branch/portlet/exoadmin/src/main/webapp/groovy/account/
epp/portal/branches/EPP_5_1_Branch/portlet/web/src/main/webapp/groovy/portal/webui/component/UILoginForm.gtmpl
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java
Log:
JBEPP-489: Clean redundant UILoginForm resources
Deleted: epp/portal/branches/EPP_5_1_Branch/portlet/web/src/main/webapp/groovy/portal/webui/component/UILoginForm.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/portlet/web/src/main/webapp/groovy/portal/webui/component/UILoginForm.gtmpl 2010-09-23 10:01:31 UTC (rev 4331)
+++ epp/portal/branches/EPP_5_1_Branch/portlet/web/src/main/webapp/groovy/portal/webui/component/UILoginForm.gtmpl 2010-09-23 10:10:23 UTC (rev 4332)
@@ -1,13 +0,0 @@
-<div class="UILoginForm" id="ChildTest">
- <%uiform.begin()%>
- <div class="FieldContainer">
- <label for="userName"><%=_ctx.appRes("UILoginForm.label.login")%></label>
- <% uiform.renderChild(0); %>
- </div>
- <div class="FieldContainer">
- <label for="password"><%=_ctx.appRes("UILoginForm.label.password")%></label>
- <% uiform.renderChild(1); %>
- </div>
- <a class="Button" href="<%=uicomponent.url("Login");%>"><span></span></a>
- <%uiform.end()%>
-</div>
Deleted: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java 2010-09-23 10:01:31 UTC (rev 4331)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java 2010-09-23 10:10:23 UTC (rev 4332)
@@ -1,92 +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.portal.webui;
-
-import org.exoplatform.portal.application.PortalRequestContext;
-import org.exoplatform.portal.webui.portal.UIPortal;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
-import org.exoplatform.services.organization.OrganizationService;
-import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.exception.MessageException;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormStringInput;
-
-import java.net.URLEncoder;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Nhu Dinh Thuan
- * nhudinhthuan(a)exoplatform.com
- * Jul 11, 2006
- */
-@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/portal/webui/UILoginForm.gtmpl", events = {
- @EventConfig(listeners = UILoginForm.SigninActionListener.class),
- @EventConfig(phase = Phase.DECODE, listeners = UIMaskWorkspace.CloseActionListener.class)})
-public class UILoginForm extends UIForm
-{
-
- public UILoginForm() throws Exception
- {
- addUIFormInput(new UIFormStringInput("username", "username", null)).addUIFormInput(
- new UIFormStringInput("password", "password", null).setType(UIFormStringInput.PASSWORD_TYPE));
- }
-
- static public class SigninActionListener extends EventListener<UILoginForm>
- {
-
- public void execute(Event<UILoginForm> event) throws Exception
- {
- UILoginForm uiForm = event.getSource();
- String username = uiForm.getUIStringInput("username").getValue();
- String password = uiForm.getUIStringInput("password").getValue();
-
- OrganizationService orgService = uiForm.getApplicationComponent(OrganizationService.class);
- boolean authentication = orgService.getUserHandler().authenticate(username, password);
- if (!authentication)
- {
- throw new MessageException(new ApplicationMessage("UILoginForm.msg.Invalid-account", null));
- }
-
- PortalRequestContext prContext = Util.getPortalRequestContext();
- HttpServletRequest request = prContext.getRequest();
- HttpSession session = request.getSession();
- session.setAttribute("authentication.username", username);
- session.setAttribute("authentication.password", password);
- UIPortal uiPortal = Util.getUIPortal();
- prContext.setResponseComplete(true);
- String portalName = uiPortal.getName();
- portalName = URLEncoder.encode(portalName, "UTF-8");
- String redirect = request.getContextPath() + "/private/" + portalName + "/";
- prContext.getResponse().sendRedirect(redirect);
- }
-
- }
-
-}
14 years, 3 months