From e8776cc427ab1a0eac604e742de51dbc05d9c1b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boles=C5=82aw=20Dawidowicz?= Date: Thu, 24 Oct 2013 10:42:58 +0200 Subject: [PATCH] Revert "GTNPORTAL-2899 Support * wildcard membership type" This reverts commit b7ba8edcf82cb430bb4e9e3ab7897bfcf2310129. --- component/identity/pom.xml | 7 + .../organization/idm/GroupDAOImpl.java | 89 ++---- .../idm/MembershipTypeDAOImpl.java | 9 +- .../AbstractTestOrganizationService.java | 18 +- .../TestOrganizationService-configuration.xml | 26 +- .../config/UserPortalConfigService.java | 2 +- component/web/api/pom.xml | 5 - .../web/filter/TestExtensibleFilter.java | 301 +++++++++++++++++- component/web/resources/pom.xml | 1 + pom.xml | 28 +- .../organization-configuration.xml | 10 - .../standalone-webui-configuration.xml | 1 + .../webapp/WEB-INF/webui-configuration.xml | 1 + .../organization/account/UIGroupSelector.java | 2 +- .../PortalApplicationLifecycle.java | 59 ++++ 15 files changed, 393 insertions(+), 166 deletions(-) create mode 100644 webui/portal/src/main/java/org/exoplatform/portal/application/PortalApplicationLifecycle.java diff --git a/component/identity/pom.xml b/component/identity/pom.xml index a9e7ab682..6378758dc 100644 --- a/component/identity/pom.xml +++ b/component/identity/pom.xml @@ -75,12 +75,19 @@ 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 de7e2c3c8..119bc4bd4 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,10 +32,9 @@ 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.Role; +import org.picketlink.idm.api.IdentitySession; import org.picketlink.idm.impl.api.SimpleAttribute; /* @@ -92,6 +91,8 @@ 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()); @@ -200,7 +201,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) { @@ -224,12 +225,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(); @@ -251,64 +252,7 @@ public Collection findGroupByMembership(String userName, String membershi } if (mmm.isAssociationMapped() && mmm.getAssociationMapping().equals(membershipType)) { - 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(); + Collection groups = new HashSet(); try { orgService.flush(); @@ -325,7 +269,7 @@ public Collection resolveGroupByMembership(String userName, String member } // 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); @@ -360,7 +304,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 }); } @@ -386,6 +330,8 @@ public Collection findGroups(Group parent) throws Exception { return Collections.emptyList(); } + String parentId = parent == null ? null : parent.getParentId(); + Set plGroups = new HashSet(); try { @@ -450,7 +396,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 }); @@ -476,7 +422,7 @@ public Collection findGroupsOfUser(String user) throws Exception { return Collections.emptyList(); } - Collection allGroups = new HashSet(); + Collection allGroups = new HashSet(); try { orgService.flush(); @@ -502,7 +448,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); } @@ -544,7 +490,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); @@ -583,7 +529,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(); @@ -670,7 +616,7 @@ private String getGroupId(org.picketlink.idm.api.Group jbidGroup, List(); } - Collection parents = new HashSet(); + Collection parents = new HashSet(); String gtnGroupName = getGtnGroupName(jbidGroup.getName()); @@ -898,4 +844,5 @@ 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 8e421b0cf..853900823 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,6 +34,7 @@ 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; /* @@ -182,7 +183,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); } @@ -200,11 +201,7 @@ public Collection findMembershipTypes() throws Exception { for (RoleType rt : rts) { MembershipType mt = new MembershipTypeImpl(rt.getName(), null, null); populateMembershipType(mt); - if (mt.getName().equals("*")) { - mts.add(0, mt); - } else { - mts.add(mt); - } + 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 390566769..a40246fe1 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,7 +26,6 @@ import static org.junit.Assert.*; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import org.exoplatform.commons.utils.PageList; @@ -333,14 +332,6 @@ 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 @@ -367,21 +358,20 @@ public void testMembershipType() throws Exception { mtHandler_.createMembershipType(mt, true); /* - * find all membership type Expect result: 4 membershipType: "testmembership", "anothertype", "member" and "*" (default + * find all membership type Expect result: 3 membershipType: "testmembership", "anothertype" and "member"(default * membership type, it is created at startup time) */ - 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()); + assertEquals("Expect 3 membership in collection: ", 3, mtHandler_.findMembershipTypes().size()); /* 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): ", 3, mtHandler_.findMembershipTypes().size()); + assertEquals("Expect 2 membership in collection(1 is default): ", 2, 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): ", 2, mtHandler_.findMembershipTypes().size()); + assertEquals("Expect 1 membership in collection(default type): ", 1, 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 05d7a5fe7..834e2e462 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,16 +189,6 @@ - - - - * - - - Any membership type - - - @@ -222,24 +212,12 @@ + the /users group - - - - administrators - - - - - - the /administrators group - - - @@ -263,7 +241,7 @@ demo@localhost - member:/users, *:/administrators + member:/users 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 5f329ff3d..7f2a2a512 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().resolveGroupByMembership(remoteUser, userACL_.getMakableMT()); + groups = orgService_.getGroupHandler().findGroupByMembership(remoteUser, userACL_.getMakableMT()); } // diff --git a/component/web/api/pom.xml b/component/web/api/pom.xml index 629e988db..2bdb1dc85 100644 --- a/component/web/api/pom.xml +++ b/component/web/api/pom.xml @@ -48,10 +48,5 @@ 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 dc5de0f64..beb126a57 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,17 +19,27 @@ package org.exoplatform.web.filter; -import org.exoplatform.component.test.AbstractGateInTest; -import org.exoplatform.test.mocks.servlet.MockServletRequest; - +import java.io.BufferedReader; 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 @@ -43,7 +53,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, null), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); assertTrue(mockFilterOKTF.start); assertTrue(mockFilterOKTF.end); assertTrue(mockFilterOKWTF.start); @@ -55,7 +65,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, null), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); assertTrue(mockFilterOKTF.start); assertTrue(mockFilterOKTF.end); assertTrue(mockFilterOKWTF.start); @@ -68,7 +78,7 @@ public void testDoFilter() throws IOException, ServletException { exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOIO()))); try { - exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); fail("IOException is expected"); } catch (IOException e) { } @@ -84,7 +94,7 @@ public void testDoFilter() throws IOException, ServletException { exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOSE()))); try { - exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); fail("ServletException is expected"); } catch (ServletException e) { } @@ -100,7 +110,7 @@ public void testDoFilter() throws IOException, ServletException { exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKORE()))); try { - exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); fail("RuntimeException is expected"); } catch (RuntimeException e) { } @@ -116,7 +126,7 @@ public void testDoFilter() throws IOException, ServletException { exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF), getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOER()))); try { - exFilter.doFilter(new MockServletRequest(null, null), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); fail("Error is expected"); } catch (Error e) { } @@ -133,7 +143,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, null), null, chain, pathRequest); + exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest); fail("IOException is expected"); } catch (IOException e) { } @@ -226,4 +236,275 @@ 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 890833f78..e3c15f1f8 100644 --- a/component/web/resources/pom.xml +++ b/component/web/resources/pom.xml @@ -80,6 +80,7 @@ org.exoplatform.tool exo.tool.framework.junit + 1.2.2-GA test diff --git a/pom.xml b/pom.xml index 6a041a87c..f31c5f606 100644 --- a/pom.xml +++ b/pom.xml @@ -37,11 +37,10 @@ GateIn - Portal - 2.5.0-Alpha2 - 2.6.0-Alpha2 - 2.4.0-Alpha2 - 1.16.0-Alpha2 - 1.2.4-GA + 2.5.0-Alpha1 + 2.6.0-Alpha1 + 2.4.0-Alpha1 + 1.16.0-Alpha1 2.0.2.Final-gatein-4 1.1.1.Final-gatein-4 1.0.1.Final @@ -69,8 +68,6 @@ 3.0.3 - 1.1 - org.exoplatform.kernel @@ -1133,11 +1118,6 @@ 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 6e26b93a4..cdf590983 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,16 +59,6 @@ - - - - * - - - 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 974920c26..cf406a942 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,6 +34,7 @@ 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 d5a904f0e..098ccc390 100644 --- a/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml +++ b/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml @@ -35,6 +35,7 @@ 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 d4bc088f6..1c433ebf8 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 new file mode 100644 index 000000000..3e6fd1a8d --- /dev/null +++ b/webui/portal/src/main/java/org/exoplatform/portal/application/PortalApplicationLifecycle.java @@ -0,0 +1,59 @@ +/** + * 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) { + } + +}