git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/my-vres@134343 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
660ddada36
commit
8dfd57adb6
|
@ -1,4 +1,8 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
|
<Changeset component="org.gcube.portlet.user.my-vres.2-2-0" date="2016-11-17">
|
||||||
|
<Change>Removed ASL Session</Change>
|
||||||
|
<Change>Implemented Feature #4877 remove VRE association to single Category constraint</Change>
|
||||||
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portlet.user.my-vres.2-1-0" date="2016-09-12">
|
<Changeset component="org.gcube.portlet.user.my-vres.2-1-0" date="2016-09-12">
|
||||||
<Change>Shows only the virtual groups available in the Site it is deployed on</Change>
|
<Change>Shows only the virtual groups available in the Site it is deployed on</Change>
|
||||||
<Change>VRE was not updated in the portlet due to liferay versioning of Document Library</Change>
|
<Change>VRE was not updated in the portlet due to liferay versioning of Document Library</Change>
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
|
||||||
LinkedHashMap<String, ArrayList<VRE>> toReturn = new LinkedHashMap<String, ArrayList<VRE>>();
|
LinkedHashMap<String, ArrayList<VRE>> toReturn = new LinkedHashMap<String, ArrayList<VRE>>();
|
||||||
|
|
||||||
|
|
||||||
List<VirtualGroup> currentSiteVGroups = ManagementUtils.getVirtualGroupsBySiteGroupId(ManagementUtils.getSiteGroupIdFromServletRequest(getThreadLocalRequest().getServerName()));
|
List<VirtualGroup> currentSiteVGroups = gm.getVirtualGroups(ManagementUtils.getSiteGroupIdFromServletRequest(getThreadLocalRequest().getServerName()));
|
||||||
for (VirtualGroup vg : currentSiteVGroups) {
|
for (VirtualGroup vg : currentSiteVGroups) {
|
||||||
String gName = vg.getName();
|
String gName = vg.getName();
|
||||||
ArrayList<VRE> toCreate = new ArrayList<VRE>();
|
ArrayList<VRE> toCreate = new ArrayList<VRE>();
|
||||||
|
@ -109,16 +109,24 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
|
||||||
|
|
||||||
vreToAdd.setUserBelonging(UserBelonging.NOT_BELONGING);
|
vreToAdd.setUserBelonging(UserBelonging.NOT_BELONGING);
|
||||||
GCubeUser currUser = new LiferayUserManager().getUserByUsername(username);
|
GCubeUser currUser = new LiferayUserManager().getUserByUsername(username);
|
||||||
|
|
||||||
if (gm.listGroupsByUser(currUser.getUserId()).contains(vre)) {
|
if (gm.listGroupsByUser(currUser.getUserId()).contains(vre)) {
|
||||||
vreToAdd.setUserBelonging(UserBelonging.BELONGING);
|
vreToAdd.setUserBelonging(UserBelonging.BELONGING);
|
||||||
|
|
||||||
String catName = gm.getVirtualGroup(vre.getGroupId()).getName();
|
List<VirtualGroup> vreGroups = gm.getVirtualGroups(vre.getGroupId());
|
||||||
|
for (VirtualGroup vreGroup : vreGroups) {
|
||||||
|
for (String category : toReturn.keySet()) {
|
||||||
|
//for preserving order we inserted the keys before
|
||||||
|
if (vreGroup.getName().compareTo(category)==0) {
|
||||||
|
ArrayList<VRE> toUpdate = toReturn.get(category);
|
||||||
|
toUpdate.add(vreToAdd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//for preserving order we inserted the keys before
|
|
||||||
if (toReturn.containsKey(catName)) {
|
|
||||||
ArrayList<VRE> toUpdate = toReturn.get(catName);
|
|
||||||
toUpdate.add(vreToAdd);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue