fixed getGroupName for getVresFromInfrastructure

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-sharing-widget@97867 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-06-26 15:44:22 +00:00
parent 267185cbee
commit d28c852a08
1 changed files with 22 additions and 5 deletions

View File

@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import org.gcube.application.framework.core.session.ASLSession; import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.application.framework.core.session.SessionManager;
import org.gcube.common.homelibrary.home.HomeLibrary; import org.gcube.common.homelibrary.home.HomeLibrary;
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException; import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException; import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
@ -50,7 +51,7 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements
WorkspaceSharingService { WorkspaceSharingService {
protected Logger logger = LoggerFactory.getLogger(WorkspaceSharingServiceImpl.class); protected static Logger logger = LoggerFactory.getLogger(WorkspaceSharingServiceImpl.class);
protected GWTWorkspaceSharingBuilder getGWTWorkspaceBuilder() protected GWTWorkspaceSharingBuilder getGWTWorkspaceBuilder()
@ -134,7 +135,7 @@ public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements
PortalContext context = PortalContext.getConfiguration(); PortalContext context = PortalContext.getConfiguration();
logger.info("context.getInfrastructureName(): "+context.getInfrastructureName()); logger.info("context.getInfrastructureName(): "+context.getInfrastructureName());
logger.info("aslSession.getScope(): "+ aslSession.getScope()); logger.info("aslSession.getGroupName(): "+ aslSession.getGroupName());
List<VO> lsVOs = WsUtil.getVresFromInfrastructure(context.getInfrastructureName(), aslSession.getScope()); List<VO> lsVOs = WsUtil.getVresFromInfrastructure(context.getInfrastructureName(), aslSession.getScope());
listContactsModel.addAll(builder.buildGXTListContactsModelFromVOs(lsVOs)); listContactsModel.addAll(builder.buildGXTListContactsModelFromVOs(lsVOs));
} }
@ -489,12 +490,28 @@ public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements
WorkspaceSharingServiceImpl impl = new WorkspaceSharingServiceImpl(); WorkspaceSharingServiceImpl impl = new WorkspaceSharingServiceImpl();
try { PortalContext context = PortalContext.getConfiguration();
List<InfoContactModel> groups = impl.getFakeGroups(); logger.info("context.getInfrastructureName(): "+context.getInfrastructureName());
String user = "pippo";
String sessionID = "123";
ASLSession aslSession = SessionManager.getInstance().getASLSession(sessionID, user);
aslSession.setScope("/gcube/devsec");
// aslSession.set
logger.info("aslSession.getGroupName(): "+ aslSession.getGroupName());
for (InfoContactModel infoContactModel : groups) { try {
System.out.println(infoContactModel); List<VO> lsVOs = WsUtil.getVresFromInfrastructure(context.getInfrastructureName(), "devsec");
for (VO vo : lsVOs) {
System.out.println(vo.getName());
for (VRE vre : vo.getVres()) {
System.out.println("VRE: "+vre.getName());
}
} }
// for (InfoContactModel infoContactModel : groups) {
// System.out.println(infoContactModel);
// }
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block