diff --git a/distro/changelog.xml b/distro/changelog.xml
index 8bb1cf2..b223db3 100644
--- a/distro/changelog.xml
+++ b/distro/changelog.xml
@@ -2,6 +2,7 @@
Removed ASL Session
Implemented Feature #4877 remove VRE association to single Category constraint
+ Info Button redircets to VRE Public page (if a public page exists for the VRE)
diff --git a/src/main/java/org/gcube/portlets/user/joinvre/client/ui/VreThumbnail.java b/src/main/java/org/gcube/portlets/user/joinvre/client/ui/VreThumbnail.java
index 588aa69..99d6776 100644
--- a/src/main/java/org/gcube/portlets/user/joinvre/client/ui/VreThumbnail.java
+++ b/src/main/java/org/gcube/portlets/user/joinvre/client/ui/VreThumbnail.java
@@ -93,8 +93,12 @@ public class VreThumbnail extends Composite {
@UiHandler("vreInfoButton")
void infoClick(ClickEvent e) {
- InfoPanel modal = new InfoPanel(myVre);
- modal.show();
+ if (myVre.getPublicURL() == null) {
+ InfoPanel modal = new InfoPanel(myVre);
+ modal.show();
+ } else {
+ Window.open(myVre.getPublicURL(),"_blank","");
+ }
}
public void setPending() {
diff --git a/src/main/java/org/gcube/portlets/user/joinvre/server/JoinServiceImpl.java b/src/main/java/org/gcube/portlets/user/joinvre/server/JoinServiceImpl.java
index 78c9284..9037a9e 100644
--- a/src/main/java/org/gcube/portlets/user/joinvre/server/JoinServiceImpl.java
+++ b/src/main/java/org/gcube/portlets/user/joinvre/server/JoinServiceImpl.java
@@ -25,17 +25,14 @@ import org.gcube.vomanagement.usermanagement.UserManager;
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
-import org.gcube.vomanagement.usermanagement.exception.VirtualGroupNotExistingException;
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
-import org.gcube.vomanagement.usermanagement.model.CustomAttributeKeys;
import org.gcube.vomanagement.usermanagement.model.GCubeGroup;
import org.gcube.vomanagement.usermanagement.model.GCubeMembershipRequest;
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.gcube.vomanagement.usermanagement.model.GroupMembershipType;
import org.gcube.vomanagement.usermanagement.model.MembershipRequestStatus;
import org.gcube.vomanagement.usermanagement.model.VirtualGroup;
-import org.gcube.vomanagement.usermanagement.util.ManagementUtils;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.liferay.portal.kernel.cache.CacheRegistryUtil;
@@ -45,10 +42,6 @@ import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.model.Group;
import com.liferay.portal.model.VirtualHost;
-import com.liferay.portal.security.auth.PrincipalThreadLocal;
-import com.liferay.portal.security.permission.PermissionChecker;
-import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil;
-import com.liferay.portal.security.permission.PermissionThreadLocal;
import com.liferay.portal.service.GroupLocalServiceUtil;
import com.liferay.portal.service.LayoutSetLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
@@ -62,7 +55,7 @@ import com.liferay.portal.util.PortalUtil;
public class JoinServiceImpl extends RemoteServiceServlet implements JoinService {
private static Log _log = LogFactoryUtil.getLog(JoinServiceImpl.class);
private static DatabookStore store;
-
+ public static final String PREFIX_PUBLIC_URL = "/web";
/**
*
* @return true if you're running into the portal, false if in development
@@ -161,6 +154,10 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
ArrayList toUpdate = toReturn.get(vre);
UserBelonging belongs = UserBelonging.NOT_BELONGING;
VRE toAdd = new VRE(vreID,vreName, vreDescription, vreLogoURL, groupName, friendlyURL, belongs, getVREMembershipType(vreSite.getMembershipType()));
+ if (GroupLocalServiceUtil.getGroup(vreID).getPublicLayoutsPageCount() > 0) {
+ String publicURL = PREFIX_PUBLIC_URL+vreSite.getFriendlyURL();
+ toAdd.setPublicURL(publicURL);
+ }
if (currUser != null) {
//check if the user belongs to it
if (currUserGroups.contains(vreSite)) {
diff --git a/src/main/java/org/gcube/portlets/user/joinvre/shared/VRE.java b/src/main/java/org/gcube/portlets/user/joinvre/shared/VRE.java
index 116c53d..8fedcdd 100644
--- a/src/main/java/org/gcube/portlets/user/joinvre/shared/VRE.java
+++ b/src/main/java/org/gcube/portlets/user/joinvre/shared/VRE.java
@@ -11,7 +11,7 @@ public class VRE extends ResearchEnvironment implements Serializable, Comparable
protected VreMembershipType membershipType;
protected long id;
-
+ protected String publicURL;
public VRE() {
super();
@@ -42,6 +42,15 @@ public class VRE extends ResearchEnvironment implements Serializable, Comparable
}
+
+ public String getPublicURL() {
+ return publicURL;
+ }
+
+ public void setPublicURL(String publicURL) {
+ this.publicURL = publicURL;
+ }
+
public VreMembershipType getMembershipType() {
return membershipType;
}