Author: liem_nguyen
Date: 2010-02-24 23:31:14 -0500 (Wed, 24 Feb 2010)
New Revision: 1855
Modified:
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java
Log:
GTNPORTAL-593 Don't update new membership in Select Permission form after create new
membership
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-02-25
04:10:17 UTC (rev 1854)
+++
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java 2010-02-25
04:31:14 UTC (rev 1855)
@@ -19,25 +19,25 @@
package org.exoplatform.webui.organization;
+import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIBreadcumbs;
-import org.exoplatform.webui.core.UIBreadcumbs.LocalPath;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.UITree;
+import org.exoplatform.webui.core.UIBreadcumbs.LocalPath;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIForm;
import java.util.ArrayList;
@@ -103,6 +103,28 @@
}
}*/
+ /**
+ * @see
org.exoplatform.webui.core.UIComponent#processRender(org.exoplatform.webui.application.WebuiRequestContext)
+ */
+ @Override
+ public void processRender(WebuiRequestContext context) throws Exception
+ {
+ OrganizationService service = getApplicationComponent(OrganizationService.class);
+ Collection<?> sibblingsGroup = service.getGroupHandler().findGroups(null);
+ UITree tree = getChild(UITree.class);
+ if (tree != null)
+ tree.setSibbling((List)sibblingsGroup);
+
+ Collection<?> collection =
service.getMembershipTypeHandler().findMembershipTypes();
+ listMemberhip = new ArrayList<String>(5);
+ for (Object obj : collection)
+ {
+ listMemberhip.add(((MembershipType)obj).getName());
+ }
+ listMemberhip.add("*");
+ super.processRender(context);
+ }
+
public Group getCurrentGroup()
{
return selectGroup_;
@@ -192,7 +214,7 @@
UIComponent uiComp = event.getSource();
UIGroupMembershipSelector uiSelector = uiComp.getParent();
uiSelector.changeGroup(groupId);
- UIComponent uiPermission =
uiSelector.<UIComponent>getParent().getParent();
+ UIComponent uiPermission = uiSelector.<UIComponent>
getParent().getParent();
uiPermission.setRenderSibling(uiPermission.getClass());
uiPermission.broadcast(event, Event.Phase.PROCESS);
UIPopupWindow uiPopup = uiSelector.getParent();
@@ -214,7 +236,7 @@
public void execute(Event<UIGroupMembershipSelector> event) throws Exception
{
UIGroupMembershipSelector uiSelector = event.getSource();
- UIComponent uiPermission =
uiSelector.<UIComponent>getParent().getParent();
+ UIComponent uiPermission = uiSelector.<UIComponent>
getParent().getParent();
uiPermission.setRenderSibling(uiPermission.getClass());
WebuiRequestContext pcontext = event.getRequestContext();
@@ -235,7 +257,7 @@
{
UIApplication uiApp = pcontext.getUIApplication();
uiApp.addMessage(new
ApplicationMessage("UIGroupMembershipSelector.msg.selectGroup", null));
-// pcontext.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
+ //
pcontext.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
uiPopup.setShow(true);
return;
}