diff --git a/component/identity/pom.xml b/component/identity/pom.xml index 6378758dc..a9e7ab682 100644 --- a/component/identity/pom.xml +++ b/component/identity/pom.xml @@ -75,19 +75,12 @@ picketlink-idm-cache - - org.hsqldb - hsqldb - test - org.gatein.portal exo.portal.component.test.core test - - diff --git a/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java b/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java index 119bc4bd4..de7e2c3c8 100644 --- a/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java +++ b/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java @@ -32,9 +32,10 @@ import org.exoplatform.services.organization.Group; import org.exoplatform.services.organization.GroupEventListener; import org.exoplatform.services.organization.GroupHandler; +import org.exoplatform.services.organization.MembershipTypeHandler; import org.gatein.common.logging.LogLevel; import org.picketlink.idm.api.Attribute; -import org.picketlink.idm.api.IdentitySession; +import org.picketlink.idm.api.Role; import org.picketlink.idm.impl.api.SimpleAttribute; /* @@ -91,8 +92,6 @@ public void addChild(Group parent, Group child, boolean broadcast) throws Except org.picketlink.idm.api.Group parentGroup = null; - String childPLGroupName = getPLIDMGroupName(child.getGroupName()); - if (parent != null) { String parentPLGroupName = getPLIDMGroupName(parent.getGroupName()); @@ -201,7 +200,7 @@ public Group removeGroup(Group group, boolean broadcast) throws Exception { .findAssociatedGroups(jbidGroup, null, false, false); // not possible to disassociate only one child... - Set dummySet = new HashSet(); + Set dummySet = new HashSet(); dummySet.add(jbidGroup); for (org.picketlink.idm.api.Group parent : parents) { @@ -225,12 +224,12 @@ public Group removeGroup(Group group, boolean broadcast) throws Exception { return group; } - public Collection findGroupByMembership(String userName, String membershipType) throws Exception { + public Collection findGroupByMembership(String userName, String membershipType) throws Exception { if (log.isTraceEnabled()) { Tools.logMethodIn(log, LogLevel.TRACE, "findGroupsByMembership", new Object[] { "userName", membershipType }); } - Collection allRoles = new HashSet(); + Collection allRoles = new HashSet(); try { orgService.flush(); @@ -252,7 +251,64 @@ public Collection findGroupByMembership(String userName, String membershipType) } if (mmm.isAssociationMapped() && mmm.getAssociationMapping().equals(membershipType)) { - Collection groups = new HashSet(); + Collection groups = new HashSet(); + + try { + orgService.flush(); + + groups = getIdentitySession().getRelationshipManager().findAssociatedGroups(userName, null); + } catch (Exception e) { + handleException("Identity operation error: ", e); + } + + for (org.picketlink.idm.api.Group group : groups) { + exoGroups.add(convertGroup(group)); + } + + } + + // UI has hardcoded casts to List + Collection result = new LinkedList(exoGroups); + + if (log.isTraceEnabled()) { + Tools.logMethodOut(log, LogLevel.TRACE, "findGroupByMembership", result); + } + + return result; + } + + + @Override + public Collection resolveGroupByMembership(String userName, String membershipType) throws Exception { + if (log.isTraceEnabled()) { + Tools.logMethodIn(log, LogLevel.TRACE, "findGroupsByMembership", new Object[] { "userName", membershipType }); + } + + Collection roles = new HashSet(); + + try { + orgService.flush(); + + roles.addAll(getIdentitySession().getRoleManager().findRoles(userName, membershipType)); + + roles.addAll(getIdentitySession().getRoleManager().findRoles(userName, MembershipTypeHandler.ANY_MEMBERSHIP_TYPE)); + } catch (Exception e) { + handleException("Identity operation error: ", e); + } + + Set exoGroups = new HashSet(); + + MembershipDAOImpl mmm = (MembershipDAOImpl) orgService.getMembershipHandler(); + + for (org.picketlink.idm.api.Role role : roles) { + Group exoGroup = convertGroup(role.getGroup()); + if (mmm.isCreateMembership(role.getRoleType().getName(), exoGroup.getId())) { + exoGroups.add(exoGroup); + } + } + + if (mmm.isAssociationMapped() && mmm.getAssociationMapping().equals(membershipType)) { + Collection groups = new HashSet(); try { orgService.flush(); @@ -269,7 +325,7 @@ public Collection findGroupByMembership(String userName, String membershipType) } // UI has hardcoded casts to List - Collection result = new LinkedList(exoGroups); + Collection result = new LinkedList(exoGroups); if (log.isTraceEnabled()) { Tools.logMethodOut(log, LogLevel.TRACE, "findGroupByMembership", result); @@ -304,7 +360,7 @@ public Group findGroupById(String groupId) throws Exception { } - public Collection findGroups(Group parent) throws Exception { + public Collection findGroups(Group parent) throws Exception { if (log.isTraceEnabled()) { Tools.logMethodIn(log, LogLevel.TRACE, "findGroups", new Object[] { "parent", parent }); } @@ -330,8 +386,6 @@ public Collection findGroups(Group parent) throws Exception { return Collections.emptyList(); } - String parentId = parent == null ? null : parent.getParentId(); - Set plGroups = new HashSet(); try { @@ -396,7 +450,7 @@ public Collection findGroups(Group parent) throws Exception { } - public Collection findGroupsOfUser(String user) throws Exception { + public Collection findGroupsOfUser(String user) throws Exception { if (log.isTraceEnabled()) { Tools.logMethodIn(log, LogLevel.TRACE, "findGroupsOfUser", new Object[] { "user", user }); @@ -422,7 +476,7 @@ public Collection findGroupsOfUser(String user) throws Exception { return Collections.emptyList(); } - Collection allGroups = new HashSet(); + Collection allGroups = new HashSet(); try { orgService.flush(); @@ -448,7 +502,7 @@ public Collection findGroupsOfUser(String user) throws Exception { return exoGroups; } - public Collection getAllGroups() throws Exception { + public Collection getAllGroups() throws Exception { if (log.isTraceEnabled()) { Tools.logMethodIn(log, LogLevel.TRACE, "getAllGroups", null); } @@ -490,7 +544,7 @@ public Collection getAllGroups() throws Exception { } // UI has hardcoded casts to List - Collection result = new LinkedList(exoGroups); + Collection result = new LinkedList(exoGroups); if (log.isTraceEnabled()) { Tools.logMethodOut(log, LogLevel.TRACE, "getAllGroups", result); @@ -529,7 +583,7 @@ protected Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exce Tools.logMethodIn(log, LogLevel.TRACE, "convertGroup", new Object[] { "jbidGroup", jbidGroup }); } - Map attrs = new HashMap(); + Map attrs = new HashMap(); try { orgService.flush(); @@ -616,7 +670,7 @@ private String getGroupId(org.picketlink.idm.api.Group jbidGroup, List(); } - Collection parents = new HashSet(); + Collection parents = new HashSet(); String gtnGroupName = getGtnGroupName(jbidGroup.getName()); @@ -844,5 +898,4 @@ public String getPLIDMGroupName(String gtnGroupName) { public String getGtnGroupName(String plidmGroupName) { return orgService.getConfiguration().getGtnGroupName(plidmGroupName); } - } diff --git a/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java b/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java index 853900823..8e421b0cf 100644 --- a/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java +++ b/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java @@ -34,7 +34,6 @@ import org.exoplatform.services.organization.MembershipTypeHandler; import org.exoplatform.services.organization.impl.MembershipTypeImpl; import org.gatein.common.logging.LogLevel; -import org.picketlink.idm.api.IdentitySession; import org.picketlink.idm.api.RoleType; /* @@ -183,7 +182,7 @@ public MembershipType removeMembershipType(String name, boolean broadcast) throw } - public Collection findMembershipTypes() throws Exception { + public Collection findMembershipTypes() throws Exception { if (log.isTraceEnabled()) { Tools.logMethodIn(log, LogLevel.TRACE, "findMembershipTypes", null); } @@ -201,7 +200,11 @@ public Collection findMembershipTypes() throws Exception { for (RoleType rt : rts) { MembershipType mt = new MembershipTypeImpl(rt.getName(), null, null); populateMembershipType(mt); - mts.add(mt); + if (mt.getName().equals("*")) { + mts.add(0, mt); + } else { + mts.add(mt); + } } if (log.isTraceEnabled()) { diff --git a/component/identity/src/test/java/org/exoplatform/services/organization/AbstractTestOrganizationService.java b/component/identity/src/test/java/org/exoplatform/services/organization/AbstractTestOrganizationService.java index a40246fe1..390566769 100644 --- a/component/identity/src/test/java/org/exoplatform/services/organization/AbstractTestOrganizationService.java +++ b/component/identity/src/test/java/org/exoplatform/services/organization/AbstractTestOrganizationService.java @@ -26,6 +26,7 @@ import static org.junit.Assert.*; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import org.exoplatform.commons.utils.PageList; @@ -332,6 +333,14 @@ public void testGroup() throws Exception { groupHandler_.removeGroup(groupParent, true); assertEquals("Expect ParentGroup is removed:", null, groupHandler_.findGroupById(groupParent.getId())); assertEquals("Expect all child group is removed: ", 0, groupHandler_.findGroups(groupParent).size()); + + Collection groups = groupHandler_.findGroupByMembership("demo", "member"); + assertNotNull(groups); + assertEquals(1, groups.size()); + + groups = groupHandler_.resolveGroupByMembership("demo", "member"); + assertNotNull(groups); + assertEquals(2, groups.size()); } @Test @@ -358,20 +367,21 @@ public void testMembershipType() throws Exception { mtHandler_.createMembershipType(mt, true); /* - * find all membership type Expect result: 3 membershipType: "testmembership", "anothertype" and "member"(default + * find all membership type Expect result: 4 membershipType: "testmembership", "anothertype", "member" and "*" (default * membership type, it is created at startup time) */ - assertEquals("Expect 3 membership in collection: ", 3, mtHandler_.findMembershipTypes().size()); + assertEquals("Expect 4 membership in collection: ", 4, mtHandler_.findMembershipTypes().size()); + assertEquals("The * should be the first one in collection: ", MembershipTypeHandler.ANY_MEMBERSHIP_TYPE, mtHandler_.findMembershipTypes().iterator().next().getName()); /* remove "testmembership" */ mtHandler_.removeMembershipType(testType, true); assertEquals("Membership type has been removed:", null, mtHandler_.findMembershipType(testType)); - assertEquals("Expect 2 membership in collection(1 is default): ", 2, mtHandler_.findMembershipTypes().size()); + assertEquals("Expect 2 membership in collection(1 is default): ", 3, mtHandler_.findMembershipTypes().size()); /* remove "anothertype" */ mtHandler_.removeMembershipType("anothertype", true); assertEquals("Membership type has been removed:", null, mtHandler_.findMembershipType("anothertype")); - assertEquals("Expect 1 membership in collection(default type): ", 1, mtHandler_.findMembershipTypes().size()); + assertEquals("Expect 1 membership in collection(default type): ", 2, mtHandler_.findMembershipTypes().size()); /* All membershipType was removed(except default membership) */ } diff --git a/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganizationService-configuration.xml b/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganizationService-configuration.xml index 834e2e462..05d7a5fe7 100644 --- a/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganizationService-configuration.xml +++ b/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganizationService-configuration.xml @@ -189,6 +189,16 @@ + + + + * + + + Any membership type + + + @@ -212,12 +222,24 @@ - the /users group + + + + administrators + + + + + + the /administrators group + + + @@ -241,7 +263,7 @@ demo@localhost - member:/users + member:/users, *:/administrators diff --git a/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java b/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java index 7f2a2a512..5f329ff3d 100644 --- a/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java +++ b/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java @@ -241,7 +241,7 @@ public List getMakableNavigations(String remoteUser, boolean withSite) t if (remoteUser.equals(userACL_.getSuperUser())) { groups = orgService_.getGroupHandler().getAllGroups(); } else { - groups = orgService_.getGroupHandler().findGroupByMembership(remoteUser, userACL_.getMakableMT()); + groups = orgService_.getGroupHandler().resolveGroupByMembership(remoteUser, userACL_.getMakableMT()); } // diff --git a/component/web/api/pom.xml b/component/web/api/pom.xml index 2bdb1dc85..629e988db 100644 --- a/component/web/api/pom.xml +++ b/component/web/api/pom.xml @@ -48,5 +48,10 @@ exo.portal.component.test.core test + + org.exoplatform.tool + exo.tool.framework.junit + test + diff --git a/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java b/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java index beb126a57..dc5de0f64 100644 --- a/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java +++ b/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java @@ -19,27 +19,17 @@ package org.exoplatform.web.filter; -import java.io.BufferedReader; +import org.exoplatform.component.test.AbstractGateInTest; +import org.exoplatform.test.mocks.servlet.MockServletRequest; + import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.security.Principal; import java.util.Arrays; import java.util.Collections; -import java.util.Enumeration; -import java.util.Locale; -import java.util.Map; import javax.servlet.FilterChain; -import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; -import javax.servlet.ServletInputStream; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import org.exoplatform.component.test.AbstractGateInTest; /** * Created by The eXo Platform SAS Author : Nicolas Filotto nicolas.filotto@exoplatform.com 25 sept. 2009 @@ -53,7 +43,7 @@ public void testDoFilter() throws IOException, ServletException { MockFilterOKWTF mockFilterOKWTF = new MockFilterOKWTF(); MockFilterChain chain = new MockFilterChain(); exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF))); - exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); assertTrue(mockFilterOKTF.start); assertTrue(mockFilterOKTF.end); assertTrue(mockFilterOKWTF.start); @@ -65,7 +55,7 @@ public void testDoFilter() throws IOException, ServletException { chain = new MockFilterChain(); exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKO()))); - exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); assertTrue(mockFilterOKTF.start); assertTrue(mockFilterOKTF.end); assertTrue(mockFilterOKWTF.start); @@ -78,7 +68,7 @@ public void testDoFilter() throws IOException, ServletException { exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOIO()))); try { - exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); fail("IOException is expected"); } catch (IOException e) { } @@ -94,7 +84,7 @@ public void testDoFilter() throws IOException, ServletException { exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOSE()))); try { - exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); fail("ServletException is expected"); } catch (ServletException e) { } @@ -110,7 +100,7 @@ public void testDoFilter() throws IOException, ServletException { exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKORE()))); try { - exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); fail("RuntimeException is expected"); } catch (RuntimeException e) { } @@ -126,7 +116,7 @@ public void testDoFilter() throws IOException, ServletException { exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOER()))); try { - exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); fail("Error is expected"); } catch (Error e) { } @@ -143,7 +133,7 @@ public void testDoFilter() throws IOException, ServletException { exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOIO()), getFilterDefinition(mockFilterOKTF2))); try { - exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); fail("IOException is expected"); } catch (IOException e) { } @@ -236,275 +226,4 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha throw new Error(); } } - - @SuppressWarnings("unchecked") - private static class MockServletRequest implements HttpServletRequest { - - public String getAuthType() { - - return null; - } - - public String getContextPath() { - - return null; - } - - public Cookie[] getCookies() { - - return null; - } - - public long getDateHeader(String name) { - - return 0; - } - - public String getHeader(String name) { - - return null; - } - - public Enumeration getHeaderNames() { - - return null; - } - - public Enumeration getHeaders(String name) { - - return null; - } - - public int getIntHeader(String name) { - - return 0; - } - - public String getMethod() { - - return null; - } - - public String getPathInfo() { - return null; - } - - public String getPathTranslated() { - - return null; - } - - public String getQueryString() { - - return null; - } - - public String getRemoteUser() { - - return null; - } - - public String getRequestURI() { - - return "/"; - } - - public StringBuffer getRequestURL() { - - return null; - } - - public String getRequestedSessionId() { - - return null; - } - - public String getServletPath() { - - return null; - } - - public HttpSession getSession() { - - return null; - } - - public HttpSession getSession(boolean create) { - - return null; - } - - public Principal getUserPrincipal() { - - return null; - } - - public boolean isRequestedSessionIdFromCookie() { - - return false; - } - - public boolean isRequestedSessionIdFromURL() { - - return false; - } - - public boolean isRequestedSessionIdFromUrl() { - - return false; - } - - public boolean isRequestedSessionIdValid() { - - return false; - } - - public boolean isUserInRole(String role) { - - return false; - } - - public Object getAttribute(String name) { - - return null; - } - - public Enumeration getAttributeNames() { - - return null; - } - - public String getCharacterEncoding() { - - return null; - } - - public int getContentLength() { - - return 0; - } - - public String getContentType() { - - return null; - } - - public ServletInputStream getInputStream() throws IOException { - - return null; - } - - public String getLocalAddr() { - - return null; - } - - public String getLocalName() { - - return null; - } - - public int getLocalPort() { - - return 0; - } - - public Locale getLocale() { - - return null; - } - - public Enumeration getLocales() { - - return null; - } - - public String getParameter(String name) { - - return null; - } - - public Map getParameterMap() { - - return null; - } - - public Enumeration getParameterNames() { - - return null; - } - - public String[] getParameterValues(String name) { - - return null; - } - - public String getProtocol() { - - return null; - } - - public BufferedReader getReader() throws IOException { - - return null; - } - - public String getRealPath(String path) { - - return null; - } - - public String getRemoteAddr() { - - return null; - } - - public String getRemoteHost() { - - return null; - } - - public int getRemotePort() { - - return 0; - } - - public RequestDispatcher getRequestDispatcher(String path) { - - return null; - } - - public String getScheme() { - - return null; - } - - public String getServerName() { - - return null; - } - - public int getServerPort() { - - return 0; - } - - public boolean isSecure() { - - return false; - } - - public void removeAttribute(String name) { - - } - - public void setAttribute(String name, Object o) { - - } - - public void setCharacterEncoding(String env) throws UnsupportedEncodingException { - - } - - } } diff --git a/component/web/resources/pom.xml b/component/web/resources/pom.xml index e3c15f1f8..890833f78 100644 --- a/component/web/resources/pom.xml +++ b/component/web/resources/pom.xml @@ -80,7 +80,6 @@ org.exoplatform.tool exo.tool.framework.junit - 1.2.2-GA test diff --git a/pom.xml b/pom.xml index f31c5f606..6a041a87c 100644 --- a/pom.xml +++ b/pom.xml @@ -37,10 +37,11 @@ GateIn - Portal - 2.5.0-Alpha1 - 2.6.0-Alpha1 - 2.4.0-Alpha1 - 1.16.0-Alpha1 + 2.5.0-Alpha2 + 2.6.0-Alpha2 + 2.4.0-Alpha2 + 1.16.0-Alpha2 + 1.2.4-GA 2.0.2.Final-gatein-4 1.1.1.Final-gatein-4 1.0.1.Final @@ -68,6 +69,8 @@ 3.0.3 + 1.1 + org.exoplatform.kernel @@ -1118,6 +1133,11 @@ hsqldb test + + org.javassist + javassist + test + diff --git a/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml b/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml index cdf590983..6e26b93a4 100644 --- a/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml +++ b/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml @@ -59,6 +59,16 @@ + + + + * + + + any membership type + + + diff --git a/web/portal/src/main/webapp/WEB-INF/standalone-webui-configuration.xml b/web/portal/src/main/webapp/WEB-INF/standalone-webui-configuration.xml index cf406a942..974920c26 100644 --- a/web/portal/src/main/webapp/WEB-INF/standalone-webui-configuration.xml +++ b/web/portal/src/main/webapp/WEB-INF/standalone-webui-configuration.xml @@ -34,7 +34,6 @@ org.exoplatform.portal.application.PortalLogoutLifecycle org.exoplatform.portal.application.PortalStatisticLifecycle - org.exoplatform.portal.application.PortalApplicationLifecycle org.exoplatform.webui.application.MonitorApplicationLifecycle diff --git a/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml b/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml index 098ccc390..d5a904f0e 100644 --- a/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml +++ b/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml @@ -35,7 +35,6 @@ org.exoplatform.portal.application.UserSiteLifeCycle org.exoplatform.portal.application.PortalLogoutLifecycle org.exoplatform.portal.application.PortalStatisticLifecycle - org.exoplatform.portal.application.PortalApplicationLifecycle org.exoplatform.webui.application.MonitorApplicationLifecycle org.exoplatform.portal.application.UserProfileLifecycle org.exoplatform.portal.application.localization.LocalizationLifecycle diff --git a/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java b/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java index 1c433ebf8..d4bc088f6 100644 --- a/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java +++ b/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIGroupSelector.java @@ -134,7 +134,7 @@ public List getListGroup() throws Exception { List listGroup = new ArrayList(); if (getCurrentGroup() == null) return null; - Collection groups = service.getGroupHandler().findGroups(getCurrentGroup()); + Collection groups = service.getGroupHandler().findGroups(getCurrentGroup()); if (groups.size() > 0) { for (Object child : groups) { Group childGroup = (Group) child; diff --git a/webui/portal/src/main/java/org/exoplatform/portal/application/PortalApplicationLifecycle.java b/webui/portal/src/main/java/org/exoplatform/portal/application/PortalApplicationLifecycle.java deleted file mode 100644 index 3e6fd1a8d..000000000 --- a/webui/portal/src/main/java/org/exoplatform/portal/application/PortalApplicationLifecycle.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.exoplatform.portal.application; - -import org.exoplatform.container.ExoContainer; -import org.exoplatform.container.ExoContainerContext; -import org.exoplatform.container.SessionContainer; -import org.exoplatform.container.SessionManagerContainer; -import org.exoplatform.web.application.Application; -import org.exoplatform.web.application.ApplicationLifecycle; -import org.exoplatform.web.application.RequestFailure; -import org.exoplatform.webui.application.WebuiRequestContext; - -public class PortalApplicationLifecycle implements ApplicationLifecycle { - - @SuppressWarnings("unused") - public void onInit(Application app) { - } - - @SuppressWarnings("unused") - public void onStartRequest(Application app, WebuiRequestContext rcontext) throws Exception { - ExoContainer pcontainer = ExoContainerContext.getCurrentContainer(); - SessionContainer.setInstance(((SessionManagerContainer) pcontainer).getSessionManager().getSessionContainer( - rcontext.getSessionId())); - } - - @SuppressWarnings("unused") - public void onFailRequest(Application app, WebuiRequestContext rontext, RequestFailure failureType) { - - } - - @SuppressWarnings("unused") - public void onEndRequest(Application app, WebuiRequestContext rcontext) throws Exception { - SessionContainer.setInstance(null); - ExoContainerContext.setCurrentContainer(null); - } - - @SuppressWarnings("unused") - public void onDestroy(Application app) { - } - -}