From e873fb8677674fb029617db77f0d657c2774bc12 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Thu, 10 Mar 2016 18:04:51 +0000 Subject: [PATCH] refined method for getting group logo url and friendlyURL git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vo-management/usermanagement-core@124957 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../usermanagement/impl/LiferayGroupManager.java | 7 ++++--- .../usermanagement/impl/LiferayRoleManager.java | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayGroupManager.java b/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayGroupManager.java index f61c563..bd8cdbb 100644 --- a/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayGroupManager.java +++ b/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayGroupManager.java @@ -42,15 +42,16 @@ public class LiferayGroupManager implements GroupManager { // group mapping private GCubeGroup mapLRGroup(Group g) throws PortalException, SystemException, UserManagementSystemException, GroupRetrievalFault { if (g != null) { - long logoId = LayoutSetLocalServiceUtil.getLayoutSet(g.getGroupId(), true).getLayoutSetId(); + long logoId = LayoutSetLocalServiceUtil.getLayoutSet(g.getGroupId(), true).getLogoId(); if (isVRE(g.getGroupId())) { return new GCubeGroup(g.getGroupId(), g.getParentGroupId(), g.getName(), g.getDescription(), g.getFriendlyURL(), logoId, null); } else if (isVO(g.getGroupId())) { List vres = new ArrayList(); List VREs = g.getChildren(true); - for (Group vre : VREs) + for (Group vre : VREs) { vres.add(mapLRGroup(vre)); + } return new GCubeGroup(g.getGroupId(), g.getParentGroupId(), g.getName(), g.getDescription(), g.getFriendlyURL(), logoId, vres); } else if (isRootVO(g.getGroupId())) { List vos = new ArrayList(); @@ -174,7 +175,7 @@ public class LiferayGroupManager implements GroupManager { g = GroupLocalServiceUtil.getGroup(ManagementUtils.getCompany().getCompanyId(), groupName); return g.getGroupId(); } catch (PortalException e) { - throw new GroupRetrievalFault("Group not existing", e); + _log.warn(groupName + " Group not existing"); } catch (SystemException e) { e.printStackTrace(); } diff --git a/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayRoleManager.java b/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayRoleManager.java index 102d4d0..ef2922f 100644 --- a/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayRoleManager.java +++ b/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayRoleManager.java @@ -76,7 +76,7 @@ public class LiferayRoleManager implements RoleManager { return (mapLRRole(role)); } } catch (PortalException e) { - throw new GroupRetrievalFault("Group not existing", e); + _log.warn(roleName + " Role not existing"); } catch (SystemException e) { throw new RoleRetrievalFault(e.getMessage(), e); } @@ -90,7 +90,7 @@ public class LiferayRoleManager implements RoleManager { try { return mapLRRole(RoleLocalServiceUtil.getRole(roleId)); } catch (PortalException e) { - throw new RoleRetrievalFault("Role not existing", e); + _log.warn(roleId + " Role id not existing"); } catch (SystemException e) { e.printStackTrace(); }