diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 2ff775f..8b65df3 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -4,6 +4,9 @@ + + uses + diff --git a/distro/descriptor.xml b/distro/descriptor.xml index dc46ade..b3f5628 100644 --- a/distro/descriptor.xml +++ b/distro/descriptor.xml @@ -16,6 +16,7 @@ README LICENSE changelog.xml + profile.xml 755 true diff --git a/pom.xml b/pom.xml index 0bc91fa..7a9a63e 100644 --- a/pom.xml +++ b/pom.xml @@ -16,13 +16,11 @@ 3.0.0-SNAPSHOT gCube Join VRE Portlet Display the available VRE to Join - scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId} scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId} http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId} - 2.7.0 @@ -86,6 +84,16 @@ aslcore provided + + org.gcube.portal + invites-common-library + [1.0.0-SNAPSHOT,) + + + org.gcube.portal + social-networking-library + provided + org.gcube.dvos usermanagement-core @@ -97,6 +105,12 @@ ${liferay.version} provided + + javax.mail + javax.mail-api + 1.4.5 + provided + javax.portlet portlet-api @@ -213,6 +227,7 @@ + diff --git a/src/main/java/org/gcube/portlets/user/joinvre/client/JoinService.java b/src/main/java/org/gcube/portlets/user/joinvre/client/JoinService.java index 2f67d4a..6612f48 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/client/JoinService.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/client/JoinService.java @@ -2,7 +2,6 @@ package org.gcube.portlets.user.joinvre.client; import java.util.ArrayList; import java.util.LinkedHashMap; -import java.util.TreeMap; import org.gcube.portlets.user.joinvre.shared.VRE; import org.gcube.portlets.user.joinvre.shared.VRECategory; @@ -13,13 +12,15 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; /** * The client side stub for the RPC service. * @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it - * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ */ @RemoteServiceRelativePath("JoinService") public interface JoinService extends RemoteService { LinkedHashMap> getVREs(); - Boolean joinVRE(Long vreID); + String joinVRE(Long vreId); + VRE getSelectedVRE(Long vreId); + + void addMembershipRequest(String scope, String optionalMessage); } diff --git a/src/main/java/org/gcube/portlets/user/joinvre/client/JoinServiceAsync.java b/src/main/java/org/gcube/portlets/user/joinvre/client/JoinServiceAsync.java index 9967867..fec19d6 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/client/JoinServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/client/JoinServiceAsync.java @@ -2,7 +2,6 @@ package org.gcube.portlets.user.joinvre.client; import java.util.ArrayList; import java.util.LinkedHashMap; -import java.util.TreeMap; import org.gcube.portlets.user.joinvre.shared.VRE; import org.gcube.portlets.user.joinvre.shared.VRECategory; @@ -11,11 +10,15 @@ import com.google.gwt.user.client.rpc.AsyncCallback; /** * @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it - * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ */ public interface JoinServiceAsync { void getVREs(AsyncCallback< LinkedHashMap>> callback); - void joinVRE(Long vreID, AsyncCallback callback); + void joinVRE(Long vreId, AsyncCallback callback); + + void getSelectedVRE(Long vreId, AsyncCallback callback); + + void addMembershipRequest(String scope, String optionalMessage, + AsyncCallback callback); } diff --git a/src/main/java/org/gcube/portlets/user/joinvre/client/JoinVRE.java b/src/main/java/org/gcube/portlets/user/joinvre/client/JoinVRE.java index ac3054a..a249160 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/client/JoinVRE.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/client/JoinVRE.java @@ -1,19 +1,95 @@ package org.gcube.portlets.user.joinvre.client; +import java.util.logging.Level; +import java.util.logging.Logger; + import org.gcube.portlets.user.joinvre.client.responsive.ResponsivePanel; +import org.gcube.portlets.user.joinvre.shared.UserBelonging; +import org.gcube.portlets.user.joinvre.shared.VRE; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.Window.Location; +import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.RootPanel; /** * @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it */ public class JoinVRE implements EntryPoint { + Logger logger = Logger.getLogger(JoinVRE.class.getName()); + public static final String GET_OID_PARAMETER = "siteId"; + private final JoinServiceAsync joinService = GWT.create(JoinService.class); public void onModuleLoad() { - GWT.log("onModuleLoad"); - RootPanel.get("JoinVRE-Container").add(new ResponsivePanel()); + checkIsReferral(); + } + /** + * first async callback + */ + private void checkIsReferral() { + logger.log(Level.INFO,"checkIsReferral()"); + if (getSiteLiferayId() == null) { + displayVREs(); + } + else { + Long vreId = -1L; + try { + vreId = Long.parseLong(getSiteLiferayId()); + } + catch (Exception ex) { + logger.log(Level.WARNING, "org id is not a number " + ex.getMessage()); + return; + } + joinService.getSelectedVRE(vreId, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + logger.log(Level.SEVERE,"getSelectedVRE error " + caught.getMessage()); + Window.alert("Server error"); + } + @Override + public void onSuccess(final VRE vre) { + logger.log(Level.INFO, "A VRE was Returned"); + if (vre == null) { + GWT.log("A VRE Returned is null"); + displayVREs(); + return; + } + else { + ResponsivePanel rp = null; + logger.log(Level.INFO, "A Valid VRE was Returned"); + switch (vre.getUserBelonging()) { + case BELONGING: + logger.log(Level.INFO, "User is Belonging"); + Location.assign(vre.getFriendlyURL()); + break; + case PENDING: + logger.log(Level.INFO, "User is Pending"); + rp = displayVREs(); + rp.displayPending(); + break; + default: //Not belonging + logger.log(Level.INFO, "User is NOT Belonging"); + rp = displayVREs(); + rp.requestMembership(vre); + break; + } + } + } + }); + } + } + private ResponsivePanel displayVREs() { + ResponsivePanel toReturn = new ResponsivePanel(); + RootPanel.get("JoinVRE-Container").add(toReturn); + return toReturn; + } + /** + * check if it has to show just one feed + * @return + */ + private String getSiteLiferayId() { + return Window.Location.getParameter(GET_OID_PARAMETER); } - } diff --git a/src/main/java/org/gcube/portlets/user/joinvre/client/responsive/ResponsivePanel.java b/src/main/java/org/gcube/portlets/user/joinvre/client/responsive/ResponsivePanel.java index b052eb5..17f5bb2 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/client/responsive/ResponsivePanel.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/client/responsive/ResponsivePanel.java @@ -5,6 +5,7 @@ import java.util.LinkedHashMap; import org.gcube.portlets.user.joinvre.client.JoinService; import org.gcube.portlets.user.joinvre.client.JoinServiceAsync; +import org.gcube.portlets.user.joinvre.client.ui.RequestMembershipDialog; import org.gcube.portlets.user.joinvre.client.ui.VreThumbnail; import org.gcube.portlets.user.joinvre.shared.VRE; import org.gcube.portlets.user.joinvre.shared.VRECategory; @@ -12,6 +13,7 @@ import org.gcube.portlets.user.joinvre.shared.VRECategory; import com.github.gwtbootstrap.client.ui.PageHeader; import com.github.gwtbootstrap.client.ui.Thumbnails; import com.google.gwt.core.client.GWT; +import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; @@ -41,6 +43,7 @@ public class ResponsivePanel extends Composite { header.setSubtext(cat.getDescription()); mainPanel.add(header); mainPanel.add(getVREThumbnails(categories, cat)); + } } } @@ -69,6 +72,15 @@ public class ResponsivePanel extends Composite { mainPanel.clear(); mainPanel.add(new HTML("
" + message + ". Please reload this page.
")); } + + public void displayPending() { + Window.alert("Pending"); + } + + public void requestMembership(VRE vre) { + RequestMembershipDialog modal = new RequestMembershipDialog(vre); + modal.show(); + } } diff --git a/src/main/java/org/gcube/portlets/user/joinvre/client/ui/RequestMembershipDialog.java b/src/main/java/org/gcube/portlets/user/joinvre/client/ui/RequestMembershipDialog.java new file mode 100644 index 0000000..f4e7303 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/joinvre/client/ui/RequestMembershipDialog.java @@ -0,0 +1,74 @@ +package org.gcube.portlets.user.joinvre.client.ui; + +import org.gcube.portlets.user.joinvre.client.JoinService; +import org.gcube.portlets.user.joinvre.client.JoinServiceAsync; +import org.gcube.portlets.user.joinvre.shared.VRE; + +import com.github.gwtbootstrap.client.ui.Button; +import com.github.gwtbootstrap.client.ui.HelpBlock; +import com.github.gwtbootstrap.client.ui.Modal; +import com.github.gwtbootstrap.client.ui.TextArea; +import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.uibinder.client.UiHandler; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Widget; + +public class RequestMembershipDialog extends Composite { + private final JoinServiceAsync joinService = GWT.create(JoinService.class); + + private static RequestAccessModalUiBinder uiBinder = GWT + .create(RequestAccessModalUiBinder.class); + + interface RequestAccessModalUiBinder extends + UiBinder { + } + @UiField Modal m; + @UiField Button close; + @UiField Button confirmRequest; + @UiField TextArea optionalText; + @UiField HelpBlock helpBlock; + VRE myVRE = null; + + public RequestMembershipDialog(VRE myVRE) { + initWidget(uiBinder.createAndBindUi(this)); + this.myVRE = myVRE; + optionalText.setWidth("95%"); + optionalText.setPlaceholder("You can add an optional comment here"); + } + + public void show() { + m.setTitle("Join request for " +myVRE.getName()); + m.show(); + } + + @UiHandler("close") + void handleClick(ClickEvent e) { + m.hide(); + } + @UiHandler("confirmRequest") + void confirm(ClickEvent e) { + String text = optionalText.getText() == null || optionalText.getText().equals("") ? " ": optionalText.getText(); + + joinService.addMembershipRequest(myVRE.getinfraScope(), text, new AsyncCallback() { + @Override + public void onSuccess(Void result) { + confirmRequest.removeFromParent(); + optionalText.removeFromParent(); + m.setTitle("Thank you, your request has been sent successfully"); + helpBlock.setText("You will receive an email as soon as your request will be processed."); + } + @Override + public void onFailure(Throwable caught) { + confirmRequest.removeFromParent(); + optionalText.removeFromParent(); + m.setTitle("An error occurred! Your request has not been sent"); + helpBlock.setText("An email with the cause of the error has been sent to the support team, we'll be back to you shortly."); + } + }); + } +} diff --git a/src/main/java/org/gcube/portlets/user/joinvre/client/ui/RequestMembershipDialog.ui.xml b/src/main/java/org/gcube/portlets/user/joinvre/client/ui/RequestMembershipDialog.ui.xml new file mode 100644 index 0000000..d663b06 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/joinvre/client/ui/RequestMembershipDialog.ui.xml @@ -0,0 +1,20 @@ + + + + + + + Please confirm your request + + + + + + Confirm Request + Close + + + + \ No newline at end of file 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 269bb82..b6b61b4 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 @@ -2,6 +2,7 @@ package org.gcube.portlets.user.joinvre.client.ui; import org.gcube.portlets.user.joinvre.client.JoinService; import org.gcube.portlets.user.joinvre.client.JoinServiceAsync; +import org.gcube.portlets.user.joinvre.client.JoinVRE; import org.gcube.portlets.user.joinvre.shared.VRE; import com.github.gwtbootstrap.client.ui.Button; @@ -14,6 +15,7 @@ import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.Window.Location; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; @@ -58,20 +60,21 @@ public class VreThumbnail extends Composite { modal.show(); } else { - joinService.joinVRE(myVre.getId(), new AsyncCallback() { + joinService.joinVRE(myVre.getId(), new AsyncCallback() { @Override public void onFailure(Throwable caught) { String errorDescription = "Error while trying to join to" + myVre.getName() + " VRE. Please Try again later. " - + "If the problem persist contact system administrator"; + + "If the problem persist please contact us at www.gcube-system.org"; Window.alert(errorDescription); } @Override - public void onSuccess(Boolean result) { - Window.open("/group/data-e-infrastructure-gateway/join-new?orgid="+myVre.getId(), "_self", ""); + public void onSuccess(String currentGroupName) { + Location.assign("/group/" +currentGroupName +"/explore?"+JoinVRE.GET_OID_PARAMETER+"="+myVre.getId()); + //RequestMembershipDialog modal = new RequestMembershipDialog(currentGroupName); + //modal.show(); } - }); } } diff --git a/src/main/java/org/gcube/portlets/user/joinvre/server/EmailNotification.java b/src/main/java/org/gcube/portlets/user/joinvre/server/EmailNotification.java new file mode 100644 index 0000000..62e6651 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/joinvre/server/EmailNotification.java @@ -0,0 +1,106 @@ +package org.gcube.portlets.user.joinvre.server; + +import java.util.Date; +import java.util.Properties; + +import javax.mail.Address; +import javax.mail.Message; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; + +import org.gcube.common.portal.PortalContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * A class for sending email + * + * @author M. Assante + * + */ +public class EmailNotification { + private static final String SENDER_EMAIL = "notificationSenderEmail"; + private static final String GATEWAY_NAME = "portalinstancename"; + /** + * The sender of the email + */ + private String emailSender; + + /** + * The recipients of the email + */ + private String emailrecipients[]; + + /** + * Email's subject + */ + private String emailSubject; + + /** + * Email's body message + */ + private String emailBody; + + private String portalName; + + /** Logger */ + private static Logger _log = LoggerFactory.getLogger(EmailNotification.class); + + /** + * Class's constructor + * + * @param sender + * @param recipients + * @param subject + * @param body + */ + public EmailNotification(String sender, String recipients[], String subject, String body) { + this.emailSender = PortalContext.getConfiguration().getSenderEmail(); + this.emailrecipients = recipients; + this.emailSubject = subject; + this.emailBody = body; + this.portalName = PortalContext.getConfiguration().getGatewayName(); + } + + public void sendEmail() { + Properties props = System.getProperties(); + String mailServiceHost = "localhost"; + props.put("mail.smtp.host", mailServiceHost); + String mailServicePort = "25"; + props.put("mail.smtp.port", mailServicePort); + Session session = Session.getDefaultInstance(props, null); + session.setDebug(true); + Message mimeMessage = new MimeMessage(session); + + try { + // EMAIL SENDER + Address from = new InternetAddress(emailSender, portalName); + mimeMessage.setHeader("Content-Type", "text/html; charset=UTF-8"); + mimeMessage.setFrom(from); + + // EMAIL RECIPIENTS + for (int i=0; i vHosts = VirtualHostLocalServiceUtil.getVirtualHosts(0, VirtualHostLocalServiceUtil.getVirtualHostsCount()); + for (VirtualHost virtualHost : vHosts) { + _log.debug("Found " + virtualHost.getHostname()); + if (virtualHost.getHostname().compareTo("localhost") != 0 && + virtualHost.getLayoutSetId() != 0 && + virtualHost.getHostname().compareTo(currentVirtualHost) == 0) { + long layoutSetId = virtualHost.getLayoutSetId(); + site = LayoutSetLocalServiceUtil.getLayoutSet(layoutSetId).getGroup(); + return site; + } + } + return null; + } /** * * @param session the Asl Session @@ -93,60 +130,9 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService try { if (isWithinPortal()) { - toReturn = getPortalOrganizationMappedToVRE(); + toReturn = getPortalSitesMappedToVRE(); } else { - VRECategory devsecCategory = new VRECategory(1, "Z_Development", "designed to apply Data Mining techniques to biological data. " - + "The algorithms are executed in a distributed fashion on the e-Infrastructure nodes or on local multi-core machines."); - ArrayList vres = new ArrayList(); - - vres.add(new VRE(0, "BiodiversityLab", "" - + "

BiodiversityLab

" - + "The BiodiversityLab is a VRE designed to provide a collection of applications that allow scholars to perform complete experiments about " - + "single individuals or groups of marine species. The VRE allows to:
  • inspect species maps;
  • produce a species distribution map by means of either an expert system (AquaMaps) or a machine learning model (e.g. Neural Networks);" - + "
  • analyse species observation trends;" - + "
  • inspect species occurrence data;" - + "
  • inspect species descriptions and characteristics;" - + "
  • perform analysis of climatic changes and of their effects on species distribution;" - + "
  • produce GIS maps for geo-spatial datasets;" - + "
  • discover Taxa names;" - + "
  • cluster occurrence data;" - + "
  • estimate similarities among habitats." - + "
" - + "", "", "http://placehold.it/200x200", "/group/devsec", UserBelonging.NOT_BELONGING, false)); - vres.add(new VRE(0, "Scalable Data", "" - + "

Scalable Data Mining

" - + "The Scalable Data Mining is a VRE designed to apply Data Mining techniques to biological data. The algorithms are executed in a distributed fashion on the e-Infrastructure nodes or on local multi-core machines. Scalability is thus meant as distributed data processing but even as services dynamically provided to the users. The system is scalable in the number of users and in the size of the data to process. Statistical data processing can be applied to perform Niche Modelling or Ecological Modelling experiments. Other applications can use general purpose techniques like Bayesian models. Time series of observations can be managed as well, in order to classify trends, catch anomaly patterns and perform simulations. The idea under the distributed computation for data mining techniques is to overcome common limitations that can happen when using statistical algorithms: " - + "single individuals or groups of marine species. The VRE allows to:
  • inspect species maps;
  • produce a species distribution map by means of either an expert system (AquaMaps) or a machine learning model (e.g. Neural Networks);" - + "
  • analyse species observation trends;" - + "
  • inspect species occurrence data;" - + "
  • inspect species descriptions and characteristics;" - + "
  • perform analysis of climatic changes and of their effects on species distribution;" - + "
  • produce GIS maps for geo-spatial datasets;" - + "
  • discover Taxa names;" - + "
  • cluster occurrence data;" - + "
  • estimate similarities among habitats." - + "
" - + "", "", "http://placehold.it/200x200", "/group/devsec", UserBelonging.NOT_BELONGING, true)); - toReturn.put(devsecCategory, vres); - - devsecCategory = new VRECategory(2, "Sailing", "Sailing prod desc"); - vres = new ArrayList(); - vres.add(new VRE(1, "PerformanceEvaluationInAquaculture", "devVRE VRE description", "http://placehold.it/200x100", "http://placehold.it/200x100", "/group/devVRE", UserBelonging.NOT_BELONGING, false, true, "http://i-marine.d4science.org")); - vres.add(new VRE(2, "devmode", "devmode VRE description", "http://placehold.it/200x100", "https://placeholdit.imgix.net/~text?txtsize=19&txt=200%C3%97100&w=200&h=100", "/group/devmode", UserBelonging.NOT_BELONGING, true)); - vres.add(new VRE(1, "StrategicInvestmentAnalysis", "devVRE VRE description", "", "https://placeholdit.imgix.net/~text?txtsize=19&txt=200%C3%97100&w=200&h=100", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); - vres.add(new VRE(2, "devmode2", "devmode VRE description", "http://placehold.it/200x100", "", "/group/devmode", UserBelonging.NOT_BELONGING, true)); - vres.add(new VRE(1, "devVR3E", "devVRE VRE description", "http://placehold.it/200x200", "aaaa", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); - vres.add(new VRE(2, "devmode3", "devmode VRE description", "http://placehold.it/200x200", "", "/group/devmode", UserBelonging.NOT_BELONGING, true)); - vres.add(new VRE(1, "devVRE4", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); - vres.add(new VRE(2, "devmode4", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true)); - vres.add(new VRE(1, "devVRE5", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); - vres.add(new VRE(2, "devmode5", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true)); - vres.add(new VRE(1, "devVRE6", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); - vres.add(new VRE(2, "devmode6", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true)); - vres.add(new VRE(1, "devVRE7", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); - vres.add(new VRE(2, "devmod76", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true)); - toReturn.put(devsecCategory, vres); - } + toReturn = getFakePortalVREs(); } } catch (Exception e) { _log.error("Error getting VREs", e); } @@ -155,14 +141,6 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService return toReturn; } - private String getPortalBasicUrl() { - HttpServletRequest request = this.getThreadLocalRequest(); - String protocol = (request.isSecure()) ? "https://" : "http://" ; - String port = (request.getServerPort() == 80) ? "" : String.format(":%d", request.getServerPort()); - String portalBasicUrl = String.format("%s%s%s", protocol, request.getServerName(), port); - _log.debug(String.format("getPortalBasicUrl : %s", portalBasicUrl)); - return portalBasicUrl; - } public VRECustomAttributes getVRECustomAttr(GCubeGroup group) throws PortalException, SystemException { VRECustomAttributes toReturn = new VRECustomAttributes(); @@ -184,52 +162,23 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService _log.trace("RETURNING VRECustomAttributes:\n" + toReturn.toString()); return toReturn; } - //TODO: put it in users mana - private String getVirtualGroupName(Group site){ - try { - _log.debug("Setting Thread Permission"); - long userId = LiferayUserManager.getAdmin().getUserId(); - PrincipalThreadLocal.setName(userId); - PermissionChecker permissionChecker = PermissionCheckerFactoryUtil.create(UserLocalServiceUtil.getUser(userId)); - PermissionThreadLocal.setPermissionChecker(permissionChecker); - - if (site.getExpandoBridge().getAttribute(CustomAttributeKeys.VIRTUAL_GROUP.getKeyName()) == null || site.getExpandoBridge().getAttribute(CustomAttributeKeys.VIRTUAL_GROUP.getKeyName()).equals("")) { - _log.warn(String.format("Attribute %s not initialized.", CustomAttributeKeys.VIRTUAL_GROUP.getKeyName())); - return null; - } else { - String[] values = (String[]) site.getExpandoBridge().getAttribute(CustomAttributeKeys.VIRTUAL_GROUP.getKeyName()); - if (values != null) - return values[0]; - else return ""; - } - } catch (Exception e) { - e.printStackTrace(); - return "Exception "; - } - } - - /** * * @return the Virtual groups with their VREs in the order estabilished in the LR Control Panel * @throws SystemException * @throws PortalException */ - public LinkedHashMap> getPortalOrganizationMappedToVRE() throws Exception { - + public LinkedHashMap> getPortalSitesMappedToVRE() throws Exception { + GroupManager gm = new LiferayGroupManager(); LinkedHashMap> toReturn = new LinkedHashMap>(); //before iterating the actual groups create the virtualGroups in the correct order - List virtualGroups = GCubeSiteManagerImpl.getVirtualGroups(); - for (String vg : virtualGroups) { - String[] splits = vg.split("\\|"); - String gName = splits[0]; - String gDescription = splits[1]; + List virtualGroups = gm.getVirtualGroups(); + for (VirtualGroup vg : virtualGroups) { ArrayList toCreate = new ArrayList(); - VRECategory cat = new VRECategory(1L, gName, gDescription); + VRECategory cat = new VRECategory(1L, vg.getName(), vg.getDescription()); toReturn.put(cat, toCreate); } - GroupManager gm = new LiferayGroupManager(); GCubeGroup rootGroupVO = gm.getRootVO(); @@ -244,7 +193,7 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService for (GCubeGroup vOrg : rootGroupVO.getChildren()) { for (GCubeGroup vreOrganization : vOrg.getChildren()) { long vreID = vreOrganization.getGroupId(); - String vreName = vreOrganization.getName(); + String vreName = vreOrganization.getGroupName(); String vreDescription = vreOrganization.getDescription(); long logoId = vreOrganization.getLogoId(); @@ -259,10 +208,7 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService boolean isExternal = attrs.isExternal(); String urlIfAny = attrs.getUrlIfAny(); - Group theLRGroup = GroupLocalServiceUtil.getGroup(vreID); - String catName = getVirtualGroupName(theLRGroup); - String[] splits = catName.split("\\|"); - catName = splits[0]; + String catName = gm.getVirtualGroup(vreID).getName(); VRECategory toLookFor = null; for (VRECategory vre : toReturn.keySet()) { @@ -285,9 +231,131 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService } + + /** + * useful method for development purpose + * @return + */ + private LinkedHashMap> getFakePortalVREs() { + LinkedHashMap> toReturn = new LinkedHashMap>(); + VRECategory devsecCategory = new VRECategory(1, "Z_Development", "designed to apply Data Mining techniques to biological data. " + + "The algorithms are executed in a distributed fashion on the e-Infrastructure nodes or on local multi-core machines."); + ArrayList vres = new ArrayList(); + + vres.add(new VRE(0, "BiodiversityLab", "" + + "

BiodiversityLab

" + + "The BiodiversityLab is a VRE designed to provide a collection of applications that allow scholars to perform complete experiments about " + + "single individuals or groups of marine species. The VRE allows to:
  • inspect species maps;
  • produce a species distribution map by means of either an expert system (AquaMaps) or a machine learning model (e.g. Neural Networks);" + + "
  • analyse species observation trends;" + + "
  • inspect species occurrence data;" + + "
  • inspect species descriptions and characteristics;" + + "
  • perform analysis of climatic changes and of their effects on species distribution;" + + "
  • produce GIS maps for geo-spatial datasets;" + + "
  • discover Taxa names;" + + "
  • cluster occurrence data;" + + "
  • estimate similarities among habitats." + + "
" + + "", "", "http://placehold.it/200x200", "/group/devsec", UserBelonging.NOT_BELONGING, false)); + vres.add(new VRE(0, "Scalable Data", "" + + "

Scalable Data Mining

" + + "The Scalable Data Mining is a VRE designed to apply Data Mining techniques to biological data. The algorithms are executed in a distributed fashion on the e-Infrastructure nodes or on local multi-core machines. Scalability is thus meant as distributed data processing but even as services dynamically provided to the users. The system is scalable in the number of users and in the size of the data to process. Statistical data processing can be applied to perform Niche Modelling or Ecological Modelling experiments. Other applications can use general purpose techniques like Bayesian models. Time series of observations can be managed as well, in order to classify trends, catch anomaly patterns and perform simulations. The idea under the distributed computation for data mining techniques is to overcome common limitations that can happen when using statistical algorithms: " + + "single individuals or groups of marine species. The VRE allows to:
  • inspect species maps;
  • produce a species distribution map by means of either an expert system (AquaMaps) or a machine learning model (e.g. Neural Networks);" + + "
  • analyse species observation trends;" + + "
  • inspect species occurrence data;" + + "
  • inspect species descriptions and characteristics;" + + "
  • perform analysis of climatic changes and of their effects on species distribution;" + + "
  • produce GIS maps for geo-spatial datasets;" + + "
  • discover Taxa names;" + + "
  • cluster occurrence data;" + + "
  • estimate similarities among habitats." + + "
" + + "", "", "http://placehold.it/200x200", "/group/devsec", UserBelonging.NOT_BELONGING, true)); + toReturn.put(devsecCategory, vres); + + devsecCategory = new VRECategory(2, "Sailing", "Sailing prod desc"); + vres = new ArrayList(); + vres.add(new VRE(1, "PerformanceEvaluationInAquaculture", "devVRE VRE description", "http://placehold.it/200x100", "http://placehold.it/200x100", "/group/devVRE", UserBelonging.NOT_BELONGING, false, true, "http://i-marine.d4science.org")); + vres.add(new VRE(2, "devmode", "devmode VRE description", "http://placehold.it/200x100", "https://placeholdit.imgix.net/~text?txtsize=19&txt=200%C3%97100&w=200&h=100", "/group/devmode", UserBelonging.NOT_BELONGING, true)); + vres.add(new VRE(1, "StrategicInvestmentAnalysis", "devVRE VRE description", "", "https://placeholdit.imgix.net/~text?txtsize=19&txt=200%C3%97100&w=200&h=100", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); + vres.add(new VRE(2, "devmode2", "devmode VRE description", "http://placehold.it/200x100", "", "/group/devmode", UserBelonging.NOT_BELONGING, true)); + vres.add(new VRE(1, "devVR3E", "devVRE VRE description", "http://placehold.it/200x200", "aaaa", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); + vres.add(new VRE(2, "devmode3", "devmode VRE description", "http://placehold.it/200x200", "", "/group/devmode", UserBelonging.NOT_BELONGING, true)); + vres.add(new VRE(1, "devVRE4", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); + vres.add(new VRE(2, "devmode4", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true)); + vres.add(new VRE(1, "devVRE5", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); + vres.add(new VRE(2, "devmode5", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true)); + vres.add(new VRE(1, "devVRE6", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); + vres.add(new VRE(2, "devmode6", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true)); + vres.add(new VRE(1, "devVRE7", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false)); + vres.add(new VRE(2, "devmod76", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true)); + toReturn.put(devsecCategory, vres); + return toReturn; + } + @Override - public Boolean joinVRE(Long vreID) { - // Here for future improvement - return new Boolean(true); + public VRE getSelectedVRE(Long groupId) { + _log.debug("*getting Selected Research Environment from referral, site id = " + groupId); + ASLSession session = getASLSession(); + VRE toReturn = null; + try { + GroupManager gm = new LiferayGroupManager(); + UserManager um = new LiferayUserManager(); + GCubeGroup selectedVRE = gm.getGroup(groupId); + String vreName = selectedVRE.getGroupName(); + String vreDescription = selectedVRE.getDescription(); + + long logoId = selectedVRE.getLogoId(); + String vreLogoURL = "/image/layout_set_logo?img_id="+ logoId; + String infraScope = gm.getInfrastructureScope(selectedVRE.getGroupId()); + String friendlyURL = GCubePortalConstants.PREFIX_GROUP_URL+selectedVRE.getFriendlyURL(); + VRECustomAttributes attrs = getVRECustomAttr(selectedVRE); + boolean requireAccessGrant = attrs.isUponRequest(); + boolean isExternal = attrs.isExternal(); + String urlIfAny = attrs.getUrlIfAny(); + + GCubeUser currUser = um.getUserByUsername(session.getUsername()); + //check if the user belongs to it + UserBelonging belongEnum = UserBelonging.NOT_BELONGING; + if (gm.listGroupsByUser(currUser.getUserId()).contains(selectedVRE)) + belongEnum = UserBelonging.BELONGING; + else if (checkPending(session.getUsername(), selectedVRE.getGroupId())) + belongEnum = UserBelonging.PENDING; + //return the selected VRE for this user + toReturn = new VRE(groupId, vreName, vreDescription, vreLogoURL, infraScope, friendlyURL, belongEnum, requireAccessGrant, isExternal, urlIfAny); + } catch (Exception e) { + _log.error("Something wrong happened while trying to getSite by id, probably the group id is wrong. " + e.getMessage()); + } + return toReturn; + } + /** + * + * @param screenName + * @param groupId + * @return + * @throws UserRetrievalFault + * @throws GroupRetrievalFault + * @throws UserManagementSystemException + */ + private static boolean checkPending(String screenName, long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault { + UserManager um = new LiferayUserManager(); + List requests = um.listMembershipRequestsByGroup(groupId); + for (GCubeMembershipRequest r : requests) { + if ( r.getStatus() == MembershipRequestStatus.REQUEST && (r.getRequestingUser().getUsername().compareTo(screenName)==0)) + return true; + } + return false; + } + + @Override + public void addMembershipRequest(String scope, String optionalMessage) { + String username = getASLSession().getUsername(); + try { + LoginServiceUtil.addMembershipRequest(username, scope, optionalMessage, getPortalUrl(), PortalContext.getConfiguration().getGatewayName()); + } catch (Exception e) { + e.printStackTrace(); + } + } + public String getPortalUrl() throws PortalException, SystemException { + return PortalUtil.getPortalURL(this.getThreadLocalRequest()); } } diff --git a/src/main/java/org/gcube/portlets/user/joinvre/server/LoginServiceUtil.java b/src/main/java/org/gcube/portlets/user/joinvre/server/LoginServiceUtil.java new file mode 100644 index 0000000..d7e4db5 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/joinvre/server/LoginServiceUtil.java @@ -0,0 +1,235 @@ +package org.gcube.portlets.user.joinvre.server; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.gcube.common.portal.PortalContext; +import org.gcube.portal.databook.shared.Invite; +import org.gcube.portlets.user.joinvre.shared.VO; +import org.gcube.vomanagement.usermanagement.GroupManager; +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.impl.LiferayGroupManager; +import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager; +import org.gcube.vomanagement.usermanagement.model.GCubeGroup; +import org.gcube.vomanagement.usermanagement.model.GCubeRole; +import org.gcube.vomanagement.usermanagement.model.GCubeUser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Massimiliano Assante ISTI-CNR + * + */ +public class LoginServiceUtil { + /** + * + */ + public static final String ROOT_ORG = "rootorganization"; + /** + * + */ + public static final String PUBLIC_LAYOUT_NAME = " Data e-Infrastructure gateway"; + /** + * + */ + public static final String GUEST_COMMUNITY_NAME = "Guest"; + + private static Logger _log = LoggerFactory.getLogger(LoginServiceUtil.class); + + protected static ArrayList getAdministratorsEmails(String scope) { + LiferayUserManager userManager = new LiferayUserManager(); + LiferayGroupManager groupManager = new LiferayGroupManager(); + long groupId = -1; + try { + List allGroups = groupManager.listGroups(); + _log.debug("Number of groups retrieved: " + allGroups.size()); + for (int i = 0; i < allGroups.size(); i++) { + long grId = allGroups.get(i).getGroupId(); + String groupScope = groupManager.getInfrastructureScope(grId); + System.out.println("Comparing: " + groupScope + " " + scope); + if (groupScope.equals(scope)) { + groupId = allGroups.get(i).getGroupId(); + break; + } + } + } catch (UserManagementSystemException e) { + e.printStackTrace(); + } catch (GroupRetrievalFault e) { + e.printStackTrace(); + } + Map> usersAndRoles = null; + try { + usersAndRoles = userManager.listUsersAndRolesByGroup(groupId); + } catch (Exception e) { + e.printStackTrace(); + } + Set users = usersAndRoles.keySet(); + ArrayList adminEmailsList = new ArrayList(); + for (GCubeUser usr:users) { + List roles = usersAndRoles.get(usr); + for (int i = 0; i < roles.size(); i++) { + if (roles.get(i).getRoleName().equals("VO-Admin") || roles.get(i).getRoleName().equals("VRE-Manager")) { + adminEmailsList.add(usr.getEmail()); + _log.debug("Admin: " + usr.getFullname()); + break; + } + } + } + return adminEmailsList; + } + + /** + * + * @param scope . + * @param optionalMessage . + */ + public static void addMembershipRequest(String username, String scope, String optionalMessage,String portalbasicurl, String gatewayName) throws Exception{ + _log.info("gatewayName = " + gatewayName + " Message=" + optionalMessage); + + + ArrayList adminEmails = LoginServiceUtil.getAdministratorsEmails(scope); + + UserManager um = new LiferayUserManager(); + GCubeUser currUser = um.getUserByUsername(username); + String name = currUser.getFirstName(); + String lastname = currUser.getLastName(); + + String selectedVRE = scope.substring(scope.lastIndexOf("/")+1, scope.length()); + _log.info("Requested MEMBERSHIP for: " + selectedVRE + " scope: " + scope); + GroupManager gm = new LiferayGroupManager(); + um.requestMembership(currUser.getUserId(), gm.getGroupIdFromInfrastructureScope(scope), optionalMessage); + + StringBuffer body = new StringBuffer(); + body.append("

Dear manager of "+ scope +",
this email message was automatically generated by " + portalbasicurl +" to inform you that "); + body.append("

"); + body.append("

"); + body.append(""+name + " " + lastname +" has requested access to the following environment: "); + body.append("

"); + body.append("" + scope+""); + body.append("
"); + body.append("
"); + body.append("Username: " + username); + body.append("
"); + body.append("e-mail: " + currUser.getEmail()); + body.append("

"); + body.append("

"); + body.append("The request is annotated with the following text: " + optionalMessage); + body.append("

"); + body.append("

"); + body.append("You are kindly asked to manage such request by either approving or rejecting it through the user management " + + "facilities available at "); + body.append("
" + portalbasicurl); + body.append("

"); + body.append("

"); + body.append("WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain"+ + " information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. " + + "If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message."); + body.append("

"); + + String[] allMails = new String[adminEmails.size()]; + + adminEmails.toArray(allMails); + + EmailNotification mailToAdmin = new EmailNotification(PortalContext.getConfiguration().getSenderEmail(), allMails , "[" + gatewayName + "] - Join Request", body.toString()); + + mailToAdmin.sendEmail(); + } + + /** + * + * @param scope . + * @param optionalMessage . + */ + public static void notifyUserSelfRegistration(String username, VO rootVO, String scope, String portalbasicurl, String gatewayName) throws Exception { + + ArrayList adminEmails = LoginServiceUtil.getAdministratorsEmails(scope); + LiferayUserManager um = new LiferayUserManager(); + GCubeUser currUser = um.getUserByUsername(username); + String name = currUser.getFirstName(); + String lastname = currUser.getLastName(); + + + StringBuffer body = new StringBuffer(); + body.append("

Dear manager of "+ scope +",
this email message was automatically generated by " + portalbasicurl +" to inform you that "); + body.append("

"); + body.append("

"); + body.append(""+name + " " + lastname +" has self registered to the following environment: "); + body.append("

"); + body.append("" + scope+""); + body.append("
"); + body.append("
"); + body.append("Username: " + username); + body.append("
"); + body.append("e-mail: " + currUser.getEmail()); + body.append("

"); + body.append("

"); + body.append("
" + portalbasicurl); + body.append("

"); + body.append("

"); + body.append("WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain"+ + " information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. " + + "If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message."); + body.append("

"); + + String[] allMails = new String[adminEmails.size()]; + + adminEmails.toArray(allMails); + + EmailNotification mailToAdmin = new EmailNotification("no-reply@d4science.org", allMails , "[" + gatewayName + "] - Self Registration", body.toString()); + + mailToAdmin.sendEmail(); + } + + + /** + * + * @param scope . + * @param optionalMessage . + */ + public static void notifyUserAcceptedInvite(String username, VO rootVO, String scope, String portalbasicurl, String gatewayName, Invite invite) throws Exception { + + ArrayList adminEmails = LoginServiceUtil.getAdministratorsEmails(scope); + + LiferayUserManager um = new LiferayUserManager(); + GCubeUser currUser = um.getUserByUsername(username); + String name = currUser.getFirstName(); + String lastname = currUser.getLastName(); + + + StringBuffer body = new StringBuffer(); + body.append("

Dear manager of "+ scope +",
this email message was automatically generated by " + portalbasicurl +" to inform you that "); + body.append("

"); + body.append("

"); + body.append(""+name + " " + lastname +" has accepted an invitation to the following environment: "); + body.append("

"); + body.append("" + scope+""); + body.append("
"); + body.append("
"); + body.append("Username: " + username); + body.append("
"); + body.append("e-mail: " + currUser.getEmail()); + body.append("

"); + body.append("

"); + body.append("The invitation was sent by " + invite.getSenderFullName() +" (" + invite.getSenderUserId()+") on " + invite.getTime()+""); + body.append("

"); + body.append("

"); + body.append("WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain"+ + " information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. " + + "If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message."); + body.append("

"); + + String[] allMails = new String[adminEmails.size()]; + + adminEmails.toArray(allMails); + + EmailNotification mailToAdmin = new EmailNotification("no-reply@d4science.org", allMails , "[" + gatewayName + "] - Accepted Invitation", body.toString()); + + mailToAdmin.sendEmail(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/joinvre/shared/ResearchEnvironment.java b/src/main/java/org/gcube/portlets/user/joinvre/shared/ResearchEnvironment.java index b563743..57a177d 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/shared/ResearchEnvironment.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/shared/ResearchEnvironment.java @@ -12,7 +12,7 @@ public class ResearchEnvironment implements Serializable { private String imageURL; - private String groupName; + private String infraScope; private String friendlyURL; @@ -23,13 +23,13 @@ public class ResearchEnvironment implements Serializable { } public ResearchEnvironment(String name, String description, - String imageURL, String groupName, String friendlyURL, + String imageURL, String infraScope, String friendlyURL, UserBelonging userBelonging) { super(); this.name = name; this.description = description; this.imageURL = imageURL; - this.groupName = groupName; + this.infraScope = infraScope; this.friendlyURL = friendlyURL; this.userBelonging = userBelonging; } @@ -58,12 +58,12 @@ public class ResearchEnvironment implements Serializable { this.imageURL = imageURL; } - public String getGroupName() { - return groupName; + public String getinfraScope() { + return infraScope; } - public void setGroupName(String groupName) { - this.groupName = groupName; + public void setinfraScope(String infraScope) { + this.infraScope = infraScope; } public String getFriendlyURL() { diff --git a/src/main/java/org/gcube/portlets/user/joinvre/shared/VO.java b/src/main/java/org/gcube/portlets/user/joinvre/shared/VO.java index 31a8360..947d915 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/shared/VO.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/shared/VO.java @@ -30,9 +30,9 @@ public class VO extends ResearchEnvironment implements Comparable, Serializa * @param vres . */ public VO(String voName, String description, String imageURL, - String vomsGroupName, String friendlyURL, + String infraScope, String friendlyURL, UserBelonging userBelonging, boolean isRoot, ArrayList vres) { - super(voName, description, imageURL, vomsGroupName, friendlyURL, userBelonging); + super(voName, description, imageURL, infraScope, friendlyURL, userBelonging); this.isRoot = isRoot; this.vres = vres; } 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 3fe080e..100360e 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 @@ -23,15 +23,15 @@ public class VRE extends ResearchEnvironment implements Serializable, Comparable * @param vreName * @param description * @param imageURL - * @param vomsGroupName + * @param groupName * @param friendlyURL * @param categories * @param userBelonging * @param uponRequest */ public VRE(long id, String vreName, String description, String imageURL, - String vomsGroupName, String friendlyURL, UserBelonging userBelonging, boolean uponRequest) { - super(vreName, description, imageURL, vomsGroupName, friendlyURL, userBelonging); + String infraScope, String friendlyURL, UserBelonging userBelonging, boolean uponRequest) { + super(vreName, description, imageURL, infraScope, friendlyURL, userBelonging); this.uponRequest = uponRequest; this.id = id; isExternal = false; @@ -39,8 +39,8 @@ public class VRE extends ResearchEnvironment implements Serializable, Comparable } public VRE(long id, String vreName, String description, String imageURL, - String vomsGroupName, String friendlyURL, UserBelonging userBelonging, boolean uponRequest, boolean isExternal, String url) { - super(vreName, description, imageURL, vomsGroupName, friendlyURL, userBelonging); + String infraScope, String friendlyURL, UserBelonging userBelonging, boolean uponRequest, boolean isExternal, String url) { + super(vreName, description, imageURL, infraScope, friendlyURL, userBelonging); this.uponRequest = uponRequest; this.id = id; this.isExternal = isExternal; diff --git a/src/main/resources/org/gcube/portlets/user/joinvre/JoinVRE.gwt.xml b/src/main/resources/org/gcube/portlets/user/joinvre/JoinVRE.gwt.xml index 71ff8d7..1f86f29 100644 --- a/src/main/resources/org/gcube/portlets/user/joinvre/JoinVRE.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/joinvre/JoinVRE.gwt.xml @@ -1,14 +1,18 @@ + + - + + + diff --git a/src/main/webapp/WEB-INF/liferay-plugin-package.properties b/src/main/webapp/WEB-INF/liferay-plugin-package.properties index ca0406a..d4ae677 100644 --- a/src/main/webapp/WEB-INF/liferay-plugin-package.properties +++ b/src/main/webapp/WEB-INF/liferay-plugin-package.properties @@ -4,6 +4,6 @@ module-incremental-version=1 tags= short-description= change-log= -page-url=http://www.d4science.org -author=D4Science Org. -licenses=EUPL \ No newline at end of file +page-url=http://www.gcube-system.org +author=Massimiliano Assante +licenses=EUPL