" +
+ html += "
" +
"
" +
"
";
setHTML(html);
diff --git a/src/main/java/org/gcube/portlet/user/my_vres/server/MyVREsServiceImpl.java b/src/main/java/org/gcube/portlet/user/my_vres/server/MyVREsServiceImpl.java
index 0f1e324..4a562a8 100644
--- a/src/main/java/org/gcube/portlet/user/my_vres/server/MyVREsServiceImpl.java
+++ b/src/main/java/org/gcube/portlet/user/my_vres/server/MyVREsServiceImpl.java
@@ -29,6 +29,7 @@ import com.liferay.portal.model.Group;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.User;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
+import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.theme.ThemeDisplay;
/**
@@ -51,7 +52,7 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
private VO rootVO = new VO();
- private boolean withinPortal = false;
+
/**
* the current ASLSession
@@ -66,18 +67,30 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
}
else {
_log.info("LIFERAY PORTAL DETECTED user=" + user);
- withinPortal = true;
}
return SessionManager.getInstance().getASLSession(sessionID, user);
}
-
+ /**
+ *
+ * @return true if you're running into the portal, false if in development
+ */
+ private boolean isWithinPortal() {
+ try {
+ UserLocalServiceUtil.getService();
+ return true;
+ }
+ catch (com.liferay.portal.kernel.bean.BeanLocatorException ex) {
+ _log.trace("Development Mode ON");
+ return false;
+ }
+ }
/**
* first method called by the UI
*/
public ArrayList
getInfrastructureVOs() {
getASLSession();
//_log.trace("getInfrastructureVOs method called");
- if (!withinPortal)
+ if (!isWithinPortal())
return getFakeVOs();
//return new ArrayList();
else
diff --git a/src/main/webapp/WEB-INF/portlet.xml b/src/main/webapp/WEB-INF/portlet.xml
index d606c6d..5dc6d95 100644
--- a/src/main/webapp/WEB-INF/portlet.xml
+++ b/src/main/webapp/WEB-INF/portlet.xml
@@ -3,16 +3,16 @@
MyVREs
- gCube MyVREs Login Portlet
+ Your Virtual Research Environments
org.gcube.portlet.user.my_vres.server.portlet.MyVREsPortlet
0
text/html
- My Virtual Research Environments
- gCube MyVREs Login
- gCube MyVREs Login
+ Your Virtual Research Environments
+ VREs Login
+ VRE
administrator