gatein SVN: r1352 - in portal/trunk: component/portal/src/main/java/org/exoplatform/portal/config and 6 other directories.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2010-01-18 21:21:38 -0500 (Mon, 18 Jan 2010)
New Revision: 1352
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NoSuchDateException.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/StorageException.java
Removed:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/DataMissingException.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/UIDataFeed.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIRepeater.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java
Log:
GTNPORTAL-273 Improve the code and add unit test for Data Storage services
Deleted: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/DataMissingException.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/DataMissingException.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/DataMissingException.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -1,52 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2009, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.exoplatform.commons.utils;
-
-public class DataMissingException extends RuntimeException
-{
-
- public DataMissingException()
- {
- // TODO Auto-generated constructor stub
- }
-
- public DataMissingException(String message)
- {
- super(message);
- // TODO Auto-generated constructor stub
- }
-
- public DataMissingException(Throwable cause)
- {
- super(cause);
- // TODO Auto-generated constructor stub
- }
-
- public DataMissingException(String message, Throwable cause)
- {
- super(message, cause);
- // TODO Auto-generated constructor stub
- }
-
-}
Copied: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NoSuchDateException.java (from rev 1347, portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/DataMissingException.java)
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NoSuchDateException.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NoSuchDateException.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.exoplatform.portal.config;
+
+
+public class NoSuchDateException extends StorageException
+{
+ public NoSuchDateException()
+ {
+ }
+
+ public NoSuchDateException(String message)
+ {
+ super(message);
+ }
+
+ public NoSuchDateException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/StorageException.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/StorageException.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/StorageException.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -0,0 +1,22 @@
+package org.exoplatform.portal.config;
+
+/**
+ * @author <a href="mailto:trong.tran@exoplatform.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class StorageException extends RuntimeException
+{
+ public StorageException()
+ {
+ }
+
+ public StorageException(String message)
+ {
+ super(message);
+ }
+
+ public StorageException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -24,8 +24,8 @@
import org.exoplatform.commons.chromattic.SessionContext;
import org.exoplatform.commons.chromattic.SynchronizationListener;
import org.exoplatform.commons.chromattic.SynchronizationStatus;
-import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.NoSuchDateException;
import org.exoplatform.portal.pom.data.Mapper;
import org.gatein.mop.api.Model;
import org.gatein.mop.api.content.Customization;
@@ -203,7 +203,7 @@
{
Customization<?> customization = getModel().findCustomizationById(id);
if (customization == null) {
- throw new DataMissingException("Can not find " + id);
+ throw new NoSuchDateException("Can not find " + id);
}
return customization;
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -19,7 +19,7 @@
package org.exoplatform.portal.pom.config.tasks;
-import org.exoplatform.commons.utils.DataMissingException;
+import org.exoplatform.portal.config.NoSuchDateException;
import org.exoplatform.portal.pom.config.POMTask;
import org.exoplatform.portal.pom.config.cache.DataAccessMode;
import org.exoplatform.portal.pom.config.cache.CacheableDataTask;
@@ -112,7 +112,7 @@
Site srcSite = workspace.getSite(siteType, ownerId);
if (srcSite == null)
{
- throw new DataMissingException("Could not clone page " + name + "from non existing site of type "
+ throw new NoSuchDateException("Could not clone page " + name + "from non existing site of type "
+ ownerType + " with id " + ownerId);
}
else
@@ -125,7 +125,7 @@
//
if (srcPage == null)
{
- throw new DataMissingException("Could not clone non existing page " + name + " from site of type "
+ throw new NoSuchDateException("Could not clone non existing page " + name + " from site of type "
+ ownerType + " with id " + ownerId);
}
@@ -267,7 +267,7 @@
Site site = workspace.getSite(siteType, ownerId);
if (site == null)
{
- throw new DataMissingException("Could not remove page " + name + "of non existing site of type "
+ throw new NoSuchDateException("Could not remove page " + name + "of non existing site of type "
+ ownerType + " with id " + ownerId);
}
else
@@ -277,7 +277,7 @@
org.gatein.mop.api.workspace.Page page = pages.getChild(name);
if (page == null)
{
- throw new DataMissingException("Could not remove non existing page " + name + " of site of type "
+ throw new NoSuchDateException("Could not remove non existing page " + name + " of site of type "
+ ownerType + " with id " + ownerId);
}
page.destroy();
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -19,8 +19,8 @@
package org.exoplatform.portal.pom.config.tasks;
-import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.NoSuchDateException;
import org.exoplatform.portal.pom.config.cache.DataAccessMode;
import org.exoplatform.portal.pom.config.cache.CacheableDataTask;
import org.exoplatform.portal.pom.data.Mapper;
@@ -80,7 +80,7 @@
Site site = workspace.getSite(type, key.getId());
if (site == null)
{
- throw new DataMissingException("Could not remove non existing portal " + key.getId());
+ throw new NoSuchDateException("Could not remove non existing portal " + key.getId());
}
else
{
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -19,7 +19,7 @@
package org.exoplatform.portal.pom.config.tasks;
-import org.exoplatform.commons.utils.DataMissingException;
+import org.exoplatform.portal.config.NoSuchDateException;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMTask;
import org.exoplatform.portal.pom.config.cache.CacheableDataTask;
@@ -50,7 +50,7 @@
{
Customization<S> customization = (Customization<S>)session.findCustomizationById(storageId);
if (customization == null) {
- throw new DataMissingException("Can not find " + storageId);
+ throw new NoSuchDateException("Can not find " + storageId);
}
return customization.getContentId();
}
@@ -136,7 +136,7 @@
Customization<S> customization = (Customization<S>)session.findCustomizationById(storageId);
if (customization == null) {
- throw new DataMissingException("Can not find " + storageId);
+ throw new NoSuchDateException("Can not find " + storageId);
}
if (prefs != null)
{
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -19,7 +19,7 @@
package org.exoplatform.portal.pom.data;
-import org.exoplatform.commons.utils.DataMissingException;
+import org.exoplatform.portal.config.NoSuchDateException;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.ApplicationType;
@@ -398,7 +398,7 @@
private List<ComponentData> loadChildren(UIContainer src)
{
- if (src == null) throw new DataMissingException("Can not load children");
+ if (src == null) throw new NoSuchDateException("Can not load children");
ArrayList<ComponentData> children = new ArrayList<ComponentData>(src.size());
for (UIComponent component : src)
{
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -53,9 +53,6 @@
{
/** . */
- private final String testPortal = "testPortal";
-
- /** . */
private final String testPage = "portal::classic::testPage";
/** . */
@@ -128,10 +125,19 @@
PortalConfig portal = storage_.getPortalConfig("portal", "test");
assertNotNull(portal);
- //
storage_.remove(portal);
- portal = storage_.getPortalConfig(testPortal);
- assertNull(portal);
+ assertNull(storage_.getPortalConfig("portal", "test"));
+
+ try
+ {
+ //Trying to remove non existing a portal config
+ storage_.remove(portal);
+ fail("was expecting a NoSuchDataException");
+ }
+ catch (NoSuchDateException e)
+ {
+
+ }
}
public void testCreatePage() throws Exception
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/UIDataFeed.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/UIDataFeed.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/UIDataFeed.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -19,8 +19,8 @@
package org.exoplatform.webui.bean;
-import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.portal.config.NoSuchDateException;
/**
* Created by The eXo Platform SAS Author : liem.nguyen ncliam(a)gmail.com Jun 26,
@@ -33,10 +33,10 @@
/***
* Load data of next page. Throws DataMissingException when page's data is cannot load
- * @throws DataMissingException
+ * @throws NoSuchDateException
* @throws Exception
*/
- public void feedNext() throws DataMissingException, Exception;
+ public void feedNext() throws NoSuchDateException, Exception;
public boolean hasNext();
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIRepeater.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIRepeater.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIRepeater.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -19,8 +19,8 @@
package org.exoplatform.webui.core;
-import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.portal.config.NoSuchDateException;
import org.exoplatform.util.ReflectionUtil;
import org.exoplatform.webui.bean.UIDataFeed;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -106,7 +106,7 @@
return method.invoke(bean, ReflectionUtil.EMPTY_ARGS);
}
- public void feedNext() throws DataMissingException, Exception
+ public void feedNext() throws NoSuchDateException, Exception
{
int page = datasource.getCurrentPage();
page++;
@@ -126,7 +126,7 @@
catch (Throwable e)
{
datasource.getPage(page--);
- throw new DataMissingException(e);
+ throw new NoSuchDateException(e);
}
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java 2010-01-18 14:04:19 UTC (rev 1351)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java 2010-01-19 02:21:38 UTC (rev 1352)
@@ -19,8 +19,8 @@
package org.exoplatform.webui.core;
-import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.portal.config.NoSuchDateException;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.bean.UIDataFeed;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -80,7 +80,7 @@
{
dataFeed.feedNext();
}
- catch (DataMissingException e)
+ catch (NoSuchDateException e)
{
// Update parent of virtual list to refresh
event.getRequestContext().addUIComponentToUpdateByAjax(virtualList.getParent());
14 years, 11 months
gatein SVN: r1351 - in portal/trunk: component/scripting/src/test/java/org/exoplatform and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-18 09:04:19 -0500 (Mon, 18 Jan 2010)
New Revision: 1351
Removed:
portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/AtomicPositiveLong.java
portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/BoundedBuffer.java
portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/LongSampler.java
portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/ObjectRef.java
portal/trunk/component/scripting/src/test/java/org/exoplatform/commons/
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/SerializationMode.java
Log:
- remove classes moved to common package
- minor mod on serialization mode
Deleted: portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/AtomicPositiveLong.java
===================================================================
--- portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/AtomicPositiveLong.java 2010-01-18 13:24:19 UTC (rev 1350)
+++ portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/AtomicPositiveLong.java 2010-01-18 14:04:19 UTC (rev 1351)
@@ -1,112 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.commons.utils;
-
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * Extends the @link{AtomicLong} to contain positive longs. If no initial value
- * is provided when the object is created then the value is -1 to indicate that
- * it is not yet initialized.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- * @todo move to common utils
- */
-public class AtomicPositiveLong extends AtomicLong
-{
-
- /**
- * Create an atomic positive long with an inital provided value.
- *
- * @param initialValue the initial value
- * @throws IllegalArgumentException if the value is negative
- */
- public AtomicPositiveLong(long initialValue) throws IllegalArgumentException
- {
- super(initialValue);
-
- //
- if (initialValue == -1)
- {
- throw new IllegalArgumentException();
- }
- }
-
- /**
- * Create an atomic positive long with no initial value.
- */
- public AtomicPositiveLong()
- {
- super(-1);
- }
-
- /**
- * Update the value if the new value is greater than the previous one or if the long is not initialized.
- *
- * @param newValue the new value
- * @throws IllegalArgumentException if the new value is negative
- */
- public void setIfGreater(long newValue) throws IllegalArgumentException
- {
- if (newValue < 0)
- {
- throw new IllegalArgumentException();
- }
- while (true)
- {
- long oldValue = get();
- if (newValue > oldValue || oldValue == -1)
- {
- compareAndSet(oldValue, newValue);
- }
- else
- {
- break;
- }
- }
- }
-
- /**
- * Update the value if the new value is lower than the previous one or if the long is not initialized.
- *
- * @param newValue the new value
- * @throws IllegalArgumentException if the new value is negative
- */
- public void setIfLower(long newValue) throws IllegalArgumentException
- {
- if (newValue < 0)
- {
- throw new IllegalArgumentException();
- }
- while (true)
- {
- long oldValue = get();
- if (newValue < oldValue || oldValue == -1)
- {
- compareAndSet(oldValue, newValue);
- }
- else
- {
- break;
- }
- }
- }
-}
Deleted: portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/BoundedBuffer.java
===================================================================
--- portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/BoundedBuffer.java 2010-01-18 13:24:19 UTC (rev 1350)
+++ portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/BoundedBuffer.java 2010-01-18 14:04:19 UTC (rev 1351)
@@ -1,186 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.commons.utils;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-/**
- * <p>A thread safe bounded buffer.</p>
- *
- * <p>The idea of this class is that it retains only the last elements added
- * to the buffer up to a determined size, but it is possible to make snapshot of the buffer elements and iterate
- * over them with a neglectable impact on synchronization.</p>
- *
- * <p>It maintains a linked list. When a new element is added, the first element will have for
- * successor that new element. If the number of elements is greater than the max size then the last element
- * is discarded.</p>
- *
- * <p> When a snapshot for iteration is required, the class only needs to keep a reference to the last element of the list
- * and keep also the actual size of the list. The copy is made in an atomic manner for consistency. Note that this class
- * expose only a notion of iterator to its client instead of a notion of list as iterator have a notion of being short
- * lived objects. Indeed keeping a reference on an iterator would create a memory leak and so this class must be used
- * with caution.</p>
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- * @todo move to common utils
- * @todo develop a non blocking implementation pretty much like the ConcurrentLinkedQueue does
- * @todo although I don't think this class is a bottleneck as there is very short lived synchronization
- * @todo and actually I don't know if it's feasible to have a non blocking impl due to the size value
- *
- */
-public class BoundedBuffer<T> implements Iterable<T>
-{
-
- /** The max size. */
- private final int maxSize;
-
- /** The elder element. */
- private ObjectRef<T> last;
-
- /** The younger element. */
- private ObjectRef<T> first;
-
- /** The size, it is declared as volatile for the @link{getSize()} method. */
- private volatile int size;
-
- public BoundedBuffer(int maxSize)
- {
- if (maxSize < 1)
- {
- throw new IllegalArgumentException("Buffer size needs to be greater than zero");
- }
-
- //
- this.maxSize = maxSize;
- this.size = 0;
- }
-
- public int getMaxSize()
- {
- return maxSize;
- }
-
- public int getSize()
- {
- return size;
- }
-
- /**
- * Add an element to the buffer.
- *
- * @param t the element to add
- */
- public void add(T t)
- {
- synchronized (this)
- {
- if (first == null)
- {
- first = new ObjectRef<T>(t);
- last = first;
- size = 1;
- }
- else
- {
- ObjectRef<T> tmp = first;
- first = new ObjectRef<T>(t);
- tmp.next.set(first);
- if (size < maxSize)
- {
- size++;
- }
- else
- {
- last = last.next.get();
- }
- }
- }
- }
-
- /**
- * Make a snapshot of the buffer and iterate over the elements. It is important to not keep reference
- * on an iterator returned by this method otherwise it could create a memory leak.
- *
- * @return an iterator over the elements
- */
- public Iterator<T> iterator()
- {
- if (size == 0)
- {
- List<T> empty = Collections.emptyList();
- return empty.iterator();
- }
- else
- {
- // Get consistent state
- final ObjectRef<T> lastSnapshot;
- final int sizeSnapshot;
- synchronized (this)
- {
- lastSnapshot = last;
- sizeSnapshot = size;
- }
- return new BoundedIterator<T>(lastSnapshot, sizeSnapshot);
- }
- }
-
- private static final class BoundedIterator<T> implements Iterator<T>
- {
-
- final int size;
-
- ObjectRef<T> current;
-
- int count = 0;
-
- private BoundedIterator(ObjectRef<T> current, int size)
- {
- this.current = current;
- this.size = size;
- this.count = 0;
- }
-
- public boolean hasNext()
- {
- return count < size && current != null;
- }
-
- public T next()
- {
- if (!hasNext())
- {
- throw new NoSuchElementException();
- }
- T next = current.object;
- current = current.next.get();
- count++;
- return next;
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-}
Deleted: portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/LongSampler.java
===================================================================
--- portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/LongSampler.java 2010-01-18 13:24:19 UTC (rev 1350)
+++ portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/LongSampler.java 2010-01-18 14:04:19 UTC (rev 1351)
@@ -1,74 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.commons.utils;
-
-/**
- * An object that sample long values.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- * @todo move to common utils
- */
-public class LongSampler extends BoundedBuffer<Long>
-{
-
- public LongSampler(int maxSize)
- {
- super(maxSize);
- }
-
- /**
- * Returns the average value.
- *
- * @return the average
- */
- public double average()
- {
- long sumTime = 0;
- int size = 0;
- for (long value : this)
- {
- sumTime += value;
- size++;
- }
- return size == 0 ? 0 : (double)sumTime / (double)size;
- }
-
- /**
- * Returns the number of values which are greater or equals to the threshold value.
- *
- * @param threshold the threshold value
- * @return the count of values above the provided threshold
- */
- public int countAboveThreshold(long threshold)
- {
- System.out.println("bbb" + threshold);
- int count = 0;
- for (long value : this)
- {
- System.out.println("aaaa" + value);
- if (value >= threshold)
- {
- count++;
- }
- }
- return count;
- }
-}
Deleted: portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/ObjectRef.java
===================================================================
--- portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/ObjectRef.java 2010-01-18 13:24:19 UTC (rev 1350)
+++ portal/trunk/component/scripting/src/main/java/org/exoplatform/commons/utils/ObjectRef.java 2010-01-18 14:04:19 UTC (rev 1351)
@@ -1,45 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.commons.utils;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-/**
- * An internal class to keep a reference onto another object, it is used in the bounded buffer implementation.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- * @todo move to common utils
- */
-class ObjectRef<T>
-{
-
- /** . */
- final T object;
-
- /** . */
- final AtomicReference<ObjectRef<T>> next;
-
- ObjectRef(T object)
- {
- this.object = object;
- this.next = new AtomicReference<ObjectRef<T>>();
- }
-}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/SerializationMode.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/SerializationMode.java 2010-01-18 13:24:19 UTC (rev 1350)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/SerializationMode.java 2010-01-18 14:04:19 UTC (rev 1351)
@@ -30,6 +30,8 @@
SERIALIZABLE,
+ STATELESS,
+
NONE
14 years, 11 months
gatein SVN: r1350 - in portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication: api and 3 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-18 08:24:19 -0500 (Mon, 18 Jan 2010)
New Revision: 1350
Removed:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/Replicatable.java
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/TypeConverter.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/annotations/Converted.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/annotations/Serialized.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/factory/ObjectFactory.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataContainer.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataKind.java
Log:
a bit of tuning of the replication framework
Deleted: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/Replicatable.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/Replicatable.java 2010-01-18 12:48:28 UTC (rev 1349)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/Replicatable.java 2010-01-18 13:24:19 UTC (rev 1350)
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.webui.application.replication;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public interface Replicatable
-{
-}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/TypeConverter.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/TypeConverter.java 2010-01-18 12:48:28 UTC (rev 1349)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/TypeConverter.java 2010-01-18 13:24:19 UTC (rev 1350)
@@ -20,14 +20,33 @@
package org.exoplatform.webui.application.replication.api;
/**
+ * A type converter that performs a bidirectional conversion between an external
+ * type and an internal type. The converter only assure conversion of non null values.
+ *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
+ * @param <E> the type parameter of the external type
+ * @param <I> the type parameter of the internal type
*/
-public abstract class TypeConverter<I, O>
+public abstract class TypeConverter<E, I>
{
- public abstract O write(I input) throws Exception;
+ /**
+ * Converts an external value to an internal value.
+ *
+ * @param external the external value
+ * @return the the internal value
+ * @throws Exception any conversion exception
+ */
+ public abstract I write(E external) throws Exception;
- public abstract I read(O output) throws Exception;
+ /**
+ * Converts an internal value to an external value.
+ *
+ * @param internal the internal value
+ * @return the external value
+ * @throws Exception any conversion exception
+ */
+ public abstract E read(I internal) throws Exception;
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/annotations/Converted.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/annotations/Converted.java 2010-01-18 12:48:28 UTC (rev 1349)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/annotations/Converted.java 2010-01-18 13:24:19 UTC (rev 1350)
@@ -28,7 +28,7 @@
import java.lang.annotation.Target;
/**
- * Annotates a type to be converted to another type for serialization.
+ * Declares a type to be converted.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/annotations/Serialized.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/annotations/Serialized.java 2010-01-18 12:48:28 UTC (rev 1349)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/annotations/Serialized.java 2010-01-18 13:24:19 UTC (rev 1350)
@@ -25,7 +25,7 @@
import java.lang.annotation.Target;
/**
- * Annotates a type to be serializable.
+ * Declares a type serialized.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/factory/ObjectFactory.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/factory/ObjectFactory.java 2010-01-18 12:48:28 UTC (rev 1349)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/api/factory/ObjectFactory.java 2010-01-18 13:24:19 UTC (rev 1350)
@@ -24,21 +24,24 @@
import java.util.Map;
/**
+ * A factory that creates instance of a type.
+ *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
- * @param <B> the base object type
+ * @param <B> the paraemter type of the base type
*/
public abstract class ObjectFactory<B>
{
/**
- * Instantiate an object based on the provided class.
+ * Instantiate an object based on the provided type. The implementor should take care of
+ * configuring the state of the returned objet with the provided state map argument.
*
* @param type the type
* @param state the state
- * @param <S> the sub type of the base type
+ * @param <S> the parameter type of the sub type of the base type
* @return the S instance
- * @throws CreateException anything wrong that could happen during instance creation
+ * @throws CreateException anything wrong that happened during instance creation
*/
public abstract <S extends B> S create(Class<S> type, Map<FieldModel<? super S, ?>, ?> state) throws CreateException;
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataContainer.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataContainer.java 2010-01-18 12:48:28 UTC (rev 1349)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataContainer.java 2010-01-18 13:24:19 UTC (rev 1350)
@@ -19,14 +19,17 @@
package org.exoplatform.webui.application.replication.serial;
-import java.io.*;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
import java.util.LinkedList;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class DataContainer implements Serializable
+public class DataContainer implements Externalizable
{
/** . */
@@ -57,6 +60,24 @@
return structure.removeFirst();
}
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ out.writeInt(structure.size());
+ for (Object o : structure)
+ {
+ out.writeObject(o);
+ }
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ int size = in.readInt();
+ while (size-- > 0)
+ {
+ structure.addLast(in.readObject());
+ }
+ }
+
@Override
public String toString()
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataKind.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataKind.java 2010-01-18 12:48:28 UTC (rev 1349)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataKind.java 2010-01-18 13:24:19 UTC (rev 1350)
@@ -23,7 +23,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class DataKind
+class DataKind
{
public static final int OBJECT = 0;
14 years, 11 months
gatein SVN: r1349 - components/pc/trunk/federation/src/test/java/org/gatein/pc/federation.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-18 07:48:28 -0500 (Mon, 18 Jan 2010)
New Revision: 1349
Modified:
components/pc/trunk/federation/src/test/java/org/gatein/pc/federation/FederatingPortletInvokerTestCase.java
Log:
- Fixed test case: needed to fake dereferencing of portlet id for proper resolution.
Modified: components/pc/trunk/federation/src/test/java/org/gatein/pc/federation/FederatingPortletInvokerTestCase.java
===================================================================
--- components/pc/trunk/federation/src/test/java/org/gatein/pc/federation/FederatingPortletInvokerTestCase.java 2010-01-18 12:31:08 UTC (rev 1348)
+++ components/pc/trunk/federation/src/test/java/org/gatein/pc/federation/FederatingPortletInvokerTestCase.java 2010-01-18 12:48:28 UTC (rev 1349)
@@ -222,6 +222,21 @@
return "inexistent";
}
+ @Override
+ public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
+ {
+ // fake dereferencing of compound portlet id
+ String portletId = portletContext.getId();
+ if (portletId.startsWith(getId() + "."))
+ {
+ return super.getPortlet(PortletContext.createPortletContext(portletId.substring(portletId.indexOf('.') + 1)));
+ }
+ else
+ {
+ throw new NoSuchPortletException(portletId);
+ }
+ }
+
public PortletInvoker getPortletInvoker()
{
return null;
14 years, 11 months
gatein SVN: r1348 - in portal/trunk: component/application-registry/src/main/java/org/exoplatform/application/registry and 18 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-18 07:31:08 -0500 (Mon, 18 Jan 2010)
New Revision: 1348
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/PortletExtraSerializer.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/LegacyPortalStateManager.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ReplicatingStateManager.java
Removed:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicatingStateManager.java
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Gadget.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Source.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/Application.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationCategory.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/ExtGroup.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddGadget.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationInfo.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationRegistryEditMode.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationRegistryPortlet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategorySelector.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIFormTableIteratorInputSet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletInfo.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/ParentAppStateManager.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletApplication.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/metadata/DomainMetaData.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/ReflectionDataMapping.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponentDecorator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIGrid.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPageIterator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupWindow.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UITree.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/model/SelectItemOption.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormGrid.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputContainer.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputInfo.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormPageIterator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormPopupWindow.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormRadioBoxInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormStringInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTableInputSet.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTextAreaInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/IdentifierValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/MandatoryValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/NameValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/StringLengthValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/URLValidator.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIListPermissionSelector.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UISelector.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStateManager.java
Log:
GTNPORTAL-523 : Serialization framework
GTNPORTAL-524 : Application Registry Portlet replication
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Gadget.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Gadget.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Gadget.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,13 +19,15 @@
package org.exoplatform.application.gadget;
+import java.io.Serializable;
+
/**
* Created by The eXo Platform SAS
* Author : Pham Thanh Tung
* thanhtungty(a)gmail.com
* Jul 28, 2008
*/
-public class Gadget
+public class Gadget implements Serializable
{
private String name;
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Source.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Source.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Source.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,6 +19,7 @@
package org.exoplatform.application.gadget;
+import java.io.Serializable;
import java.util.Calendar;
/**
@@ -27,7 +28,7 @@
* thanhtungty(a)gmail.com
* Oct 23, 2008
*/
-public class Source
+public class Source implements Serializable
{
private String name;
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/Application.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/Application.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/Application.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -21,6 +21,7 @@
import org.exoplatform.portal.config.model.ApplicationType;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
@@ -30,7 +31,7 @@
* Date: 15 juin 2004
*
*/
-public class Application
+public class Application implements Serializable
{
private String categoryName;
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationCategory.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationCategory.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationCategory.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,6 +19,7 @@
package org.exoplatform.application.registry;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -28,7 +29,7 @@
* User: Benjamin Mestrallet
* Date: 15 juin 2004
*/
-public class ApplicationCategory
+public class ApplicationCategory implements Serializable
{
private String name;
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/ExtGroup.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/ExtGroup.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/ExtGroup.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -24,7 +24,9 @@
import org.exoplatform.services.organization.Group;
-public class ExtGroup implements Group
+import java.io.Serializable;
+
+public class ExtGroup implements Group, Serializable
{
private String id;
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -31,6 +31,7 @@
import org.exoplatform.services.security.Identity;
import org.exoplatform.services.security.MembershipEntry;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -574,7 +575,7 @@
return result;
}
- static public class Permission
+ static public class Permission implements Serializable
{
private String name_;
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,13 +19,15 @@
package org.exoplatform.web.application;
+import java.io.Serializable;
+
/**
* Created by The eXo Platform SARL
* Author : Dang Van Minh
* minhdv81(a)yahoo.com
* Jun 7, 2006
*/
-public class ApplicationMessage
+public class ApplicationMessage implements Serializable
{
final public static int ERROR = 0, WARNING = 1, INFO = 2;
Added: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/PortletExtraSerializer.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/PortletExtraSerializer.java (rev 0)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/PortletExtraSerializer.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -0,0 +1,51 @@
+/*
+ * 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.applicationregistry.webui.component;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.webui.application.replication.api.TypeConverter;
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.pc.api.PortletInvoker;
+import org.gatein.pc.federation.FederatingPortletInvoker;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PortletExtraSerializer extends TypeConverter<UIPortletManagement.PortletExtra, PortletContext>
+{
+
+ @Override
+ public PortletContext write(UIPortletManagement.PortletExtra input)
+ {
+ return input.context;
+ }
+
+ @Override
+ public UIPortletManagement.PortletExtra read(PortletContext output) throws Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ FederatingPortletInvoker portletInvoker = (FederatingPortletInvoker)manager.getComponentInstance(PortletInvoker.class);
+ Portlet portlet = portletInvoker.getPortlet(output);
+ return new UIPortletManagement.PortletExtra(portlet);
+ }
+}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -26,11 +26,13 @@
import org.exoplatform.application.registry.ApplicationRegistryService;
import org.exoplatform.applicationregistry.webui.Util;
import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.SerializablePageList;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -66,6 +68,7 @@
@EventConfig(listeners = UIAddApplicationForm.ChangeTypeActionListener.class, phase = Phase.DECODE),
@EventConfig(listeners = UIAddApplicationForm.AddActionListener.class),
@EventConfig(listeners = UIAddApplicationForm.CancelActionListener.class, phase = Phase.DECODE)})
+@Serialized
public class UIAddApplicationForm extends UIForm
{
@@ -137,8 +140,7 @@
i++;
}
UIFormPageIterator uiIterator = uiTableInputSet.getChild(UIFormPageIterator.class);
- LazyPageList<UIFormInputSet> pageList =
- new LazyPageList<UIFormInputSet>(new FormInputSetListAccess(uiInputSetList), 10);
+ SerializablePageList<UIFormInputSet> pageList = new SerializablePageList<UIFormInputSet>(UIFormInputSet.class, uiInputSetList, 10);
uiIterator.setPageList(pageList);
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddGadget.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddGadget.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddGadget.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -24,6 +24,7 @@
import org.exoplatform.portal.webui.application.GadgetUtil;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -48,6 +49,7 @@
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIForm.gtmpl", events = {
@EventConfig(listeners = UIAddGadget.AddActionListener.class),
@EventConfig(listeners = UIAddGadget.CancelActionListener.class, phase = Phase.DECODE)})
+@Serialized
public class UIAddGadget extends UIForm
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -23,6 +23,7 @@
import org.exoplatform.application.registry.ApplicationRegistryService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -48,6 +49,7 @@
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl", events = {
@EventConfig(listeners = UIApplicationForm.SaveActionListener.class),
@EventConfig(phase = Phase.DECODE, listeners = UIApplicationForm.CancelActionListener.class)})
+@Serialized
public class UIApplicationForm extends UIForm
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationInfo.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationInfo.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationInfo.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -22,6 +22,7 @@
import org.exoplatform.application.registry.Application;
import org.exoplatform.application.registry.ApplicationCategory;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIContainer;
@@ -36,6 +37,7 @@
*/
@ComponentConfig(template = "app:/groovy/applicationregistry/webui/component/UIApplicationInfo.gtmpl", events = {@EventConfig(listeners = UIApplicationInfo.EditApplicationActionListener.class)})
+@Serialized
public class UIApplicationInfo extends UIContainer
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -31,6 +31,7 @@
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -53,7 +54,8 @@
@EventConfig(listeners = UIApplicationOrganizer.EditCategoryActionListener.class),
@EventConfig(listeners = UIApplicationOrganizer.AddApplicationActionListener.class),
@EventConfig(listeners = UIApplicationOrganizer.RemoveApplicationActionListener.class, confirm = "UIOrganizer.msg.deleteApplication")})
-public class UIApplicationOrganizer extends UIContainer
+@Serialized
+public class UIApplicationOrganizer extends UIContainer
{
private ApplicationCategory selectedCategory;
@@ -279,7 +281,8 @@
UIApplicationOrganizer uiOrganizer = event.getSource();
Application selectedApp = uiOrganizer.getApplication(appName);
ApplicationRegistryService service = uiOrganizer.getApplicationComponent(ApplicationRegistryService.class);
- if (service.getApplication(selectedApp.getId()) == null)
+ String selectedAppId = selectedApp.getId();
+ if (service.getApplication(selectedAppId) == null)
{
UIApplication uiApp = ctx.getUIApplication();
uiApp.addMessage(new ApplicationMessage("UIOrganizer.msg.applicationNoExist", null));
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationRegistryEditMode.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationRegistryEditMode.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationRegistryEditMode.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -22,6 +22,7 @@
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
@@ -42,7 +43,7 @@
template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl",
events = {@EventConfig(listeners = UIApplicationRegistryEditMode.SaveActionListener.class)}
)
-
+@Serialized
public class UIApplicationRegistryEditMode extends UIForm
{
public static final String SHOW_IMPORT = "showImport";
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationRegistryPortlet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationRegistryPortlet.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationRegistryPortlet.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -22,12 +22,14 @@
import org.exoplatform.portal.webui.portal.UIPortalComponentActionListener.ViewChildActionListener;
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIPortletApplication;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
@ComponentConfig(lifecycle = UIApplicationLifecycle.class, template = "app:/groovy/applicationregistry/webui/component/UIApplicationRegistryPortlet.gtmpl", events = {@EventConfig(listeners = ViewChildActionListener.class)})
+@Serialized
public class UIApplicationRegistryPortlet extends UIPortletApplication
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -24,6 +24,7 @@
import org.exoplatform.application.registry.ApplicationRegistryService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -49,6 +50,7 @@
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
@EventConfig(listeners = UICategoryForm.SaveActionListener.class),
@EventConfig(listeners = UICategoryForm.CancelActionListener.class, phase = Phase.DECODE)})
+@Serialized
public class UICategoryForm extends UIFormTabPane
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategorySelector.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategorySelector.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategorySelector.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -4,6 +4,9 @@
import org.exoplatform.application.registry.ApplicationCategory;
import org.exoplatform.application.registry.ApplicationRegistryService;
import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.PageListAccess;
+import org.exoplatform.commons.utils.SerializablePageList;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
@@ -27,6 +30,7 @@
@ComponentConfig(template = "system:/groovy/webui/form/UIForm.gtmpl", lifecycle = UIFormLifecycle.class, events = {
@EventConfig(listeners = UICategorySelector.SaveActionListener.class),
@EventConfig(listeners = UICategorySelector.CancelActionListener.class, phase = Phase.DECODE)})
+@Serialized
public class UICategorySelector extends UIForm
{
private Application application;
@@ -72,6 +76,8 @@
UIFormInputSet uiInputSet;
UIFormCheckBoxInput<Boolean> checkBoxInput;
UIFormInputInfo uiInfo;
+
+ //
ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
List<ApplicationCategory> categories = getAllCategories();
List<UIFormInputSet> uiInputSetList = new ArrayList<UIFormInputSet>();
@@ -93,8 +99,9 @@
}
UIFormPageIterator uiIterator = uiTableInputSet.getChild(UIFormPageIterator.class);
- LazyPageList<UIFormInputSet> pageList =
- new LazyPageList<UIFormInputSet>(new FormInputSetListAccess(uiInputSetList), 5);
+ SerializablePageList<UIFormInputSet> pageList = new SerializablePageList<UIFormInputSet>(
+ UIFormInputSet.class, uiInputSetList, 5
+ );
uiIterator.setPageList(pageList);
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIFormTableIteratorInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIFormTableIteratorInputSet.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIFormTableIteratorInputSet.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.applicationregistry.webui.component;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.form.UIFormInputBase;
@@ -36,6 +37,7 @@
* Aug 20, 2007
*/
@ComponentConfig(template = "app:/groovy/applicationregistry/webui/component/UIFormTableIteratorInputSet.gtmpl")
+@Serialized
public class UIFormTableIteratorInputSet extends UIFormTableInputSet
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -29,6 +29,7 @@
import org.exoplatform.portal.webui.application.GadgetUtil;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.InitParams;
import org.exoplatform.webui.config.Param;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -46,6 +47,7 @@
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.Validator;
+import java.io.Serializable;
import java.util.Calendar;
/**
@@ -55,6 +57,7 @@
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIForm.gtmpl", initParams = @ParamConfig(name = "SampleGadget", value = "app:/WEB-INF/conf/uiconf/applicationregistry/component/SampleGadget.groovy"), events = {
@EventConfig(listeners = UIGadgetEditor.SaveActionListener.class),
@EventConfig(listeners = UIGadgetEditor.CancelActionListener.class, phase = Phase.DECODE)})
+@Serialized
public class UIGadgetEditor extends UIForm
{
@@ -220,7 +223,7 @@
}
- public static class GadgetSpecValidator implements Validator
+ public static class GadgetSpecValidator implements Validator, Serializable
{
public void validate(UIFormInput uiInput) throws Exception
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -33,6 +33,7 @@
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.web.application.gadget.GadgetApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -58,6 +59,7 @@
@EventConfig(listeners = UIGadgetInfo.CopyActionListener.class),
@EventConfig(listeners = UIGadgetInfo.EditActionListener.class),
@EventConfig(listeners = UIGadgetInfo.ShowCategoriesActionListener.class)})
+@Serialized
public class UIGadgetInfo extends UIContainer
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -31,6 +31,7 @@
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.web.application.gadget.GadgetApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -52,6 +53,7 @@
@EventConfig(listeners = UIGadgetManagement.RemoveGadgetActionListener.class, confirm = "UIGadgetManagement.msg.deleteGadget"),
@EventConfig(listeners = UIGadgetManagement.AddLocalGadgetActionListener.class),
@EventConfig(listeners = UIGadgetManagement.SelectGadgetActionListener.class)})
+@Serialized
public class UIGadgetManagement extends UIContainer
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -23,6 +23,7 @@
import org.exoplatform.application.registry.ApplicationRegistryService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -45,6 +46,7 @@
@EventConfig(listeners = UIPermissionForm.SelectMembershipActionListener.class),
@EventConfig(listeners = UIPermissionForm.DeleteActionListener.class),
@EventConfig(listeners = UIPermissionForm.ChangePublicModeActionListener.class)})
+@Serialized
public class UIPermissionForm extends UIForm
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletInfo.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletInfo.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletInfo.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.applicationregistry.webui.component;
import org.exoplatform.applicationregistry.webui.component.UIPortletManagement.PortletExtra;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.UIComponent;
@@ -30,6 +31,7 @@
* Sep 11, 2008
*/
@ComponentConfig(template = "app:/groovy/applicationregistry/webui/component/UIPortletInfo.gtmpl")
+@Serialized
public class UIPortletInfo extends UIComponent
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -23,6 +23,8 @@
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Converted;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIContainer;
@@ -30,6 +32,7 @@
import org.exoplatform.webui.event.EventListener;
import org.gatein.common.i18n.LocalizedString;
import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.api.info.MetaInfo;
import org.gatein.pc.api.info.PortletInfo;
@@ -53,6 +56,7 @@
@ComponentConfig(template = "app:/groovy/applicationregistry/webui/component/UIPortletManagement.gtmpl", events = {
@EventConfig(listeners = UIPortletManagement.SelectPortletActionListener.class),
@EventConfig(listeners = UIPortletManagement.SelectPortletType.class)})
+@Serialized
public class UIPortletManagement extends UIContainer
{
@@ -68,9 +72,21 @@
private String selectedType;
- private static final Comparator<WebApp> WEB_APP_COMPARATOR = new WebAppComparator();
+ private static final Comparator<WebApp> WEB_APP_COMPARATOR = new Comparator<WebApp>()
+ {
+ public int compare(WebApp app1, WebApp app2)
+ {
+ return app1.getName().compareToIgnoreCase(app2.getName());
+ }
+ };
- private static final Comparator<PortletExtra> PORTLET_EXTRA_COMPARATOR = new PortletComparator();
+ private static final Comparator<PortletExtra> PORTLET_EXTRA_COMPARATOR = new Comparator<PortletExtra>()
+ {
+ public int compare(PortletExtra portlet1, PortletExtra portlet2)
+ {
+ return portlet1.getName().compareToIgnoreCase(portlet2.getName());
+ }
+ };
public UIPortletManagement() throws Exception
{
@@ -80,6 +96,7 @@
private void initWebApps(String type) throws Exception
{
webApps = new LinkedList<WebApp>(); // LinkedList is more appropriate here since we add lots of elements and sort
+ // julien : who said that LinkedList is appropriate for sorting ?
ExoContainer manager = ExoContainerContext.getCurrentContainer();
FederatingPortletInvoker portletInvoker =
@@ -104,7 +121,6 @@
for (Portlet portlet : portlets)
{
PortletInfo info = portlet.getInfo();
- String portletName = info.getName();
String appName = info.getApplicationName();
WebApp webApp = getWebApp(appName);
@@ -113,8 +129,7 @@
webApp = new WebApp(appName);
webApps.add(webApp);
}
- String portletId = appName + "/" + portletName;
- webApp.addPortlet(new PortletExtra(portletId, type, info));
+ webApp.addPortlet(new PortletExtra(portlet));
}
Collections.sort(webApps, WEB_APP_COMPARATOR);
@@ -232,6 +247,7 @@
}
+ @Converted(PortletExtraSerializer.class)
static public class PortletExtra
{
@@ -245,14 +261,24 @@
private PortletInfo portletInfo_;
- public PortletExtra(String id, String type, PortletInfo info)
+ final PortletContext context;
+
+ public PortletExtra(Portlet portlet)
{
- id_ = id;
- String[] fragments = id.split("/");
+ PortletInfo info = portlet.getInfo();
+ String portletName = info.getName();
+ String appName = info.getApplicationName();
+ String portletId = appName + "/" + portletName;
+ String type = portlet.isRemote() ? REMOTE : LOCAL;
+
+ //
+ id_ = portletId;
+ String[] fragments = portletId.split("/");
group_ = fragments[0];
name_ = fragments[1];
type_ = type;
portletInfo_ = info;
+ context = portlet.getContext();
}
public String getId()
@@ -277,18 +303,12 @@
public String getDisplayName()
{
- LocalizedString displayName = portletInfo_.getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
- if (displayName == null || displayName.getDefaultString() == null)
- return name_;
- return displayName.getDefaultString();
+ return getMetaValue(MetaInfo.DISPLAY_NAME, name_);
}
public String getDescription()
{
- LocalizedString description = portletInfo_.getMeta().getMetaValue(MetaInfo.DESCRIPTION);
- if (description == null || description.getDefaultString() == null)
- return name_;
- return description.getDefaultString();
+ return getMetaValue(MetaInfo.DESCRIPTION, name_);
}
public PreferencesInfo getPortletPreferences()
@@ -296,8 +316,16 @@
return portletInfo_.getPreferences();
}
+ private String getMetaValue(String metaKey, String defaultValue)
+ {
+ LocalizedString metaValue = portletInfo_.getMeta().getMetaValue(metaKey);
+ if (metaValue == null || metaValue.getDefaultString() == null)
+ return defaultValue;
+ return metaValue.getDefaultString();
+ }
}
+ @Serialized
static public class WebApp
{
@@ -305,6 +333,10 @@
List<PortletExtra> portlets_;
+ public WebApp()
+ {
+ }
+
public WebApp(String name)
{
name_ = name;
@@ -344,25 +376,4 @@
}
}
-
- static public class WebAppComparator implements Comparator<WebApp>
- {
-
- public int compare(WebApp app1, WebApp app2)
- {
- return app1.getName().compareToIgnoreCase(app2.getName());
- }
-
- }
-
- static public class PortletComparator implements Comparator<PortletExtra>
- {
-
- public int compare(PortletExtra portlet1, PortletExtra portlet2)
- {
- return portlet1.getName().compareToIgnoreCase(portlet2.getName());
- }
-
- }
-
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,8 +19,7 @@
package org.exoplatform.organization.webui.component;
-import org.exoplatform.commons.utils.ObjectPageList;
-import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.commons.utils.*;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.OrganizationService;
@@ -36,6 +35,7 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import java.io.Serializable;
import java.io.Writer;
import java.util.List;
@@ -70,11 +70,17 @@
@SuppressWarnings("unchecked")
public void loadData() throws Exception
{
- OrganizationService service = getApplicationComponent(OrganizationService.class);
- List memberships = (List)service.getMembershipTypeHandler().findMembershipTypes();
- PageList pagelist = new ObjectPageList(memberships, 10);
- pagelist.setPageSize(5);
- getChild(UIGrid.class).getUIPageIterator().setPageList(pagelist);
+ StatelessPageList<MembershipType> pla = new StatelessPageList<MembershipType>(5)
+ {
+ @Override
+ protected ListAccess<MembershipType> connect() throws Exception
+ {
+ OrganizationService service = getApplicationComponent(OrganizationService.class);
+ List<MembershipType> memberships = (List<MembershipType>)service.getMembershipTypeHandler().findMembershipTypes();
+ return new ListAccessImpl<MembershipType>(MembershipType.class, memberships);
+ }
+ };
+ getChild(UIGrid.class).getUIPageIterator().setPageList(pla);
}
public void processRender(WebuiRequestContext context) throws Exception
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml 2010-01-18 12:31:08 UTC (rev 1348)
@@ -30,7 +30,6 @@
<ui-component-root>org.exoplatform.portal.webui.workspace.UIPortalApplication</ui-component-root>
<state-manager>org.exoplatform.portal.application.PortalStateManager</state-manager>
- <!--<state-manager>org.exoplatform.portal.application.ReplicatingStateManager</state-manager>-->
<application-lifecycle-listeners>
<listener>org.exoplatform.portal.application.PortalStatisticLifecycle</listener>
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/ParentAppStateManager.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/ParentAppStateManager.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/ParentAppStateManager.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -38,8 +38,10 @@
}
@SuppressWarnings("unused")
- public void storeUIRootComponent(WebuiRequestContext context)
+ public void storeUIRootComponent(WebuiRequestContext context) throws Exception
{
+ WebuiRequestContext pcontext = (WebuiRequestContext)context.getParentAppRequestContext();
+ pcontext.getStateManager().storeUIRootComponent(context);
}
@SuppressWarnings("unused")
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletApplication.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletApplication.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletApplication.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -27,6 +27,7 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.web.application.ApplicationLifecycle;
import org.exoplatform.web.application.RequestContext;
+import org.exoplatform.webui.application.StateManager;
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.core.UIApplication;
@@ -159,13 +160,17 @@
{
lifecycle.onStartRequest(this, context);
}
- UIApplication uiApp = getStateManager().restoreUIRootComponent(context);
+ StateManager sm = getStateManager();
+ UIApplication uiApp = sm.restoreUIRootComponent(context);
context.setUIApplication(uiApp);
uiApp.processDecode(context);
if (!context.isResponseComplete() && !context.getProcessRender())
{
uiApp.processAction(context);
}
+
+ // Store ui root
+ sm.storeUIRootComponent(context);
}
finally
{
@@ -194,12 +199,16 @@
{
lifecycle.onStartRequest(this, context);
}
- UIApplication uiApp = getStateManager().restoreUIRootComponent(context);
+ StateManager sm = getStateManager();
+ UIApplication uiApp = sm.restoreUIRootComponent(context);
context.setUIApplication(uiApp);
javax.portlet.Event portletEvent = req.getEvent();
context.setAttribute(PORTLET_EVENT_VALUE, portletEvent.getValue());
Event<UIComponent> uiEvent = uiApp.createEvent(portletEvent.getName(), Phase.PROCESS, context);
uiEvent.broadcast();
+
+ // Store ui root
+ sm.storeUIRootComponent(context);
}
finally
{
@@ -236,7 +245,8 @@
lifecycle.onStartRequest(this, context);
}
}
- UIApplication uiApp = getStateManager().restoreUIRootComponent(context);
+ StateManager sm = getStateManager();
+ UIApplication uiApp = sm.restoreUIRootComponent(context);
context.setUIApplication(uiApp);
if (!context.isResponseComplete())
{
@@ -244,6 +254,9 @@
uiPortletApp.processRender(this, context);
}
uiApp.setLastAccessApplication(System.currentTimeMillis());
+
+ // Store ui root
+ sm.storeUIRootComponent(context);
}
finally
{
Deleted: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicatingStateManager.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicatingStateManager.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicatingStateManager.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.webui.application.replication;
-
-import org.exoplatform.webui.application.StateManager;
-import org.exoplatform.webui.application.WebuiApplication;
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.core.UIApplication;
-
-/**
- * The basis is either {@link org.exoplatform.webui.core.UIPortletApplication} or
- * {@link org.exoplatform.portal.webui.workspace.UIPortalApplication}.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class ReplicatingStateManager extends StateManager {
-
- @Override
- public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void storeUIRootComponent(WebuiRequestContext context) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void expire(String sessionId, WebuiApplication app) throws Exception {
- throw new UnsupportedOperationException();
- }
-}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -163,7 +163,7 @@
typeModelMap.putAll(addedTypeModels);
//
- System.out.println("Added types " + addedTypeModels.values() + " to replication domain");
+// System.out.println("Added types " + addedTypeModels.values() + " to replication domain");
//
return model;
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/metadata/DomainMetaData.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/metadata/DomainMetaData.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/metadata/DomainMetaData.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -85,4 +85,22 @@
}
state.put(clazz.getName(), new ClassTypeMetaData(serialized));
}
+
+ public void addConvertedType(String name, Class<? extends TypeConverter<?, ?>> converterClass)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ state.put(name, new ConvertedTypeMetaData(converterClass));
+ }
+
+ public void addClassType(String name, boolean serialized)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ state.put(name, new ClassTypeMetaData(serialized));
+ }
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -139,7 +139,7 @@
{
if (!fieldModel.isTransient())
{
- System.out.println("About to serialize field " + fieldModel + " of type " + currentTypeModel);
+// System.out.println("About to serialize field " + fieldModel + " of type " + currentTypeModel);
Object fieldValue = fieldModel.get(obj);
if (fieldValue == null)
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/ReflectionDataMapping.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/ReflectionDataMapping.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/ReflectionDataMapping.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.bean;
import org.exoplatform.util.ReflectionUtil;
+import org.exoplatform.webui.application.replication.api.annotations.Converted;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormInput;
@@ -30,11 +31,25 @@
import java.util.List;
/**
+ * A stateless object that must be obtained via the {@link #getInstance()} method.
+ *
* Author : Nhu Dinh Thuan thuan.nhu(a)exoplatform.com Oct 13, 2006
*/
public class ReflectionDataMapping implements BeanDataMapping
{
+ /** . */
+ private static final ReflectionDataMapping instance = new ReflectionDataMapping();
+
+ public static ReflectionDataMapping getInstance()
+ {
+ return instance;
+ }
+
+ private ReflectionDataMapping()
+ {
+ }
+
public void mapBean(Object bean, UIForm uiForm) throws Exception
{
List<UIComponent> children = uiForm.getChildren();
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -23,6 +23,7 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.exception.MessageException;
import java.io.Writer;
@@ -31,6 +32,7 @@
* Created by The eXo Platform SAS
* May 8, 2006
*/
+@Serialized
abstract public class UIApplication extends UIContainer
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -21,6 +21,7 @@
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIBreadcumbs.SelectPathActionListener;
@@ -28,6 +29,7 @@
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIForm;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -39,6 +41,7 @@
*
*/
@ComponentConfig(events = @EventConfig(listeners = SelectPathActionListener.class))
+@Serialized
public class UIBreadcumbs extends UIComponent
{
/**
@@ -129,7 +132,7 @@
}
}
- static public class LocalPath
+ static public class LocalPath implements Serializable
{
private String label_;
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -25,6 +25,7 @@
import org.exoplatform.web.application.URLBuilder;
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.Component;
import org.exoplatform.webui.core.renderers.ValueRenderer;
import org.exoplatform.webui.core.renderers.ValueRendererRegistry;
@@ -37,6 +38,7 @@
import java.util.List;
/** Created by The eXo Platform SAS May 7, 2006 */
+@Serialized
abstract public class UIComponent
{
@@ -50,12 +52,14 @@
private boolean rendered = true;
- transient protected UIComponent uiparent;
+ protected UIComponent uiparent;
- transient protected Component config;
+ private String configId;
- transient private ValueRendererRegistry rendererRegistry = new ValueRendererRegistry();
+ protected transient Component config;
+ private transient ValueRendererRegistry rendererRegistry = new ValueRendererRegistry();
+
public String getId()
{
return this.id;
@@ -164,6 +168,7 @@
public void setComponentConfig(String componentId, Component config) throws Exception
{
this.config = config;
+ this.configId = config.getId();
if (componentId == null || componentId.length() == 0)
{
componentId = config.getId();
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponentDecorator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponentDecorator.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponentDecorator.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.core;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.lifecycle.Lifecycle;
@@ -34,6 +35,7 @@
* The decorator of a component
*/
@ComponentConfig(lifecycle = UIComponentDecorator.UIComponentDecoratorLifecycle.class)
+@Serialized
public class UIComponentDecorator extends UIComponent
{
/**
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -21,6 +21,7 @@
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.lifecycle.UIContainerLifecycle;
import org.exoplatform.webui.event.Event;
@@ -31,6 +32,7 @@
/** Created by The eXo Platform SAS May 7, 2006 */
@ComponentConfig(lifecycle = UIContainerLifecycle.class)
+@Serialized
public class UIContainer extends UIComponent
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIGrid.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIGrid.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIGrid.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.core;
import org.exoplatform.util.ReflectionUtil;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import java.lang.reflect.Method;
@@ -33,6 +34,7 @@
* @see UIPageIterator
*/
@ComponentConfig(template = "system:/groovy/webui/core/UIGrid.gtmpl")
+@Serialized
public class UIGrid extends UIComponent
{
/** The page iterator */
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPageIterator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPageIterator.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPageIterator.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,7 +19,9 @@
package org.exoplatform.webui.core;
+import org.exoplatform.commons.utils.EmptySerializablePageList;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.event.Event;
@@ -32,12 +34,13 @@
*
*/
@ComponentConfig(template = "system:/groovy/webui/core/UIPageIterator.gtmpl", events = @EventConfig(listeners = UIPageIterator.ShowPageActionListener.class))
+@Serialized
public class UIPageIterator extends UIComponent
{
/**
* The list of pages
*/
- private PageList pageList_ = PageList.EMPTY_LIST;
+ private PageList pageList_ = EmptySerializablePageList.get();
public UIPageIterator()
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -21,6 +21,7 @@
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.event.Event;
@@ -39,6 +40,7 @@
* A component to display messages of different types, in a popup window
*/
@ComponentConfig(template = "system:/groovy/webui/core/UIPopupMessages.gtmpl", events = @EventConfig(listeners = UIPopupMessages.CloseActionListener.class))
+@Serialized
public class UIPopupMessages extends UIPopupWindow
{
/**
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupWindow.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupWindow.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupWindow.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.core;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.event.Event;
@@ -35,6 +36,7 @@
* A component that creates an empty popup window
*/
@ComponentConfig(template = "system:/groovy/webui/core/UIPopupWindow.gtmpl", events = @EventConfig(listeners = UIPopupWindow.CloseActionListener.class, name = "ClosePopup"))
+@Serialized
public class UIPopupWindow extends UIComponentDecorator
{
/**
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -21,10 +21,12 @@
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import java.io.Writer;
import java.util.Set;
+@Serialized
abstract public class UIPortletApplication extends UIApplication
{
private int minWidth = 300;
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UITree.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UITree.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UITree.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -21,6 +21,7 @@
import org.exoplatform.util.ReflectionUtil;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.event.Event;
@@ -40,6 +41,7 @@
* @see UIRightClickPopupMenu
*/
@ComponentConfig(template = "system:/groovy/webui/core/UITree.gtmpl", events = @EventConfig(listeners = UITree.ChangeNodeActionListener.class))
+@Serialized
public class UITree extends UIComponent
{
/**
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/model/SelectItemOption.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/model/SelectItemOption.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/model/SelectItemOption.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,6 +19,8 @@
package org.exoplatform.webui.core.model;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
+
/**
* Created by The eXo Platform SARL
* Author : Tuan Nguyen
@@ -30,7 +32,8 @@
* @see SelectItemCategory
* @see org.exoplatform.webui.form.UIFormInputItemSelector
*/
-public class SelectItemOption<T extends Object>
+@Serialized
+public class SelectItemOption<T>
{
/**
* The label of the item
@@ -57,6 +60,10 @@
*/
protected String description_;
+ public SelectItemOption()
+ {
+ }
+
public SelectItemOption(String label, T value, String icon)
{
this(label, value, "", icon);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -21,6 +21,7 @@
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.bean.BeanDataMapping;
import org.exoplatform.webui.bean.ReflectionDataMapping;
import org.exoplatform.webui.config.Event;
@@ -38,6 +39,7 @@
* minhdv81(a)yahoo.com
* Jun 6, 2006
*/
+@Serialized
public class UIForm extends UIContainer
{
@@ -53,7 +55,7 @@
private boolean multipart_ = false;
- private BeanDataMapping beanMapping = null;
+ private transient BeanDataMapping beanMapping = null;
public UIForm addUIFormInput(UIFormInput input)
{
@@ -151,14 +153,14 @@
public void invokeGetBindingBean(Object bean) throws Exception
{
if (beanMapping == null)
- beanMapping = new ReflectionDataMapping();
+ beanMapping = ReflectionDataMapping.getInstance();
beanMapping.mapField(this, bean);
}
public void invokeSetBindingBean(Object bean) throws Exception
{
if (beanMapping == null)
- beanMapping = new ReflectionDataMapping();
+ beanMapping = ReflectionDataMapping.getInstance();
beanMapping.mapBean(bean, this);
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import java.io.Writer;
@@ -28,6 +29,7 @@
* @param <T> The type of value that is expected
*/
@SuppressWarnings("hiding")
+@Serialized
public class UIFormCheckBoxInput<T> extends UIFormInputBase<T>
{
/**
@@ -42,6 +44,10 @@
private String componentEvent_ = null;
+ public UIFormCheckBoxInput()
+ {
+ }
+
@SuppressWarnings("unchecked")
public UIFormCheckBoxInput(String name, String bindingExpression, T value)
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormGrid.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormGrid.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormGrid.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.form;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.UIGrid;
@@ -29,6 +30,7 @@
* Jul 9, 2007
*/
@ComponentConfig(template = "system:/groovy/webui/core/UIGrid.gtmpl")
+@Serialized
public class UIFormGrid extends UIGrid
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.event.Event;
@@ -39,6 +40,7 @@
* The base class to create form elements.
* Extend it to create your own elements.
*/
+@Serialized
abstract public class UIFormInputBase<T> extends UIContainer implements UIFormInput<T>
{
@@ -97,6 +99,10 @@
setId(name);
}
+ protected UIFormInputBase()
+ {
+ }
+
public String getName()
{
return name;
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputContainer.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputContainer.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputContainer.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.form;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.form.validator.Validator;
@@ -34,6 +35,7 @@
*
* Represents an abstract container of elements, inside a form
*/
+@Serialized
abstract public class UIFormInputContainer<T> extends UIContainer implements UIFormInput<T>
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputInfo.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputInfo.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputInfo.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import java.io.Writer;
@@ -27,9 +28,14 @@
* Represents a info text element
*
*/
+@Serialized
public class UIFormInputInfo extends UIFormInputBase<String>
{
+ public UIFormInputInfo()
+ {
+ }
+
public UIFormInputInfo(String name, String bindingExpression, String value)
{
super(name, bindingExpression, String.class);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.bean.BeanDataMapping;
import org.exoplatform.webui.bean.ReflectionDataMapping;
import org.exoplatform.webui.core.UIComponent;
@@ -39,10 +40,11 @@
*
* Represents table containing several input fields
*/
+@Serialized
public class UIFormInputSet extends UIContainer
{
- private BeanDataMapping beanMapping = null;
+ private transient BeanDataMapping beanMapping = null;
private static String selectedCompId = "";
@@ -132,14 +134,14 @@
public void invokeGetBindingField(Object bean) throws Exception
{
if (beanMapping == null)
- beanMapping = new ReflectionDataMapping();
+ beanMapping = ReflectionDataMapping.getInstance();
beanMapping.mapField(this, bean);
}
public void invokeSetBindingField(Object bean) throws Exception
{
if (beanMapping == null)
- beanMapping = new ReflectionDataMapping();
+ beanMapping = ReflectionDataMapping.getInstance();
beanMapping.mapBean(bean, this);
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormPageIterator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormPageIterator.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormPageIterator.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -28,6 +28,7 @@
* Represents a multi page iterator
*/
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIComponent;
@@ -40,6 +41,7 @@
import java.util.List;
@ComponentConfig(template = "system:/groovy/webui/core/UIPageIterator.gtmpl", events = @EventConfig(listeners = UIFormPageIterator.ShowPageActionListener.class, phase = Phase.DECODE))
+@Serialized
public class UIFormPageIterator extends UIPageIterator implements UIFormInput<Object>
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormPopupWindow.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormPopupWindow.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormPopupWindow.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIComponent;
@@ -37,6 +38,7 @@
* Nov 20, 2006
*/
@ComponentConfig(template = "system:/groovy/webui/core/UIPopupWindow.gtmpl", events = @EventConfig(listeners = UIFormPopupWindow.CloseActionListener.class, name = "CloseFormPopup", phase = Phase.DECODE))
+@Serialized
public class UIFormPopupWindow extends UIPopupWindow implements UIFormInput<Object>
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormRadioBoxInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormRadioBoxInput.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormRadioBoxInput.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.model.SelectItemOption;
import java.io.Writer;
@@ -32,6 +33,7 @@
* Represents a radio box element
* The selected box value is stored in the value_ property of UIFormInputBase
*/
+@Serialized
public class UIFormRadioBoxInput extends UIFormInputBase<String>
{
@@ -51,6 +53,10 @@
private int topRender_ = 0;
+ public UIFormRadioBoxInput()
+ {
+ }
+
public UIFormRadioBoxInput(String name, String value)
{
this(name, value, new ArrayList<SelectItemOption<String>>());
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.model.SelectItemOption;
@@ -33,6 +34,7 @@
* Represents a select element
*
*/
+@Serialized
public class UIFormSelectBox extends UIFormStringInput
{
@@ -56,6 +58,10 @@
*/
private String onchange_;
+ public UIFormSelectBox()
+ {
+ }
+
public UIFormSelectBox(String name, String bindingExpression, List<SelectItemOption<String>> options)
{
super(name, bindingExpression, null);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormStringInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormStringInput.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormStringInput.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import java.io.Writer;
@@ -32,6 +33,7 @@
* Represents a input string field
* The value is stored in UIFormInputBase
*/
+@Serialized
public class UIFormStringInput extends UIFormInputBase<String>
{
/**
@@ -54,6 +56,10 @@
*/
private int maxLength = 0;
+ public UIFormStringInput()
+ {
+ }
+
public UIFormStringInput(String name, String bindingExpression, String value)
{
super(name, bindingExpression, String.class);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTableInputSet.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTableInputSet.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTableInputSet.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.UIComponent;
@@ -30,6 +31,7 @@
* May 7, 2006
*/
@ComponentConfig(template = "system:/groovy/webui/form/UIFormTableInputSet.gtmpl")
+@Serialized
public class UIFormTableInputSet extends UIFormInputSet
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTextAreaInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTextAreaInput.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTextAreaInput.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import java.io.Writer;
@@ -27,6 +28,7 @@
* Represents a textarea element
* The value is stored in UIFormInputBase
*/
+@Serialized
public class UIFormTextAreaInput extends UIFormInputBase<String>
{
/**
@@ -39,6 +41,10 @@
*/
private int columns = 30;
+ public UIFormTextAreaInput()
+ {
+ }
+
public UIFormTextAreaInput(String name, String bindingExpression, String value) {
super(name, bindingExpression, String.class);
this.value_ = value ;
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/IdentifierValidator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/IdentifierValidator.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/IdentifierValidator.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -25,6 +25,8 @@
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormInput;
+import java.io.Serializable;
+
/**
* Created by The eXo Platform SARL
* Author : Dang Van Minh
@@ -33,7 +35,7 @@
*
* Validates whether the value is composed of letters, numbers or '_'
*/
-public class IdentifierValidator implements Validator
+public class IdentifierValidator implements Validator, Serializable
{
public void validate(UIFormInput uiInput) throws Exception
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/MandatoryValidator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/MandatoryValidator.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/MandatoryValidator.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -25,6 +25,8 @@
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormInput;
+import java.io.Serializable;
+
/**
* Created by The eXo Platform SARL
* Author : Dang Van Minh
@@ -36,7 +38,7 @@
* is mandatory in your form, add it this validator. A '*' character will be automatically added
* during the rendering phase to specify the user
*/
-public class MandatoryValidator implements Validator
+public class MandatoryValidator implements Validator, Serializable
{
public void validate(UIFormInput uiInput) throws Exception
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/NameValidator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/NameValidator.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/NameValidator.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -25,6 +25,8 @@
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormInput;
+import java.io.Serializable;
+
/**
* Created by The eXo Platform SARL
* Author : Dang Van Minh
@@ -33,7 +35,7 @@
*
* Validates whether this value is composed of letters, numbers, '_', '-', '.' or '*'
*/
-public class NameValidator implements Validator
+public class NameValidator implements Validator, Serializable
{
public void validate(UIFormInput uiInput) throws Exception
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/StringLengthValidator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/StringLengthValidator.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/StringLengthValidator.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -25,6 +25,8 @@
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormInput;
+import java.io.Serializable;
+
/**
* Created by The eXo Platform SARL
* Author : Dang Van Minh
@@ -33,7 +35,7 @@
*
* Validates whether this value has a length between min and max
*/
-public class StringLengthValidator implements Validator
+public class StringLengthValidator implements Validator, Serializable
{
/**
* The minimum number of characters in this String
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/URLValidator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/URLValidator.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/URLValidator.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -25,13 +25,15 @@
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormInput;
+import java.io.Serializable;
+
/**
* Created by The eXo Platform SAS
* Author : Tan Pham Dinh
* pdtanit(a)gmail.com
* Oct 30, 2008
*/
-public class URLValidator implements Validator
+public class URLValidator implements Validator, Serializable
{
static private final String IP_REGEX =
Modified: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java
===================================================================
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -24,6 +24,7 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
import org.exoplatform.webui.config.annotation.EventConfig;
@@ -51,6 +52,7 @@
@EventConfig(phase = Phase.DECODE, listeners = UIGroupMembershipSelector.SelectPathActionListener.class)}),
@ComponentConfig(type = UITree.class, id = "UITreeGroupSelector", template = "system:/groovy/webui/core/UITree.gtmpl", events = @EventConfig(phase = Phase.DECODE, listeners = UITree.ChangeNodeActionListener.class)),
@ComponentConfig(type = UIBreadcumbs.class, id = "BreadcumbGroupSelector", template = "system:/groovy/webui/core/UIBreadcumbs.gtmpl", events = @EventConfig(phase = Phase.DECODE, listeners = UIBreadcumbs.SelectPathActionListener.class))})
+@Serialized
public class UIGroupMembershipSelector extends UIContainer
{
Modified: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIListPermissionSelector.java
===================================================================
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIListPermissionSelector.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIListPermissionSelector.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,16 +19,16 @@
package org.exoplatform.webui.organization;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import java.io.Serializable;
+import java.util.*;
import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.SerializablePageList;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserACL.Permission;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIBreadcumbs;
@@ -53,6 +53,7 @@
@EventConfig(phase = Phase.DECODE, listeners = UIListPermissionSelector.DeleteActionListener.class, confirm = "UIAccessGroup.deleteAccessGroup"),
@EventConfig(phase = Phase.DECODE, listeners = UIPermissionSelector.SelectMembershipActionListener.class),
@EventConfig(phase = Phase.DECODE, listeners = UIListPermissionSelector.ChangePublicModeActionListener.class)})
+@Serialized
public class UIListPermissionSelector extends UISelector<String[]>
{
private boolean publicMode_ = false;
@@ -65,7 +66,7 @@
uiGrid.setLabel("UIListPermissionSelector");
uiGrid.configure("expression", new String[]{"groupId", "membership"}, new String[]{"Delete"});
UIFormPageIterator uiIterator = (UIFormPageIterator)uiGrid.getUIPageIterator();
- uiIterator.setPageList(new LazyPageList(new PermissionListAccess(null), 10));
+ uiIterator.setPageList(new SerializablePageList(Permission.class, Collections.emptyList(), 10));
addChild(uiIterator);
uiIterator.setRendered(false);
UIFormPopupWindow uiPopup = addChild(UIFormPopupWindow.class, null, null);
@@ -131,7 +132,7 @@
public UIListPermissionSelector setValue(String[] permissions) throws Exception
{
- List<Object> list = new ArrayList<Object>();
+ List<Permission> list = new ArrayList<Permission>();
setPublicMode(false);
for (String exp : permissions)
{
@@ -155,7 +156,7 @@
list.add(permission);
}
UIPageIterator uiIterator = getChild(UIGrid.class).getUIPageIterator();
- uiIterator.setPageList(new LazyPageList(new AccessGroupListAccess(list), 10));
+ uiIterator.setPageList(new SerializablePageList(Permission.class, list, 10));
return this;
}
@@ -292,7 +293,7 @@
}
- static public class EmptyIteratorValidator implements Validator
+ static public class EmptyIteratorValidator implements Validator, Serializable
{
public void validate(UIFormInput uiInput) throws Exception
{
Modified: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UISelector.java
===================================================================
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UISelector.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UISelector.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.organization;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
@@ -31,6 +32,7 @@
* nhudinhthuan(a)exoplatform.com
* Jul 19, 2006
*/
+@Serialized
abstract class UISelector<T> extends UIFormInputContainer<T>
{
Added: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/LegacyPortalStateManager.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/LegacyPortalStateManager.java (rev 0)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/LegacyPortalStateManager.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.application;
+
+import org.exoplatform.commons.utils.Safe;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.SessionManagerContainer;
+import org.exoplatform.portal.config.UserPortalConfig;
+import org.exoplatform.portal.config.UserPortalConfigService;
+import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.webui.application.ConfigurationManager;
+import org.exoplatform.webui.application.StateManager;
+import org.exoplatform.webui.application.WebuiApplication;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.portlet.PortletRequestContext;
+import org.exoplatform.webui.core.UIApplication;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+public class LegacyPortalStateManager extends StateManager
+{
+
+ protected static Log log = ExoLogger.getLogger("portal:PortalStateManager");
+
+ /** ConcurrentMap<SessionId, HashMap<PortalName, PortalApplicationState>> * */
+ private ConcurrentMap<String, HashMap<String, PortalApplicationState>> uiApplications =
+ new ConcurrentHashMap<String, HashMap<String, PortalApplicationState>>();
+
+ /**
+ * This method is used to restore the UI component tree either the current request targets a portlet or the portal.
+ * <p/>
+ * In both cases, if the tree is not stored already it is created and then stored in a local Map
+ */
+ @SuppressWarnings("unchecked")
+ public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception
+ {
+ context.setStateManager(this);
+ WebuiApplication app = (WebuiApplication)context.getApplication();
+
+ /*
+ * If the request context is of type PortletRequestContext, we extract the parent context which will
+ * allow to get access to the PortalApplicationState object thanks to the session id used as the key for the
+ * synchronize Map uiApplications
+ */
+ if (context instanceof PortletRequestContext)
+ {
+ WebuiRequestContext preqContext = (WebuiRequestContext)context.getParentAppRequestContext();
+ PortletRequestContext pcontext = (PortletRequestContext)context;
+ String key = pcontext.getApplication().getApplicationId() + "/" + pcontext.getWindowId();
+ PortalApplicationState state = getApplicationState(preqContext);
+ UIApplication uiApplication = state.get(key);
+ if (uiApplication != null)
+ {
+ return uiApplication;
+ }
+ ConfigurationManager cmanager = app.getConfigurationManager();
+ String uirootClass = cmanager.getApplication().getUIRootComponent();
+ Class type = Thread.currentThread().getContextClassLoader().loadClass(uirootClass);
+ uiApplication = (UIApplication)app.createUIComponent(type, null, null, context);
+ state.put(key, uiApplication);
+ return uiApplication;
+ }
+
+ PortalRequestContext pcontext = (PortalRequestContext)context;
+ PortalApplicationState state = getApplicationState(pcontext);
+ if (state != null)
+ {
+ if (!Safe.equals(pcontext.getRemoteUser(), state.getUserName()))
+ {
+ clearSession(pcontext.getRequest().getSession());
+ state = null;
+ }
+ }
+ if (state == null)
+ {
+ ConfigurationManager cmanager = app.getConfigurationManager();
+ String uirootClass = cmanager.getApplication().getUIRootComponent();
+ Class type = Thread.currentThread().getContextClassLoader().loadClass(uirootClass);
+ UserPortalConfig config = getUserPortalConfig(pcontext);
+ if (config == null)
+ {
+ HttpServletResponse response = pcontext.getResponse();
+ // if(pcontext.getRemoteUser() == null) {
+ // String portalName = pcontext.getPortalOwner() ;
+ // portalName = URLEncoder.encode(portalName, "UTF-8") ;
+ // String redirect = pcontext.getRequest().getContextPath() + "/private/" + portalName + "/";
+ // response.sendRedirect(redirect);
+ // }
+ // else response.sendRedirect(pcontext.getRequest().getContextPath() + "/portal-unavailable.jsp");
+ response.sendRedirect(pcontext.getRequest().getContextPath() + "/portal-unavailable.jsp");
+ pcontext.setResponseComplete(true);
+ return null;
+ }
+ pcontext.setAttribute(UserPortalConfig.class, config);
+ UIPortalApplication uiApplication = (UIPortalApplication)app.createUIComponent(type, null, null, context);
+ state = new PortalApplicationState(uiApplication, pcontext.getRemoteUser());
+ cacheApplicationState(pcontext.getSessionId(), pcontext.getPortalOwner(), state);
+ SessionManagerContainer pcontainer = (SessionManagerContainer)app.getApplicationServiceContainer();
+ pcontainer.createSessionContainer(context.getSessionId(), uiApplication.getOwner());
+ }
+ return state.getUIPortalApplication();
+ }
+
+ @SuppressWarnings("unused")
+ public void storeUIRootComponent(WebuiRequestContext context)
+ {
+ }
+
+ public void expire(String sessionId, WebuiApplication app)
+ {
+ uiApplications.remove(sessionId);
+ SessionManagerContainer pcontainer = (SessionManagerContainer)app.getApplicationServiceContainer();
+ pcontainer.removeSessionContainer(sessionId);
+ }
+
+ private PortalApplicationState getApplicationState(WebuiRequestContext context)
+ {
+ PortalRequestContext portalContext = null;
+ if (context instanceof PortalRequestContext)
+ {
+ portalContext = (PortalRequestContext)context;
+ }
+ else
+ {
+ portalContext = (PortalRequestContext)context.getParentAppRequestContext();
+ }
+ String portalName = portalContext.getPortalOwner();
+ String sessionId = portalContext.getSessionId();
+
+ HashMap<String, PortalApplicationState> appStates = uiApplications.get(sessionId);
+ return (appStates == null) ? null : appStates.get(portalName);
+ }
+
+ private void cacheApplicationState(String sessionId, String portalName, PortalApplicationState state)
+ {
+ HashMap<String, PortalApplicationState> appStates = uiApplications.get(sessionId);
+ if (appStates == null)
+ {
+ appStates = new HashMap<String, PortalApplicationState>();
+ uiApplications.put(sessionId, appStates);
+ }
+ appStates.put(portalName, state);
+ }
+
+ private UserPortalConfig getUserPortalConfig(PortalRequestContext context) throws Exception
+ {
+ ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
+ UserPortalConfigService service_ =
+ (UserPortalConfigService)appContainer.getComponentInstanceOfType(UserPortalConfigService.class);
+ String remoteUser = context.getRemoteUser();
+ String ownerUser = context.getPortalOwner();
+ return service_.getUserPortalConfig(ownerUser, remoteUser);
+ }
+
+ private void clearSession(HttpSession session)
+ {
+ Enumeration<?> e = session.getAttributeNames();
+ while (e.hasMoreElements())
+ {
+ String name = (String)e.nextElement();
+ session.removeAttribute(name);
+ }
+ }
+
+ @SuppressWarnings("serial")
+ static public class PortalApplicationState extends HashMap<String, UIApplication>
+ {
+
+ private final UIPortalApplication uiPortalApplication_;
+
+ private final String userName_;
+
+ public PortalApplicationState(UIPortalApplication uiPortalApplication, String userName)
+ {
+ uiPortalApplication_ = uiPortalApplication;
+ userName_ = userName;
+ }
+
+ public String getUserName()
+ {
+ return userName_;
+ }
+
+ public UIPortalApplication getUIPortalApplication()
+ {
+ return uiPortalApplication_;
+ }
+ }
+}
\ No newline at end of file
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -110,6 +110,9 @@
if (uiApp != null)
uiApp.setLastAccessApplication(System.currentTimeMillis());
+
+ // Store ui root
+ app.getStateManager().storeUIRootComponent(context);
}
catch (Exception ex)
{
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStateManager.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStateManager.java 2010-01-18 12:02:11 UTC (rev 1347)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStateManager.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -19,195 +19,48 @@
package org.exoplatform.portal.application;
-import org.exoplatform.commons.utils.Safe;
import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.SessionManagerContainer;
-import org.exoplatform.portal.config.UserPortalConfig;
-import org.exoplatform.portal.config.UserPortalConfigService;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.webui.application.ConfigurationManager;
import org.exoplatform.webui.application.StateManager;
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.core.UIApplication;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
public class PortalStateManager extends StateManager
{
- protected static Log log = ExoLogger.getLogger("portal:PortalStateManager");
+ /** . */
+ private final StateManager impl;
- /** ConcurrentMap<SessionId, HashMap<PortalName, PortalApplicationState>> * */
- private ConcurrentMap<String, HashMap<String, PortalApplicationState>> uiApplications =
- new ConcurrentHashMap<String, HashMap<String, PortalApplicationState>>();
-
- /**
- * This method is used to restore the UI component tree either the current request targets a portlet or the portal.
- * <p/>
- * In both cases, if the tree is not stored already it is created and then stored in a local Map
- */
- @SuppressWarnings("unchecked")
- public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception
+ public PortalStateManager()
{
- context.setStateManager(this);
- WebuiApplication app = (WebuiApplication)context.getApplication();
+ boolean clustered = ExoContainer.getProfiles().contains("cluster");
- /*
- * If the request context is of type PortletRequestContext, we extract the parent context which will
- * allow to get access to the PortalApplicationState object thanks to the session id used as the key for the
- * synchronize Map uiApplications
- */
- if (context instanceof PortletRequestContext)
+ //
+ if (clustered)
{
- WebuiRequestContext preqContext = (WebuiRequestContext)context.getParentAppRequestContext();
- PortletRequestContext pcontext = (PortletRequestContext)context;
- String key = pcontext.getApplication().getApplicationId() + "/" + pcontext.getWindowId();
- PortalApplicationState state = getApplicationState(preqContext);
- UIApplication uiApplication = state.get(key);
- if (uiApplication != null)
- {
- return uiApplication;
- }
- ConfigurationManager cmanager = app.getConfigurationManager();
- String uirootClass = cmanager.getApplication().getUIRootComponent();
- Class type = Thread.currentThread().getContextClassLoader().loadClass(uirootClass);
- uiApplication = (UIApplication)app.createUIComponent(type, null, null, context);
- state.put(key, uiApplication);
- return uiApplication;
+ impl = new ReplicatingStateManager();
}
-
- PortalRequestContext pcontext = (PortalRequestContext)context;
- PortalApplicationState state = getApplicationState(pcontext);
- if (state != null)
- {
- if (!Safe.equals(pcontext.getRemoteUser(), state.getUserName()))
- {
- clearSession(pcontext.getRequest().getSession());
- state = null;
- }
- }
- if (state == null)
- {
- ConfigurationManager cmanager = app.getConfigurationManager();
- String uirootClass = cmanager.getApplication().getUIRootComponent();
- Class type = Thread.currentThread().getContextClassLoader().loadClass(uirootClass);
- UserPortalConfig config = getUserPortalConfig(pcontext);
- if (config == null)
- {
- HttpServletResponse response = pcontext.getResponse();
- // if(pcontext.getRemoteUser() == null) {
- // String portalName = pcontext.getPortalOwner() ;
- // portalName = URLEncoder.encode(portalName, "UTF-8") ;
- // String redirect = pcontext.getRequest().getContextPath() + "/private/" + portalName + "/";
- // response.sendRedirect(redirect);
- // }
- // else response.sendRedirect(pcontext.getRequest().getContextPath() + "/portal-unavailable.jsp");
- response.sendRedirect(pcontext.getRequest().getContextPath() + "/portal-unavailable.jsp");
- pcontext.setResponseComplete(true);
- return null;
- }
- pcontext.setAttribute(UserPortalConfig.class, config);
- UIPortalApplication uiApplication = (UIPortalApplication)app.createUIComponent(type, null, null, context);
- state = new PortalApplicationState(uiApplication, pcontext.getRemoteUser());
- cacheApplicationState(pcontext.getSessionId(), pcontext.getPortalOwner(), state);
- SessionManagerContainer pcontainer = (SessionManagerContainer)app.getApplicationServiceContainer();
- pcontainer.createSessionContainer(context.getSessionId(), uiApplication.getOwner());
- }
- return state.getUIPortalApplication();
- }
-
- @SuppressWarnings("unused")
- public void storeUIRootComponent(WebuiRequestContext context)
- {
- }
-
- public void expire(String sessionId, WebuiApplication app)
- {
- uiApplications.remove(sessionId);
- SessionManagerContainer pcontainer = (SessionManagerContainer)app.getApplicationServiceContainer();
- pcontainer.removeSessionContainer(sessionId);
- }
-
- private PortalApplicationState getApplicationState(WebuiRequestContext context)
- {
- PortalRequestContext portalContext = null;
- if (context instanceof PortalRequestContext)
- {
- portalContext = (PortalRequestContext)context;
- }
else
{
- portalContext = (PortalRequestContext)context.getParentAppRequestContext();
+ impl = new LegacyPortalStateManager();
}
- String portalName = portalContext.getPortalOwner();
- String sessionId = portalContext.getSessionId();
-
- HashMap<String, PortalApplicationState> appStates = uiApplications.get(sessionId);
- return (appStates == null) ? null : appStates.get(portalName);
}
- private void cacheApplicationState(String sessionId, String portalName, PortalApplicationState state)
+ @Override
+ public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception
{
- HashMap<String, PortalApplicationState> appStates = uiApplications.get(sessionId);
- if (appStates == null)
- {
- appStates = new HashMap<String, PortalApplicationState>();
- uiApplications.put(sessionId, appStates);
- }
- appStates.put(portalName, state);
+ return impl.restoreUIRootComponent(context);
}
- private UserPortalConfig getUserPortalConfig(PortalRequestContext context) throws Exception
+ @Override
+ public void storeUIRootComponent(WebuiRequestContext context) throws Exception
{
- ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
- UserPortalConfigService service_ =
- (UserPortalConfigService)appContainer.getComponentInstanceOfType(UserPortalConfigService.class);
- String remoteUser = context.getRemoteUser();
- String ownerUser = context.getPortalOwner();
- return service_.getUserPortalConfig(ownerUser, remoteUser);
+ impl.storeUIRootComponent(context);
}
- private void clearSession(HttpSession session)
+ @Override
+ public void expire(String sessionId, WebuiApplication app) throws Exception
{
- Enumeration<?> e = session.getAttributeNames();
- while (e.hasMoreElements())
- {
- String name = (String)e.nextElement();
- session.removeAttribute(name);
- }
+ impl.expire(sessionId, app);
}
-
- @SuppressWarnings("serial")
- static public class PortalApplicationState extends HashMap<String, UIApplication>
- {
-
- private final UIPortalApplication uiPortalApplication_;
-
- private final String userName_;
-
- public PortalApplicationState(UIPortalApplication uiPortalApplication, String userName)
- {
- uiPortalApplication_ = uiPortalApplication;
- userName_ = userName;
- }
-
- public String getUserName()
- {
- return userName_;
- }
-
- public UIPortalApplication getUIPortalApplication()
- {
- return uiPortalApplication_;
- }
- }
}
\ No newline at end of file
Copied: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ReplicatingStateManager.java (from rev 1253, portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicatingStateManager.java)
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ReplicatingStateManager.java (rev 0)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ReplicatingStateManager.java 2010-01-18 12:31:08 UTC (rev 1348)
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.application;
+
+import org.exoplatform.commons.utils.LazyList;
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.portal.config.UserPortalConfig;
+import org.exoplatform.portal.config.UserPortalConfigService;
+import org.exoplatform.webui.Util;
+import org.exoplatform.webui.application.ConfigurationManager;
+import org.exoplatform.webui.application.StateManager;
+import org.exoplatform.webui.application.WebuiApplication;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.portlet.PortletRequestContext;
+import org.exoplatform.webui.application.replication.SerializationContext;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
+import org.exoplatform.webui.application.replication.api.factory.CreateException;
+import org.exoplatform.webui.application.replication.api.factory.ObjectFactory;
+import org.exoplatform.webui.application.replication.model.FieldModel;
+import org.exoplatform.webui.application.replication.model.TypeDomain;
+import org.exoplatform.webui.application.replication.model.metadata.DomainMetaData;
+import org.exoplatform.webui.application.replication.serial.ObjectWriter;
+import org.exoplatform.webui.config.Component;
+import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.UIComponent;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.ByteArrayOutputStream;
+import java.util.Map;
+
+/**
+ * The basis is either {@link org.exoplatform.webui.core.UIPortletApplication} or
+ * {@link org.exoplatform.portal.webui.workspace.UIPortalApplication}.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ReplicatingStateManager extends StateManager
+{
+
+ @Override
+ public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception
+ {
+ context.setStateManager(this);
+
+ //
+ WebuiApplication app = (WebuiApplication)context.getApplication();
+
+ //
+ HttpSession session = getSession(context);
+ String key = getKey(context);
+
+ //
+ UIApplication uiapp = (UIApplication)session.getAttribute("bilto_" + key);
+
+ // Looks like some necessary hacking
+ if (context instanceof PortalRequestContext)
+ {
+ PortalRequestContext portalRC = (PortalRequestContext)context;
+ UserPortalConfig config = getUserPortalConfig(portalRC);
+ if (config == null)
+ {
+ HttpServletResponse response = portalRC.getResponse();
+ response.sendRedirect(portalRC.getRequest().getContextPath() + "/portal-unavailable.jsp");
+ portalRC.setResponseComplete(true);
+ return null;
+ }
+ portalRC.setAttribute(UserPortalConfig.class, config);
+// SessionManagerContainer pcontainer = (SessionManagerContainer)app.getApplicationServiceContainer();
+// pcontainer.createSessionContainer(context.getSessionId(), uiapp.getOwner());
+ }
+
+ //
+ if (uiapp == null)
+ {
+ ConfigurationManager cmanager = app.getConfigurationManager();
+ String uirootClass = cmanager.getApplication().getUIRootComponent();
+ Class<? extends UIApplication> type = (Class<UIApplication>) Thread.currentThread().getContextClassLoader().loadClass(uirootClass);
+ uiapp = app.createUIComponent(type, null, null, context);
+ }
+
+ //
+ return uiapp;
+ }
+
+ @Override
+ public void storeUIRootComponent(final WebuiRequestContext context) throws Exception
+ {
+ UIApplication uiapp = context.getUIApplication();
+
+ //
+ HttpSession session = getSession(context);
+
+ //
+ Class<? extends UIApplication> appClass = uiapp.getClass();
+ if (appClass.getAnnotation(Serialized.class) != null)
+ {
+ try
+ {
+ DomainMetaData domainMetaData = new DomainMetaData();
+/*
+ domainMetaData.addClassType(PageList.class, true);
+ domainMetaData.addClassType(LazyPageList.class, true);
+ domainMetaData.addClassType(LazyList.class, true);
+ domainMetaData.addClassType(LazyList.class.getName() + "$Batch", true);
+*/
+
+ //
+ SerializationContext serializationContext = (SerializationContext)session.getAttribute("SerializationContext");
+ if (serializationContext == null)
+ {
+ TypeDomain domain = new TypeDomain(domainMetaData, true);
+ serializationContext = new SerializationContext(domain);
+ session.setAttribute("SerializationContext", serializationContext);
+ ObjectFactory<UIComponent> factory = new ObjectFactory<UIComponent>()
+ {
+
+ private <S extends UIComponent> Object getFieldValue(String fieldName, Map<FieldModel<? super S, ?>, ?> state)
+ {
+ for (Map.Entry<FieldModel<? super S, ?>, ?> entry : state.entrySet())
+ {
+ FieldModel<? super S, ?> fieldModel = entry.getKey();
+ if (fieldModel.getOwner().getJavaType() == UIComponent.class && fieldModel.getName().equals(fieldName))
+ {
+ return entry.getValue();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public <S extends UIComponent> S create(Class<S> type, Map<FieldModel<? super S, ?>, ?> state) throws CreateException
+ {
+ // Get config id
+ String configId = (String)getFieldValue("configId", state);
+ String id = (String)getFieldValue("id", state);
+
+ //
+ try
+ {
+ WebuiApplication webuiApp = (WebuiApplication) context.getApplication();
+ ConfigurationManager configMgr = webuiApp.getConfigurationManager();
+ Component config = configMgr.getComponentConfig(type, configId);
+
+ //
+ S instance;
+ if (config != null)
+ {
+ instance = Util.createObject(type, config.getInitParams());
+ instance.setComponentConfig(id, config);
+ }
+ else
+ {
+ instance = Util.createObject(type, null);
+ instance.setId(id);
+ }
+
+ // Now set state
+ for (Map.Entry<FieldModel<? super S, ?>, ?> entry : state.entrySet())
+ {
+ FieldModel<? super S, ?> fieldModel = entry.getKey();
+ Object value = entry.getValue();
+ fieldModel.castAndSet(instance, value);
+ }
+
+ //
+ return instance;
+ }
+ catch (Exception e)
+ {
+ throw new CreateException(e);
+ }
+ }
+ };
+ serializationContext.addFactory(factory);
+ }
+
+ //
+
+ //
+ uiapp = serializationContext.clone(uiapp);
+ System.out.println("Cloned application");
+ }
+ catch (Exception e)
+ {
+ System.out.println("Could not clone application");
+ e.printStackTrace();
+ }
+ }
+
+
+ //
+ String key = getKey(context);
+ session.setAttribute("bilto_" + key, uiapp);
+ }
+
+ @Override
+ public void expire(String sessionId, WebuiApplication app) throws Exception
+ {
+ // For now do nothing....
+ }
+
+ private UserPortalConfig getUserPortalConfig(PortalRequestContext context) throws Exception
+ {
+ ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
+ UserPortalConfigService service_ = (UserPortalConfigService)appContainer.getComponentInstanceOfType(UserPortalConfigService.class);
+ String remoteUser = context.getRemoteUser();
+ String ownerUser = context.getPortalOwner();
+ return service_.getUserPortalConfig(ownerUser, remoteUser);
+ }
+
+ private String getKey(WebuiRequestContext webuiRC)
+ {
+ if (webuiRC instanceof PortletRequestContext)
+ {
+ PortletRequestContext portletRC = (PortletRequestContext)webuiRC;
+ return portletRC.getApplication().getApplicationId() + "/" + portletRC.getWindowId();
+ }
+ else
+ {
+ PortalRequestContext portalRC = (PortalRequestContext)webuiRC;
+ return "portal";
+ }
+ }
+
+ private HttpSession getSession(WebuiRequestContext webuiRC)
+ {
+ if (webuiRC instanceof PortletRequestContext)
+ {
+ PortletRequestContext portletRC = (PortletRequestContext)webuiRC;
+ PortalRequestContext portalRC = (PortalRequestContext) portletRC.getParentAppRequestContext();
+ HttpServletRequest req = portalRC.getRequest();
+ return req.getSession();
+ }
+ else
+ {
+ PortalRequestContext portalRC = (PortalRequestContext)webuiRC;
+ HttpServletRequest req = portalRC.getRequest();
+ return req.getSession();
+ }
+ }
+}
14 years, 11 months
gatein SVN: r1347 - in portal/trunk: portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web and 3 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-18 07:02:11 -0500 (Mon, 18 Jan 2010)
New Revision: 1347
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/AccountPortlet_it.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_it.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/StarToolbarPortlet_it.properties
portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_it.properties
portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/LogoPortlet_it.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_it.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/guests_it.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties
Log:
GTNPORTAL-496: Translation in Italian
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/AccountPortlet_it.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/AccountPortlet_it.properties 2010-01-18 10:43:15 UTC (rev 1346)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/AccountPortlet_it.properties 2010-01-18 12:02:11 UTC (rev 1347)
@@ -51,7 +51,7 @@
UIAccountForm.label.option.male=Maschio
UIAccountForm.label.option.female=Femmina
-UIAccountForm.label.HomeInfo=Informazioni della Home
+UIAccountForm.label.HomeInfo=Informazioni principali
UIAccountForm.label.user.name.given=#{word.givenName}:
UIAccountForm.label.user.name.family=#{word.familyName}:
UIAccountForm.label.user.name.nickName=#{word.nickName}:
@@ -60,7 +60,7 @@
UIAccountForm.label.user.employer=#{word.employer}:
UIAccountForm.label.user.department=#{word.department}:
UIAccountForm.label.user.jobtitle=#{word.jobTitle}:
-UIAccountForm.label.user.language=Linguaggio
+UIAccountForm.label.user.language=Lingua
UIAccountForm.label.user.home-info.postal.name=#:
UIAccountForm.label.user.home-info.postal.street=#{word.street}:
UIAccountForm.label.user.home-info.postal.city=#{word.city}:
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_it.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_it.properties 2010-01-18 10:43:15 UTC (rev 1346)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_it.properties 2010-01-18 12:02:11 UTC (rev 1347)
@@ -24,43 +24,43 @@
##org.exoplatform.organization.webui.component.UIMembershipTypeForm
-UIMembershipTypeForm.title=Add/Edit Membership
-UIMembershipTypeForm.label.name=Membership name
-UIMembershipTypeForm.label.description=Description
+UIMembershipTypeForm.title=Aggiungi/Modifica Membership
+UIMembershipTypeForm.label.name=Nome del Membership
+UIMembershipTypeForm.label.description=Descrizione
UIMembershipTypeForm.action.Save=#{word.save}
UIMembershipTypeForm.action.Back=#{word.back}
-UIMembershipTypeForm.action.Reset=Reset
-UIMembershipTypeForm.msg.SameName=This membership already exists, please enter another one
-UIMembershipTypeForm.msg.MembershipNotExist= Membership [{0}] is not exist or has been deleted.
+UIMembershipTypeForm.action.Reset=Azzera
+UIMembershipTypeForm.msg.SameName=Il membership esiste gi\u00E0, inseriscine un'altro
+UIMembershipTypeForm.msg.MembershipNotExist= Il membership [{0}] non esiste o \u00E8 stato cancellato.
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
-UIGroupEditMembershipForm.label.username=User Name
+UIGroupEditMembershipForm.label.username=Nome Utente
UIGroupEditMembershipForm.label.membership=Membership
-UIGroupEditMembershipForm.action.Save=Save
-UIGroupEditMembershipForm.action.Cancel=Cancel
-UIGroupEditMembershipForm.msg.membership-delete=Can't save, membership removed!.
-UIGroupEditMembershipForm.msg.membership-exist="Membership type already exists, please enter another one.
-EditMembership.title.UIGroupEditMembershipForm=Edit Membership
-EditMembership.title.EditMembership=Edit Membership
-UIGroupMembershipForm.label.title=Group Membership
-UIGroupMembershipForm.label.username=Username
+UIGroupEditMembershipForm.action.Save=Salva
+UIGroupEditMembershipForm.action.Cancel=Annulla
+UIGroupEditMembershipForm.msg.membership-delete=Non posso salvare, il membership \u00E8 stato rimosso!.
+UIGroupEditMembershipForm.msg.membership-exist="Il tipo di membership esiste gi\u00E0, inseriscine un'altro.
+EditMembership.title.UIGroupEditMembershipForm=Modifica il Membership
+EditMembership.title.EditMembership=Modifica il Membership
+UIGroupMembershipForm.label.title=Membership del Gruppo
+UIGroupMembershipForm.label.username=Nome utente
UIGroupMembershipForm.label.membership=Membership
UIGroupMembershipForm.action.Save=#{word.save}
SearchUserForm.label.option.userName=#{word.userName}
SearchUserForm.label.option.firstName=#{word.firstName}
SearchUserForm.label.option.lastName=#{word.lastName}
SearchUserForm.label.option.email=#{word.email}
-SearchUser.title.UIUserSelector=Select User
-SearchUser.title.SearchUser=Select User
+SearchUser.title.UIUserSelector=Seleziona l'Utente
+SearchUser.title.SearchUser=Seleziona l'Utente
#{0} is the member that the remote memeber enter
-UIMemberShipForm.msg.membershipType-exist=The membership type '{0}' is taken
+UIMemberShipForm.msg.membershipType-exist=Il tipo di membership '{0}' \u00E8 stato preso
##org.exoplatform.organization.webui.component.UIMembershipForm
-UIMembershipForm.label.username=User Name
+UIMembershipForm.label.username=Nome Utente
UIMembershipForm.label.membership=Membership
UIMembershipForm.action.Save=#{word.save}
UIMembershipForm.action.Back=#{word.back}
-UIMembershipForm.label.name=Membership Name
+UIMembershipForm.label.name=Nome del Membership
UIMembershipForm.label.description=#{word.description}
##org.exoplatform.organization.webui.component.UIListUser
@@ -69,43 +69,43 @@
UIListUsers.header.firstName=#{word.firstName}
UIListUsers.header.email=#{word.email}
-UIListUsers.action.title.DeleteUser=Delete User
-UIListUsers.action.title.SelectUser=Select User
-UIListUsers.action.title.ViewUserInfo=Edit User Info
-SearchUser.title.ListUserForSearch=Search User
+UIListUsers.action.title.DeleteUser=Cancella l'Utente
+UIListUsers.action.title.SelectUser=Seleziona l'Utente
+UIListUsers.action.title.ViewUserInfo=Modifica le Informazioni dell'Utente
+SearchUser.title.ListUserForSearch=Cerca l'Utente
UIListUsers.header.action=#{word.action}
UIListUsers.label.option.userName=#{word.userName}
UIListUsers.label.option.firstName=#{word.firstName}
UIListUsers.label.option.lastName=#{word.lastName}
UIListUsers.label.option.email=#{word.email}
-UIListUsers.msg.DeleteSuperUser={0} is Super User, it can not be deleted
-UIListUsers.deleteUser=Are you sure you want to delete {0} user?
+UIListUsers.msg.DeleteSuperUser={0} \u00E8 un Super Utente, non pu\u00F2 essere cancellato
+UIListUsers.deleteUser=Sicuro di voler cancellare l'utente {0}?
-UIListMembershipType.deleteMemberShip=Are you sure you want to delete this membership?
+UIListMembershipType.deleteMemberShip=Sicuro di voler cancellare il membership?
##org.exoplatform.organization.webui.component.UIUserInfo
-UIUserInfo.title=User Profile Info
-UIUserInfo.tab.label.AccountInputSet=Account Info
-UIUserInfo.tab.label.UIUserProfileInputSet=User Profile
-UIUserInfo.tab.label.UIUserMembershipSelector=User Membership
-UIUserInfo.tab.label.UIAccountEditInputSet=Account Info
+UIUserInfo.title=Informazioni sul Profilo Utente
+UIUserInfo.tab.label.AccountInputSet=Informazioni sull'Account
+UIUserInfo.tab.label.UIUserProfileInputSet=Profilo Utente
+UIUserInfo.tab.label.UIUserMembershipSelector=Membership dell'Utente
+UIUserInfo.tab.label.UIAccountEditInputSet=Informazioni sull'Account
-UIUserInfo.label.changePassword=Change Password:
-UIUserInfo.label.newPassword=New Password:
-UIUserInfo.label.confirmPassword=Confirm Password:
+UIUserInfo.label.changePassword=Cambia Password:
+UIUserInfo.label.newPassword=Nuova Password:
+UIUserInfo.label.confirmPassword=Conferma Password:
-UIUserInfo.label.Profile=User Profile
+UIUserInfo.label.Profile=Profilo Utente
UIUserInfo.label.userName=#{word.userName}:
UIUserInfo.label.password=Password :
-UIUserInfo.label.Confirmpassword=Confirm Password :
+UIUserInfo.label.Confirmpassword=Conferma Password :
UIUserInfo.label.firstName=#{word.firstName}:
UIUserInfo.label.lastName=#{word.lastName}:
-UIUserInfo.label.email=Email Address:
-UIUserInfo.label.user.language: Language
+UIUserInfo.label.email=Indirizzo Email:
+UIUserInfo.label.user.language: Lingua
UIUserInfo.action.Back=#{word.cancel}
UIUserInfo.action.Save=#{word.save}
-UIUserInfo.label.HomeInfo=Home Informations
+UIUserInfo.label.HomeInfo=Informazioni Principali
UIUserInfo.label.user.language=#{word.language}:
UIUserInfo.label.user.name.given=#{word.givenName}:
UIUserInfo.label.user.name.family=#{word.familyName}:
@@ -124,21 +124,21 @@
UIUserInfo.label.user.home-info.telecom.mobile.number=#{word.mobile}:
UIUserInfo.label.user.home-info.telecom.telephone.number=#{word.tel}:
UIUserInfo.label.user.home-info.online.email=#{word.email}:
-UIUserInfo.label.user.home-info.online.uri=Website:
-UIUserInfo.label.option.male=Male
-UIUserInfo.label.option.female=Female
-UIUserInfo.label.option.en=English
+UIUserInfo.label.user.home-info.online.uri=Sito Web:
+UIUserInfo.label.option.male=Maschio
+UIUserInfo.label.option.female=Femmina
+UIUserInfo.label.option.en=Inglese
UIUserInfo.label.option.ma=Ma
-UIUserInfo.label.option.vi=Vietnamese
-UIUserInfo.label.option.ar=Arabic
-UIUserInfo.label.option.fr=French
-UIUserInfo.label.option.ru=Russian
+UIUserInfo.label.option.vi=Vietnamita
+UIUserInfo.label.option.ar=Arabo
+UIUserInfo.label.option.fr=Francese
+UIUserInfo.label.option.ru=Russo
-UIUserInfo.label.BusinessInfo=Business Informations
+UIUserInfo.label.BusinessInfo=Informazioni di Business
UIUserInfo.label.user.business-info.postal.name=#:
UIUserInfo.label.user.business-info.postal.city=#{word.city}:
-UIUserInfo.label.user.business-info.postal.stateprov=State/Prov:
-UIUserInfo.label.user.business-info.postal.postalcode=Postal Code:
+UIUserInfo.label.user.business-info.postal.stateprov=Citt\u00E0/Prov:
+UIUserInfo.label.user.business-info.postal.postalcode=Codice Postale:
UIUserInfo.label.user.business-info.postal.country=#{word.country}:
UIUserInfo.label.user.business-info.telecom.mobile.number=#{word.mobile}:
UIUserInfo.label.user.business-info.telecom.telephone.number=#{word.tel}:
@@ -146,50 +146,50 @@
UIUserInfo.label.user.business-info.online.uri=#{word.website}:
##org.exoplatform.organization.webui.component.UIUserInGroup
-UIUserInGroup.confirm.deleteUser=Are you sure you want to delete user {0} from group {1}?
+UIUserInGroup.confirm.deleteUser=Sicuro di voler cancellare l'utente {0} dal gruppo {1}?
UIUserInGroup.header.userName=#{word.userName}
UIUserInGroup.header.lastName=#{word.lastName}
UIUserInGroup.header.firstName=#{word.firstName}
UIUserInGroup.header.email=#{word.email}
UIUserInGroup.header.action=#{word.action}
-UIUserInGroup.header.membershipType=Membership Type
-UIUserInGroup.header.lastLoginTime=Last Login
+UIUserInGroup.header.membershipType=Tipo di Membership
+UIUserInGroup.header.lastLoginTime=Ultimo accesso
UIUserInGroup.label.username=#{word.userName}
-UIUserInGroup.label.membership=Membership name
-UIUserInGroup.action.title.DeleteUser=Delete member
-UIUserInGroup.action.title.Edit=Edit member
+UIUserInGroup.label.membership=Nome del membership
+UIUserInGroup.action.title.DeleteUser=Cancella l'utente
+UIUserInGroup.action.title.Edit=Modifica l'utente
##org.exoplatform.organization.webui.component.UIGroupInfo
-UIGroupInfo.tab.label.UIUserInGroup=User In Group
+UIGroupInfo.tab.label.UIUserInGroup=Utente Nel Gruppo
UIGroupInfo.label.UIUserInGroup=
-UIGroupInfo.title=Group Info
+UIGroupInfo.title=Informazioni sul Gruppo
##org.exoplatform.organization.webui.component.UIMembershipList
-UIMembershipList.header.name=Membership name
-UIMembershipList.header.createdDate=Created date
-UIMembershipList.header.modifiedDate=Modified date
+UIMembershipList.header.name=Nome del membership
+UIMembershipList.header.createdDate=Data di creazione
+UIMembershipList.header.modifiedDate=Data di modifica
UIMembershipList.header.action=#{word.action}
UIMembershipList.header.description=#{word.description}
-UIMembershipList.action.title.EditMembership=Edit Membership
-UIMembershipList.action.title.DeleteMembership=Delete Membership
-UIMembershipList.msg.InUse=You can not delete this membership because it is in use
-UIMembershipList.msg.DeleteMandatory=You can not delete this membership because it is mandatory
+UIMembershipList.action.title.EditMembership=Modifica il Membership
+UIMembershipList.action.title.DeleteMembership=Elimina il Membership
+UIMembershipList.msg.InUse=Non puoi eliminare il membership perch\u00E8 \u00E8 gi\u00E0 in uso
+UIMembershipList.msg.DeleteMandatory=Non puoi eliminare il membership perch\u00E8 \u00E8 obbligatorio
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
-UIGroupMembershipForm.title=Add member
-UIGroupMembershipForm.label.username=User Name
+UIGroupMembershipForm.title=Aggiungi utenza
+UIGroupMembershipForm.label.username=Nome Utente
UIGroupMembershipForm.label.membership=Membership
-UIGroupMembershipForm.label.SearchUser=Select User
-UIGroupMembershipForm.label.Refresh=Refresh
+UIGroupMembershipForm.label.SearchUser=Seleziona l'Utente
+UIGroupMembershipForm.label.Refresh=Aggiorna
UIGroupMembershipForm.action.Save=#{word.save}
-UIUserMembershipSelector.deleteMembership=Are you sure you want to delete this membership?
+UIUserMembershipSelector.deleteMembership=Sicuro di voler eliminare il membership?
##org.exoplatform.organization.webui.component.UIGroupForm
-AddGroup.title=Add New Group
-EditGroup.title=Edit Current Group
-UIGroupForm.label.groupName=Group Name
-UIGroupForm.label.description=Description
-UIGroupForm.label.label=Label
+AddGroup.title=Aggiungi un Nuovo Gruppo
+EditGroup.title=Modifica il Gruppo Corrente
+UIGroupForm.label.groupName=Nome del Gruppo
+UIGroupForm.label.description=Descrizione
+UIGroupForm.label.label=Etichetta
AddGroup.action.Save=#{word.save}
AddGroup.action.Back=#{word.cancel}
@@ -197,61 +197,61 @@
EditGroup.action.Save=#{word.save}
EditGroup.action.Back=#{word.cancel}
-UIGroupForm.msg.group-exist=This group name ialready exists, please enter another one
-UIGroupForm.msg.group-not-exist=Group "{0}" doesn't exist or has been deleted.
+UIGroupForm.msg.group-exist=Il gruppo esiste gi\u00E0, inseriscine un altro
+UIGroupForm.msg.group-not-exist=Il gruppo "{0}" non esiste o \u00E8 stato eliminato.
############################################################################
# org.exoplatform.portal.component.customization.UIShareNavigationForm #
############################################################################
-UITabPane.title.UISharedNavigationForm=Shared Navigation
+UITabPane.title.UISharedNavigationForm=Navigazione Condivisa
UISharedNavigationForm.action.Save=#{word.save}
UISharedNavigationForm.action.Back=#{word.back}
-UISharedNavigationForm.action.Remove=Remove
+UISharedNavigationForm.action.Remove=Elimina
-UISharedNavigationForm.label.navigation=Navigation
-UISharedNavigationForm.label.description=Description
-UISharedNavigation.msg.notSelected=You must select a group!
-UISharedNavigationForm.tab.label.SharedNavigation=Shared Navigation Setting
+UISharedNavigationForm.label.navigation=Navigazione
+UISharedNavigationForm.label.description=Descrizione
+UISharedNavigation.msg.notSelected=Devi selezionare un gruppo!
+UISharedNavigationForm.tab.label.SharedNavigation=Preferenze della Navigazione Condivisa
UISharedNavigationForm.label.membership=Membership
-UISharedNavigationForm.tab.label.Permission=Permission Selector
-UISharedNavigationForm.label.priority=Priority
-UISharedNavigationForm.msg.user-nonexist=User "{0}" is not exist
+UISharedNavigationForm.tab.label.Permission=Selettore del Permesso
+UISharedNavigationForm.label.priority=Priorit\u00E0
+UISharedNavigationForm.msg.user-nonexist=L'utente "{0}" non esiste
#############################################################################
# org.exoplatform.portal.component.customization.UISharePortalForm#
#############################################################################
-UITabPane.title.UISharedPortalForm=Shared Portal
+UITabPane.title.UISharedPortalForm=Portale Condiviso
UISharedPortalForm.action.Save=#{word.save}
UISharedPortalForm.action.Back=#{word.back}
-UISharedPortalForm.action.Remove=Remove
+UISharedPortalForm.action.Remove=Elimina
-UISharedPortalForm.label.portal=Portal
-UISharedPortalForm.label.description=Description
+UISharedPortalForm.label.portal=Portale
+UISharedPortalForm.label.description=Descrizione
UISharedPortalForm.label.membership=Membership
-UISharedPortalForm.label.priority=Priority
+UISharedPortalForm.label.priority=Priorit\u00E0
-UISharedPortalForm.tab.label.SharedPortal=Portal Setting
-UISharedPortalForm.tab.label.Permission=Permission Selector
+UISharedPortalForm.tab.label.SharedPortal=Preferenze del Portale
+UISharedPortalForm.tab.label.Permission=Selettore del Permesso
-UITabPane.title.UIUserInGroup=Group Info
-UIGroupSharedInfo.title=Share Info
-UISharedPortalForm.msg.user-nonexist=User "{0}" is not exist
+UITabPane.title.UIUserInGroup=Informazioni del Gruppo
+UIGroupSharedInfo.title=Condividi le Informazioni
+UISharedPortalForm.msg.user-nonexist=L'utente "{0}" non esiste
#############################################################################
# org.exoplatform.portal.organization.component.UIGroupManagement#
#############################################################################
-UIGroupManagement.label.Groups=Groups
-UIGroupManagement.deleteGroup=Are you sure you want to delete this group?
-UIGroupManagement.label.Groups=Groups
-UIGroupManagement.label.AddGroup=Add New Group
-UIGroupManagement.label.EditGroup=Edit Selected Group
-UIGroupManagement.label.DeleteGroup=Delete Selected Group
+UIGroupManagement.label.Groups=Gruppi
+UIGroupManagement.deleteGroup=Sicuro di voler eliminare il gruppo?
+UIGroupManagement.label.Groups=Gruppi
+UIGroupManagement.label.AddGroup=Aggiungi un Nuovo Gruppo
+UIGroupManagement.label.EditGroup=Modifica il Gruppo Selezionato
+UIGroupManagement.label.DeleteGroup=Eimina il Gruppo Selezionato
#############################################################################
# org.exoplatform.portal.organization.component.UISharedNavigation#
#############################################################################
-UITabPane.title.UISharedNavigation=Group Page Navigation
-UISharedNavigation.label.userNavigation=User Page Navigation Name
-UISharedNavigation.label.priority=Priority
-UISharedNavigation.action.Save=Save
+UITabPane.title.UISharedNavigation=Navigazione della Pagina del Gruppo
+UISharedNavigation.label.userNavigation=Nome della Navigazione della Pagina Utente
+UISharedNavigation.label.priority=Priorit\u00E0
+UISharedNavigation.action.Save=Salva
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/StarToolbarPortlet_it.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/StarToolbarPortlet_it.properties 2010-01-18 10:43:15 UTC (rev 1346)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/StarToolbarPortlet_it.properties 2010-01-18 12:02:11 UTC (rev 1347)
@@ -17,7 +17,7 @@
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
#
-UIStarToolbarPortlet.item.ChangeLanguage=Cambia Linguaggio
+UIStarToolbarPortlet.item.ChangeLanguage=Cambia Lingua
UIStarToolbarPortlet.item.ChangeSkin=Cambia Skin
UIStarToolbarPortlet.item.AccountSetting=Preferenze Account
UIStarToolbarPortlet.item.Logout=Uscita
\ No newline at end of file
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_it.properties
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_it.properties 2010-01-18 10:43:15 UTC (rev 1346)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_it.properties 2010-01-18 12:02:11 UTC (rev 1347)
@@ -26,16 +26,16 @@
UIIFrameEditMode.label.editmode=Modifica
UIIFrameEditMode.action.Save=Salva
-UIBannerPortlet.action.changeLanguage=Cambia Linguaggio
+UIBannerPortlet.action.changeLanguage=Cambia Lingua
+UIBannerPortlet.action.register=Registrati
-
#############################################################################
#org.exoplatform.portal.webui.component.UIHomePagePortlet #
#############################################################################
UIHomePagePortlet.Label.Title=Prova GateIn 3.0 con uno di questi account utente:
UIHomePagePortlet.Label.Intro=La nuova versione nasce con una moderna interfaccia utente<br/>Layout Classici e WebOS Desktop<br/> Funzionalit\u00E0 di Drag and Drop. Wizard di creazione della pagina<br/>E oltre...
-UIHomePagePortlet.Label.Slogan=Il Meglio di eXo e JBoss Portal<div>GateIn 3.0 Beta 4</div>
+UIHomePagePortlet.Label.Slogan=Il meglio di eXo e JBoss Portal<div>GateIn 3.0 Beta 5</div>
UIHomePagePortlet.Label.Username=Nome utente:
UIHomePagePortlet.Label.Password=Password:
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/LogoPortlet_it.properties
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/LogoPortlet_it.properties 2010-01-18 10:43:15 UTC (rev 1346)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/LogoPortlet_it.properties 2010-01-18 12:02:11 UTC (rev 1347)
@@ -25,7 +25,7 @@
UILogoEditMode.label.logoUrl=URL
UILogoEditMode.label.editmode=Modifica
UILogoEditMode.action.Save=Salva
-UILogoPortlet.action.changeLanguage=Cambia Linguaggio
+UILogoPortlet.action.changeLanguage=Cambia Lingua
UILogoPortlet.action.Register=Registra
UILogoPortlet.action.signout=Uscita
UILogoPortlet.action.signin=Ingresso
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_it.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_it.properties 2010-01-18 10:43:15 UTC (rev 1346)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_it.properties 2010-01-18 12:02:11 UTC (rev 1347)
@@ -18,5 +18,5 @@
#
organization.title=Organizzazione
-organization.newstaff=Nuovo Staff
+organization.newstaff=Nuovo Utente
organization.management=Gestione utenti e gruppi
\ No newline at end of file
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/guests_it.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/guests_it.properties 2010-01-18 10:43:15 UTC (rev 1346)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/guests_it.properties 2010-01-18 12:02:11 UTC (rev 1347)
@@ -17,6 +17,6 @@
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
#
-platform.guests.register=Registra
+platform.guests.register=Registrati
platform.guests.sitemap=Mappa del Sito
platform.guests.link=Collegamento
\ No newline at end of file
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties 2010-01-18 10:43:15 UTC (rev 1346)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties 2010-01-18 12:02:11 UTC (rev 1347)
@@ -156,12 +156,12 @@
# UIChangeLanguage #
#############################################################################
-UIChangeLanguage.title.LanguageSetting=Preferenze per l'interfaccia del Linguaggio
+UIChangeLanguage.title.LanguageSetting=Preferenze per l'interfaccia della Lingua
UIChangeLanguage.action.save=Applica
UIChangeLanguage.action.close=Annulla
Euro.label=Euro
Asia.label=Asia
-Language.left.title=Seleziona un linguaggio
+Language.left.title=Seleziona una lingua
#############################################################################
# Change Skin #
@@ -228,7 +228,7 @@
UIUserProfileInputSet.msg.sucsesful.update.userprofile=Il profilo utente \u00E8 stato aggiornato.
UIUserProfileInputSet.title=Informazioni Personali
UIUserProfileInputSet.label.Profile=Profilo
-UIUserProfileInputSet.label.HomeInfo=Informazioni della Home
+UIUserProfileInputSet.label.HomeInfo=Informazioni principali
UIUserProfileInputSet.label.BusinessInfo=Informazioni di Business
UIGroupMembershipForm.msg.user-not-exist=L'utente "{0}" non esiste.
UIGroupMembershipForm.msg.user-not-empty=Il nome utente non pu\u00F2 essere vuoto.
14 years, 11 months
gatein SVN: r1346 - portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-18 05:43:15 -0500 (Mon, 18 Jan 2010)
New Revision: 1346
Added:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/AbstractSerializablePageList.java
Removed:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/NoArgConstructorPageList.java
Modified:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/EmptySerializablePageList.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/PageListAccess.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/StatelessPageList.java
Log:
refactor the serializable page list stuff to have more reuse of code
Copied: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/AbstractSerializablePageList.java (from rev 1343, portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/NoArgConstructorPageList.java)
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/AbstractSerializablePageList.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/AbstractSerializablePageList.java 2010-01-18 10:43:15 UTC (rev 1346)
@@ -0,0 +1,249 @@
+/*
+ * 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 java.io.IOException;
+import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.List;
+
+/**
+ * <p>This class defines the common functionalities for the serializable subclasses of {@link PageList}. Note
+ * that itself it does not implement the {@link java.io.Serializable} interface for the reason that it needs to
+ * define a no arg constructor in a non serializble class (serialization constraint).</p>
+ *
+ * <p>The method defines an abstract {@link #connect()} method that is used to connect the the page list to the
+ * underlying data.</p>
+ *
+ * <p>The methods {@link #readState(java.io.ObjectInputStream)} and {@link #writeState(java.io.ObjectOutputStream)}
+ * are defined for the subclasses and should be called by <code>void readObject(ObjectInputStream in)</code> and
+ * <code>void writeObject(ObjectOutputStream out)</code> custom serialization protocol.</p>
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class AbstractSerializablePageList<E> extends PageList<E>
+{
+
+ /** . */
+ private static final Field pageSizeField;
+
+ static
+ {
+ try
+ {
+ pageSizeField = PageList.class.getDeclaredField("pageSize_");
+ pageSizeField.setAccessible(true);
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new Error(e);
+ }
+ }
+
+ /**
+ * Builds a page list.
+ *
+ * @param pageSize the page size
+ */
+ protected AbstractSerializablePageList(int pageSize)
+ {
+ super(pageSize);
+ }
+
+ /**
+ * This constructor should not be used by subclasses, it is only for serialization needs.
+ */
+ protected AbstractSerializablePageList()
+ {
+ super(10);
+ }
+
+ /** . */
+ private LazyList<E> lazyList;
+
+ protected abstract ListAccess<E> connect() throws Exception;
+
+ private void ensureCorrectState()
+ {
+ if (lazyList == null)
+ {
+ try
+ {
+ lazyList = new LazyList<E>(connect(), super.getPageSize());
+ }
+ catch (Exception e)
+ {
+ throw new UndeclaredThrowableException(e);
+ }
+
+ // Save temporarily the current page
+ int currentPage = currentPage_;
+
+ // Refresh state
+ super.setAvailablePage(lazyList.size());
+
+ // Put back current page that was written by previous method call
+ if (currentPage != -1)
+ {
+ currentPage_ = currentPage;
+ }
+ }
+ }
+
+ @Override
+ protected final void populateCurrentPage(int page) throws Exception
+ {
+ // Make sure we have correct state
+ ensureCorrectState();
+
+ //
+ int from = getFrom();
+ int to = getTo();
+ currentListPage_ = lazyList.subList(from, to);
+ }
+
+ @Override
+ public final List<E> getAll()
+ {
+ ensureCorrectState();
+
+ //
+ return lazyList;
+ }
+
+ // Serialization : should be used by subclasses
+
+ protected final void writeState(ObjectOutputStream out) throws IOException
+ {
+ int pageSize;
+ try
+ {
+ pageSize = pageSizeField.getInt(this);
+ }
+ catch (IllegalAccessException e)
+ {
+ InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
+ ioe.initCause(e);
+ throw ioe;
+ }
+
+ //
+ out.writeInt(pageSize);
+ out.writeInt(currentPage_);
+ }
+
+ protected final void readState(ObjectInputStream in) throws IOException, ClassNotFoundException
+ {
+ try
+ {
+ pageSizeField.setInt(this, in.readInt());
+ }
+ catch (IllegalAccessException e)
+ {
+ InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
+ ioe.initCause(e);
+ throw ioe;
+ }
+ currentPage_ = in.readInt();
+ }
+
+ // Intercept all method calls
+
+ @Override
+ public final int getAvailablePage()
+ {
+ ensureCorrectState();
+ return super.getAvailablePage();
+ }
+
+ @Override
+ public final int getTo()
+ {
+ ensureCorrectState();
+ return super.getTo();
+ }
+
+ @Override
+ public final int getFrom()
+ {
+ ensureCorrectState();
+ return super.getFrom();
+ }
+
+ @Override
+ protected final void setAvailablePage(int available)
+ {
+ ensureCorrectState();
+ super.setAvailablePage(available);
+ }
+
+ @Override
+ protected final void checkAndSetPage(int page) throws Exception
+ {
+ ensureCorrectState();
+ super.checkAndSetPage(page);
+ }
+
+ @Override
+ public final List<E> getPage(int page) throws Exception
+ {
+ ensureCorrectState();
+ return super.getPage(page);
+ }
+
+ @Override
+ public final List<E> currentPage() throws Exception
+ {
+ ensureCorrectState();
+ return super.currentPage();
+ }
+
+ @Override
+ public final int getAvailable()
+ {
+ ensureCorrectState();
+ return super.getAvailable();
+ }
+
+ @Override
+ public final int getCurrentPage()
+ {
+ ensureCorrectState();
+ return super.getCurrentPage();
+ }
+
+ @Override
+ public final void setPageSize(int pageSize)
+ {
+ ensureCorrectState();
+ super.setPageSize(pageSize);
+ }
+
+ @Override
+ public final int getPageSize()
+ {
+ ensureCorrectState();
+ return super.getPageSize();
+ }
+}
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/EmptySerializablePageList.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/EmptySerializablePageList.java 2010-01-18 10:29:43 UTC (rev 1345)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/EmptySerializablePageList.java 2010-01-18 10:43:15 UTC (rev 1346)
@@ -20,36 +20,41 @@
package org.exoplatform.commons.utils;
import java.io.Serializable;
-import java.util.Collections;
-import java.util.List;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class EmptySerializablePageList<E> extends NoArgConstructorPageList<E> implements Serializable
+public class EmptySerializablePageList<E> extends AbstractSerializablePageList<E> implements Serializable
{
/** . */
private static final EmptySerializablePageList instance = new EmptySerializablePageList();
+ /** . */
+ private final ListAccess<E> listAccess = new ListAccess<E>()
+ {
+ public E[] load(int index, int length) throws Exception, IllegalArgumentException
+ {
+ throw new UnsupportedOperationException("Should not be called");
+ }
+ public int getSize() throws Exception
+ {
+ return 0;
+ }
+ };
+
public EmptySerializablePageList()
{
super(10);
}
@Override
- protected void populateCurrentPage(int page) throws Exception
+ protected ListAccess<E> connect() throws Exception
{
- currentListPage_ = Collections.emptyList();
+ return listAccess;
}
- @Override
- public List<E> getAll() throws Exception
- {
- return Collections.emptyList();
- }
-
public static <E> PageList<E> get()
{
// Cast OK
Deleted: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/NoArgConstructorPageList.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/NoArgConstructorPageList.java 2010-01-18 10:29:43 UTC (rev 1345)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/NoArgConstructorPageList.java 2010-01-18 10:43:15 UTC (rev 1346)
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.commons.utils;
-
-/**
- * This class is required for the {@link org.exoplatform.commons.utils.PageListAccess} class to be serializable.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public abstract class NoArgConstructorPageList<E> extends PageList<E>
-{
-
- protected NoArgConstructorPageList(int pageSize)
- {
- super(pageSize);
- }
-
- protected NoArgConstructorPageList()
- {
- super(10);
- }
-}
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/PageListAccess.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/PageListAccess.java 2010-01-18 10:29:43 UTC (rev 1345)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/PageListAccess.java 2010-01-18 10:43:15 UTC (rev 1346)
@@ -20,38 +20,17 @@
package org.exoplatform.commons.utils;
import java.io.*;
-import java.lang.reflect.Field;
-import java.util.List;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class PageListAccess<E, S extends Serializable> extends NoArgConstructorPageList<E> implements Serializable
+public abstract class PageListAccess<E, S extends Serializable> extends AbstractSerializablePageList<E> implements Serializable
{
- /** . */
- private static final Field pageSizeField;
-
- static
- {
- try
- {
- pageSizeField = PageList.class.getDeclaredField("pageSize_");
- pageSizeField.setAccessible(true);
- }
- catch (NoSuchFieldException e)
- {
- throw new Error(e);
- }
- }
-
/** The state that recreates the list. */
private S state;
- /** . */
- private LazyList<E> lazyList;
-
protected PageListAccess(S state, int pageSize)
{
super(pageSize);
@@ -68,167 +47,27 @@
//
this.state = state;
- this.lazyList = null;
}
- private void ensureCorrectState()
- {
- if (lazyList == null)
- {
- lazyList = new LazyList<E>(create(state), super.getPageSize());
-
- // Save temporarily the current page
- int currentPage = currentPage_;
-
- // Refresh state
- super.setAvailablePage(lazyList.size());
-
- // Put back current page that was written by previous method call
- if (currentPage != -1)
- {
- currentPage_ = currentPage;
- }
- }
- }
-
-
@Override
- protected final void populateCurrentPage(int page) throws Exception
+ protected ListAccess<E> connect() throws Exception
{
- // Make sure we have correct state
- ensureCorrectState();
-
- //
- int from = getFrom();
- int to = getTo();
- currentListPage_ = lazyList.subList(from, to);
+ return create(state);
}
- @Override
- public final List<E> getAll()
- {
- ensureCorrectState();
-
- //
- return lazyList;
- }
-
protected abstract ListAccess<E> create(S state);
// Serialization
private void writeObject(ObjectOutputStream out) throws IOException
{
- int pageSize;
- try
- {
- pageSize = pageSizeField.getInt(this);
- }
- catch (IllegalAccessException e)
- {
- InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
- ioe.initCause(e);
- throw ioe;
- }
-
- //
- out.writeInt(pageSize);
- out.writeInt(currentPage_);
+ super.writeState(out);
out.writeObject(state);
}
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
- try
- {
- pageSizeField.setInt(this, in.readInt());
- }
- catch (IllegalAccessException e)
- {
- InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
- ioe.initCause(e);
- throw ioe;
- }
- currentPage_ = in.readInt();
+ super.readState(in);
state = (S)in.readObject();
}
-
- // Intercept all method calls
-
- @Override
- public final int getAvailablePage()
- {
- ensureCorrectState();
- return super.getAvailablePage();
- }
-
- @Override
- public final int getTo()
- {
- ensureCorrectState();
- return super.getTo();
- }
-
- @Override
- public final int getFrom()
- {
- ensureCorrectState();
- return super.getFrom();
- }
-
- @Override
- protected final void setAvailablePage(int available)
- {
- ensureCorrectState();
- super.setAvailablePage(available);
- }
-
- @Override
- protected final void checkAndSetPage(int page) throws Exception
- {
- ensureCorrectState();
- super.checkAndSetPage(page);
- }
-
- @Override
- public final List<E> getPage(int page) throws Exception
- {
- ensureCorrectState();
- return super.getPage(page);
- }
-
- @Override
- public final List<E> currentPage() throws Exception
- {
- ensureCorrectState();
- return super.currentPage();
- }
-
- @Override
- public final int getAvailable()
- {
- ensureCorrectState();
- return super.getAvailable();
- }
-
- @Override
- public final int getCurrentPage()
- {
- ensureCorrectState();
- return super.getCurrentPage();
- }
-
- @Override
- public final void setPageSize(int pageSize)
- {
- ensureCorrectState();
- super.setPageSize(pageSize);
- }
-
- @Override
- public final int getPageSize()
- {
- ensureCorrectState();
- return super.getPageSize();
- }
}
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/StatelessPageList.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/StatelessPageList.java 2010-01-18 10:29:43 UTC (rev 1345)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/StatelessPageList.java 2010-01-18 10:43:15 UTC (rev 1346)
@@ -20,217 +20,29 @@
package org.exoplatform.commons.utils;
import java.io.*;
-import java.lang.reflect.Field;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.util.List;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class StatelessPageList<E> extends NoArgConstructorPageList<E> implements Serializable
+public abstract class StatelessPageList<E> extends AbstractSerializablePageList<E> implements Serializable
{
-
- /** . */
- private static final Field pageSizeField;
-
- static
- {
- try
- {
- pageSizeField = PageList.class.getDeclaredField("pageSize_");
- pageSizeField.setAccessible(true);
- }
- catch (NoSuchFieldException e)
- {
- throw new Error(e);
- }
- }
-
- /** . */
- private LazyList<E> lazyList;
-
protected StatelessPageList(int pageSize)
{
super(pageSize);
-
- //
- if (pageSize < 0)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.lazyList = null;
}
- private void ensureCorrectState()
- {
- if (lazyList == null)
- {
- ListAccess<E> listAccess;
- try
- {
- listAccess = connect();
- }
- catch (Exception e)
- {
- throw new UndeclaredThrowableException(e, "Cannot connect to list access ");
- }
-
- //
- lazyList = new LazyList<E>(listAccess, super.getPageSize());
-
- // Save temporarily the current page
- int currentPage = currentPage_;
-
- // Refresh state
- super.setAvailablePage(lazyList.size());
-
- // Put back current page that was written by previous method call
- if (currentPage != -1)
- {
- currentPage_ = currentPage;
- }
- }
- }
-
-
- @Override
- protected final void populateCurrentPage(int page) throws Exception
- {
- // Make sure we have correct state
- ensureCorrectState();
-
- //
- int from = getFrom();
- int to = getTo();
- currentListPage_ = lazyList.subList(from, to);
- }
-
- @Override
- public final List<E> getAll()
- {
- ensureCorrectState();
-
- //
- return lazyList;
- }
-
protected abstract ListAccess<E> connect() throws Exception;
// Serialization
private void writeObject(ObjectOutputStream out) throws IOException
{
- int pageSize;
- try
- {
- pageSize = pageSizeField.getInt(this);
- }
- catch (IllegalAccessException e)
- {
- InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
- ioe.initCause(e);
- throw ioe;
- }
-
- //
- out.writeInt(pageSize);
- out.writeInt(currentPage_);
+ super.writeState(out);
}
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
- try
- {
- pageSizeField.setInt(this, in.readInt());
- }
- catch (IllegalAccessException e)
- {
- InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
- ioe.initCause(e);
- throw ioe;
- }
- currentPage_ = in.readInt();
+ super.readState(in);
}
-
- // Intercept all method calls
-
- @Override
- public final int getAvailablePage()
- {
- ensureCorrectState();
- return super.getAvailablePage();
- }
-
- @Override
- public final int getTo()
- {
- ensureCorrectState();
- return super.getTo();
- }
-
- @Override
- public final int getFrom()
- {
- ensureCorrectState();
- return super.getFrom();
- }
-
- @Override
- protected final void setAvailablePage(int available)
- {
- ensureCorrectState();
- super.setAvailablePage(available);
- }
-
- @Override
- protected final void checkAndSetPage(int page) throws Exception
- {
- ensureCorrectState();
- super.checkAndSetPage(page);
- }
-
- @Override
- public final List<E> getPage(int page) throws Exception
- {
- ensureCorrectState();
- return super.getPage(page);
- }
-
- @Override
- public final List<E> currentPage() throws Exception
- {
- ensureCorrectState();
- return super.currentPage();
- }
-
- @Override
- public final int getAvailable()
- {
- ensureCorrectState();
- return super.getAvailable();
- }
-
- @Override
- public final int getCurrentPage()
- {
- ensureCorrectState();
- return super.getCurrentPage();
- }
-
- @Override
- public final void setPageSize(int pageSize)
- {
- ensureCorrectState();
- super.setPageSize(pageSize);
- }
-
- @Override
- public final int getPageSize()
- {
- ensureCorrectState();
- return super.getPageSize();
- }
}
\ No newline at end of file
14 years, 11 months
gatein SVN: r1345 - portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component.
by do-not-reply@jboss.org
Author: tuancn
Date: 2010-01-18 05:29:43 -0500 (Mon, 18 Jan 2010)
New Revision: 1345
Modified:
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
Log:
GTNPORTAL-404: the maximized portlet is still display after deleting the page (update)
Modified: portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
--- portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2010-01-18 10:15:35 UTC (rev 1344)
+++ portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2010-01-18 10:29:43 UTC (rev 1345)
@@ -390,7 +390,7 @@
// set maximizedUIComponent of UIPageBody is null if it is maximized portlet of removed page
UIPortal uiPortal = Util.getUIPortal();
UIPageBody uiPageBody = uiPortal.findFirstComponentOfType(UIPageBody.class);
- if(uiPageBody.getMaximizedUIComponent() != null){
+ if(uiPageBody != null && uiPageBody.getMaximizedUIComponent() != null){
uiPageBody.setMaximizedUIComponent(null);
}
14 years, 11 months
gatein SVN: r1344 - portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-18 05:15:35 -0500 (Mon, 18 Jan 2010)
New Revision: 1344
Added:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/EmptySerializablePageList.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/ListAccessImpl.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/SerializablePageList.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/StatelessPageList.java
Log:
more page list stuff
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/EmptySerializablePageList.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/EmptySerializablePageList.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/EmptySerializablePageList.java 2010-01-18 10:15:35 UTC (rev 1344)
@@ -0,0 +1,58 @@
+/*
+ * 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 java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class EmptySerializablePageList<E> extends NoArgConstructorPageList<E> implements Serializable
+{
+
+ /** . */
+ private static final EmptySerializablePageList instance = new EmptySerializablePageList();
+
+ public EmptySerializablePageList()
+ {
+ super(10);
+ }
+
+ @Override
+ protected void populateCurrentPage(int page) throws Exception
+ {
+ currentListPage_ = Collections.emptyList();
+ }
+
+ @Override
+ public List<E> getAll() throws Exception
+ {
+ return Collections.emptyList();
+ }
+
+ public static <E> PageList<E> get()
+ {
+ // Cast OK
+ return (PageList<E>)instance;
+ }
+}
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/ListAccessImpl.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/ListAccessImpl.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/ListAccessImpl.java 2010-01-18 10:15:35 UTC (rev 1344)
@@ -0,0 +1,64 @@
+/*
+ * 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 java.io.Serializable;
+import java.lang.reflect.Array;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ListAccessImpl<E> implements ListAccess<E>, Serializable
+{
+
+ /** . */
+ private final List<E> list;
+
+ /** . */
+ private final Class<E> elementType;
+
+ public ListAccessImpl(Class<E> elementType, List<E> list)
+ {
+ if (elementType == null)
+ {
+ throw new NullPointerException();
+ }
+ if (list == null)
+ {
+ throw new NullPointerException();
+ }
+ this.elementType = elementType;
+ this.list = list;
+ }
+
+ public E[] load(int index, int length) throws Exception, IllegalArgumentException
+ {
+ E[] array = (E[])Array.newInstance(elementType, length);
+ list.subList(index, index + length).toArray(array);
+ return array;
+ }
+
+ public int getSize() throws Exception
+ {
+ return list.size();
+ }
+}
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/SerializablePageList.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/SerializablePageList.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/SerializablePageList.java 2010-01-18 10:15:35 UTC (rev 1344)
@@ -0,0 +1,55 @@
+/*
+ * 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 java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class SerializablePageList<E> extends StatelessPageList<E>
+{
+
+ /** . */
+ private final ListAccess<E> listAccess;
+
+ public SerializablePageList(ListAccess<E> listAccess, int pageSize)
+ {
+ super(pageSize);
+
+ //
+ this.listAccess = listAccess;
+ }
+
+ public SerializablePageList(Class<E> serializableType, List<E> list, int pageSize)
+ {
+ super(pageSize);
+
+ //
+ this.listAccess = new ListAccessImpl<E>(serializableType, list);
+ }
+
+ @Override
+ protected ListAccess<E> connect() throws Exception
+ {
+ return listAccess;
+ }
+}
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/StatelessPageList.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/StatelessPageList.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/StatelessPageList.java 2010-01-18 10:15:35 UTC (rev 1344)
@@ -0,0 +1,236 @@
+/*
+ * 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 java.io.*;
+import java.lang.reflect.Field;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class StatelessPageList<E> extends NoArgConstructorPageList<E> implements Serializable
+{
+
+ /** . */
+ private static final Field pageSizeField;
+
+ static
+ {
+ try
+ {
+ pageSizeField = PageList.class.getDeclaredField("pageSize_");
+ pageSizeField.setAccessible(true);
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new Error(e);
+ }
+ }
+
+ /** . */
+ private LazyList<E> lazyList;
+
+ protected StatelessPageList(int pageSize)
+ {
+ super(pageSize);
+
+ //
+ if (pageSize < 0)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.lazyList = null;
+ }
+
+ private void ensureCorrectState()
+ {
+ if (lazyList == null)
+ {
+ ListAccess<E> listAccess;
+ try
+ {
+ listAccess = connect();
+ }
+ catch (Exception e)
+ {
+ throw new UndeclaredThrowableException(e, "Cannot connect to list access ");
+ }
+
+ //
+ lazyList = new LazyList<E>(listAccess, super.getPageSize());
+
+ // Save temporarily the current page
+ int currentPage = currentPage_;
+
+ // Refresh state
+ super.setAvailablePage(lazyList.size());
+
+ // Put back current page that was written by previous method call
+ if (currentPage != -1)
+ {
+ currentPage_ = currentPage;
+ }
+ }
+ }
+
+
+ @Override
+ protected final void populateCurrentPage(int page) throws Exception
+ {
+ // Make sure we have correct state
+ ensureCorrectState();
+
+ //
+ int from = getFrom();
+ int to = getTo();
+ currentListPage_ = lazyList.subList(from, to);
+ }
+
+ @Override
+ public final List<E> getAll()
+ {
+ ensureCorrectState();
+
+ //
+ return lazyList;
+ }
+
+ protected abstract ListAccess<E> connect() throws Exception;
+
+ // Serialization
+
+ private void writeObject(ObjectOutputStream out) throws IOException
+ {
+ int pageSize;
+ try
+ {
+ pageSize = pageSizeField.getInt(this);
+ }
+ catch (IllegalAccessException e)
+ {
+ InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
+ ioe.initCause(e);
+ throw ioe;
+ }
+
+ //
+ out.writeInt(pageSize);
+ out.writeInt(currentPage_);
+ }
+
+ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
+ {
+ try
+ {
+ pageSizeField.setInt(this, in.readInt());
+ }
+ catch (IllegalAccessException e)
+ {
+ InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
+ ioe.initCause(e);
+ throw ioe;
+ }
+ currentPage_ = in.readInt();
+ }
+
+ // Intercept all method calls
+
+ @Override
+ public final int getAvailablePage()
+ {
+ ensureCorrectState();
+ return super.getAvailablePage();
+ }
+
+ @Override
+ public final int getTo()
+ {
+ ensureCorrectState();
+ return super.getTo();
+ }
+
+ @Override
+ public final int getFrom()
+ {
+ ensureCorrectState();
+ return super.getFrom();
+ }
+
+ @Override
+ protected final void setAvailablePage(int available)
+ {
+ ensureCorrectState();
+ super.setAvailablePage(available);
+ }
+
+ @Override
+ protected final void checkAndSetPage(int page) throws Exception
+ {
+ ensureCorrectState();
+ super.checkAndSetPage(page);
+ }
+
+ @Override
+ public final List<E> getPage(int page) throws Exception
+ {
+ ensureCorrectState();
+ return super.getPage(page);
+ }
+
+ @Override
+ public final List<E> currentPage() throws Exception
+ {
+ ensureCorrectState();
+ return super.currentPage();
+ }
+
+ @Override
+ public final int getAvailable()
+ {
+ ensureCorrectState();
+ return super.getAvailable();
+ }
+
+ @Override
+ public final int getCurrentPage()
+ {
+ ensureCorrectState();
+ return super.getCurrentPage();
+ }
+
+ @Override
+ public final void setPageSize(int pageSize)
+ {
+ ensureCorrectState();
+ super.setPageSize(pageSize);
+ }
+
+ @Override
+ public final int getPageSize()
+ {
+ ensureCorrectState();
+ return super.getPageSize();
+ }
+}
\ No newline at end of file
14 years, 11 months
gatein SVN: r1343 - in portal/trunk/component: portal/src/main/java/org/exoplatform/portal/pom/config and 2 other directories.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2010-01-18 02:59:26 -0500 (Mon, 18 Jan 2010)
New Revision: 1343
Added:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/DataMissingException.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
Log:
GTNPORTAL-273 Still edit navigation of portal which was deleted
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/DataMissingException.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/DataMissingException.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/DataMissingException.java 2010-01-18 07:59:26 UTC (rev 1343)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.exoplatform.commons.utils;
+
+public class DataMissingException extends RuntimeException
+{
+
+ public DataMissingException()
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+ public DataMissingException(String message)
+ {
+ super(message);
+ // TODO Auto-generated constructor stub
+ }
+
+ public DataMissingException(Throwable cause)
+ {
+ super(cause);
+ // TODO Auto-generated constructor stub
+ }
+
+ public DataMissingException(String message, Throwable cause)
+ {
+ super(message, cause);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2010-01-18 04:18:28 UTC (rev 1342)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2010-01-18 07:59:26 UTC (rev 1343)
@@ -24,6 +24,7 @@
import org.exoplatform.commons.chromattic.SessionContext;
import org.exoplatform.commons.chromattic.SynchronizationListener;
import org.exoplatform.commons.chromattic.SynchronizationStatus;
+import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.pom.data.Mapper;
import org.gatein.mop.api.Model;
@@ -200,7 +201,11 @@
public Customization<?> findCustomizationById(String id)
{
- return getModel().findCustomizationById(id);
+ Customization<?> customization = getModel().findCustomizationById(id);
+ if (customization == null) {
+ throw new DataMissingException("Can not find " + id);
+ }
+ return customization;
}
public void addPortletPreferences(PortletPreferences prefs)
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2010-01-18 04:18:28 UTC (rev 1342)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2010-01-18 07:59:26 UTC (rev 1343)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.pom.config.tasks;
+import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.portal.pom.config.POMTask;
import org.exoplatform.portal.pom.config.cache.DataAccessMode;
import org.exoplatform.portal.pom.config.cache.CacheableDataTask;
@@ -111,7 +112,7 @@
Site srcSite = workspace.getSite(siteType, ownerId);
if (srcSite == null)
{
- throw new IllegalArgumentException("Could not clone page " + name + "from non existing site of type "
+ throw new DataMissingException("Could not clone page " + name + "from non existing site of type "
+ ownerType + " with id " + ownerId);
}
else
@@ -124,7 +125,7 @@
//
if (srcPage == null)
{
- throw new IllegalArgumentException("Could not clone non existing page " + name + " from site of type "
+ throw new DataMissingException("Could not clone non existing page " + name + " from site of type "
+ ownerType + " with id " + ownerId);
}
@@ -266,7 +267,7 @@
Site site = workspace.getSite(siteType, ownerId);
if (site == null)
{
- throw new IllegalArgumentException("Could not remove page " + name + "of non existing site of type "
+ throw new DataMissingException("Could not remove page " + name + "of non existing site of type "
+ ownerType + " with id " + ownerId);
}
else
@@ -276,7 +277,7 @@
org.gatein.mop.api.workspace.Page page = pages.getChild(name);
if (page == null)
{
- throw new IllegalArgumentException("Could not remove non existing page " + name + " of site of type "
+ throw new DataMissingException("Could not remove non existing page " + name + " of site of type "
+ ownerType + " with id " + ownerId);
}
page.destroy();
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java 2010-01-18 04:18:28 UTC (rev 1342)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java 2010-01-18 07:59:26 UTC (rev 1343)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.pom.config.tasks;
+import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.pom.config.cache.DataAccessMode;
import org.exoplatform.portal.pom.config.cache.CacheableDataTask;
@@ -79,7 +80,7 @@
Site site = workspace.getSite(type, key.getId());
if (site == null)
{
- throw new NullPointerException("Could not remove non existing portal " + key.getId());
+ throw new DataMissingException("Could not remove non existing portal " + key.getId());
}
else
{
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java 2010-01-18 04:18:28 UTC (rev 1342)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java 2010-01-18 07:59:26 UTC (rev 1343)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.pom.config.tasks;
+import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMTask;
import org.exoplatform.portal.pom.config.cache.CacheableDataTask;
@@ -48,6 +49,9 @@
public String run(POMSession session) throws Exception
{
Customization<S> customization = (Customization<S>)session.findCustomizationById(storageId);
+ if (customization == null) {
+ throw new DataMissingException("Can not find " + storageId);
+ }
return customization.getContentId();
}
}
@@ -131,7 +135,9 @@
{
Customization<S> customization = (Customization<S>)session.findCustomizationById(storageId);
-
+ if (customization == null) {
+ throw new DataMissingException("Can not find " + storageId);
+ }
if (prefs != null)
{
customization.setState(prefs);
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-01-18 04:18:28 UTC (rev 1342)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-01-18 07:59:26 UTC (rev 1343)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.pom.data;
+import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.ApplicationType;
@@ -397,6 +398,7 @@
private List<ComponentData> loadChildren(UIContainer src)
{
+ if (src == null) throw new DataMissingException("Can not load children");
ArrayList<ComponentData> children = new ArrayList<ComponentData>(src.size());
for (UIComponent component : src)
{
14 years, 11 months