git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/accounting-dashboard@169712 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
206d987dfd
commit
a0b4265079
|
@ -20,6 +20,8 @@ import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
|
||||||
import org.gcube.vomanagement.usermanagement.model.GCubeGroup;
|
import org.gcube.vomanagement.usermanagement.model.GCubeGroup;
|
||||||
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||||
import org.gcube.vomanagement.usermanagement.model.VirtualGroup;
|
import org.gcube.vomanagement.usermanagement.model.VirtualGroup;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.liferay.portal.kernel.exception.PortalException;
|
import com.liferay.portal.kernel.exception.PortalException;
|
||||||
import com.liferay.portal.kernel.exception.SystemException;
|
import com.liferay.portal.kernel.exception.SystemException;
|
||||||
|
@ -28,37 +30,11 @@ import com.liferay.portal.model.VirtualHost;
|
||||||
import com.liferay.portal.service.LayoutSetLocalServiceUtil;
|
import com.liferay.portal.service.LayoutSetLocalServiceUtil;
|
||||||
import com.liferay.portal.service.VirtualHostLocalServiceUtil;
|
import com.liferay.portal.service.VirtualHostLocalServiceUtil;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
public class PortalContextTreeProvider implements ContextTreeProvider {
|
public class PortalContextTreeProvider implements ContextTreeProvider {
|
||||||
|
|
||||||
private static GroupManager groupsManager;
|
private static GroupManager groupsManager;
|
||||||
|
|
||||||
@AllArgsConstructor
|
private static Logger log = LoggerFactory.getLogger(PortalContextTreeProvider.class);
|
||||||
@Getter
|
|
||||||
private class VRECategory{
|
|
||||||
private long categoryID;
|
|
||||||
private String name;
|
|
||||||
private String description;
|
|
||||||
}
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Getter
|
|
||||||
private class VRE implements Comparable<VRE>{
|
|
||||||
private String name;
|
|
||||||
private String description;
|
|
||||||
private long id;
|
|
||||||
private String url;
|
|
||||||
private String scope;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int compareTo(VRE vre) {
|
|
||||||
return this.getName().compareTo(vre.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -90,17 +66,17 @@ public class PortalContextTreeProvider implements ContextTreeProvider {
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScopeDescriptor asScopeDescriptor(GCubeGroup group)
|
// private ScopeDescriptor asScopeDescriptor(GCubeGroup group)
|
||||||
throws UserManagementSystemException, GroupRetrievalFault {
|
// throws UserManagementSystemException, GroupRetrievalFault {
|
||||||
ScopeDescriptor toReturn = new ScopeDescriptor(group.getGroupName(),
|
// ScopeDescriptor toReturn = new ScopeDescriptor(group.getGroupName(),
|
||||||
groupsManager.getInfrastructureScope(group.getGroupId()));
|
// groupsManager.getInfrastructureScope(group.getGroupId()));
|
||||||
if (group.getChildren() != null && !group.getChildren().isEmpty()) {
|
// if (group.getChildren() != null && !group.getChildren().isEmpty()) {
|
||||||
for (GCubeGroup child : group.getChildren()) {
|
// for (GCubeGroup child : group.getChildren()) {
|
||||||
toReturn.getChildren().add(asScopeDescriptor(child));
|
// toReturn.getChildren().add(asScopeDescriptor(child));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return toReturn;
|
// return toReturn;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -212,4 +188,71 @@ public class PortalContextTreeProvider implements ContextTreeProvider {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private class VRECategory{
|
||||||
|
private long categoryID;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
public VRECategory(long categoryID, String name, String description) {
|
||||||
|
super();
|
||||||
|
this.categoryID = categoryID;
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getCategoryID() {
|
||||||
|
return categoryID;
|
||||||
|
}
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private class VRE implements Comparable<VRE>{
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
private long id;
|
||||||
|
private String url;
|
||||||
|
private String scope;
|
||||||
|
|
||||||
|
|
||||||
|
public VRE(String name, String description, long id, String url, String scope) {
|
||||||
|
super();
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.id = id;
|
||||||
|
this.url = url;
|
||||||
|
this.scope = scope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public String getScope() {
|
||||||
|
return scope;
|
||||||
|
}
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(VRE vre) {
|
||||||
|
return this.getName().compareTo(vre.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue