Author: julien_viet
Date: 2010-01-19 08:46:24 -0500 (Tue, 19 Jan 2010)
New Revision: 1371
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindMembershipByGroupPageList.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindMembershipTypesPageList.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindUsersPageList.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/Safe.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupDetail.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupEditMembershipForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupExplorer.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupInfo.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupManagement.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java
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/UIListUsers.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipManagement.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInGroup.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserManagement.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UISearch.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UISearchForm.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/EmailAddressValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ExpressionValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/PasswordStringLengthValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ResourceValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/SpecialCharacterValidator.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserMembershipSelector.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ReplicatingStateManager.java
Log:
GTNPORTAL-535 : User and group management portlet replication
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-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/EmptySerializablePageList.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -32,7 +32,7 @@
private static final EmptySerializablePageList instance = new
EmptySerializablePageList();
/** . */
- private final ListAccess<E> listAccess = new ListAccess<E>()
+ private transient final ListAccess<E> listAccess = new ListAccess<E>()
{
public E[] load(int index, int length) throws Exception, IllegalArgumentException
{
@@ -60,4 +60,9 @@
// Cast OK
return (PageList<E>)instance;
}
+
+ private Object readResolve()
+ {
+ return instance;
+ }
}
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-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/PageListAccess.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -25,7 +25,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public abstract class PageListAccess<E, S extends Serializable> extends
AbstractSerializablePageList<E> implements Serializable
+public abstract class PageListAccess<E, S> extends
AbstractSerializablePageList<E> implements Serializable
{
/** The state that recreates the list. */
@@ -50,12 +50,12 @@
}
@Override
- protected ListAccess<E> connect() throws Exception
+ protected final ListAccess<E> connect() throws Exception
{
return create(state);
}
- protected abstract ListAccess<E> create(S state);
+ protected abstract ListAccess<E> create(S state) throws Exception;
// Serialization
Modified:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java
===================================================================
---
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -24,6 +24,8 @@
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.UndeclaredThrowableException;
/**
* A class that contains utility method that make the caller not worry much about the
unexpectable expected such as
@@ -110,4 +112,41 @@
IOTools.safeClose(is);
}
}
+
+ // THIS CODE IS TEMPORARY
+
+ /** . */
+ private static final Field listAccessField;
+
+ static
+ {
+ try
+ {
+ listAccessField = LazyList.class.getDeclaredField("listAccess");
+ listAccessField.setAccessible(true);
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new Error(e);
+ }
+ }
+
+ public static <E> ListAccess<E> unwrap(PageList<E> pageList)
+ {
+ LazyPageList<E> lazyPageList = (LazyPageList<E>)pageList;
+
+ //
+ try
+ {
+ // Get LazyList first
+ LazyList<E> lazyList = (LazyList<E>)lazyPageList.getAll();
+
+ // Now get list access
+ return (ListAccess<E>)listAccessField.get(lazyList);
+ }
+ catch (Exception e)
+ {
+ throw new UndeclaredThrowableException(e);
+ }
+ }
}
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindMembershipByGroupPageList.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindMembershipByGroupPageList.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindMembershipByGroupPageList.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -0,0 +1,56 @@
+/*
+ * 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.organization.webui.component;
+
+import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.commons.utils.ListAccessImpl;
+import org.exoplatform.commons.utils.PageListAccess;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.Membership;
+import org.exoplatform.services.organization.MembershipHandler;
+import org.exoplatform.services.organization.OrganizationService;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class FindMembershipByGroupPageList extends PageListAccess<Membership,
String>
+{
+
+ public FindMembershipByGroupPageList(String groupId, int pageSize)
+ {
+ super(groupId, pageSize);
+ }
+
+ @Override
+ protected ListAccess<Membership> create(String state) throws Exception
+ {
+ ExoContainer container = PortalContainer.getInstance();
+ OrganizationService service =
(OrganizationService)container.getComponentInstance(OrganizationService.class);
+ MembershipHandler handler = service.getMembershipHandler();
+ Group group = service.getGroupHandler().findGroupById(state);
+ List<Membership> memberships =
(List<Membership>)handler.findMembershipsByGroup(group);
+ return new ListAccessImpl<Membership>(Membership.class, memberships);
+ }
+}
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindMembershipTypesPageList.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindMembershipTypesPageList.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindMembershipTypesPageList.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -0,0 +1,52 @@
+/*
+ * 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.organization.webui.component;
+
+import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.commons.utils.ListAccessImpl;
+import org.exoplatform.commons.utils.StatelessPageList;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.organization.MembershipType;
+import org.exoplatform.services.organization.OrganizationService;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class FindMembershipTypesPageList extends StatelessPageList<MembershipType>
+{
+
+ public FindMembershipTypesPageList(int pageSize)
+ {
+ super(pageSize);
+ }
+
+ @Override
+ protected ListAccess<MembershipType> connect() throws Exception
+ {
+ ExoContainer container = PortalContainer.getInstance();
+ OrganizationService service =
(OrganizationService)container.getComponentInstance(OrganizationService.class);
+ List<MembershipType> memberships =
(List<MembershipType>)service.getMembershipTypeHandler().findMembershipTypes();
+ return new ListAccessImpl<MembershipType>(MembershipType.class,
memberships);
+ }
+}
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindUsersPageList.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindUsersPageList.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/FindUsersPageList.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -0,0 +1,50 @@
+/*
+ * 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.organization.webui.component;
+
+import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.commons.utils.PageListAccess;
+import org.exoplatform.commons.utils.Safe;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.organization.OrganizationService;
+import org.exoplatform.services.organization.Query;
+import org.exoplatform.services.organization.User;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class FindUsersPageList extends PageListAccess<User, Query>
+{
+ public FindUsersPageList(Query state, int pageSize)
+ {
+ super(state, pageSize);
+ }
+
+ protected ListAccess<User> create(Query state) throws Exception
+ {
+ ExoContainer container = PortalContainer.getInstance();
+ OrganizationService service =
(OrganizationService)container.getComponentInstance(OrganizationService.class);
+ PageList<User> pageList = service.getUserHandler().findUsers(state);
+ return Safe.unwrap(pageList);
+ }
+}
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -25,6 +25,7 @@
import org.exoplatform.services.organization.User;
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.core.UIApplication;
import org.exoplatform.webui.form.UIFormCheckBoxInput;
import org.exoplatform.webui.form.UIFormInputBase;
@@ -39,6 +40,7 @@
import org.exoplatform.webui.organization.UIUserProfileInputSet;
/** Created by The eXo Platform SARL Author : dang.tung tungcnw(a)gmail.com Jun 25, 2008
*/
+@Serialized
public class UIAccountEditInputSet extends UIFormInputSet
{
@@ -50,6 +52,10 @@
final static String CHANGEPASS = "changePassword";
+ public UIAccountEditInputSet()
+ {
+ }
+
public UIAccountEditInputSet(String name) throws Exception
{
super(name);
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupDetail.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupDetail.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupDetail.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -20,6 +20,7 @@
package org.exoplatform.organization.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.UIContainer;
@@ -31,6 +32,7 @@
* 10:07:15 AM
*/
@ComponentConfig()
+@Serialized
public class UIGroupDetail extends UIContainer
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupEditMembershipForm.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupEditMembershipForm.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupEditMembershipForm.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -26,6 +26,7 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.web.application.ApplicationMessage;
+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;
@@ -51,6 +52,7 @@
@ComponentConfig(lifecycle = UIFormLifecycle.class, template =
"system:/groovy/webui/form/UIForm.gtmpl", events = {
@EventConfig(listeners = UIGroupEditMembershipForm.SaveActionListener.class),
@EventConfig(listeners = UIGroupEditMembershipForm.CancelActionListener.class)})
+@Serialized
public class UIGroupEditMembershipForm extends UIForm
{
@@ -60,9 +62,9 @@
private final static String MEMBER_SHIP = "membership";
- private Membership membership;
+ private String membershipId;
- private Group group;
+ private String groupId;
public UIGroupEditMembershipForm() throws Exception
{
@@ -72,8 +74,8 @@
public void setValue(Membership memberShip, Group selectedGroup) throws Exception
{
- this.membership = memberShip;
- this.group = selectedGroup;
+ this.membershipId = memberShip.getId();
+ this.groupId = selectedGroup.getId();
getUIStringInput(USER_NAME).setValue(memberShip.getUserName());
OrganizationService service = getApplicationComponent(OrganizationService.class);
List<?> collection =
(List<?>)service.getMembershipTypeHandler().findMembershipTypes();
@@ -96,8 +98,9 @@
UIApplication uiApp = event.getRequestContext().getUIApplication();
UIPopupWindow uiPopup = uiForm.getParent();
OrganizationService service =
uiForm.getApplicationComponent(OrganizationService.class);
- String userName = uiForm.membership.getUserName();
- Group group = uiForm.group;
+ Membership formMembership =
service.getMembershipHandler().findMembership(uiForm.membershipId);
+ String userName = formMembership.getUserName();
+ Group group = service.getGroupHandler().findGroupById(uiForm.groupId);
User user = service.getUserHandler().findUserByName(userName);
MembershipHandler memberShipHandler = service.getMembershipHandler();
String memberShipType = uiForm.getUIFormSelectBox(MEMBER_SHIP).getValue();
@@ -111,7 +114,7 @@
uiApp.addMessage(new
ApplicationMessage("UIGroupEditMembershipForm.msg.membership-exist", null));
return;
}
- memberShipHandler.removeMembership(uiForm.membership.getId(), true);
+ memberShipHandler.removeMembership(uiForm.membershipId, true);
memberShipHandler.linkMembership(user, group, membershipType, true);
}
catch (Exception e)
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupExplorer.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupExplorer.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupExplorer.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -22,6 +22,7 @@
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.OrganizationService;
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;
@@ -43,6 +44,7 @@
* 10:07:15 AM
*/
@ComponentConfig(events = @EventConfig(listeners =
UIGroupExplorer.ChangeNodeActionListener.class))
+@Serialized
public class UIGroupExplorer extends UIContainer
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -25,6 +25,7 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.web.application.ApplicationMessage;
+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;
@@ -43,10 +44,11 @@
@ComponentConfig(lifecycle = UIFormLifecycle.class, template =
"system:/groovy/webui/form/UIFormWithTitle.gtmpl", events = {
@EventConfig(listeners = UIGroupForm.SaveActionListener.class),
@EventConfig(phase = Phase.DECODE, listeners =
UIGroupForm.BackActionListener.class)})
+@Serialized
public class UIGroupForm extends UIForm
{
- private Group group_;
+ private String groupId;
private String componentName_ = "AddGroup";
@@ -62,22 +64,24 @@
StringLengthValidator.class, 0, 255));
}
- public Group getGroup()
+ public String getGroupId()
{
- return group_;
+ return groupId;
}
public void setGroup(Group group) throws Exception
{
- this.group_ = group;
- if (group_ == null)
+ if (group != null)
{
+ this.groupId = group.getId();
+ getUIStringInput(GROUP_NAME).setEditable(UIFormStringInput.DISABLE);
+ invokeGetBindingBean(group);
+ }
+ else
+ {
getUIStringInput(GROUP_NAME).setEditable(UIFormStringInput.ENABLE);
reset();
- return;
}
- getUIStringInput(GROUP_NAME).setEditable(UIFormStringInput.DISABLE);
- invokeGetBindingBean(group_);
}
public String getName()
@@ -100,9 +104,10 @@
OrganizationService service =
uiGroupForm.getApplicationComponent(OrganizationService.class);
UIGroupExplorer uiGroupExplorer =
uiGroupManagement.getChild(UIGroupExplorer.class);
- Group currentGroup = uiGroupForm.getGroup();
- if (currentGroup != null)
+ String currentGroupId = uiGroupForm.getGroupId();
+ if (currentGroupId != null)
{
+ Group currentGroup =
service.getGroupHandler().findGroupById(currentGroupId);
uiGroupForm.invokeSetBindingBean(currentGroup);
if (currentGroup.getLabel() == null ||
currentGroup.getLabel().trim().length() == 0)
{
@@ -131,12 +136,15 @@
}
//UIGroupExplorer uiGroupExplorer =
uiGroupManagement.getChild(UIGroupExplorer.class) ;
- String currentGroupId = null;
- currentGroup = uiGroupExplorer.getCurrentGroup();
+ Group currentGroup = uiGroupExplorer.getCurrentGroup();
if (currentGroup != null)
{
currentGroupId = currentGroup.getId();
}
+ else
+ {
+ currentGroupId = null;
+ }
String groupName = "/" +
uiGroupForm.getUIStringInput(GROUP_NAME).getValue();
GroupHandler groupHandler = service.getGroupHandler();
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupInfo.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupInfo.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupInfo.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -20,6 +20,7 @@
package org.exoplatform.organization.webui.component;
import org.exoplatform.services.organization.Group;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.UIContainer;
@@ -31,6 +32,7 @@
* 10:08:51 AM
*/
@ComponentConfig(template =
"app:/groovy/organization/webui/component/UIGroupInfoContainer.gtmpl")
+@Serialized
public class UIGroupInfo extends UIContainer
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupManagement.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupManagement.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -25,6 +25,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.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -54,6 +55,7 @@
@EventConfig(listeners = UIGroupManagement.EditGroupActionListener.class)
})
+@Serialized
public class UIGroupManagement extends UIContainer
{
@@ -140,7 +142,7 @@
return;
}
UIGroupForm groupForm =
uiGroupManagement.findFirstComponentOfType(UIGroupForm.class);
- if (groupForm.getGroup() != null)
+ if (groupForm.getGroupId() != null)
{
uiApp.addMessage(new
ApplicationMessage("UIGroupManagement.msg.Delete", null));
return;
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -26,6 +26,7 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.web.application.ApplicationMessage;
+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;
@@ -65,6 +66,7 @@
@EventConfig(listeners = UIPopupWindow.CloseActionListener.class, name =
"ClosePopup"),
@EventConfig(listeners = UIGroupMembershipForm.CloseActionListener.class, name =
"Close", phase = Phase.DECODE),
@EventConfig(listeners = UIGroupMembershipForm.AddActionListener.class, name =
"Add", phase = Phase.DECODE)})})
+@Serialized
public class UIGroupMembershipForm extends UIForm
{
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-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -25,6 +25,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.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -42,6 +43,7 @@
@ComponentConfig(events = {
@EventConfig(listeners = UIListMembershipType.EditMembershipActionListener.class),
@EventConfig(listeners = UIListMembershipType.DeleteMembershipActionListener.class,
confirm = "UIListMembershipType.deleteMemberShip")})
+@Serialized
public class UIListMembershipType extends UIContainer
{
@@ -70,17 +72,7 @@
@SuppressWarnings("unchecked")
public void loadData() throws Exception
{
- 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);
+ getChild(UIGrid.class).getUIPageIterator().setPageList(new
FindMembershipTypesPageList(5));
}
public void processRender(WebuiRequestContext context) throws Exception
@@ -121,8 +113,8 @@
UIMembershipManagement membership = uiMembership.getParent();
UIMembershipTypeForm uiForm =
membership.findFirstComponentOfType(UIMembershipTypeForm.class);
- MembershipType existMembershipType = uiForm.getMembershipType();
- if (existMembershipType != null &&
existMembershipType.getName().equals(name))
+ String existMembershipTypeName = uiForm.getMembershipTypeName();
+ if (existMembershipTypeName != null &&
existMembershipTypeName.equals(name))
{
UIApplication uiApp = event.getRequestContext().getUIApplication();
uiApp.addMessage(new
ApplicationMessage("UIMembershipList.msg.InUse", null));
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -19,12 +19,12 @@
package org.exoplatform.organization.webui.component;
-import org.exoplatform.commons.utils.PageList;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.Query;
import org.exoplatform.web.application.ApplicationMessage;
+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;
@@ -41,7 +41,8 @@
import org.exoplatform.webui.form.UIFormSelectBox;
import org.exoplatform.webui.form.UIFormStringInput;
-import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
/**
@@ -55,29 +56,28 @@
@EventConfig(listeners = UIListUsers.ViewUserInfoActionListener.class),
@EventConfig(listeners = UIListUsers.SelectUserActionListener.class),
@EventConfig(listeners = UIListUsers.DeleteUserActionListener.class, confirm =
"UIListUsers.deleteUser")})
+@Serialized
public class UIListUsers extends UISearch
{
- public static String USER_NAME = "userName";
+ public static final String USER_NAME = "userName";
- public static String LAST_NAME = "lastName";
+ public static final String LAST_NAME = "lastName";
- public static String FIRST_NAME = "firstName";
+ public static final String FIRST_NAME = "firstName";
- public static String EMAIL = "email";
+ public static final String EMAIL = "email";
- private static String[] USER_BEAN_FIELD = {USER_NAME, LAST_NAME, FIRST_NAME, EMAIL};
+ private static final String[] USER_BEAN_FIELD = {USER_NAME, LAST_NAME, FIRST_NAME,
EMAIL};
- private static String[] USER_ACTION = {"ViewUserInfo",
"DeleteUser"};
+ private static final String[] USER_ACTION = {"ViewUserInfo",
"DeleteUser"};
- private static List<SelectItemOption<String>> OPTIONS_ = new
ArrayList<SelectItemOption<String>>(4);
- static
- {
- OPTIONS_.add(new SelectItemOption<String>(USER_NAME, USER_NAME));
- OPTIONS_.add(new SelectItemOption<String>(LAST_NAME, LAST_NAME));
- OPTIONS_.add(new SelectItemOption<String>(FIRST_NAME, FIRST_NAME));
- OPTIONS_.add(new SelectItemOption<String>(EMAIL, EMAIL));
- }
+ private final static List<SelectItemOption<String>> OPTIONS_ =
Collections.unmodifiableList(Arrays.asList(
+ new SelectItemOption<String>(USER_NAME, USER_NAME),
+ new SelectItemOption<String>(LAST_NAME, LAST_NAME),
+ new SelectItemOption<String>(FIRST_NAME, FIRST_NAME),
+ new SelectItemOption<String>(EMAIL, EMAIL)
+ ));
private Query lastQuery_;
@@ -108,10 +108,7 @@
public void search(Query query) throws Exception
{
lastQuery_ = query;
- OrganizationService service = getApplicationComponent(OrganizationService.class);
- PageList pageList = service.getUserHandler().findUsers(query);
- pageList.setPageSize(10);
- grid_.getUIPageIterator().setPageList(pageList);
+ grid_.getUIPageIterator().setPageList(new FindUsersPageList(query, 10));
UIPageIterator pageIterator = grid_.getUIPageIterator();
if (pageIterator.getAvailable() == 0)
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipManagement.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipManagement.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -21,6 +21,7 @@
import org.exoplatform.services.organization.MembershipType;
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.UIContainer;
@@ -31,6 +32,7 @@
* Jun 23, 2006 10:07:15 AM
*/
@ComponentConfig()
+@Serialized
public class UIMembershipManagement extends UIContainer
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -22,6 +22,7 @@
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.web.application.ApplicationMessage;
+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;
@@ -40,12 +41,13 @@
@ComponentConfig(lifecycle = UIFormLifecycle.class, template =
"system:/groovy/webui/form/UIFormWithTitle.gtmpl", events = {
@EventConfig(listeners = UIMembershipTypeForm.SaveActionListener.class),
@EventConfig(listeners = UIMembershipTypeForm.ResetActionListener.class, phase =
Phase.DECODE)})
+@Serialized
public class UIMembershipTypeForm extends UIForm
{
private static String MEMBERSHIP_TYPE_NAME = "name", DESCRIPTION =
"description";
- private MembershipType membershipType_;
+ private String membershipTypeName;
public UIMembershipTypeForm() throws Exception
{
@@ -58,20 +60,23 @@
public void setMembershipType(MembershipType membershipType) throws Exception
{
- membershipType_ = membershipType;
- if (membershipType_ == null)
+ if (membershipType == null)
{
getUIStringInput(MEMBERSHIP_TYPE_NAME).setEditable(UIFormStringInput.ENABLE);
return;
}
- getUIStringInput(MEMBERSHIP_TYPE_NAME).setEditable(UIFormStringInput.DISABLE);
- invokeGetBindingBean(membershipType_);
+ else
+ {
+ membershipTypeName = membershipType.getName();
+ getUIStringInput(MEMBERSHIP_TYPE_NAME).setEditable(UIFormStringInput.DISABLE);
+ }
+ invokeGetBindingBean(membershipType);
}
- public MembershipType getMembershipType()
+ public String getMembershipTypeName()
{
- return membershipType_;
- };
+ return membershipTypeName;
+ }
static public class SaveActionListener extends
EventListener<UIMembershipTypeForm>
{
@@ -81,7 +86,7 @@
UIMembershipManagement uiMembershipManagement = uiForm.getParent();
OrganizationService service =
uiForm.getApplicationComponent(OrganizationService.class);
- MembershipType mt = uiForm.getMembershipType();
+ MembershipType mt =
service.getMembershipTypeHandler().findMembershipType(uiForm.membershipTypeName);
if (mt != null)
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -21,6 +21,7 @@
import
org.exoplatform.portal.webui.portal.UIPortalComponentActionListener.ViewChildActionListener;
import org.exoplatform.services.organization.Query;
+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;
@@ -41,6 +42,7 @@
@EventConfig(listeners = ViewChildActionListener.class)}
)
+@Serialized
public class UIOrganizationPortlet extends UIPortletApplication
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInGroup.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInGroup.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInGroup.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -19,7 +19,7 @@
package org.exoplatform.organization.webui.component;
-import org.exoplatform.commons.utils.ObjectPageList;
+import org.exoplatform.commons.utils.EmptySerializablePageList;
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.Membership;
@@ -28,6 +28,7 @@
import org.exoplatform.services.organization.User;
import org.exoplatform.services.organization.UserHandler;
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;
@@ -38,6 +39,7 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import java.io.Serializable;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Iterator;
@@ -55,6 +57,7 @@
@EventConfig(listeners = UIUserInGroup.DeleteUserActionListener.class, confirm =
"UIUserInGroup.confirm.deleteUser"),
@EventConfig(listeners = UIUserInGroup.EditActionListener.class)}),
@ComponentConfig(type =
org.exoplatform.organization.webui.component.UIUserInGroup.UIGridUser.class, id =
"UIGridUser", template = "system:/groovy/webui/core/UIGrid.gtmpl")})
+@Serialized
public class UIUserInGroup extends UIContainer
{
@@ -123,14 +126,14 @@
PageList pageList = null;
if (group == null)
{
- pageList = new ObjectPageList(new ArrayList<Object>(), 10);
+ pageList = EmptySerializablePageList.get();
}
else
{
OrganizationService service =
getApplicationComponent(OrganizationService.class);
MembershipHandler handler = service.getMembershipHandler();
List<?> memberships =
(List<?>)handler.findMembershipsByGroup(group);
- pageList = new ObjectPageList(memberships, 10);
+ pageList = new FindMembershipByGroupPageList(group.getId(), 10);
}
UIGridUser uiGrid = getChild(UIGridUser.class);
pageList.setPageSize(5);
@@ -220,6 +223,7 @@
}
}
+ @Serialized
static public class UIGridUser extends UIGrid
{
@@ -269,19 +273,28 @@
}
- static public class MembershipUser
+ static public class MembershipUser implements Serializable
{
- private User user;
-
private String mtype;
+ private String userName;
+
+ private String firstName;
+
+ private String lastName;
+
+ private String email;
+
private String id;
public MembershipUser(User user, String mtype, String id)
{
this.mtype = mtype;
- this.user = user;
+ this.userName = user.getUserName();
+ this.firstName = user.getFirstName();
+ this.lastName = user.getLastName();
+ this.email = user.getEmail();
this.id = id;
}
@@ -295,34 +308,24 @@
this.mtype = mtype;
}
- public User getUser()
- {
- return user;
- }
-
- public void setUser(User user)
- {
- this.user = user;
- }
-
public String getUserName()
{
- return user.getUserName();
+ return userName;
}
public String getFirstName()
{
- return user.getFirstName();
+ return firstName;
}
public String getLastName()
{
- return user.getLastName();
+ return lastName;
}
public String getEmail()
{
- return user.getEmail();
+ return email;
}
public String getId()
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -23,6 +23,7 @@
import org.exoplatform.services.organization.Query;
import org.exoplatform.services.organization.User;
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.UIPopupWindow;
@@ -41,6 +42,7 @@
@EventConfig(listeners = UIUserInfo.SaveActionListener.class),
@EventConfig(listeners = UIUserInfo.BackActionListener.class, phase = Phase.DECODE),
@EventConfig(listeners = UIUserInfo.ToggleChangePasswordActionListener.class, phase =
Phase.DECODE)})
+@Serialized
public class UIUserInfo extends UIFormTabPane
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserManagement.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserManagement.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -20,6 +20,7 @@
package org.exoplatform.organization.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.UIContainer;
@@ -33,6 +34,7 @@
* 10:07:15 AM
*/
@ComponentConfig()
+@Serialized
public class UIUserManagement extends UIContainer
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UISearch.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UISearch.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UISearch.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.core;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.model.SelectItemOption;
import org.exoplatform.webui.form.UIFormInputSet;
@@ -36,6 +37,7 @@
* @see UISearchForm
*/
@ComponentConfig()
+@Serialized
abstract public class UISearch extends UIContainer
{
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UISearchForm.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UISearchForm.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UISearchForm.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -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.config.annotation.EventConfig;
import org.exoplatform.webui.core.UISearch;
@@ -38,6 +39,7 @@
* Represents a search form
*/
@ComponentConfig(lifecycle = UIFormLifecycle.class, template =
"system:/groovy/webui/form/UISearchForm.gtmpl", events = @EventConfig(listeners
= UISearchForm.QuickSearchActionListener.class))
+@Serialized
public class UISearchForm extends UIForm
{
/**
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/EmailAddressValidator.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/EmailAddressValidator.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/EmailAddressValidator.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form.validator;
import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.exception.MessageException;
import org.exoplatform.webui.form.UIForm;
@@ -33,6 +34,7 @@
*
* Validates whether an email is in the correct format
*/
+@Serialized
public class EmailAddressValidator implements Validator
{
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ExpressionValidator.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ExpressionValidator.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ExpressionValidator.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form.validator;
import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.exception.MessageException;
import org.exoplatform.webui.form.UIForm;
@@ -33,12 +34,18 @@
*
* Validates whether this value matches one regular expression.
*/
+@Serialized
public class ExpressionValidator implements Validator
{
private String expression_;
private String key_;
+ // For @Serialized needs
+ public ExpressionValidator()
+ {
+ }
+
public ExpressionValidator(final String expression)
{
expression_ = expression;
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/PasswordStringLengthValidator.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/PasswordStringLengthValidator.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/PasswordStringLengthValidator.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form.validator;
import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.exception.MessageException;
import org.exoplatform.webui.form.UIForm;
@@ -33,6 +34,7 @@
*
* Validates whether this value has a length between min and max
*/
+@Serialized
public class PasswordStringLengthValidator implements Validator
{
/**
@@ -45,6 +47,11 @@
*/
private Integer max_ = 0;
+ // For @Serialized needs
+ public PasswordStringLengthValidator()
+ {
+ }
+
public PasswordStringLengthValidator(Integer max)
{
max_ = max;
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ResourceValidator.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ResourceValidator.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ResourceValidator.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form.validator;
import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.exception.MessageException;
import org.exoplatform.webui.form.UIForm;
@@ -33,6 +34,7 @@
*
* Validates whether the value is composed of letters, numbers or '_'
*/
+@Serialized
public class ResourceValidator implements Validator
{
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/SpecialCharacterValidator.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/SpecialCharacterValidator.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/SpecialCharacterValidator.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.form.validator;
import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.exception.MessageException;
import org.exoplatform.webui.form.UIForm;
@@ -31,6 +32,7 @@
* tungcnw(a)gmail.com
* Dec 12, 2007
*/
+@Serialized
public class SpecialCharacterValidator implements Validator
{
Modified:
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserMembershipSelector.java
===================================================================
---
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserMembershipSelector.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserMembershipSelector.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -26,6 +26,7 @@
import org.exoplatform.services.organization.MembershipTypeHandler;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
+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.UIGrid;
@@ -36,6 +37,7 @@
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormPopupWindow;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -50,6 +52,7 @@
@ComponentConfig(template =
"system:/groovy/organization/webui/component/UIUserMembershipSelector.gtmpl",
events = {
@EventConfig(listeners =
UIUserMembershipSelector.SelectMembershipActionListener.class),
@EventConfig(listeners =
UIUserMembershipSelector.DeleteMembershipActionListener.class, phase = Phase.DECODE,
confirm = "UIUserMembershipSelector.deleteMembership")})
+@Serialized
public class UIUserMembershipSelector extends UISelector<String>
{
@@ -59,9 +62,9 @@
private boolean isAdminRole_ = false;
- public static String[] BEAN_FIELD = {"userName", "groupId",
"membershipType"};
+ public static final String[] BEAN_FIELD = {"userName", "groupId",
"membershipType"};
- public static String[] ACTIONS = {"DeleteMembership"};
+ public static final String[] ACTIONS = {"DeleteMembership"};
public UIUserMembershipSelector() throws Exception
{
@@ -198,7 +201,7 @@
}
}
- static public class Membership
+ static public class Membership implements Serializable
{
private String groupId_;
Modified:
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
===================================================================
---
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -27,6 +27,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.core.UIApplication;
import org.exoplatform.webui.core.UIComponent;
@@ -46,15 +47,20 @@
* Jun 28, 2006
*/
@ComponentConfig(template = "system:/groovy/webui/form/UIVTabInputSet.gtmpl")
+@Serialized
public class UIUserProfileInputSet extends UIFormInputSet
{
private String user_;
- public static String MALE = "male";
+ public final static String MALE = "male";
- public static String FEMALE = "female";
+ public final static String FEMALE = "female";
+ public UIUserProfileInputSet()
+ {
+ }
+
public UIUserProfileInputSet(String name) throws Exception
{
super(name);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ReplicatingStateManager.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ReplicatingStateManager.java 2010-01-19
13:29:36 UTC (rev 1370)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ReplicatingStateManager.java 2010-01-19
13:46:24 UTC (rev 1371)
@@ -19,12 +19,10 @@
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.services.organization.Query;
import org.exoplatform.webui.Util;
import org.exoplatform.webui.application.ConfigurationManager;
import org.exoplatform.webui.application.StateManager;
@@ -46,7 +44,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import java.io.ByteArrayOutputStream;
import java.util.Map;
/**
@@ -119,12 +116,7 @@
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);
-*/
+ domainMetaData.addClassType(Query.class, true);
//
SerializationContext serializationContext =
(SerializationContext)session.getAttribute("SerializationContext");