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
This commit is contained in:
Massimiliano Assante 2016-03-10 18:04:51 +00:00
parent fc8a1738e4
commit e873fb8677
2 changed files with 6 additions and 5 deletions

View File

@ -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<GCubeGroup> vres = new ArrayList<GCubeGroup>();
List<Group> 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<GCubeGroup> vos = new ArrayList<GCubeGroup>();
@ -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();
}

View File

@ -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();
}