gatein SVN: r7334 - portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/description.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-09-07 13:32:38 -0400 (Wed, 07 Sep 2011)
New Revision: 7334
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/description/CacheValue.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/description/SimpleDataCache.java
Log:
GTNPORTAL-2085 : Proper serialization for description cache
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/description/CacheValue.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/description/CacheValue.java 2011-09-07 17:32:17 UTC (rev 7333)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/description/CacheValue.java 2011-09-07 17:32:38 UTC (rev 7334)
@@ -21,12 +21,13 @@
import org.exoplatform.portal.mop.Described;
+import java.io.Serializable;
import java.util.concurrent.atomic.AtomicLong;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
*/
-public class CacheValue
+public class CacheValue implements Serializable
{
/** . */
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/description/SimpleDataCache.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/description/SimpleDataCache.java 2011-09-07 17:32:17 UTC (rev 7333)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/description/SimpleDataCache.java 2011-09-07 17:32:38 UTC (rev 7334)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.mop.description;
+import org.exoplatform.commons.serialization.MarshalledObject;
import org.exoplatform.portal.mop.Described;
import org.exoplatform.portal.pom.config.POMSession;
@@ -31,33 +32,46 @@
{
/** . */
- private final ConcurrentHashMap<CacheKey, CacheValue> map;
+ private final ConcurrentHashMap<MarshalledObject<CacheKey>, MarshalledObject<CacheValue>> map;
public SimpleDataCache()
{
- this.map = new ConcurrentHashMap<CacheKey, CacheValue>();
+ this.map = new ConcurrentHashMap<MarshalledObject<CacheKey>, MarshalledObject<CacheValue>>();
}
@Override
protected Described.State getState(POMSession session, CacheKey key)
{
- CacheValue value = map.get(key);
- if (value == null)
+ MarshalledObject<CacheKey> marshalledKey = MarshalledObject.marshall(key);
+ MarshalledObject<CacheValue> marshalledValue = map.get(marshalledKey);
+ if (marshalledValue == null)
{
- value = getValue(session, key);
+ CacheValue value = getValue(session, key);
+ if (value != null)
+ {
+ map.put(marshalledKey, MarshalledObject.marshall(value));
+ return value.state;
+ }
+ else
+ {
+ return null;
+ }
}
- return value != null ? value.state : null;
+ else
+ {
+ return marshalledValue.unmarshall().state;
+ }
}
@Override
protected void removeState(CacheKey key)
{
- map.remove(key);
+ map.remove(MarshalledObject.marshall(key));
}
@Override
protected void putValue(CacheKey key, CacheValue value)
{
- map.put(key, value);
+ map.put(MarshalledObject.marshall(key), MarshalledObject.marshall(value));
}
}
13 years, 3 months
gatein SVN: r7333 - portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-09-07 13:32:17 -0400 (Wed, 07 Sep 2011)
New Revision: 7333
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NavigationData.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/SimpleDataCache.java
Log:
GTNPORTAL-2086 : Proper serialization for navigation cache
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NavigationData.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NavigationData.java 2011-09-07 17:30:31 UTC (rev 7332)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NavigationData.java 2011-09-07 17:32:17 UTC (rev 7333)
@@ -69,4 +69,16 @@
this.state = state;
this.rootId = rootId;
}
+
+ protected Object readResolve()
+ {
+ if (key == null && state == null && rootId == null)
+ {
+ return EMPTY;
+ }
+ else
+ {
+ return this;
+ }
+ }
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/SimpleDataCache.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/SimpleDataCache.java 2011-09-07 17:30:31 UTC (rev 7332)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/SimpleDataCache.java 2011-09-07 17:32:17 UTC (rev 7333)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.mop.navigation;
+import org.exoplatform.commons.serialization.MarshalledObject;
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.pom.config.POMSession;
@@ -35,57 +36,78 @@
{
/** . */
- protected Map<SiteKey, NavigationData> navigations;
+ protected Map<MarshalledObject<SiteKey>, MarshalledObject<NavigationData>> navigations;
/** . */
- protected Map<String, NodeData> nodes;
+ protected Map<MarshalledObject<String>, MarshalledObject<NodeData>> nodes;
public SimpleDataCache()
{
- this.navigations = new ConcurrentHashMap<SiteKey, NavigationData>();
- this.nodes = new ConcurrentHashMap<String, NodeData>();
+ this.navigations = new ConcurrentHashMap<MarshalledObject<SiteKey>, MarshalledObject<NavigationData>>();
+ this.nodes = new ConcurrentHashMap<MarshalledObject<String>, MarshalledObject<NodeData>>();
}
@Override
protected void removeNodes(Collection<String> keys)
{
- nodes.keySet().removeAll(keys);
+ for (String key : keys)
+ {
+ nodes.remove(MarshalledObject.marshall(key));
+ }
}
@Override
protected NodeData getNode(POMSession session, String key)
{
- NodeData node = nodes.get(key);
- if (node == null)
+ MarshalledObject<String> marshalledKey = MarshalledObject.marshall(key);
+ MarshalledObject<NodeData> marshalledNode = nodes.get(marshalledKey);
+ if (marshalledNode == null)
{
- node = loadNode(session, key);
+ NodeData node = loadNode(session, key);
if (node != null)
{
- nodes.put(key, node);
+ nodes.put(marshalledKey, MarshalledObject.marshall(node));
+ return node;
}
+ else
+ {
+ return null;
+ }
}
- return node;
+ else
+ {
+ return marshalledNode.unmarshall();
+ }
}
@Override
protected void removeNavigation(SiteKey key)
{
- navigations.remove(key);
+ navigations.remove(MarshalledObject.marshall(key));
}
@Override
protected NavigationData getNavigation(POMSession session, SiteKey key)
{
- NavigationData navigation = navigations.get(key);
- if (navigation == null)
+ MarshalledObject<SiteKey> marshalledKey = MarshalledObject.marshall(key);
+ MarshalledObject<NavigationData> marshalledNavigation = navigations.get(marshalledKey);
+ if (marshalledNavigation == null)
{
- navigation = loadNavigation(session, key);
+ NavigationData navigation = loadNavigation(session, key);
if (navigation != null)
{
- navigations.put(key, navigation);
+ navigations.put(marshalledKey, MarshalledObject.marshall(navigation));
+ return navigation;
}
+ else
+ {
+ return null;
+ }
}
- return navigations.get(key);
+ else
+ {
+ return marshalledNavigation.unmarshall();
+ }
}
@Override
13 years, 3 months
gatein SVN: r7332 - in portal/trunk/component/common/src: test/java/org/exoplatform/commons/utils and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-09-07 13:30:31 -0400 (Wed, 07 Sep 2011)
New Revision: 7332
Added:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/serialization/MarshalledObject.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestMarshalledObject.java
Log:
GTNPORTAL-2087 : Simple MarshalledObject to contain an marshalled object into bytes
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/serialization/MarshalledObject.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/serialization/MarshalledObject.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/serialization/MarshalledObject.java 2011-09-07 17:30:31 UTC (rev 7332)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2011 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.commons.serialization;
+
+import org.gatein.common.io.IOTools;
+import org.gatein.common.io.UndeclaredIOException;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.Arrays;
+
+/**
+ * A simple marshalled object that retain the state of an object as a bytes.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class MarshalledObject<S extends Serializable>
+{
+
+ public static <S extends Serializable> MarshalledObject<S> marshall(S serializable) throws NullPointerException
+ {
+ if (serializable == null)
+ {
+ throw new NullPointerException("Cannot marshall null");
+ }
+ try
+ {
+ byte[] bytes = IOTools.serialize(serializable);
+ return new MarshalledObject<S>(serializable.getClass().getClassLoader(), bytes);
+ }
+ catch (IOException e)
+ {
+ throw new UndeclaredIOException(e);
+ }
+ }
+
+ /** . */
+ private final ClassLoader loader;
+
+ /** . */
+ private final byte[] state;
+
+ private MarshalledObject(ClassLoader loader, byte[] state)
+ {
+ this.loader = loader;
+ this.state = state;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof MarshalledObject)
+ {
+ MarshalledObject<?> that = (MarshalledObject<?>)obj;
+ return Arrays.equals(state, that.state);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return Arrays.hashCode(state);
+ }
+
+ public S unmarshall() throws UndeclaredThrowableException
+ {
+ try
+ {
+ return (S)IOTools.unserialize(state, loader);
+ }
+ catch (IOException e)
+ {
+ throw new UndeclaredIOException(e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new UndeclaredThrowableException(e);
+ }
+ }
+}
Added: portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestMarshalledObject.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestMarshalledObject.java (rev 0)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestMarshalledObject.java 2011-09-07 17:30:31 UTC (rev 7332)
@@ -0,0 +1,72 @@
+/**
+ * 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.commons.utils;
+
+import org.exoplatform.commons.serialization.MarshalledObject;
+import org.exoplatform.component.test.AbstractGateInTest;
+
+/** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
+public class TestMarshalledObject extends AbstractGateInTest
+{
+
+ public void testSerialization()
+ {
+ String from = "foo";
+ MarshalledObject<String> marshalled = MarshalledObject.marshall(from);
+ String to = marshalled.unmarshall();
+ assertEquals(to, from);
+ }
+
+ public void testNPE()
+ {
+ try
+ {
+ MarshalledObject.marshall(null);
+ fail();
+ }
+ catch (NullPointerException e)
+ {
+ }
+ }
+
+ public void testHashCode()
+ {
+ MarshalledObject<String> marshalled1 = MarshalledObject.marshall("foo");
+ assertEquals(marshalled1.hashCode(), marshalled1.hashCode());
+ MarshalledObject<String> marshalled2 = MarshalledObject.marshall("foo");
+ assertEquals(marshalled1.hashCode(), marshalled2.hashCode());
+ assertEquals(marshalled2.hashCode(), marshalled1.hashCode());
+ MarshalledObject<String> marshalled3 = MarshalledObject.marshall("bar");
+ assertNotSame(marshalled1.hashCode(), marshalled3.hashCode());
+ assertNotSame(marshalled3.hashCode(), marshalled1.hashCode());
+ }
+
+ public void testEquals()
+ {
+ MarshalledObject<String> marshalled1 = MarshalledObject.marshall("foo");
+ assertTrue(marshalled1.equals(marshalled1));
+ MarshalledObject<String> marshalled2 = MarshalledObject.marshall("foo");
+ assertTrue(marshalled1.equals(marshalled2));
+ assertTrue(marshalled2.equals(marshalled1));
+ MarshalledObject<String> marshalled3 = MarshalledObject.marshall("bar");
+ assertFalse(marshalled1.equals(marshalled3));
+ assertFalse(marshalled3.equals(marshalled1));
+ }
+}
13 years, 3 months
gatein SVN: r7331 - portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations.
by do-not-reply@jboss.org
Author: nscavell
Date: 2011-09-07 12:35:33 -0400 (Wed, 07 Sep 2011)
New Revision: 7331
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java
Log:
GTNPORTAL-2084: Allow for emtpy zip file for import.
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java 2011-09-07 13:54:58 UTC (rev 7330)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java 2011-09-07 16:35:33 UTC (rev 7331)
@@ -107,6 +107,7 @@
Map<SiteKey, MopImport> importMap = new HashMap<SiteKey, MopImport>();
final NonCloseableZipInputStream zis = new NonCloseableZipInputStream(inputStream);
ZipEntry entry;
+ boolean empty = false;
try
{
log.info("Preparing data for import.");
@@ -114,6 +115,9 @@
{
// Skip directories
if (entry.isDirectory()) continue;
+ // Skip empty entries (this allows empty zip files to not cause exceptions).
+ empty = entry.getName().equals("");
+ if (empty) continue;
// Parse zip entry
String[] parts = parseEntry(entry);
@@ -186,6 +190,12 @@
}
}
+ if (empty)
+ {
+ log.info("Nothing to import, zip file empty.");
+ return;
+ }
+
// Perform import
Map<SiteKey, MopImport> importsRan = new HashMap<SiteKey, MopImport>();
try
13 years, 3 months
gatein SVN: r7330 - in portal/trunk/component/portal/src: test/java/org/exoplatform/portal/config and 8 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-09-07 09:54:58 -0400 (Wed, 07 Sep 2011)
New Revision: 7330
Added:
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml
Log:
GTNPORTAL-2083 : A site should not be overwritten when the workspace import marker is not present
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2011-09-07 12:12:19 UTC (rev 7329)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2011-09-07 13:54:58 UTC (rev 7330)
@@ -20,6 +20,8 @@
package org.exoplatform.portal.config;
import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
/**
* Author : Nhu Dinh Thuan
@@ -43,6 +45,8 @@
private String importMode;
+ final Set<String> createdOwners = new HashSet<String>();
+
/**
* @deprecated use the location instead
*/
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-09-07 12:12:19 UTC (rev 7329)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-09-07 13:54:58 UTC (rev 7330)
@@ -433,7 +433,10 @@
{
for (String owner : config.getPredefinedOwner())
{
- createPortalConfig(config, owner);
+ if (createPortalConfig(config, owner))
+ {
+ config.createdOwners.add(owner);
+ }
}
}
@@ -441,7 +444,10 @@
{
for (String owner : config.getPredefinedOwner())
{
- createPage(config, owner);
+ if (config.createdOwners.contains(owner))
+ {
+ createPage(config, owner);
+ }
}
}
@@ -464,50 +470,48 @@
}
}
- public void createPortalConfig(NewPortalConfig config, String owner) throws Exception
+ public boolean createPortalConfig(NewPortalConfig config, String owner) throws Exception
{
- try
+ String type = config.getOwnerType();
+ PortalConfig currentPortalConfig = dataStorage_.getPortalConfig(type, owner);
+ if (currentPortalConfig == null)
{
- String type = config.getOwnerType();
- UnmarshalledObject<PortalConfig> obj = getConfig(config, owner, type, PortalConfig.class);
+ try
+ {
+ UnmarshalledObject<PortalConfig> obj = getConfig(config, owner, type, PortalConfig.class);
- if (obj == null)
- {
- // Ensure that the PortalConfig has been defined
- // The PortalConfig could be empty if the related PortalConfigListener
- // has been launched after starting this service
- PortalConfig cfg = dataStorage_.getPortalConfig(type, owner);
- if (cfg == null)
+ if (obj == null)
{
- cfg = new PortalConfig(type);
- cfg.setPortalLayout(new Container());
- cfg.setName(owner);
- dataStorage_.create(cfg);
+ // Ensure that the PortalConfig has been defined
+ // The PortalConfig could be empty if the related PortalConfigListener
+ // has been launched after starting this service
+ PortalConfig cfg = dataStorage_.getPortalConfig(type, owner);
+ if (cfg == null)
+ {
+ cfg = new PortalConfig(type);
+ cfg.setPortalLayout(new Container());
+ cfg.setName(owner);
+ dataStorage_.create(cfg);
+ return true;
+ }
}
- return;
+ else
+ {
+ PortalConfig pconfig = obj.getObject();
+ // We use that owner value because it may have been fixed for group names
+ owner = pconfig.getName();
+ dataStorage_.create(pconfig);
+ return true;
+ }
}
-
- //
- PortalConfig pconfig = obj.getObject();
-
- // We use that owner value because it may have been fixed for group names
- owner = pconfig.getName();
-
- //
- PortalConfig currentPortalConfig = dataStorage_.getPortalConfig(type, owner);
- if (currentPortalConfig == null)
+ catch (IOException e)
{
- dataStorage_.create(pconfig);
+ log.error("Could not load portal configuration", e);
}
- else
- {
- dataStorage_.save(pconfig);
- }
}
- catch (IOException e)
- {
- log.error("Could not load portal configuration", e);
- }
+
+ //
+ return false;
}
public void createPage(NewPortalConfig config, String owner) throws Exception
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java 2011-09-07 12:12:19 UTC (rev 7329)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java 2011-09-07 13:54:58 UTC (rev 7330)
@@ -24,6 +24,11 @@
import org.exoplatform.component.test.KernelBootstrap;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.ApplicationState;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.importer.Imported;
import org.exoplatform.portal.mop.navigation.NavigationContext;
@@ -32,6 +37,7 @@
import org.exoplatform.portal.mop.navigation.NodeContext;
import org.exoplatform.portal.mop.navigation.Scope;
import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
import org.gatein.mop.api.workspace.Workspace;
import java.io.File;
@@ -99,4 +105,70 @@
RequestLifeCycle.end();
bootstrap.dispose();
}
+
+ public void testNoMixin() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ System.setProperty("override.1", "false");
+ System.setProperty("import.mode.1", "conserve");
+ System.setProperty("import.portal.1", "site1");
+
+ //
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ DataStorage service = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ RequestLifeCycle.begin(container);
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ Workspace workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ long when1 = workspace.adapt(Imported.class).getCreationDate().getTime();
+ PortalConfig portal = service.getPortalConfig("classic");
+ Container layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site1/layout", service.getId(layoutPortlet.getState()));
+ Page page1 = service.getPage("portal::classic::page1");
+ assertEquals(1, page1.getChildren().size());
+ Application<Portlet> page1Portlet = (Application<Portlet>)page1.getChildren().get(0);
+ assertEquals("site1/page1", service.getId(page1Portlet.getState()));
+ workspace.removeAdapter(Imported.class);
+ mgr.getSession().save();
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+
+ //
+ System.setProperty("override.1", "false");
+ System.setProperty("import.mode.1", "conserve");
+ System.setProperty("import.portal.1", "site2");
+
+ //
+ bootstrap.boot();
+ container = bootstrap.getContainer();
+ service = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ RequestLifeCycle.begin(container);
+ mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ long when2 = workspace.adapt(Imported.class).getCreationDate().getTime();
+ assertTrue(when2 > when1);
+ portal = service.getPortalConfig("classic");
+ layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site1/layout", service.getId(layoutPortlet.getState()));
+ page1 = service.getPage("portal::classic::page1");
+ assertEquals(1, page1.getChildren().size());
+ page1Portlet = (Application<Portlet>)page1.getChildren().get(0);
+ assertEquals("site1/page1", service.getId(page1Portlet.getState()));
+ Page page2 = service.getPage("portal::classic::page2");
+ assertNull(page2);
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+ }
}
Modified: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml 2011-09-07 12:12:19 UTC (rev 7329)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml 2011-09-07 13:54:58 UTC (rev 7330)
@@ -130,6 +130,7 @@
</field>
</object>
</object-param>
+<!--
<object-param>
<name>user.configuration</name>
<object type="org.exoplatform.portal.config.NewPortalConfig">
@@ -148,6 +149,7 @@
</field>
</object>
</object-param>
+-->
</init-params>
</component-plugin>
</external-component-plugins>
@@ -298,6 +300,18 @@
</field>
</object>
</value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>overwritelayout</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Overwrite</string></field>
+ <field name="lastName"><string>Layout</string></field>
+ <field name="email"><string>overwrite@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/users</string>
+ </field>
+ </object>
+ </value>
</collection>
</field>
</object>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml 2011-09-07 13:54:58 UTC (rev 7330)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+
+ <page>
+ <name>page1</name>
+ <portlet-application>
+ <portlet>
+ <application-ref>site1</application-ref>
+ <portlet-ref>page1</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml 2011-09-07 13:54:58 UTC (rev 7330)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2011 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.
+
+-->
+
+<portal-config
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <portal-layout>
+ <portlet-application>
+ <portlet>
+ <application-ref>site1</application-ref>
+ <portlet-ref>layout</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </portal-layout>
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml 2011-09-07 13:54:58 UTC (rev 7330)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+
+ <page>
+ <name>page1</name>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>page1</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+
+ <page>
+ <name>page2</name>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>page2</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml 2011-09-07 13:54:58 UTC (rev 7330)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2011 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.
+
+-->
+
+<portal-config
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <portal-layout>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>layout</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </portal-layout>
+</portal-config>
13 years, 3 months
gatein SVN: r7329 - in portal/branches/dom/web: eXoResources/src/main/webapp/javascript/eXo/webui and 5 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-09-07 08:12:19 -0400 (Wed, 07 Sep 2011)
New Revision: 7329
Modified:
portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupMessage/Stylesheet.css
portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupWindow/Stylesheet.css
portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupWindow/background/PortalComposer.gif
portal/branches/dom/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl
portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIPopupWindow.gtmpl
Log:
[DOM] UIPopupWindow and UIPopupMessage optimization
Modified: portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
--- portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2011-09-07 11:23:24 UTC (rev 7328)
+++ portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2011-09-07 12:12:19 UTC (rev 7329)
@@ -645,19 +645,13 @@
UIPortal.prototype.toggleComposer = function(clickedEle) {
var portalComposer = eXo.core.DOMUtil.findAncestorByClass(clickedEle, "UIPortalComposer");
- var middleBlock = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "MLPortalComposer");
- var bottomBlock = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "BLPortalComposer");
- var fakeBottom = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "Bottom");
- if(middleBlock && middleBlock.style.display != "none") {
- middleBlock.style.display = "none";
- bottomBlock.style.display = "none";
- fakeBottom.style.display = "block";
- eXo.core.DOMUtil.replaceClass(clickedEle, "ExpandIcon", "CollapseIcon");
+ var content = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "UIWindowContent");
+ if(content && content.style.display != "none") {
+ content.style.display = "none";
+ eXo.core.DOMUtil.replaceClass(clickedEle, "ExpandIcon", "CollapseIcon");
} else {
- middleBlock.style.display = "block";
- bottomBlock.style.display = "block";
- fakeBottom.style.display = "none";
- eXo.core.DOMUtil.replaceClass(clickedEle, "CollapseIcon", "ExpandIcon");
+ content.style.display = "block";
+ eXo.core.DOMUtil.replaceClass(clickedEle, "CollapseIcon", "ExpandIcon");
}
var requestStr = eXo.env.server.createPortalURL(portalComposer.id, "Toggle", true);
ajaxAsyncGetRequest(requestStr);
Modified: portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
===================================================================
--- portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js 2011-09-07 11:23:24 UTC (rev 7328)
+++ portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js 2011-09-07 12:12:19 UTC (rev 7329)
@@ -279,7 +279,7 @@
if(eXo.core.Browser.isIE6()) gadgetContainer.style.width = "99.5%";
var selectPopup = DOMUtil.findPreviousElementByTagName(uiContainer, "div");
- var closeButton = DOMUtil.findFirstDescendantByClass(selectPopup, "div", "CloseButton");
+ var closeButton = DOMUtil.findFirstDescendantByClass(selectPopup, "a", "CloseButton");
closeButton.onclick = eXo.webui.UIDashboard.showHideSelectContainer;
var colsContainer = DOMUtil.findFirstChildByClass(gadgetContainer, "div", "UIColumns");
Modified: portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
===================================================================
--- portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2011-09-07 11:23:24 UTC (rev 7328)
+++ portal/branches/dom/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2011-09-07 12:12:19 UTC (rev 7329)
@@ -44,7 +44,7 @@
if(contentBlock && (eXo.core.Browser.getBrowserHeight() - 100 < contentBlock.offsetHeight)) {
contentBlock.style.height = (eXo.core.Browser.getBrowserHeight() - 100) + "px";
}
- var popupBar = DOMUtil.findFirstDescendantByClass(popup, 'div' ,'PopupTitle') ;
+ var popupBar = DOMUtil.findFirstDescendantByClass(popup, 'span' ,'PopupTitle') ;
popupBar.onmousedown = this.initDND ;
@@ -54,7 +54,7 @@
}
if(isResizable) {
- var resizeBtn = DOMUtil.findFirstDescendantByClass(popup, "div", "ResizeButton");
+ var resizeBtn = DOMUtil.findFirstDescendantByClass(popup, "span", "ResizeButton");
resizeBtn.style.display = 'block' ;
resizeBtn.onmousedown = this.startResizeEvt ;
}
@@ -256,7 +256,7 @@
if(!dragObject.uiWindowContent) return;
if(eXo.core.Browser.browserType == "mozilla") {
dragObject.uiWindowContent.style.overflow = "hidden" ;
- var elements = eXo.core.DOMUtil.findDescendantsByClass(dragObject.uiWindowContent, "div" ,"PopupMessageBox") ;
+ var elements = eXo.core.DOMUtil.findDescendantsByClass(dragObject.uiWindowContent, "ul" ,"PopupMessageBox") ;
for(var i = 0; i < elements.length; i++) {
elements[i].style.overflow = "hidden" ;
}
@@ -270,7 +270,7 @@
var dragObject = dndEvent.dragObject ;
if(eXo.core.Browser.browserType == "mozilla" && dragObject.uiWindowContent) {
dragObject.uiWindowContent.style.overflow = "auto" ;
- var elements = eXo.core.DOMUtil.findDescendantsByClass(dragObject.uiWindowContent, "div" ,"PopupMessageBox") ;
+ var elements = eXo.core.DOMUtil.findDescendantsByClass(dragObject.uiWindowContent, "ul" ,"PopupMessageBox") ;
for(var i = 0; i < elements.length; i++) {
elements[i].style.overflow = "auto" ;
}
Modified: portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupMessage/Stylesheet.css
===================================================================
--- portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupMessage/Stylesheet.css 2011-09-07 11:23:24 UTC (rev 7328)
+++ portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupMessage/Stylesheet.css 2011-09-07 12:12:19 UTC (rev 7329)
@@ -17,14 +17,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-.UIPopupMessages {
-}
-.UIPopupMessages .UIHorizontalTabs {
- height: 31px;
- background: url('background/MessageTabBar.gif') repeat-x bottom;
-}
-
.UIPopupMessages .UIHorizontalTabs .TabsContainer {
height: 31px;
}
@@ -33,10 +26,11 @@
border: none;
}
-.UIPopupMessages .PopupMessageBox {
+.UIPopupMessages ul {
padding: 5px;
height: 200px;
overflow: auto;
+ margin: 0px;
}
.UIPopupMessages .WarningMessage .MessageContainer {
@@ -59,126 +53,41 @@
border-bottom: 1px dotted #c3c3c3;
}
-.UIPopupMessages .PopupMessageContainer .PopupIcon {
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
- width: 16px; height: 16px;
- margin-top: 5px;
+.UIPopupMessages .MessageContainer .PopupIcon {
+ display: block;
+ line-height: 16px;
+ padding: 5px 0 5px 22px;
}
-.UIPopupMessages .PopupMessageContainer .InfoMessageIcon {
- background: url(/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/Info.gif) no-repeat top;
+.UIPopupMessages .MessageContainer .InfoMessageIcon {
+ background: url(/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/Info.gif) no-repeat left 7px;
}
-.UIPopupMessages .PopupMessageContainer .WarningMessageIcon {
- background: url(/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/Warning.gif) no-repeat top;
+.UIPopupMessages .MessageContainer .WarningMessageIcon {
+ background: url(/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/Warning.gif) no-repeat left 7px;
}
-.UIPopupMessages .PopupMessageContainer .ErrorMessageIcon {
- background: url(/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/Error.gif) no-repeat top;
+.UIPopupMessages .MessageContainer .ErrorMessageIcon {
+ background: url(/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/Error.gif) no-repeat left 7px;
}
-.UIPopupMessages .PopupMessageContainer .PopupMessage {
- line-height: 16px;
- vertical-align: middle;
- padding: 5px 0px;
- margin-left: 25px; /* orientation=lt */
- margin-right: 25px; /* orientation=rt */
+.UIPopupMessages .UIHorizontalTabs{
+ background: url(background/MessageTabBar.gif) repeat-x center bottom;
+ height: 31px;
}
-.UIPopupMessages .MessageActionBar {
-}
-
/***************************Begin PoupWindow ExoMessage**********************************/
-.UIPopupWindow .ExoMessageDecorator {
- overflow: hidden;/*Fix for IE*/
-}
-
-.UIPopupWindow .ExoMessageDecorator .TopLeftCornerDecorator {
- background: url('background/ExoMessageDecorator.png') no-repeat left top;
- padding-left: 6px;
- height: 31px;
-}
-
-.UIPopupWindow .ExoMessageDecorator .TopRightCornerDecorator {
- background: url('background/ExoMessageDecorator.png') no-repeat right -31px;
- padding-right: 6px;
- height: 31px;
-}
-
-.UIPopupWindow .ExoMessageDecorator .TopCenterDecorator {
- background: url('background/ExoMessageDecorator.png') repeat-x center -62px;
- height: 26px;
-}
-
-.UIPopupWindow .ExoMessageDecorator .PopupTitle {
- background: none;
- text-align: left; /* orientation=lt */
- text-align: right; /* orientation=rt */
-}
-
-.UIPopupWindow .ExoMessageDecorator .PopupTitleIcon {
- width: 16px; height: 16px;
+.ExoMessageDecorator .OverflowContainer .PopupTitleIcon {
+ width: 16px;
+ height: 16px;
background: url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/Message.gif') no-repeat;
float: left; /* orientation=lt */
float: right; /* orientation=rt */
- margin: 4px 0px 0px 4px; /* orientation=lt */
- margin: 4px 4px 0px 0px; /* orientation=rt */
+ margin: 4px 0px 0px 8px; /* orientation=lt */
+ margin: 4px 8px 0px 0px; /* orientation=rt */
}
-.UIPopupWindow .ExoMessageDecorator .MiddleLeftSideDecorator {
- background: url('background/MiddleExoMessage.png') repeat-y left;
- padding-left: 4px;
- height: 100%;
-}
-
-.UIPopupWindow .ExoMessageDecorator .MiddleRightSideDecorator {
- background: url('background/MiddleExoMessage.png') repeat-y right;
- padding-right: 4px;
-}
-
-.UIPopupWindow .ExoMessageDecorator .MiddleCenterDecorator {
- background: #e1e1e1;
- padding: 6px 7px;
-}
-
-.UIPopupWindow .ExoMessageDecorator .UIWindowContent {
- padding: 0px; margin: 0px;
- border: none;
-}
-
-.UIPopupWindow .ExoMessageDecorator .PopupContent {
- background: none;
-}
-
-.UIPopupWindow .ExoMessageDecorator .UIWindowContent .Content {
- padding: 0px; margin: 0px;
- border: none;
-}
-
-.UIPopupWindow .ExoMessageDecorator .BottomLeftCornerDecorator {
- background: url('background/ExoMessageDecorator.png') no-repeat left -93px;
- padding-left: 6px;
-}
-
-.UIPopupWindow .ExoMessageDecorator .BottomRightCornerDecorator {
- background: url('background/ExoMessageDecorator.png') no-repeat right -99px;
- padding-right: 6px;
-}
-
-.UIPopupWindow .ExoMessageDecorator .BottomCenterDecorator {
- background: url('background/ExoMessageDecorator.png') repeat-x center -105px;
- height: 6px;
-}
-
-.UIPopupWindow .ExoMessageDecorator .UITabContentContainer {
+.ExoMessageDecorator .UITabContentContainer {
background: white;
}
-
-.UIPopupWindow .ExoMessageDecorator .UITabContentContainer .UITabContent {
- height: auto;
- background: none;
- border: none;
- padding: 0px;
-}
Modified: portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupWindow/Stylesheet.css
===================================================================
--- portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupWindow/Stylesheet.css 2011-09-07 11:23:24 UTC (rev 7328)
+++ portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupWindow/Stylesheet.css 2011-09-07 12:12:19 UTC (rev 7329)
@@ -17,293 +17,251 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-.UIPopupWindow {
- position: absolute;
- visibility: hidden;
-}
-
-.UIPopupWindow .PopupTitleIcon {
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
- margin: 5px 0px 0px 3px; /* orientation=lt */
- margin: 5px 3px 0px 0px; /* orientation=rt */
- width: 16px; height: 16px;
- background: url('background/PopupWindow.gif') no-repeat left bottom;
-}
-
-.UIPopupWindow .PopupTitleIconRight {
- float: right;
- margin: 5px 3px 0px 0px;
- width: 19px; height: 16px;
- background: url('background/PopupWindow.gif') no-repeat left bottom;
-}
-
-.UIPopupWindow .PopupTitle {
- margin: 4px 26px 0px 26px;
- line-height: 16px;
- vertical-align: middle;
- cursor: move;
- color: #000;
-}
-
-.UIPopupWindow .CloseButton {
- float: right; /* orientation=lt */
- float: left; /* orientation=rt */
- margin: 5px 3px 0px 0px; /* orientation=lt */
- margin: 5px 0px 0px 3px; /* orientation=rt */
- cursor: pointer;
- width: 23px; height: 17px;
- background: url('background/CloseIcon.gif') no-repeat right top;
-}
-
-.UIPopupWindow .BackButton {
- float: right; /* orientation=lt */
- float: left; /* orientation=rt */
- margin: 5px 3px 0px 0px; /* orientation=lt */
- margin: 5px 0px 0px 3px; /* orientation=rt */
- cursor: pointer;
- width: 18px; height: 18px;
- background: url('background/Back.gif') no-repeat right bottom;
-}
-
-.UIPopupWindow .TopLeftCornerDecorator {
- background: url('background/TopPopup.png') no-repeat left top;
- padding-left: 8px;
-}
-
-.UIPopupWindow .TopCenterDecorator {
- background: url('background/TopPopup.png') repeat-x left -66px;
- height: 28px;
- padding-top: 5px;
-}
-
-.UIPopupWindow .TopRightCornerDecorator {
- background: url('background/TopPopup.png') no-repeat right -33px;
- padding-right: 8px;
-}
-
-.UIPopupWindow .MiddleLeftSideDecorator {
- background: url('background/MiddlePopup.png') repeat-y left top;
- padding-left: 8px;
-}
-
-.UIPopupWindow .MiddleCenterDecorator {
- background: #e1e1e1;
- padding: 0px 3px 5px 3px;
-}
-
-.UIPopupWindow .MiddleRightSideDecorator {
- background: url('background/MiddlePopup.png') repeat-y right top;
- padding-right: 8px;
- }
-
-.UIPopupWindow .UIWindowContent {
- border: 1px solid #bdbcbd;
-}
-
-.UIPopupWindow .PopupContent {
- width: 100%;
- background: #f7f7f7;
- overflow: auto;
-}
-
-.UIPopupWindow .ResizeButton {
- background: url('background/ResizeBtn.gif') no-repeat right top; /* orientation=lt */
- background: url('background/ResizeBtn-rt.gif') no-repeat left top; /* orientation=rt */
- display: block;
- float: right; /* orientation=lt */
- float: left; /* orientation=rt */
- cursor: nw-resize; /* orientation=lt */
- cursor: ne-resize; /* orientation=rt */
-}
-
-.UIPopupWindow .BottomLeftCornerDecorator {
- background: url('background/BottomPopup.png') no-repeat left top;
- padding-left: 7px;
-}
-
-.UIPopupWindow .BottomCenterDecorator {
- background: url('background/BottomPopup.png') repeat-x left -14px;
- height: 7px;
-}
-
-.UIPopupWindow .BottomRightCornerDecorator {
- background: url('background/BottomPopup.png') no-repeat right -7px;
- padding-right: 7px;
-}
-
-.UIPopupWindow .Content .UIPageBrowser {
- padding: 7px 4px 0px 8px;
- width: 96%;
- margin: auto;
-}
-
-/************************** UIPortalComposer **************************/
-
-.UIPortalComposer {
-}
-
-.UIPortalComposer .TLPortalComposer {
- background: transparent url(background/PortalComposer.gif) no-repeat left top;
- padding-left: 7px;
-}
-
-.UIPortalComposer .TRPortalComposer {
- background: transparent url(background/PortalComposer.gif) no-repeat right top;
- padding-right: 7px;
-}
-
-.UIPortalComposer .TCPortalComposer {
- background: transparent url(background/PortalComposer.gif) repeat-x left -34px;
- height: 34px;
-}
-
-.UIPortalComposer .CollapseIcon {
- background: url(background/ExpandIcon.gif) no-repeat left; /* orientation=lt */
- background: url(background/ExpandIcon-rt.gif) no-repeat right; /* orientation=rt */
- width: 16px;
- height: 14px;
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
- margin: 8px 5px;
- cursor: pointer;
-}
-
-.UIPortalComposer .ExpandIcon {
- background: url(background/GrayDownIcon.gif) no-repeat left; /* orientation=lt */
- background: url(background/GrayDownIcon.gif) no-repeat right; /* orientation=rt */
- width: 16px;
- height: 14px;
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
- margin: 8px 5px;
- cursor: pointer;
-}
-
-.UIPortalComposer .CloseButton {
- background: url(background/CloseIcon.gif) no-repeat right bottom; /* orientation=lt */
- background: url(background/CloseIcon-rt.gif) no-repeat left bottom; /* orientation=rt */
- width: 23px;
+.UIPopupWindow {
+ position: absolute;
+ visibility: hidden;
+ background: #E1E1E1;
+ border: 1px solid #CACACA;
+ box-shadow: 0 0 5px #AFAFAF;
+}
+
+.UIPopupWindow .PopupTitleIcon {
+ float: left; /* orientation=lt */
+ float: right; /* orientation=rt */
+ margin: 5px 0px 0px 8px; /* orientation=lt */
+ margin: 5px 8px 0px 0px; /* orientation=rt */
+ width: 16px;
+ height: 16px;
+ background: url('background/PopupWindow.gif') no-repeat left bottom;
+}
+
+.UIPopupWindow .PopupTitleIconRight {
+ float: right;
+ margin: 5px 3px 0px 0px;
+ width: 19px; height: 16px;
+ background: url('background/PopupWindow.gif') no-repeat left bottom;
+}
+
+.UIPopupWindow .PopupTitle {
+ margin: 0px 30px 0px;
+ line-height: 26px;
+ vertical-align: middle;
+ cursor: move;
+ color: #000;
+ display: block;
+}
+
+.UIPopupWindow .CloseButton {
+ float: right; /* orientation=lt */
+ float: left; /* orientation=rt */
+ margin: 5px 8px 0px 0px; /* orientation=lt */
+ margin: 5px 0px 0px 8px; /* orientation=rt */
+ cursor: pointer;
+ width: 23px; height: 17px;
+ background: url('background/CloseIcon.gif') no-repeat right top;
+}
+
+.UIPopupWindow .BackButton {
+ float: right; /* orientation=lt */
+ float: left; /* orientation=rt */
+ margin: 5px 3px 0px 0px; /* orientation=lt */
+ margin: 5px 0px 0px 3px; /* orientation=rt */
+ cursor: pointer;
+ width: 18px; height: 18px;
+ background: url('background/Back.gif') no-repeat right bottom;
+}
+
+.UIPopupWindow .UIWindowContent {
+ border: 1px solid #bdbcbd;
+ background: #EBEBEB;
+ -moz-border-radius: 0px;
+ -webkit-border-radius: 0px;
+ border-radius: 0px;
+ margin: 5px 8px 8px 8px;
+}
+
+.UIPopupWindow .PopupContent {
+ width: 100%;
+ background: #f7f7f7;
+ overflow: auto;
+}
+
+.UIPopupWindow .ResizeButton {
+ background: url('background/ResizeBtn.gif') no-repeat right top; /* orientation=lt */
+ background: url('background/ResizeBtn-rt.gif') no-repeat left top; /* orientation=rt */
+ display: block;
+ float: right; /* orientation=lt */
+ float: left; /* orientation=rt */
+ cursor: nw-resize; /* orientation=lt */
+ cursor: ne-resize; /* orientation=rt */
+}
+
+.UIPopupWindow > .OverflowContainer{
+ background: #e1e1e1;
+ height: 25px;
+}
+
+.UIPopupWindow .Content .UIPageBrowser {
+ padding: 7px 4px 0px 8px;
+ width: 96%;
+ margin: auto;
+}
+
+/************************** UIPortalComposer **************************/
+
+.UIPortalComposer {
+ border: 1px solid #A2A3A9;
+ border-top: none;
+ background: #ececec;
+}
+
+.UIPortalComposer .CollapseIcon {
+ background: url(background/ExpandIcon.gif) no-repeat left; /* orientation=lt */
+ background: url(background/ExpandIcon-rt.gif) no-repeat right; /* orientation=rt */
+ width: 16px;
+ height: 14px;
+ float: left; /* orientation=lt */
+ float: right; /* orientation=rt */
+ margin: 8px 5px;
+ cursor: pointer;
+}
+
+.UIPortalComposer .ExpandIcon {
+ background: url(background/GrayDownIcon.gif) no-repeat left; /* orientation=lt */
+ background: url(background/GrayDownIcon.gif) no-repeat right; /* orientation=rt */
+ width: 16px;
+ height: 14px;
+ float: left; /* orientation=lt */
+ float: right; /* orientation=rt */
+ margin: 8px 5px;
+ cursor: pointer;
+}
+
+.UIPortalComposer .CloseButton {
+ background: url(background/CloseIcon.gif) no-repeat right bottom; /* orientation=lt */
+ background: url(background/CloseIcon-rt.gif) no-repeat left bottom; /* orientation=rt */
+ width: 23px;
height: 17px;
float: right; /* orientation=lt */
float: left; /* orientation=rt */
- margin: 6px 0px 0px 2px; /* orientation=lt */
- margin: 6px 2px 0px 0px; /* orientation=rt */
-}
-
-.UIPortalComposer .SaveButton {
+ margin: 6px 5px 0px 2px; /* orientation=lt */
+ margin: 6px 2px 0px 5px; /* orientation=rt */
+}
+
+.UIPortalComposer .SaveButton {
background: url(background/EdittedSaveIcon.gif) no-repeat right bottom; /* orientation=lt */
background: url(background/EdittedSaveIcon-rt.gif) no-repeat left bottom; /* orientation=rt */
- cursor: pointer;
- float: right; /* orientation=lt */
- float: left; /* orientation=rt */
- height: 17px;
+ cursor: pointer;
+ float: right; /* orientation=lt */
+ float: left; /* orientation=rt */
+ height: 17px;
margin: 6px 0px 0px 2px; /* orientation=lt */
- margin: 6px 2px 0px 0px; /* orientation=rt */
- width: 23px;
-}
-
-.UIPortalComposer .BackButton {
- background: url(background/BackIcon.gif) no-repeat right bottom; /* orientation=lt */
- background: url(background/BackIcon-rt.gif) no-repeat left bottom; /* orientation=rt */
- width: 23px;
+ margin: 6px 2px 0px 0px; /* orientation=rt */
+ width: 23px;
+}
+
+.UIPortalComposer .BackButton {
+ background: url(background/BackIcon.gif) no-repeat right bottom; /* orientation=lt */
+ background: url(background/BackIcon-rt.gif) no-repeat left bottom; /* orientation=rt */
+ width: 23px;
height: 17px;
float: right; /* orientation=lt */
- float: left; /* orientation=rt */
- margin: 6px 0px 0px 0px;
-}
-
-.UIPortalComposer .EdittedSaveButton {
+ float: left; /* orientation=rt */
+ margin: 6px 0px 0px 0px;
+}
+
+.UIPortalComposer .EdittedSaveButton {
background: url(background/SaveIcon.gif) no-repeat right bottom; /* orientation=lt */
- background: url(background/SaveIcon-rt.gif) no-repeat left bottom; /* orientation=rt */
- cursor: pointer;
- float: right; /* orientation=lt */
- float: left; /* orientation=rt */
+ background: url(background/SaveIcon-rt.gif) no-repeat left bottom; /* orientation=rt */
+ cursor: pointer;
+ float: right; /* orientation=lt */
+ float: left; /* orientation=rt */
height: 17px;
margin: 6px 0px 0px 2px; /* orientation=lt */
- margin: 6px 2px 0px 0px; /* orientation=rt */
- width: 23px;
-}
-
-.UIPortalComposer .PopupTitle {
- background: none;
- margin: 0px 42px 0px 26px; /* orientation=lt */
- margin: 0px 26px 0px 42px; /* orientation=rt */
- text-align: left; /* orientation=lt */
- text-align: right; /* orientation=rt */
- color: #000;
- font-size: 12px;
- font-family: arial;
- cursor: move;
- line-height: 30px;
- height: 30px;
-}
-
-.UIPortalComposer .MLPortalComposer {
- background: url(background/MiddlePortalComposer.gif) repeat-y left top;
- padding-left: 3px;
-}
-
-.UIPortalComposer .MRPortalComposer {
- background: url(background/MiddlePortalComposer.gif) repeat-y right top;
- padding-right: 3px;
-}
-
-.UIPortalComposer .MCPortalComposer {
- background: #d8dae1 url(background/CenterMiddleWindow.gif) repeat-x left top;
- padding: 4px;
- padding-bottom: 0px;
-}
-
-.UIPortalComposer .BLPortalComposer {
- border: 1px solid #a2a3a9;
- border-top: none;
- background: #d8dae1;
-}
-
-.UIPortalComposer .BRPortalComposer {
- padding: 0px 6px 6px 6px;
-}
-
-.UIPortalComposer .BCPortalComposer {
- background: #ececec;
- border: 1px solid #bbbcc2;
+ margin: 6px 2px 0px 0px; /* orientation=rt */
+ width: 23px;
}
-
-.UIPortalComposer .Bottom {
- border-bottom: 1px solid #a2a3a9;
-}
-
-.UIPortalComposer .UIWindowContent {
- border: none;
-}
-
-.UIPortalComposer .PopupContent {
- background: none;
-}
-
-.UIPortalComposer .UITabPane {
- height: auto;
-}
-
-.UIPortalComposer .UITabPane .TabPaneContent {
- padding: 0px;
-}
-
-.UIPortalComposer .UIHorizontalTabs .TabsContainer {
- background: url(background/CenterHorizontalTabs.gif) repeat-x left bottom;
- height: 25px;
-}
-
-.UIPortalComposer .UITabPane .UITabContentContainer {
-}
-
-.UIPortalComposer .UITabPane .UITabContentContainer .UITabContent {
- background: none;
- border: none;
-}
-
-.UIPortalComposer .ResizeButton {
- width: 13px; height: 13px;
- margin: 0;
+
+.UIPortalComposer .PopupTitle {
+ background: none;
+ margin: 0px 42px 0px 0px; /* orientation=lt */
+ margin: 0px 0px 0px 42px; /* orientation=rt */
+ text-align: left; /* orientation=lt */
+ text-align: right; /* orientation=rt */
+ color: #000;
+ font-size: 12px;
+ font-family: arial;
+ cursor: move;
+ line-height: 30px;
+ height: 30px;
+ display: block;
+}
+
+.UIPortalComposer .Bottom {
+ border-bottom: 1px solid #a2a3a9;
+}
+
+.UIPortalComposer .UIWindowContent{
+ border: none;
+ margin: 5px 4px 8px;
+}
+
+.UIPortalComposer .PopupContent {
+ background: none;
+}
+
+.UIPortalComposer .UITabPane {
+ height: auto;
+}
+
+.UIPortalComposer .UITabPane .TabPaneContent {
+ padding: 0px;
+}
+
+.UIPortalComposer .UIHorizontalTabs .TabsContainer {
+ background: url(background/CenterHorizontalTabs.gif) repeat-x left bottom;
+ height: 25px;
+}
+
+.UIPortalComposer .UITabPane .UITabContentContainer {
+}
+
+.UIPortalComposer .UITabPane .UITabContentContainer .UITabContent {
+ background: none;
+ border: none;
+}
+
+.UIPortalComposer .ResizeButton {
+ width: 13px;
+ height: 13px;
+ margin: 0px 0px 5px 0px;
+}
+
+.UIPortalComposer > .OverflowContainer{
+ background: url(background/PortalComposer.gif) repeat-x left -34px;
+ height: 30px;
+}
+
+.ExoMessageDecorator{
+ -moz-border-radius: 5px 5px 0px 0px;
+ -webkit-border-radius: 5px 5px 0px 0px;
+ border-radius: 5px 5px 0px 0px;
+}
+
+.ExoMessageDecorator .OverflowContainer{
+ background: #f3f3f3;
+ height: 26px;
+ padding-top: 5px;
+ -moz-border-radius: 5px 5px 0px 0px;
+ -webkit-border-radius: 5px 5px 0px 0px;
+ border-radius: 5px 5px 0px 0px;
+}
+
+.ExoMessageDecorator .UIWindowContent{
+ border: none;
+ background: #e1e1e1;
+}
+
+.ExoMessageDecorator .PopupContent{
+ background: none;
}
\ No newline at end of file
Modified: portal/branches/dom/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIPopup/UIPopupWindow/background/PortalComposer.gif
===================================================================
(Binary files differ)
Modified: portal/branches/dom/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
===================================================================
--- portal/branches/dom/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl 2011-09-07 11:23:24 UTC (rev 7328)
+++ portal/branches/dom/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl 2011-09-07 12:12:19 UTC (rev 7329)
@@ -8,60 +8,36 @@
rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopup.setAlign('$popupId', 2, 5, 5);");
%>
<div class="UIPopupWindow UIDragObject UIPortalComposer" exo:minWidth="200" exo:minHeight="200" id="$uicomponent.id" style="width: 320px; display: block;">
- <div class="TLPortalComposer">
- <div class="TRPortalComposer">
- <div class="TCPortalComposer">
- <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("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")%>">
-
- </a>
- <% } else {%>
- <a class="<%= isEditted ? "EdittedSaveButton" : "SaveButton" %>" title="<%=_ctx.appRes("word.finish")%>" href="<%=uicomponent.event("Finish")%>"><span></span></a>
- <% }
- } %>
- <div class="PopupTitle"><%=_ctx.appRes(popupId + ".title."+ popupId)%></div>
- </div>
- </div>
- </div>
+ <div class="OverflowContainer ClearFix">
+ <span class="<%=uicomponent.isCollapsed ? "CollapseIcon" : "ExpandIcon"%>" onclick="eXo.portal.UIPortal.toggleComposer(this)"></span>
+ <% if(uicomponent.isShowControl) { %>
+ <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);" ></a>
+ <a class="BackButton" title="<%=_ctx.appRes("word.back")%>" href="<%=uicomponent.event("Back")%>"></a>
+ <% } else {%>
+ <a class="<%= isEditted ? "EdittedSaveButton" : "SaveButton" %>" title="<%=_ctx.appRes("word.finish")%>" href="<%=uicomponent.event("Finish")%>"></a>
+ <% }
+ } %>
+ <span class="PopupTitle"><%=_ctx.appRes(popupId + ".title."+ popupId)%></span>
</div>
-
- <div class="MLPortalComposer" style="display: <%=uicomponent.isCollapsed ? "none": "block"%>">
- <div class="MRPortalComposer">
- <div class="MCPortalComposer">
- <div class="UIWindowContent">
- <div style="width: 100%;">
- <div class="PopupContent" style="height: 390px">
- <div class="Component"><% uicomponent.renderChildren(); %></div>
- </div>
- </div>
- </div>
- </div>
+
+ <div class="UIWindowContent" style="display: <%=uicomponent.isCollapsed ? "none": "block"%>" >
+ <div class="PopupContent Component" style="height: 390px">
+ <% uicomponent.renderChildren(); %>
</div>
- </div>
-
- <div class="BLPortalComposer" style="display: <%=uicomponent.isCollapsed ? "none": "block"%>">
- <div class="BRPortalComposer">
- <div class="BCPortalComposer ClearFix">
- <div class="UIAction">
- <span onclick="<%= uicomponent.event("ViewProperties") %>;eXo.portal.UIPortal.changeComposerSaveButton()" class="ActionButton SimpleStyle1">
- <a href="javascript:void(0);" class="PageProfileIcon"><%=_ctx.appRes(popupId + ".action.ViewProperties")%></a>
- </span>
- <% String changeEditMode = uicomponent.event("SwitchMode", null, null); %>
- <span onclick="$changeEditMode" class="ActionButton SimpleStyle1" onmouseover="this.style.color = '#058ee6'" onmouseout="this.style.color='black'">
- <a href="javascript:void(0);" class="ViewAsBlockIcon"><%=_ctx.appRes(popupId + ".action.SwitchMode")%></a>
- </span>
- </div>
- <div class="ResizeButton"><span></span></div>
- </div>
+
+ <div class="UIAction" style="display: <%=uicomponent.isCollapsed ? "none": "block"%>">
+ <span onclick="<%= uicomponent.event("ViewProperties") %>;eXo.portal.UIPortal.changeComposerSaveButton()" class="ActionButton SimpleStyle1">
+ <a href="javascript:void(0);" class="PageProfileIcon"><%=_ctx.appRes(popupId + ".action.ViewProperties")%></a>
+ </span>
+ <% String changeEditMode = uicomponent.event("SwitchMode", null, null); %>
+ <span onclick="$changeEditMode" class="ActionButton SimpleStyle1" onmouseover="this.style.color = '#058ee6'" onmouseout="this.style.color='black'">
+ <a href="javascript:void(0);" class="ViewAsBlockIcon"><%=_ctx.appRes(popupId + ".action.SwitchMode")%></a>
+ </span>
</div>
+ <span class="ResizeButton"></span>
</div>
- <div class="Bottom" style="display: none;"><span></span></div>
-
</div>
<script language="javascript">
eXo.portal.portalMode = <%=uicomponent.getPortalMode();%>;
Modified: portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl
===================================================================
--- portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl 2011-09-07 11:23:24 UTC (rev 7328)
+++ portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIConfirmation.gtmpl 2011-09-07 12:12:19 UTC (rev 7329)
@@ -41,22 +41,14 @@
void printMessage(String message, String messageType)
{
- println "<div class=\"UITabContent\">";
- println " <div class=\"PopupMessageBox\">";
- println " <div class=\"$messageType\">";
- println " <div class=\"PopupMessageContainer\">";
- println " <div class=\"MessageContainer\">";
- println " <div class=\"PopupIcon ${messageType}Icon\"><span></span></div>";
- println " <div class=\"PopupMessage\">";
+ println " <ul class=\"UITabContent PopupMessageBox $messageType\">";
+ println " <li class=\"MessageContainer\">";
+ println " <span class=\"PopupIcon ${messageType}Icon\">";
println message;
- println " </div>";
- println " <div style=\"clear:left\"><span></span></div>";
- println " </div>";
- println " </div>";
- println " </div>";
- println " </div>";
- println "</div>";
- }
+ println " </span>";
+ println " </li>";
+ println " </ul>";
+ }
void printAction(List actions)
{
@@ -66,56 +58,32 @@
}
}
%>
- <div class="UIPopupWindow UIDragObject" id="$popupId" style="width: 550px; display: none;">
- <div class="ExoMessageDecorator">
- <div class="TopLeftCornerDecorator">
- <div class="TopRightCornerDecorator">
- <div class="TopCenterDecorator">
- <div class="OverflowContainer">
- <div class="PopupTitleIcon"><span></span></div>
- <div class="CloseButton" title="<%=_ctx.appRes("UIConfirmation.Close")%>" onclick="<%=uicomponent.event("Close")%>"><span></span></div>
- <div class="PopupTitle"><%= _ctx.appRes("UIConfirmation.title.exoMessages") %></div>
- </div>
+ <div class="UIPopupWindow UIDragObject ExoMessageDecorator" id="$popupId" style="width: 550px; display: none;">
+ <div class="OverflowContainer ClearFix">
+ <span class="PopupTitleIcon"></span>
+ <a class="CloseButton" title="<%=_ctx.appRes("UIConfirmation.Close")%>" onclick="<%=uicomponent.event("Close")%>"></a>
+ <span class="PopupTitle"><%= _ctx.appRes("UIConfirmation.title.exoMessages") %></span>
+ </div>
+
+ <div class="UIWindowContent">
+ <div class="PopupContent UIPopupMessages">
+ <div class="UIHorizontalTabs">
+ <div class="TabsContainer">
+ <%
+ boolean flag = true
+ flag = printTab(message, "Warning", flag);
+ %>
</div>
</div>
- </div>
-
- <div class="MiddleLeftSideDecorator">
- <div class="MiddleRightSideDecorator">
- <div class="MiddleCenterDecorator">
- <div class="UIWindowContent">
- <div class="PopupContent">
- <div class="UIPopupMessages">
- <div class="UIHorizontalTabs">
- <div class="TabsContainer">
- <%
- boolean flag = true
- flag = printTab(message, "Warning", flag);
- %>
- </div>
- </div>
- <div class="UITabContentContainer">
- <%
- printMessage(message, "ErrorMessage");
- %>
- </div>
- <div class="MessageActionBar">
- <div class="UIAction">
- <%
- printAction(actions);
- %>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
+ <div class="UITabContentContainer">
+ <%
+ printMessage(message, "ErrorMessage");
+ %>
</div>
- </div>
- <div><span></span></div>
- <div class="BottomLeftCornerDecorator">
- <div class="BottomRightCornerDecorator">
- <div class="BottomCenterDecorator"><span></span></div>
+ <div class="UIAction MessageActionBar">
+ <%
+ printAction(actions);
+ %>
</div>
</div>
</div>
Modified: portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
===================================================================
--- portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2011-09-07 11:23:24 UTC (rev 7328)
+++ portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2011-09-07 12:12:19 UTC (rev 7329)
@@ -48,15 +48,11 @@
style = "";
isSelected = true;
}
- println "<div class=\"UITabContent\" $style>";
- println " <div class=\"PopupMessageBox\">";
- println " <div class=\"$messType\">";
- println " <div class=\"PopupMessageContainer\">";
+ println " <ul class=\"UITabContent PopupMessageBox $messType\" $style>";
for(mess in messages) {
if(mess.messageKey == null) continue;
- println " <div class=\"MessageContainer\">";
- println " <div class=\"PopupIcon ${messType}Icon\"><span></span></div>";
- println " <div class=\"PopupMessage\">";
+ println " <li class=\"MessageContainer\">";
+ println " <span class=\"PopupIcon ${messType}Icon\">";
String msgValue = _ctx.appRes(mess.messageKey);
Object[] msgArguments = mess.getMessageAruments();
if(msgArguments != null && msgArguments.length > 0) {
@@ -72,82 +68,49 @@
}
EntityEncoder encoder = EntityEncoder.FULL;
msgValue = encoder.encode(msgValue);
- println msgValue;
- println " </div>";
- println " <div style=\"clear:left\"><span></span></div>";
- println " </div>";
- }
- println " </div>";
- println " </div>";
- println " </div>";
- println " </div>";
- return isSelected;
+ println msgValue;
+
+ println " </span>";
+ println " </li>";
+ }
+ println " </ul>";
+ return isSelected;
}
%>
- <div class="UIPopupWindow UIDragObject" id="$popupId" style="width: 550px; display: none;">
- <div class="ExoMessageDecorator">
- <div class="TopLeftCornerDecorator">
- <div class="TopRightCornerDecorator">
- <div class="TopCenterDecorator">
- <div class="OverflowContainer">
- <div class="PopupTitleIcon"><span></span></div>
- <div class="CloseButton" title="<%=_ctx.appRes("UIPopupMessages.Close")%>" onclick="<%=uicomponent.event("Close")%>"><span></span></div>
- <div class="PopupTitle"><%=_ctx.appRes("UIPopupMessages.title.exoMessages")%></div>
- </div>
- </div>
- </div>
+ <div class="UIPopupWindow UIDragObject ExoMessageDecorator" id="$popupId" style="width: 550px; display: none;">
+ <div class="OverflowContainer ClearFix">
+ <span class="PopupTitleIcon"></span>
+ <a class="CloseButton" title="<%=_ctx.appRes("UIPopupMessages.Close")%>" onclick="<%=uicomponent.event("Close")%>"></a>
+ <span class="PopupTitle"><%=_ctx.appRes("UIPopupMessages.title.exoMessages")%></span>
</div>
- <div class="MiddleLeftSideDecorator">
- <div class="MiddleRightSideDecorator">
- <div class="MiddleCenterDecorator">
-
- <div class="UIWindowContent">
- <div class="PopupContent">
- <div class="UIPopupMessages">
-
- <div class="UIHorizontalTabs">
- <div class="TabsContainer">
- <%
- boolean flag = false;
- flag = printTab(errors, "Error", flag);
- flag = printTab(warnings, "Warning", flag);
- flag = printTab(infos, "Info", flag);
- %>
- </div>
- </div>
-
- <div class="UITabContentContainer">
- <%
- flag = false;
- flag = printMessages(errors, "ErrorMessage", flag);
- flag = printMessages(warnings, "WarningMessage", flag);
- flag = printMessages(infos, "InfoMessage", flag);
- %>
- </div>
- <div class="MessageActionBar">
-
- <div class="UIAction">
- <a href="javascript:void(0);" onclick="<%=uicomponent.event("Close")%>" class="ActionButton LightBlueStyle"><%=_ctx.appRes("UIPopupMessages.button.ok")%></a>
- </div>
-
- </div>
-
- </div>
- </div>
+ <div class="UIWindowContent">
+ <div class="PopupContent UIPopupMessages">
+ <div class="UIHorizontalTabs">
+ <div class="TabsContainer">
+ <%
+ boolean flag = false;
+ flag = printTab(errors, "Error", flag);
+ flag = printTab(warnings, "Warning", flag);
+ flag = printTab(infos, "Info", flag);
+ %>
</div>
-
</div>
- </div>
+
+ <div class="UITabContentContainer">
+ <%
+ flag = false;
+ flag = printMessages(errors, "ErrorMessage", flag);
+ flag = printMessages(warnings, "WarningMessage", flag);
+ flag = printMessages(infos, "InfoMessage", flag);
+ %>
+ </div>
+ <div class="UIAction MessageActionBar">
+ <a href="javascript:void(0);" onclick="<%=uicomponent.event("Close")%>" class="ActionButton LightBlueStyle"><%=_ctx.appRes("UIPopupMessages.button.ok")%></a>
+ </div>
+ </div>
</div>
- <div><span></span></div>
- <div class="BottomLeftCornerDecorator">
- <div class="BottomRightCornerDecorator">
- <div class="BottomCenterDecorator"><span></span></div>
- </div>
- </div>
- </div>
</div>
<%
rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.init('$popupId', false, null, null, $uicomponent.showMask);");
Modified: portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIPopupWindow.gtmpl
===================================================================
--- portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIPopupWindow.gtmpl 2011-09-07 11:23:24 UTC (rev 7328)
+++ portal/branches/dom/web/portal/src/main/webapp/groovy/webui/core/UIPopupWindow.gtmpl 2011-09-07 12:12:19 UTC (rev 7329)
@@ -32,40 +32,17 @@
if(uicomponent.isShow()) show = "block";
%>
-<div class="UIPopupWindow UIDragObject" exo:minWidth="200" exo:minHeight="200" id="$popupId" style="$widthStyle display: $show;">
- <div class="NormalStyle">
- <div class="TopLeftCornerDecorator">
- <div class="TopRightCornerDecorator">
- <div class="TopCenterDecorator">
- <div class="OverflowContainer">
- <div class="PopupTitleIcon"><span></span></div>
- <%if (showCloseButton) {%>
- <!-- <div class="CloseButton" title="Close Window" onclick="<%=uicomponent.event("ClosePopup")%>"><span></span></div> -->
- <div class="CloseButton" title="<%=_ctx.appRes("UIPopupWindow.Close")%>" onclick="<%=uicomponent.event(uicomponent.getCloseEvent())%>"><span></span></div>
- <% } else { %>
- <div class="PopupTitleIconRight"><span></span></div>
- <% } %>
- <div class="PopupTitle"><%=_ctx.appRes(rsId + ".title."+ title)%></div>
- </div>
- </div>
- </div>
- </div>
- <div class="MiddleLeftSideDecorator">
- <div class="MiddleRightSideDecorator">
- <div class="MiddleCenterDecorator">
- <div class="UIWindowContent">
- <div style="width: 100%;"><div class="PopupContent" style="$heightStyle"><% uicomponent.renderChildren(); %></div></div>
- </div>
- </div>
- </div>
- </div>
- <div><span></span></div>
- <div class="BottomLeftCornerDecorator">
- <div class="BottomRightCornerDecorator">
- <div class="BottomCenterDecorator">
- <div class="ResizeButton"><span></span></div>
- </div>
- </div>
- </div>
+<div class="UIPopupWindow UIDragObject NormalStyle" exo:minWidth="200" exo:minHeight="200" id="$popupId" style="$widthStyle display: $show;">
+ <div class="OverflowContainer ClearFix">
+ <span class="PopupTitleIcon"></span>
+ <%if (showCloseButton) {%>
+ <a class="CloseButton" title="<%=_ctx.appRes("UIPopupWindow.Close")%>" onclick="<%=uicomponent.event(uicomponent.getCloseEvent())%>"></a>
+ <% } else { %>
+ <div class="PopupTitleIconRight"><span></span></div>
+ <% } %>
+ <span class="PopupTitle"><%=_ctx.appRes(rsId + ".title."+ title)%></span>
</div>
+ <div class="UIWindowContent">
+ <div class="PopupContent" style="$heightStyle"><% uicomponent.renderChildren(); %></div>
+ </div>
</div>
\ No newline at end of file
13 years, 3 months
gatein SVN: r7328 - in portal/branches/xss: web/portal/src/main/webapp/groovy/portal/webui/application and 1 other directories.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-09-07 07:23:24 -0400 (Wed, 07 Sep 2011)
New Revision: 7328
Modified:
portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java
portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl
portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
portal/branches/xss/webui/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardSelectContainer.gtmpl
Log:
GTNPORTAL-2065 XSS vulnerability at portlet description
Modified: portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
===================================================================
--- portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2011-09-07 09:49:58 UTC (rev 7327)
+++ portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2011-09-07 11:23:24 UTC (rev 7328)
@@ -40,6 +40,7 @@
import org.exoplatform.webui.form.UIFormTextAreaInput;
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.NameValidator;
+import org.exoplatform.webui.form.validator.SpecialCharacterValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
import java.util.Calendar;
@@ -56,7 +57,7 @@
@Serialized
public class UIApplicationForm extends UIForm
{
-
+
private Application application_;
public UIApplicationForm() throws Exception
@@ -64,7 +65,7 @@
addUIFormInput(new UIFormStringInput("applicationName", "applicationName", null).addValidator(
MandatoryValidator.class).addValidator(StringLengthValidator.class, 3, 30).addValidator(NameValidator.class));
addUIFormInput(new UIFormStringInput("displayName", "displayName", null).addValidator(
- StringLengthValidator.class, 3, 30));
+ StringLengthValidator.class, 3, 30).addValidator(SpecialCharacterValidator.class));
addUIFormInput(new UIFormTextAreaInput("description", "description", null).addValidator(
StringLengthValidator.class, 0, 255));
}
Modified: portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java
===================================================================
--- portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java 2011-09-07 09:49:58 UTC (rev 7327)
+++ portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java 2011-09-07 11:23:24 UTC (rev 7328)
@@ -38,6 +38,7 @@
import org.exoplatform.webui.form.UIFormTextAreaInput;
import org.exoplatform.webui.form.validator.IdentifierValidator;
import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.exoplatform.webui.form.validator.SpecialCharacterValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
import org.exoplatform.webui.organization.UIListPermissionSelector;
import org.exoplatform.webui.organization.UIListPermissionSelector.EmptyIteratorValidator;
@@ -74,7 +75,7 @@
MandatoryValidator.class).addValidator(StringLengthValidator.class, 3, 30).addValidator(
IdentifierValidator.class));
uiCategorySetting.addUIFormInput(new UIFormStringInput(FIELD_DISPLAY_NAME, FIELD_DISPLAY_NAME, null)
- .addValidator(StringLengthValidator.class, 3, 30));
+ .addValidator(StringLengthValidator.class, 3, 30).addValidator(SpecialCharacterValidator.class));
uiCategorySetting.addUIFormInput(new UIFormTextAreaInput(FIELD_DESCRIPTION, FIELD_DESCRIPTION, null)
.addValidator(StringLengthValidator.class, 0, 255));
addChild(uiCategorySetting);
Modified: portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl
===================================================================
--- portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl 2011-09-07 09:49:58 UTC (rev 7327)
+++ portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl 2011-09-07 11:23:24 UTC (rev 7328)
@@ -15,15 +15,15 @@
<%
String cTab, cName, description, displayName;
boolean isSelected = false;
+ EntityEncoder encoder = EntityEncoder.FULL;
for(category in categories) {
- cName = category.getName();
- EntityEncoder encoder = EntityEncoder.FULL;
+ cName = category.getName();
displayName = encoder.encode(category.getDisplayName());
- if(displayName == null || displayName.length() < 1 ) displayName = cName;
- if(selectedCategory != null && cName == selectedCategory.getName()) {
+ if (displayName == null || displayName.length() < 1 ) displayName = cName;
+ if (selectedCategory != null && cName == selectedCategory.getName()) {
isSelected = true;
cTab = "SelectedTab";
- }else {
+ } else {
isSelected = false;
cTab = "NormalTab";
}
@@ -34,11 +34,12 @@
<%= displayName %>
</a>
</div>
- <% if(isSelected) { %>
+ <% if (isSelected) { %>
<div class="UIVTabContent" style="display: block">
<%
- for(application in uicomponent.getApplications()) {
- String applicationLabel = application.getDisplayName();
+ for (application in uicomponent.getApplications()) {
+ String applicationName = encoder.encode(application.getDisplayName());
+ String applicationDescription = encoder.encode(application.getDescription());
String srcBG = application.getIconURL();
String srcBGError = "/eXoResources/skin/sharedImages/Icon80x80/DefaultPortlet.png";
%>
@@ -46,9 +47,9 @@
<div class="VTabContentBG">
<div class="OverflowContainer">
<img src="<%=(srcBG!=null && srcBG.length()>0)?srcBG:srcBGError%>" onError="src='$srcBGError'" alt=""/>
- <div class="ContentInfo" title="<%= application.getDisplayName() %>" style="cursor:move;">
- <div class="LabelTab">$applicationLabel</div>
- <div class="LableText"><%= application.getDescription() %></div>
+ <div class="ContentInfo" title="$applicationName" style="cursor:move;">
+ <div class="LabelTab">$applicationName</div>
+ <div class="LableText">$applicationDescription</div>
</div>
<div class="ClearLeft"><span></span></div>
</div>
Modified: portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
--- portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2011-09-07 09:49:58 UTC (rev 7327)
+++ portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2011-09-07 11:23:24 UTC (rev 7328)
@@ -1,9 +1,11 @@
<%
- import org.exoplatform.portal.webui.page.UIPage;
- import javax.portlet.WindowState;
+ import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.web.application.JavascriptManager;
- import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+ import org.gatein.common.text.EntityEncoder;
+
+ import javax.portlet.WindowState;
+
def rcontext = _ctx.getRequestContext();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
@@ -17,9 +19,13 @@
String onControlOver = "eXo.webui.UIPortlet.onControlOver(this, true);";
String onControlOut = "eXo.webui.UIPortlet.onControlOver(this, false);";
+
WindowState windowState = uicomponent.getCurrentWindowState();
String portletId = uicomponent.getId();
+ EntityEncoder encoder = EntityEncoder.FULL;
+
+ String title = encoder.encode(uicomponent.getDisplayTitle());
if(uiPortalApp.isEditing()) {
%>
<div class="UIPortlet <%=hasPermission?"":"ProtectedPortlet"%>" id="UIPortlet-$portletId" onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);" onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);"
@@ -36,7 +42,7 @@
<div class="FixHeight">
<%
if(hasPermission) {
- print uicomponent.getDisplayTitle();
+ print title;
} else print "<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>";
%>
</div>
@@ -54,7 +60,6 @@
if(portalMode != uiPortalApp.CONTAINER_BLOCK_EDIT_MODE && portalMode != uiPortalApp.APP_BLOCK_EDIT_MODE) {
if(uicomponent.getShowInfoBar()) {
- String title = uicomponent.getDisplayTitle();
if(title == null || title.trim().length() < 1)
title = portletId;
/*Begin Window Portlet Bar*/
@@ -258,7 +263,6 @@
String portletIcon = uicomponent.getIcon();
if(portletIcon == null) portletIcon = "PortletIcon";
- 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/branches/xss/webui/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardSelectContainer.gtmpl
===================================================================
--- portal/branches/xss/webui/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardSelectContainer.gtmpl 2011-09-07 09:49:58 UTC (rev 7327)
+++ portal/branches/xss/webui/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardSelectContainer.gtmpl 2011-09-07 11:23:24 UTC (rev 7328)
@@ -1,4 +1,6 @@
<%
+ import org.gatein.common.text.EntityEncoder;
+
def uiDashboard = uicomponent.getAncestorOfType(org.exoplatform.dashboard.webui.component.UIDashboard.class);
if(!uiDashboard.canEdit()) return;
@@ -6,6 +8,8 @@
def rcontext = _ctx.getRequestContext();
rcontext.getJavascriptManager().addJavascript("eXo.webui.UIDashboard.initPopup('"+uiPopup.getId()+"');");
+ EntityEncoder encoder = EntityEncoder.FULL;
+
%>
<div class="$uicomponent.id" id="UIDashboardSelectContainer" style="display: <%= uiDashboard.isShowSelectPopup()? "block" : "none"; %>;">
<div class="DashboardItemContainer ItemContainer">
@@ -21,13 +25,14 @@
<% List categories = uicomponent.getCategories();
if(categories != null && categories.size() > 0){
for(category in categories){
+ String categoryName = encoder.encode(category.getDisplayName());
%>
<div class="GadgetCategory" id="${category.getName()}">
<div class="GadgetTab SelectedTab" onclick="eXo.webui.UIDashboard.onTabClick(this, 'NormalTab', 'SelectedTab')">
<div class="LeftCategoryTitleBar">
<div class="RightCategoryTitleBar">
<div class="MiddleCategoryTitleBar">
- <div class="ArrowIcon" title="${category.getDisplayName()}">${category.getDisplayName()}</div>
+ <div class="ArrowIcon" title="$categoryName">$categoryName</div>
</div>
</div>
</div>
@@ -40,12 +45,12 @@
// uiPopup.setWindowSize(-1, 600);
for(gadget in lstGadgets){
+ String gadgetName = encoder.encode(gadget.getDisplayName());
%>
<div class="UIGadget SelectItem Item" id="${gadget.getId()}" style="top:0px; left:0px;">
<div class="GadgetControl">
- <% def label = gadget.getDisplayName() %>
- <div class="GadgetTitle" style="cursor:move;" title="$label">
- <%= (label.length() <= 23) ? label : label.substring(0, 20)+"..." %>
+ <div class="GadgetTitle" style="cursor:move;" title="$gadgetName">
+ <%= (gadgetName.length() <= 23) ? gadgetName : gadgetName.substring(0, 20)+"..." %>
</div>
</div>
</div>
13 years, 3 months
gatein SVN: r7327 - in portal/branches/xss: webui/portal/src/main/java/org/exoplatform/portal/webui/portal and 1 other directory.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-09-07 05:49:58 -0400 (Wed, 07 Sep 2011)
New Revision: 7327
Modified:
portal/branches/xss/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl
portal/branches/xss/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
GTNPORTAL-2062 XSS issue when entering site description
Modified: portal/branches/xss/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl
===================================================================
--- portal/branches/xss/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl 2011-09-07 09:23:51 UTC (rev 7326)
+++ portal/branches/xss/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl 2011-09-07 09:49:58 UTC (rev 7327)
@@ -1,28 +1,34 @@
<%
+ import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.webui.core.UIComponent ;
import org.exoplatform.webui.form.UIForm;
- import java.text.DateFormat;
- import java.text.SimpleDateFormat;
- import org.exoplatform.portal.config.UserPortalConfigService;
-
+
+ import org.gatein.common.text.EntityEncoder;
+
String[] actions = uicomponent.getActions();
uicomponent.loadPortalConfigs();
def rcontext = _ctx.getRequestContext();
def userPortalConfigService = uicomponent.getApplicationComponent(UserPortalConfigService.class);
def defaultPortalName = userPortalConfigService.getDefaultPortal();
+ EntityEncoder encoder = EntityEncoder.FULL;
+
+ String editLayoutLabel = _ctx.appRes("UISiteManagement.label.editLayout");
+ String editNavigationLabel = _ctx.appRes("UISiteManagement.label.editNav");
+ String editPortalPropLabel = _ctx.appRes("UISiteManagement.label.editPortalProp");
+ String deletePortalLabel = _ctx.appRes("UISiteManagement.label.deletePortal");
%>
<div class="UISiteManagement UIManagement" id="<%=uicomponent.getId();%>">
- <%
- for (portalConfig in uicomponent.getPortalConfigs()) {
- %>
- <table class="ManagementBlock" style="table-layout: fixed">
- <tr>
- <td class="Image"><img src="/exoadmin/skin/navigation/webui/component/background/PlImg.gif" alt=""/></td>
- <td class="Content">
+ <%
+ for (portalConfig in uicomponent.getPortalConfigs()) {
+ %>
+ <table class="ManagementBlock" style="table-layout: fixed">
+ <tr>
+ <td class="Image"><img src="/exoadmin/skin/navigation/webui/component/background/PlImg.gif" alt=""/></td>
+ <td class="Content">
<div class="Label"><%=uicomponent.getFieldValue(portalConfig, 'name') %></div>
<%
- def siteLabel = uicomponent.getFieldValue(portalConfig, 'label');
- def siteDescription = uicomponent.getFieldValue(portalConfig, 'description');
+ def siteLabel = encoder.encode(uicomponent.getFieldValue(portalConfig, 'label'));
+ def siteDescription = encoder.encode(uicomponent.getFieldValue(portalConfig, 'description'));
if (siteLabel != null && siteLabel.trim().length() > 0)
{
print """<div>$siteLabel</div>""";
@@ -32,45 +38,45 @@
print """<div>$siteDescription</div>""";
}
%>
- </td>
- <td class="ActionBlock">
- <a href="<%=uicomponent.event("EditPortalLayout", portalConfig.getName());%>" class="EditLayoutIcon"><%=_ctx.appRes("UISiteManagement.label.editLayout")%></a>
- <a href="<%=uicomponent.event("EditNavigation", portalConfig.getName());%>" class="EditNavIcon"><%=_ctx.appRes("UISiteManagement.label.editNav")%></a>
- <a href="javascript:ajaxGet(eXo.env.server.createPortalURL('UIPortal', 'EditPortalProperties', true, [{name:'portalName',value:'<%=portalConfig.getName()%>'}]))" class="EditNavIcon"><%=_ctx.appRes("UISiteManagement.label.editPortalProp")%></a>
-
- <% if(defaultPortalName != null && !defaultPortalName.equals(portalConfig.getName())) {%>
- <a href="<%=uicomponent.url("DeletePortal", portalConfig.getName());%>" class="DeleteIcon"><%=_ctx.appRes("UISiteManagement.label.deletePortal")%></a>
- <% } %>
- </td>
- </tr>
- </table>
- <%
- }
- %>
- <%
- if(uicomponent.getPortalConfigs() != null && uicomponent.getPortalConfigs().size() > 0){
- %>
- <div class="UIAction">
+ </td>
+ <td class="ActionBlock">
+ <a href="<%=uicomponent.event("EditPortalLayout", portalConfig.getName());%>" class="EditLayoutIcon">$editLayoutLabel</a>
+ <a href="<%=uicomponent.event("EditNavigation", portalConfig.getName());%>" class="EditNavIcon">$editNavigationLabel</a>
+ <a href="javascript:ajaxGet(eXo.env.server.createPortalURL('UIPortal', 'EditPortalProperties', true, [{name:'portalName',value:'<%=portalConfig.getName()%>'}]))" class="EditNavIcon">$editPortalPropLabel</a>
+
+ <% if(defaultPortalName != null && !defaultPortalName.equals(portalConfig.getName())) {%>
+ <a href="<%=uicomponent.url("DeletePortal", portalConfig.getName());%>" class="DeleteIcon">$deletePortalLabel</a>
+ <% } %>
+ </td>
+ </tr>
+ </table>
+ <%
+ }
+ %>
+ <%
+ if(uicomponent.getPortalConfigs() != null && uicomponent.getPortalConfigs().size() > 0){
+ %>
+ <div class="UIAction">
<table class="ActionContainer">
- <tr>
- <td>
- <div onclick="ajaxGet(eXo.env.server.createPortalURL('UIWorkingWorkspace', 'CreatePortal', true))" class="ActionButton BlueButton">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.addNewPortal")%></a>
- </div>
- </div>
- </div>
- </div>
- </td>
+ <tr>
+ <td>
+ <div onclick="ajaxGet(eXo.env.server.createPortalURL('UIWorkingWorkspace', 'CreatePortal', true))" class="ActionButton BlueButton">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.addNewPortal")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
</tr>
- </table>
- </div>
- <%
- }
- %>
- <%uicomponent.renderChildren();%>
+ </table>
+ </div>
+ <%
+ }
+ %>
+ <%uicomponent.renderChildren();%>
</div>
Modified: portal/branches/xss/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
--- portal/branches/xss/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-09-07 09:23:51 UTC (rev 7326)
+++ portal/branches/xss/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-09-07 09:49:58 UTC (rev 7327)
@@ -63,6 +63,7 @@
import org.exoplatform.webui.form.UIFormTabPane;
import org.exoplatform.webui.form.validator.IdentifierValidator;
import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.exoplatform.webui.form.validator.SpecialCharacterValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
import org.exoplatform.webui.organization.UIListPermissionSelector;
import org.exoplatform.webui.organization.UIListPermissionSelector.EmptyIteratorValidator;
@@ -242,7 +243,7 @@
new UIFormStringInput(FIELD_NAME, FIELD_NAME, null).addValidator(MandatoryValidator.class).addValidator(
StringLengthValidator.class, 3, 30).addValidator(IdentifierValidator.class).setEditable(false));
- uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_LABEL, FIELD_LABEL, null));
+ uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_LABEL, FIELD_LABEL, null).addValidator(SpecialCharacterValidator.class));
uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_DESCRIPTION, FIELD_DESCRIPTION, null));
uiSettingSet.addUIFormInput(new UIFormSelectBox(FIELD_LOCALE, FIELD_LOCALE, languages).addValidator(MandatoryValidator.class));
13 years, 3 months
gatein SVN: r7326 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-09-07 05:23:51 -0400 (Wed, 07 Sep 2011)
New Revision: 7326
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
Log:
GTNPORTAL-2070: Edit Layout on Dashboard removes the dashboard layout
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-09-07 09:03:45 UTC (rev 7325)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-09-07 09:23:51 UTC (rev 7326)
@@ -20,10 +20,10 @@
package org.exoplatform.portal.webui.workspace;
import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserACL;
-import org.exoplatform.portal.config.UserPortalConfig;
-import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.mop.navigation.Scope;
import org.exoplatform.portal.mop.user.UserNavigation;
@@ -47,7 +47,6 @@
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
-
import java.lang.reflect.Method;
/**
@@ -193,44 +192,32 @@
{
public void execute(Event<UIWorkingWorkspace> event) throws Exception
{
- UIPortalApplication uiApp = Util.getUIPortalApplication();
+ PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
+ UIPortalApplication portalApp = (UIPortalApplication)pcontext.getUIApplication();
+ UIPortal currentPortal = portalApp.getCurrentSite();
+ UIWorkingWorkspace uiWorkingWS = event.getSource();
- UIPortal uiPortal = uiApp.getCurrentSite();
-
- UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
- UserPortalConfig userConfig =
- service.getUserPortalConfig(uiPortal.getName(), event.getRequestContext().getRemoteUser());
- if (userConfig == null)
- userConfig = uiApp.getUserPortalConfig();
-
- //Todo nguyenanhkien2a(a)gmail.com
- //Check editing permission
- UIPortalApplication portalApp = Util.getUIPortalApplication();
- UIPortal currentUIPortal = event.getSource().findFirstComponentOfType(UIPortal.class);
UserACL userACL = portalApp.getApplicationComponent(UserACL.class);
- if(!userACL.hasEditPermissionOnPortal(currentUIPortal.getSiteType().getName(), currentUIPortal.getName(),
- currentUIPortal.getEditPermission()))
+ if (!userACL.hasEditPermissionOnPortal(currentPortal.getSiteType().getName(), currentPortal.getName(),
+ currentPortal.getEditPermission()))
{
- uiApp.addMessage(new ApplicationMessage("UIPortalManagement.msg.Invalid-EditLayout-Permission",
- new String[]{uiPortal.getName()}));
+ portalApp.addMessage(new ApplicationMessage("UIPortalManagement.msg.Invalid-EditLayout-Permission",
+ new String[]{currentPortal.getName()}));
return;
}
-
- PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
- UIWorkingWorkspace uiWorkingWS = event.getSource();
- uiWorkingWS.setBackupUIPortal(uiPortal);
- uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- UIPortal newPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
- PortalDataMapper.toUIPortal(newPortal, userConfig.getPortalConfig());
-// newPortal.setSelectedNode(uiPortal.getSelectedNode());
-// newPortal.setNavigation(uiPortal.getNavigation());
-// newPortal.setSelectedPath(uiPortal.getSelectedPath());
- newPortal.setNavPath(uiPortal.getNavPath());
- newPortal.refreshUIPage();
+ DataStorage dataStorage = portalApp.getApplicationComponent(DataStorage.class);
+ PortalConfig portalConfig = dataStorage.getPortalConfig(pcontext.getSiteType().getName(), pcontext.getSiteName());
+ UIPortal transientPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
+ PortalDataMapper.toUIPortal(transientPortal, portalConfig);
+ transientPortal.setNavPath(currentPortal.getNavPath());
+ transientPortal.refreshUIPage();
+ uiWorkingWS.setBackupUIPortal(currentPortal);
+ portalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
+
UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
- uiEditWS.setUIComponent(newPortal);
+ uiEditWS.setUIComponent(transientPortal);
UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
siteBody.setUIComponent(null);
13 years, 3 months
gatein SVN: r7325 - portal/branches/xss/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-09-07 05:03:45 -0400 (Wed, 07 Sep 2011)
New Revision: 7325
Modified:
portal/branches/xss/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UINavigationGrid.gtmpl
Log:
GTNPORTAL-2061 XSS in Group description content
Modified: portal/branches/xss/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UINavigationGrid.gtmpl
===================================================================
--- portal/branches/xss/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UINavigationGrid.gtmpl 2011-09-07 08:43:20 UTC (rev 7324)
+++ portal/branches/xss/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UINavigationGrid.gtmpl 2011-09-07 09:03:45 UTC (rev 7325)
@@ -1,34 +1,43 @@
-<%
- import java.util.List;
- import org.exoplatform.webui.organization.OrganizationUtils;
- import org.exoplatform.portal.mop.SiteKey;
-
- def parent = uicomponent.getParent();
- def navigations = uicomponent.getBeans();
+<%
+ import org.exoplatform.portal.mop.SiteKey;
+ import org.exoplatform.webui.organization.OrganizationUtils;
+ import org.gatein.common.text.EntityEncoder;
+
+ import java.util.List;
+
+ def parent = uicomponent.getParent();
+ def navigations = uicomponent.getBeans();
%>
<div id="$uicomponent.id" class="FeedBox">
- <%
- boolean isEvenRow = true;
- SiteKey siteKey;
- for(navigation in navigations) {
- siteKey = navigation.getKey();
- deleteLink = parent.event("DeleteNavigation",String.valueOf(siteKey.getName()));
- editProperties = parent.event("EditProperties",String.valueOf(siteKey.getName()));
- editLink = parent.event("EditNavigation",String.valueOf(siteKey.getName()));%>
+ <%
+ boolean isEvenRow = true;
+ SiteKey siteKey;
+ EntityEncoder encoder = EntityEncoder.FULL;
+ String descriptionLabel = _ctx.appRes("UIGroupNavigationManagement.Label.Description");
+ String editNavigationLabel = _ctx.appRes("UIGroupNavigationManagement.Label.EditNavigation");
+ String editPropertiesLabel = _ctx.appRes("UIGroupNavigationManagement.Label.EditProperties");
+ String deleteNavigationLabel = _ctx.appRes("UIGroupNavigationManagement.Label.DeleteNavigation");
+ for(navigation in navigations) {
+ siteKey = navigation.getKey();
+ String groupDescription = encoder.encode(OrganizationUtils.getGroupDescription(siteKey.getName()));
+ String groupLabel = encoder.encode(OrganizationUtils.getGroupLabel(siteKey.getName()));
+ String deleteLink = parent.event("DeleteNavigation",String.valueOf(siteKey.getName()));
+ String editProperties = parent.event("EditProperties",String.valueOf(siteKey.getName()));
+ String editLink = parent.event("EditNavigation",String.valueOf(siteKey.getName()));%>
<table class="ManagementBlock <%=isEvenRow ? "EvenRow":"OddRow"%>" style="table-layout: fixed">
- <tr>
- <td class="Image"><img src="/exoadmin/skin/navigation/webui/component/background/GroupImage.png" alt="" /></td>
- <td class="Content">
- <div class="Label" title="$siteKey.name"><%= OrganizationUtils.getGroupLabel(siteKey.getName()) %></div>
- <div><%=_ctx.appRes("UIGroupNavigationManagement.Label.Description")%>: <%= OrganizationUtils.getGroupDescription(siteKey.getName()) %></div>
- </td>
- <td class="ActionBlock">
- <a href="<%=editLink%>" class="EditNavIcon"><%=_ctx.appRes("UIGroupNavigationManagement.Label.EditNavigation")%></a>
- <a href="<%=editProperties%>" class="EditProIcon"><%=_ctx.appRes("UIGroupNavigationManagement.Label.EditProperties")%></a>
- <a href="<%=deleteLink%>" class="DeleteIcon"><%=_ctx.appRes("UIGroupNavigationManagement.Label.DeleteNavigation")%></a>
- </td>
- </tr>
+ <tr>
+ <td class="Image"><img src="/exoadmin/skin/navigation/webui/component/background/GroupImage.png" alt="" /></td>
+ <td class="Content">
+ <div class="Label" title="$siteKey.name">$groupLabel</div>
+ <div>$descriptionLabel: $groupDescription</div>
+ </td>
+ <td class="ActionBlock">
+ <a href="<%=editLink%>" class="EditNavIcon">$editNavigationLabel</a>
+ <a href="<%=editProperties%>" class="EditProIcon">$editPropertiesLabel</a>
+ <a href="<%=deleteLink%>" class="DeleteIcon">$deleteNavigationLabel</a>
+ </td>
+ </tr>
</table>
- <% isEvenRow = !isEvenRow;} %>
+ <% isEvenRow = !isEvenRow;} %>
</div>
13 years, 3 months