Author: hoang_to
Date: 2010-09-21 23:54:57 -0400 (Tue, 21 Sep 2010)
New Revision: 4301
Added:
portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ResourceOverridingFilter.java
portal/trunk/examples/extension/war/src/main/resources/
portal/trunk/examples/extension/war/src/main/resources/tomcat/
portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml
portal/trunk/examples/portal/war/src/main/resources/
portal/trunk/examples/portal/war/src/main/resources/tomcat/
portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml
Removed:
portal/trunk/examples/extension/war/src/main/resources/tomcat/
portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml
portal/trunk/examples/portal/war/src/main/resources/tomcat/
portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml
portal/trunk/gadgets/server/src/main/webapp/WEB-INF/classes/config/
portal/trunk/gadgets/server/src/main/webapp/WEB-INF/classes/containers/
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/account/
portal/trunk/portlet/web/src/main/webapp/groovy/portal/webui/component/UILoginForm.gtmpl
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyTemplate.java
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java
portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigRemoval.java
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java
portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/conf/jboss-log4j.xml
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
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_ja.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_pt_BR.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIConfirmation.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java
portal/trunk/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletApplicationController.java
Log:
GTNPORTAL-1457: Merge branch r4047 into trunk
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -154,8 +154,11 @@
{
GroupHandler groupHandler = orgService.getGroupHandler();
Collection<String> descendantGroups = getDescendantGroups(group,
groupHandler);
+ Collection<String> deletedNavigationGroups = new ArrayList<String>();
+ deletedNavigationGroups.addAll(descendantGroups);
+ deletedNavigationGroups.add(group.getId());
PageNavigation navigation = null;
- for (String childGroup : descendantGroups)
+ for (String childGroup : deletedNavigationGroups)
{
navigation = dataService.getPageNavigation(PortalConfig.GROUP_TYPE,
childGroup);
if (navigation != null)
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -314,7 +314,7 @@
"jcr:path LIKE '" + workspaceChunk + "/" +
ownerTypeChunk + "/" + ownerIdChunk
+ "/mop:rootpage/mop:children/mop:pages/mop:children/%' AND
" +
"(" +
- "LOWER(gtn:name) LIKE '%" + title.toLowerCase() +
"%')";
+ "LOWER(gtn:name) LIKE '%" + title.toLowerCase() +
"%' ESCAPE '\\')";
}
else
{
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java
===================================================================
---
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -127,6 +127,31 @@
group = groupHandler.findGroupById("/groupTest");
assertNull(group);
}
+
+ public void testGroupNavigation() throws Exception
+ {
+ GroupHandler groupHandler = org.getGroupHandler();
+ Group group = groupHandler.createGroupInstance();
+ group.setGroupName("testGroupNavigation");
+ group.setLabel("testGroupNavigation");
+
+ groupHandler.addChild(null, group, true);
+
+ PageNavigation pageNavigation = new PageNavigation();
+ pageNavigation.setOwnerId(group.getId());
+ pageNavigation.setOwnerType(PortalConfig.GROUP_TYPE);
+ storage.create(pageNavigation);
+
+ pageNavigation = storage.getPageNavigation(PortalConfig.GROUP_TYPE,
group.getId());
+ assertNotNull(pageNavigation);
+
+ // Remove group
+ groupHandler.removeGroup(group, true);
+
+ // Group navigations is removed after remove group
+ pageNavigation = storage.getPageNavigation(PortalConfig.GROUP_TYPE,
group.getId());
+ assertNull(pageNavigation);
+ }
public void testUserLayout() throws Exception
{
Modified:
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java
===================================================================
---
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java
===================================================================
---
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyTemplate.java
===================================================================
---
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyTemplate.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyTemplate.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java
===================================================================
---
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
===================================================================
---
portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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");
Copied:
portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ResourceOverridingFilter.java
(from rev 4299,
portal/branches/branch-r4047/component/web/api/src/main/java/org/exoplatform/web/filter/ResourceOverridingFilter.java)
===================================================================
---
portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ResourceOverridingFilter.java
(rev 0)
+++
portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ResourceOverridingFilter.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.web.filter;
+
+import java.io.IOException;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+import org.exoplatform.container.PortalContainer;
+
+/**
+ * A filter enables resource overriding via extension mechanism.
+ *
+ * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang
TO</a>
+ * Sep 8, 2010
+ */
+
+public class ResourceOverridingFilter implements Filter {
+
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response,
+ FilterChain chain) throws IOException, ServletException {
+
+ HttpServletRequest upcastedRequest = (HttpServletRequest)request;
+
+ PortalContainer portalContainer = PortalContainer.getInstance();
+ ServletContext mergedContext = portalContainer.getPortalContext();
+
+ String path = upcastedRequest.getRequestURI();
+ String ctx = upcastedRequest.getContextPath();
+
+ if(ctx != null && ctx.length() > 0 && path.startsWith(ctx))
+ {
+ path = path.substring(ctx.length());
+ }
+
+ mergedContext.getRequestDispatcher(path).include(request, response);
+ }
+
+}
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -19,9 +19,8 @@
package org.exoplatform.portal.resource;
+import org.exoplatform.commons.utils.Safe;
import org.exoplatform.commons.xml.DocumentSource;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.RootContainer.PortalContainerPostInitTask;
import org.exoplatform.portal.resource.config.xml.SkinConfigParser;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
@@ -53,15 +52,9 @@
/** . */
private static final String GATEIN_CONFIG_RESOURCE =
"/WEB-INF/gatein-resources.xml";
- /**
- * The name of the portal container
- */
- private final String portalContainerName;
-
- public GateInSkinConfigDeployer(String portalContainerName, SkinService _skinService)
+ public GateInSkinConfigDeployer(SkinService _skinService)
{
this.skinService = _skinService;
- this.portalContainerName = portalContainerName;
}
@Override
@@ -72,42 +65,29 @@
WebAppLifeCycleEvent waEvent = (WebAppLifeCycleEvent)event;
if (waEvent.getType() == WebAppLifeCycleEvent.ADDED)
{
- ServletContext scontext = null;
- try
+ ServletContext scontext = event.getWebApp().getServletContext();
+ InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
+ if (is != null)
{
- scontext = event.getWebApp().getServletContext();
- InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
- if (is == null)
- return;
try
{
- is.close();
+ register(scontext);
}
catch (Exception ex)
{
- // ignore me
+ log.error("An error occurs while registering '" +
GATEIN_CONFIG_RESOURCE + "' from the context '"
+ + (scontext == null ? "unknown" :
scontext.getServletContextName()) + "'", ex);
}
- final PortalContainerPostInitTask task = new
PortalContainerPostInitTask()
+ finally
{
-
- public void execute(ServletContext scontext, PortalContainer
portalContainer)
- {
- register(scontext, portalContainer);
- skinService.registerContext(scontext);
- }
- };
- PortalContainer.addInitTask(scontext, task, portalContainerName);
+ Safe.close(is);
+ }
}
- catch (Exception ex)
- {
- log.error("An error occurs while registering '" +
GATEIN_CONFIG_RESOURCE + "' from the context '"
- + (scontext == null ? "unknown" :
scontext.getServletContextName()) + "'", ex);
- }
}
}
}
- private void register(ServletContext scontext, PortalContainer container)
+ private void register(ServletContext scontext)
{
URL url;
try
@@ -127,5 +107,8 @@
log.error("An error occurs while registering '" +
GATEIN_CONFIG_RESOURCE + "' from the context '"
+ (scontext == null ? "unknown" : scontext.getServletContextName())
+ "'", ex);
}
+
+ //
+ skinService.registerContext(scontext);
}
}
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigRemoval.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigRemoval.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigRemoval.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -36,11 +36,8 @@
private SkinService service;
- private String portalContainerName;
-
- public GateInSkinConfigRemoval(String _portalContainerName, SkinService _service)
+ public GateInSkinConfigRemoval(SkinService _service)
{
- this.portalContainerName = _portalContainerName;
this.service = _service;
}
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -151,8 +151,8 @@
portletThemes_ = new HashMap<String, Set<String>>();
portalContainerName = context.getPortalContainerName();
mainResolver = new MainResourceResolver(portalContainerName, skinConfigs_);
- deployer = new GateInSkinConfigDeployer(portalContainerName, this);
- removal = new GateInSkinConfigRemoval(portalContainerName, this);
+ deployer = new GateInSkinConfigDeployer(this);
+ removal = new GateInSkinConfigRemoval(this);
}
/**
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -82,8 +82,8 @@
availableScriptsPaths_ = new ArrayList<String>();
availableScriptsKey_ = new ArrayList<Javascript>();
extendedJavascripts = new HashMap<String, String>();
- deployer = new JavascriptDeployer(context.getPortalContainerName(), this);
- removal = new JavascriptRemoval(context.getPortalContainerName(), this);
+ deployer = new JavascriptDeployer(this);
+ removal = new JavascriptRemoval(this);
object_view_of_merged_JS = new HashMap<String, List<String>>();
}
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -19,8 +19,7 @@
package org.exoplatform.web.application.javascript;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.RootContainer.PortalContainerPostInitTask;
+import org.exoplatform.commons.utils.Safe;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.gatein.wci.WebAppEvent;
@@ -29,7 +28,6 @@
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.picocontainer.Startable;
-import java.io.IOException;
import java.io.InputStream;
import javax.servlet.ServletContext;
@@ -52,15 +50,9 @@
/** . */
private final JavascriptConfigService javascriptService;
- /**
- * The name of the portal container
- */
- private final String portalContainerName;
-
- public JavascriptDeployer(String portalContainerName, JavascriptConfigService
javascriptService)
+ public JavascriptDeployer(JavascriptConfigService javascriptService)
{
this.javascriptService = javascriptService;
- this.portalContainerName = portalContainerName;
}
public void start()
@@ -80,47 +72,33 @@
WebAppLifeCycleEvent waEvent = (WebAppLifeCycleEvent)event;
if (waEvent.getType() == WebAppLifeCycleEvent.ADDED)
{
- ServletContext scontext = null;
- try
+ ServletContext scontext = event.getWebApp().getServletContext();
+ InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
+ if (is != null)
{
- scontext = event.getWebApp().getServletContext();
-
- InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
- if (is == null)
- return;
try
{
- is.close();
+ register(scontext);
}
catch (Exception ex)
{
- // ignore me
+ LOG.error("An error occurs while registering 'Javascript in
gatein-resources.xml' from the context '"
+ + (scontext == null ? "unknown" :
scontext.getServletContextName()) + "'", ex);
}
- final PortalContainerPostInitTask task = new
PortalContainerPostInitTask()
+ finally
{
-
- public void execute(ServletContext scontext, PortalContainer
portalContainer)
- {
- register(scontext, portalContainer);
- }
- };
- PortalContainer.addInitTask(scontext, task, portalContainerName);
+ Safe.close(is);
+ }
}
- catch (Exception ex)
- {
- LOG.error("An error occurs while registering 'Javascript in
gatein-resources.xml' from the context '"
- + (scontext == null ? "unknown" :
scontext.getServletContextName()) + "'", ex);
- }
}
}
}
- private void register(ServletContext scontext, PortalContainer container)
+ private void register(ServletContext scontext)
{
- InputStream is = null;
+ InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
try
{
- is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
JavascriptConfigParser.processConfigResource(is, javascriptService, scontext);
}
catch (Exception ex)
@@ -130,17 +108,7 @@
}
finally
{
- if (is != null)
- {
- try
- {
- is.close();
- }
- catch (IOException e)
- {
- // ignore me
- }
- }
+ Safe.close(is);
}
}
}
\ No newline at end of file
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -34,13 +34,10 @@
public class JavascriptRemoval implements WebAppListener, Startable
{
- private String portalContainerName;
-
private JavascriptConfigService javascriptService;
- public JavascriptRemoval(String _portalContainerName, JavascriptConfigService
_javascriptService)
+ public JavascriptRemoval(JavascriptConfigService _javascriptService)
{
- this.portalContainerName = _portalContainerName;
this.javascriptService = _javascriptService;
}
Copied: portal/trunk/examples/extension/war/src/main/resources (from rev 4299,
portal/branches/branch-r4047/examples/extension/war/src/main/resources)
Copied: portal/trunk/examples/extension/war/src/main/resources/tomcat (from rev 4299,
portal/branches/branch-r4047/examples/extension/war/src/main/resources/tomcat)
Deleted: portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml
===================================================================
---
portal/branches/branch-r4047/examples/extension/war/src/main/resources/tomcat/sample-ext.xml 2010-09-22
01:05:10 UTC (rev 4299)
+++
portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml 2010-09-22
03:54:57 UTC (rev 4301)
@@ -1 +0,0 @@
-<Context path="/sample-ext"
docBase="../../../../../examples/extension/war/src/main/webapp/"
debug="0" reloadable="true" crossContext="true"/>
Copied: portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml (from
rev 4299,
portal/branches/branch-r4047/examples/extension/war/src/main/resources/tomcat/sample-ext.xml)
===================================================================
--- portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml
(rev 0)
+++
portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml 2010-09-22
03:54:57 UTC (rev 4301)
@@ -0,0 +1 @@
+<Context path="/sample-ext"
docBase="../../../../../examples/extension/war/src/main/webapp/"
debug="0" reloadable="true" crossContext="true"/>
Copied: portal/trunk/examples/portal/war/src/main/resources (from rev 4299,
portal/branches/branch-r4047/examples/portal/war/src/main/resources)
Copied: portal/trunk/examples/portal/war/src/main/resources/tomcat (from rev 4299,
portal/branches/branch-r4047/examples/portal/war/src/main/resources/tomcat)
Deleted: portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml
===================================================================
---
portal/branches/branch-r4047/examples/portal/war/src/main/resources/tomcat/sample-portal.xml 2010-09-22
01:05:10 UTC (rev 4299)
+++
portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml 2010-09-22
03:54:57 UTC (rev 4301)
@@ -1 +0,0 @@
-<Context path="/sample-portal"
docBase="../../../../../examples/portal/war/src/main/webapp/"
debug="0" reloadable="true" crossContext="true"/>
Copied: portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml (from
rev 4299,
portal/branches/branch-r4047/examples/portal/war/src/main/resources/tomcat/sample-portal.xml)
===================================================================
--- portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml
(rev 0)
+++
portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml 2010-09-22
03:54:57 UTC (rev 4301)
@@ -0,0 +1 @@
+<Context path="/sample-portal"
docBase="../../../../../examples/portal/war/src/main/webapp/"
debug="0" reloadable="true" crossContext="true"/>
Modified: portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2010-09-22 02:20:40
UTC (rev 4300)
+++ portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2010-09-22 03:54:57
UTC (rev 4301)
@@ -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>
Modified:
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
---
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -40,6 +40,7 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
@@ -419,7 +420,7 @@
PortalRequestContext prContext = Util.getPortalRequestContext();
prContext.setResponseComplete(true);
- prContext.getResponse().sendRedirect(prContext.getPortalURI() +
selectedNode.getUri());
+ prContext.getResponse().sendRedirect(prContext.getPortalURI() +
URLEncoder.encode(selectedNode.getUri(), "UTF-8"));
}
}
}
@@ -437,7 +438,7 @@
//We should redirect to current node while adding new tab fails
PageNode currentNode = tabPane.uiPortal.getSelectedNode();
PortalRequestContext prContext = Util.getPortalRequestContext();
- prContext.getResponse().sendRedirect(prContext.getPortalURI() +
currentNode.getUri());
+ prContext.getResponse().sendRedirect(prContext.getPortalURI() +
URLEncoder.encode(currentNode.getUri(), "UTF-8"));
Object[] args = {newTabLabel};
context.getUIApplication().addMessage(new
ApplicationMessage("UITabPaneDashboard.msg.wrongTabName", args));
@@ -450,7 +451,7 @@
{
PortalRequestContext prContext = Util.getPortalRequestContext();
prContext.setResponseComplete(true);
- prContext.getResponse().sendRedirect(prContext.getPortalURI() + uri);
+ prContext.getResponse().sendRedirect(prContext.getPortalURI() +
URLEncoder.encode(uri, "UTF-8"));
}
}
}
@@ -475,11 +476,10 @@
String newTabLabel = context.getRequestParameter(RENAMED_TAB_LABEL_PARAMETER);
if (!tabPane.validateName(newTabLabel))
{
- //TODO nguyenanhkien2a(a)gmail.com
//We should redirect to current node while renaming fails
PageNode currentNode = tabPane.uiPortal.getSelectedNode();
PortalRequestContext prContext = Util.getPortalRequestContext();
- prContext.getResponse().sendRedirect(prContext.getPortalURI() +
currentNode.getUri());
+ prContext.getResponse().sendRedirect(prContext.getPortalURI() +
URLEncoder.encode(currentNode.getUri(), "UTF-8"));
Object[] args = {newTabLabel};
context.getUIApplication().addMessage(new
ApplicationMessage("UITabPaneDashboard.msg.wrongTabName", args));
@@ -491,7 +491,7 @@
if (newUri != null)
{
PortalRequestContext prContext = Util.getPortalRequestContext();
- prContext.getResponse().sendRedirect(prContext.getPortalURI() + newUri);
+ prContext.getResponse().sendRedirect(prContext.getPortalURI() +
URLEncoder.encode(newUri, "UTF-8"));
}
}
}
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-09-22 02:20:40
UTC (rev 4300)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-09-22 03:54:57
UTC (rev 4301)
@@ -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>
Deleted:
portal/trunk/portlet/web/src/main/webapp/groovy/portal/webui/component/UILoginForm.gtmpl
===================================================================
---
portal/trunk/portlet/web/src/main/webapp/groovy/portal/webui/component/UILoginForm.gtmpl 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/portlet/web/src/main/webapp/groovy/portal/webui/component/UILoginForm.gtmpl 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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>
Modified:
portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/conf/jboss-log4j.xml
===================================================================
---
portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/conf/jboss-log4j.xml 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/conf/jboss-log4j.xml 2010-09-22
03:54:57 UTC (rev 4301)
@@ -211,8 +211,8 @@
<priority value="INFO"/>
</category>
- <!-- Limit the JSR77 categories -->
- <category name="jcr">
+ <!-- Limit the JSR170 categories -->
+ <category name="exo.jcr">
<priority value="INFO"/>
</category>
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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,12 +122,11 @@
* 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.maxZIndex = 4; //3 ;
+ maskLayer.id = "MaskLayer" ;
+ maskLayer.maxZIndex = eXo.webui.UIPopup.zIndex + 1; //3 ;
maskLayer.style.width = Browser.getBrowserWidth() + "px";
maskLayer.style.height = Browser.getBrowserHeight() + "px";
maskLayer.style.top = "0px" ;
@@ -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: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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;
}
}
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js 2010-09-22
03:54:57 UTC (rev 4301)
@@ -19,7 +19,6 @@
function UIPortalControl() {
this.scrollManagers = new Array();
- this.t = 0;
};
/**
* Change state of window
@@ -70,18 +69,20 @@
if(e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
if(code ==13) {
- if(this.t != 13) {
- var uiPortalLoginFormAction =
document.getElementById("UIPortalLoginFormAction");
- if(uiPortalLoginFormAction) {
- uiPortalLoginFormAction.onclick() ;
- }
- else
- {
- if(executeScript)
- eval(executeScript);
- }
+ if (window.event) {
+ e.returnValue = false;
+ } else {
+ e.preventDefault();
+ }
+ var uiPortalLoginFormAction =
document.getElementById("UIPortalLoginFormAction");
+ if(uiPortalLoginFormAction) {
+ uiPortalLoginFormAction.onclick() ;
}
- this.t = code;
+ else
+ {
+ if(executeScript)
+ eval(executeScript);
+ }
}
};
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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 (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
+ 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:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js 2010-09-22
03:54:57 UTC (rev 4301)
@@ -39,11 +39,6 @@
var compId = portletFrag.parentNode.id;
var nodeIndex = inputElement.id;
- //Change the tab label
- var spanElement = document.createElement("span");
- spanElement.innerHTML = newTabLabel;
- inputElement.parentNode.replaceChild(spanElement, inputElement);
-
//Send request to server to change node name
var href = eXo.env.server.portalBaseURL + "?portal:componentId=" + compId;
href += "&portal:type=action";
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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();
+ }
};
/**
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-09-22
03:54:57 UTC (rev 4301)
@@ -263,7 +263,7 @@
UILoginForm.label.Signin=Sign in
UILoginForm.label.ForAccount=Register now for an account
UILoginForm.label.SigninFail=Sign in failed. Wrong username or password.
-UILoginForm.label.Copyright=Copyright © 2009-2010. All rights reserved, Red Hat,
Inc and eXo Platform SAS
+UILoginForm.label.Copyright=Copyright © 2010. All rights reserved, Red Hat, Inc
and eXo Platform SAS
#############################################################################
# Message Error #
@@ -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:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
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 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-09-22
03:54:57 UTC (rev 4301)
@@ -239,7 +239,7 @@
UILoginForm.label.Signup=Enregistrement
UILoginForm.label.ForAccount=Créer un compte
UILoginForm.label.SigninFail=La connexion a échouée. Le nom d'utilisateur ou mot de
passe est incorrecte.
-UILoginForm.label.Copyright=Copyright © 2009-2010. All rights reserved, Red Hat,
Inc. and eXo Platform SAS
+UILoginForm.label.Copyright=Copyright © 2010. All rights reserved, Red Hat, Inc.
and eXo Platform SAS
#############################################################################
# Message Error #
@@ -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:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_pt_BR.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_pt_BR.properties 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_pt_BR.properties 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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 #
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml 2010-09-22 02:20:40 UTC (rev
4300)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml 2010-09-22 03:54:57 UTC (rev
4301)
@@ -114,11 +114,6 @@
<dispatcher>ERROR</dispatcher>
</filter-mapping>
- <filter-mapping>
- <filter-name>GenericFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
<filter-mapping>
<filter-name>ResourceRequestFilter</filter-name>
<url-pattern>*.css</url-pattern>
@@ -163,6 +158,12 @@
<filter-name>RestEncodingFilter</filter-name>
<url-pattern>/rest/*</url-pattern>
</filter-mapping>
+
+ <filter-mapping>
+ <filter-name>GenericFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
<!-- ================================================================== -->
<!-- LISTENER -->
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2010-09-22
03:54:57 UTC (rev 4301)
@@ -37,14 +37,7 @@
<div class="FixHeight">
<%
if(hasPermission) {
- if(portletTitle == null || portletTitle.trim().length() < 1) {
- try {
- String portletName =
uicomponent.getProducedOfferedPortlet().getInfo().getName();
- print
_ctx.getRequestContext().getApplicationResourceBundle().getString("UIPortlet.description."
+ portletName);
- } catch(Exception e){
- print uicomponent.getDisplayName();
- }
- } else print portletTitle;
+ print uicomponent.getDisplayTitle();
} else print "<div
class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>";
%>
</div>
@@ -62,12 +55,8 @@
if(portalMode != uiPortalApp.CONTAINER_BLOCK_EDIT_MODE && portalMode !=
uiPortalApp.APP_BLOCK_EDIT_MODE) {
if(uicomponent.getShowInfoBar()) {
- String title = portletTitle;
+ String title = uicomponent.getDisplayTitle();
if(title == null || title.trim().length() < 1)
- title = uicomponent.getTitle();
- if(title == null || title.trim().length() < 1)
- title = uicomponent.getDisplayName();
- if(title == null || title.trim().length() < 1)
title = portletId;
/*Begin Window Portlet Bar*/
String visibility = "visible";
@@ -292,9 +281,7 @@
String portletIcon = uicomponent.getIcon();
if(portletIcon == null) portletIcon = "PortletIcon";
- String title = portletTitle;
- if(title == null || title.trim().length() < 1)
- title = uicomponent.getDisplayTitle();
+ String title = uicomponent.getDisplayTitle();
if(title.length() > 30) title = title.substring(0,27) +
"...";
%>
<div class="PortletIcon $portletIcon"><%=hasPermission
? title : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIConfirmation.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIConfirmation.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIConfirmation.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
===================================================================
---
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -189,14 +189,12 @@
{
option.setSelected(true);
}
- if (config.getLanguage().equals("en"))
- {
- lang.add(0, option);
- continue;
- }
lang.add(option);
}
+ // Set default language for new user is empty
+ lang.add(new SelectItemOption<String>("", ""));
+
Collections.sort(lang, new LanguagesComparator());
langSelectBox.setOptions(lang);
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 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -63,6 +63,7 @@
errors_ = new ArrayList<ApplicationMessage>();
warnings_ = new ArrayList<ApplicationMessage>();
infos_ = new ArrayList<ApplicationMessage>();
+ setShowMask(true);
setShow(true);
}
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 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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();
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -20,6 +20,7 @@
package org.exoplatform.portal.application;
import org.exoplatform.Constants;
+import org.exoplatform.commons.utils.ExpressionUtil;
import org.exoplatform.commons.utils.PortalPrinter;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.portal.config.UserPortalConfigService;
@@ -224,6 +225,7 @@
if (page != null)
{
title = page.getTitle();
+ return
ExpressionUtil.getExpressionValue(this.getApplicationResourceBundle(), title);
}
else
{
Deleted:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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);
- }
-
- }
-
-}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -160,6 +160,9 @@
private StateString navigationalState;
+ /** A field storing localized value of javax.portlet.title **/
+ private String configuredTitle;
+
public UIPortlet()
{
// That value will be overriden when it is mapped onto a data storage
@@ -386,16 +389,6 @@
supportedPublicParams_ = supportedPublicRenderParameters;
}
- public String getDisplayTitle()
- {
- String title = getTitle();
- if (title == null)
- {
- title = getDisplayName();
- }
- return title;
- }
-
public String getDisplayName()
{
if (displayName == null)
@@ -942,4 +935,37 @@
{
this.navigationalState = navigationalState;
}
+
+ protected void setConfiguredTitle(String _configuredTitle)
+ {
+ this.configuredTitle = _configuredTitle;
+ }
+
+ /**
+ * Returns the title showed on the InfoBar. The title is computed in following
manner.
+ *
+ * 1. First, the method getTitle(), inherited from UIPortalComponent is called. The
getTitle() returns
+ * what users set in the PortletSetting tab, the current method returns call result if
it is not null.
+ *
+ * 2. configuredTitle, which is the localized value of javax.portlet.title is returned
if it is not null.
+ *
+ * 3. If the method does not terminate at neither (1) nor (2), the configured display
name is returned.
+ * @return
+ */
+ public String getDisplayTitle()
+ {
+ String displayedTitle = getTitle();
+ if(displayedTitle != null && displayedTitle.trim().length() > 0)
+ {
+ return displayedTitle;
+ }
+
+ if(configuredTitle != null)
+ {
+ return configuredTitle;
+ }
+
+ return getDisplayName();
+
+ }
}
\ No newline at end of file
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -170,7 +170,6 @@
//
Text markup = null;
- String portletTitle = null;
try
{
@@ -217,8 +216,8 @@
markup = Text.create("");
break;
}
- portletTitle = fragmentResponse.getTitle();
-
+ uicomponent.setConfiguredTitle(fragmentResponse.getTitle());
+
// setup portlet properties
if (fragmentResponse.getProperties() != null)
{
@@ -337,7 +336,6 @@
WebuiBindingContext bcontext = new WebuiBindingContext(resolver,
context.getWriter(), uicomponent, prcontext);
bcontext.put(UIComponent.UICOMPONENT, uicomponent);
bcontext.put("portletContent", markup);
- bcontext.put("portletTitle", portletTitle);
try
{
renderTemplate(uicomponent.getTemplate(), bcontext);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -171,8 +171,13 @@
LocaleConfigService localeConfigService =
getApplicationComponent(LocaleConfigService.class);
LocaleConfig localeConfig =
localeConfigService.getLocaleConfig(editPortal.getLocale());
- this.<UIFormInputSet>
getChildById("PortalSetting").<UIFormSelectBox>
getChildById(FIELD_LOCALE).setValue(
- localeConfig.getLanguage());
+ String lang = localeConfig.getLanguage();
+ if (localeConfig.getLocale().getCountry() != null &&
localeConfig.getLocale().getCountry().length() > 0)
+ {
+ lang += "_" + localeConfig.getLocale().getCountry();
+ }
+
+ this.<UIFormInputSet>
getChildById("PortalSetting").<UIFormSelectBox>
getChildById(FIELD_LOCALE).setValue(lang);
setActions(new String[]{"Save", "Close"});
}
@@ -187,7 +192,6 @@
private void createDefaultItem() throws Exception
{
- UIPortal uiPortal = Util.getUIPortal();
LocaleConfigService localeConfigService =
getApplicationComponent(LocaleConfigService.class);
Collection<?> listLocaleConfig = localeConfigService.getLocalConfigs();
LocaleConfig defaultLocale = localeConfigService.getDefaultLocaleConfig();
@@ -198,28 +202,27 @@
{
LocaleConfig localeConfig = (LocaleConfig)iterator.next();
ResourceBundle localeResourceBundle = getResourceBundle(currentLocale);
-
- String key = "Locale." + localeConfig.getLocale().getLanguage();
- if (localeConfig.getLocale().getCountry() != null)
+ Locale local = localeConfig.getLocale();
+ String lang = local.getLanguage();
+ if (local.getCountry() != null && local.getCountry().length() > 0)
{
- key += "_" + localeConfig.getLocale().getCountry();
+ lang += "_" + local.getCountry();
}
String displayName = null;
try
{
+ String key = "Locale." + lang;
String translation = localeResourceBundle.getString(key);
displayName = translation;
}
catch (MissingResourceException e)
{
- displayName =
capitalizeFirstLetter(localeConfig.getLocale().getDisplayName(currentLocale));;
+ displayName = capitalizeFirstLetter(local.getDisplayName(currentLocale));;
}
- SelectItemOption<String> option =
- new SelectItemOption<String>(displayName, localeConfig
- .getLanguage());
- if (defaultLanguage.equals(localeConfig.getLanguage()))
+ SelectItemOption<String> option = new
SelectItemOption<String>(displayName, lang);
+ if (defaultLanguage.equals(lang))
{
option.setSelected(true);
}
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 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIEditInlineWorkspace.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -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();
+ }
+ }
}
Modified:
portal/trunk/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletApplicationController.java
===================================================================
---
portal/trunk/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletApplicationController.java 2010-09-22
02:20:40 UTC (rev 4300)
+++
portal/trunk/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletApplicationController.java 2010-09-22
03:54:57 UTC (rev 4301)
@@ -107,6 +107,9 @@
{
try
{
+ //Needed to localize title via predefined I18n key javax.portlet.title
+ res.setTitle(getTitle(req));
+
getPortletApplication().render(req, res);
}
catch (Exception ex)