Compare commits

...

9 Commits

14 changed files with 142 additions and 63 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/join-vre-3.6.1-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/join-vre-3.7.1/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/join-vre-3.6.1-SNAPSHOT/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/join-vre-3.7.1/WEB-INF/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -15,11 +15,13 @@
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/> <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
@ -39,5 +41,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/join-vre-3.6.1-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/join-vre-3.7.1/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -40,6 +40,16 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>com.gwtplugins.gdt.eclipse.core.webAppProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.gwtplugins.gwt.eclipse.core.gwtProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
@ -56,5 +66,6 @@
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>com.google.gwt.eclipse.core.gwtNature</nature> <nature>com.google.gwt.eclipse.core.gwtNature</nature>
<nature>com.liferay.ide.core.liferayNature</nature> <nature>com.liferay.ide.core.liferayNature</nature>
<nature>com.gwtplugins.gwt.eclipse.core.gwtNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View File

@ -0,0 +1,4 @@
eclipse.preferences.version=1
lastWarOutDir=/Users/massi/workspace/join-vre/target/join-vre-3.7.1
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -5,4 +5,5 @@ org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.source=1.8

View File

@ -1,13 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="join-vre-portlet">
<wb-module deploy-name="join-vre">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="invites-common-library-1.5.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/invites-common-library/invites-common-library"> <dependent-module archiveName="email-templates-library-1.5.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/email-templates-library/email-templates-library">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <dependent-module archiveName="invites-common-library-1.5.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/invites-common-library/invites-common-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="join-vre"/> <property name="context-root" value="join-vre"/>
</wb-module>
</wb-module>
</project-modules> </project-modules>

View File

@ -5,4 +5,5 @@
<installed facet="liferay.portlet" version="6.0"/> <installed facet="liferay.portlet" version="6.0"/>
<installed facet="jst.web" version="3.0"/> <installed facet="jst.web" version="3.0"/>
<installed facet="java" version="1.8"/> <installed facet="java" version="1.8"/>
<installed facet="com.gwtplugins.gwt.facet" version="1.0"/>
</faceted-project> </faceted-project>

View File

@ -4,7 +4,19 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v3.7.0] [r4.23.0] - 2020-06-03 ## [v3.7.3] - 2022-01-03
- Make the motivation mandatory when someone asks to join a VRE
## [v3.7.2] - 2021-04-30
- Removed a forgotten sysout in the code :(
## [v3.7.1] - 2020-10-16
- No need to retrieve the user membership request status if the VRE Access policy is Open
## [v3.7.0] - 2020-06-03
Fixes Fixes

26
FUNDING.md Normal file
View File

@ -0,0 +1,26 @@
# Acknowledgments
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
- the H2020 research and innovation programme
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);

View File

@ -2,7 +2,6 @@
Join VRE Portlet is the Explore portlet of the Gateway when the user is not logged in. When logged in it allows the user to register to VREs. Join VRE Portlet is the Explore portlet of the Gateway when the user is not logged in. When logged in it allows the user to register to VREs.
## Structure of the project ## Structure of the project
* The source code is present in the src folder. * The source code is present in the src folder.
@ -22,11 +21,11 @@ See [Releases](https://code-repo.d4science.org/gCubeSystem/join-vre/releases).
## Authors ## Authors
* **Massimiliano Assante** - [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience) * **Massimiliano Assante** - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/M.Assante)
## Maintainers ## Maintainers
* **Massimiliano Assante** - [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience) * **Massimiliano Assante** - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/M.Assante)
## License ## License
@ -35,16 +34,8 @@ This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LIC
## About the gCube Framework ## About the gCube Framework
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an
open-source software toolkit used for building and operating Hybrid Data open-source software toolkit used for building and operating Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies. by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of European Union programmes including: The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)
- the Sixth Framework Programme for Research and Technological Development
- DILIGENT (grant no. 004260);
- the Seventh Framework Programme for research, technological development and demonstration
- D4Science (grant no. 212488), D4Science-II (grant no.239019), ENVRI (grant no. 283465), EUBrazilOpenBio (grant no. 288754), iMarine(grant no. 283644);
- the H2020 research and innovation programme
- BlueBRIDGE (grant no. 675680), EGIEngage (grant no. 654142), ENVRIplus (grant no. 654182), Parthenos (grant no. 654119), SoBigData (grant no. 654024),DESIRA (grant no. 818194), ARIADNEplus (grant no. 823914), RISIS2 (grant no. 824091), PerformFish (grant no. 727610), AGINFRAplus (grant no. 731001);

View File

@ -3,18 +3,19 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <parent>
<parent>
<artifactId>maven-parent</artifactId> <artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId> <groupId>org.gcube.tools</groupId>
<version>1.1.0</version> <version>1.1.0</version>
<relativePath /> <relativePath />
</parent> </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>join-vre</artifactId> <artifactId>join-vre</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>3.7.0</version> <version>3.7.3</version>
<name>gCube Join VRE Portlet</name> <name>gCube Join VRE Portlet</name>
<description>Display the available VRE to Join</description> <description>Display the available VRE to Join</description>
<scm> <scm>
@ -38,7 +39,7 @@
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId> <artifactId>maven-portal-bom</artifactId>
<version>3.6.0</version> <version>3.6.3</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -17,6 +17,7 @@ import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler; 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.Window.Location;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
@ -24,11 +25,11 @@ import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
public class RequestMembershipDialog extends Composite { public class RequestMembershipDialog extends Composite {
private static final String OPTIONAL_COMMENT_TEXT = "You can add an optional comment here, it will be attached to your request and read by this VRE Moderators."; private static final String MANDATORY_MOTIVATION_TEXT = "Please state your motivation here, it will be attached to your request and read by this VRE Moderators (Mandatory field).";
private final JoinServiceAsync joinService = GWT.create(JoinService.class); private final JoinServiceAsync joinService = GWT.create(JoinService.class);
private static RequestAccessModalUiBinder uiBinder = GWT private static RequestAccessModalUiBinder uiBinder = GWT
.create(RequestAccessModalUiBinder.class); .create(RequestAccessModalUiBinder.class);
@ -38,12 +39,12 @@ public class RequestMembershipDialog extends Composite {
@UiField Modal m; @UiField Modal m;
@UiField Button close; @UiField Button close;
@UiField Button confirmRequest; @UiField Button confirmRequest;
@UiField TextArea optionalText; @UiField TextArea mandatoryMotivation;
@UiField HelpBlock helpBlock; @UiField HelpBlock helpBlock;
@UiField Icon loading; @UiField Icon loading;
private VRE myVRE = null; private VRE myVRE = null;
private ResponsivePanel responsivePanel; private ResponsivePanel responsivePanel;
@UiField HelpBlock touGatewayBlock; @UiField HelpBlock touGatewayBlock;
@UiField HTML touText; @UiField HTML touText;
@ -51,8 +52,8 @@ public class RequestMembershipDialog extends Composite {
initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));
this.myVRE = myVRE; this.myVRE = myVRE;
this.responsivePanel = responsivePanel; this.responsivePanel = responsivePanel;
optionalText.setWidth("95%"); mandatoryMotivation.setWidth("95%");
optionalText.setPlaceholder(OPTIONAL_COMMENT_TEXT); mandatoryMotivation.setPlaceholder(MANDATORY_MOTIVATION_TEXT);
} }
public void show() { public void show() {
@ -85,12 +86,12 @@ public class RequestMembershipDialog extends Composite {
((Element)m.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom"); ((Element)m.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom");
touText.setHTML(result); touText.setHTML(result);
} }
m.show(); m.show();
} }
}); });
m.show(); m.show();
} }
@ -100,27 +101,32 @@ public class RequestMembershipDialog extends Composite {
} }
@UiHandler("confirmRequest") @UiHandler("confirmRequest")
void confirm(ClickEvent e) { void confirm(ClickEvent e) {
String text = optionalText.getText(); String text = mandatoryMotivation.getText();
confirmRequest.setEnabled(false); if (text.isEmpty() || text.length() < 8) {
joinService.addMembershipRequest(myVRE, text, new AsyncCallback<Void>() { Window.alert("The motivation is mandatory, please state your motivation appropriately.");
@Override }
public void onSuccess(Void result) { else {
confirmRequest.removeFromParent(); confirmRequest.setEnabled(false);
optionalText.removeFromParent(); joinService.addMembershipRequest(myVRE, text, new AsyncCallback<Void>() {
m.setTitle("Thank you, your request has been sent successfully"); @Override
helpBlock.setText("You will receive an email as soon as your request will be processed."); public void onSuccess(Void result) {
responsivePanel.setPending(myVRE); confirmRequest.removeFromParent();
confirmRequest.setEnabled(false); mandatoryMotivation.removeFromParent();
touText.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 responsivePanel.setPending(myVRE);
public void onFailure(Throwable caught) { confirmRequest.setEnabled(false);
confirmRequest.removeFromParent(); touText.removeFromParent();
optionalText.removeFromParent(); }
m.setTitle("An error occurred! Your request has not been sent"); @Override
helpBlock.setText("An email with the cause of the error has been sent to the support team, we'll be back to you shortly."); public void onFailure(Throwable caught) {
touText.removeFromParent(); confirmRequest.removeFromParent();
} mandatoryMotivation.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.");
touText.removeFromParent();
}
});
}
} }
} }

View File

@ -8,7 +8,7 @@
visible="false" /> visible="false" />
<b:ControlGroup> <b:ControlGroup>
<b:Controls> <b:Controls>
<b:TextArea ui:field="optionalText" alternateSize="XLARGE" /> <b:TextArea ui:field="mandatoryMotivation" alternateSize="XLARGE" />
<b:HelpBlock ui:field="helpBlock">Your request will be reviewed by this VRE moderators, you will be notified via email about the result as soon as possible (tipically within a few hours).</b:HelpBlock> <b:HelpBlock ui:field="helpBlock">Your request will be reviewed by this VRE moderators, you will be notified via email about the result as soon as possible (tipically within a few hours).</b:HelpBlock>
<b:HelpBlock ui:field="touGatewayBlock" visible="false"> <b:HelpBlock ui:field="touGatewayBlock" visible="false">
By asking access to this VRE you agree to the terms indicated in By asking access to this VRE you agree to the terms indicated in

View File

@ -527,16 +527,19 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
String infraScope = gm.getInfrastructureScope(selectedVRE.getGroupId()); String infraScope = gm.getInfrastructureScope(selectedVRE.getGroupId());
String friendlyURL = GCubePortalConstants.PREFIX_GROUP_URL+selectedVRE.getFriendlyURL(); String friendlyURL = GCubePortalConstants.PREFIX_GROUP_URL+selectedVRE.getFriendlyURL();
VreMembershipType mType = getVREMembershipType(selectedVRE.getMembershipType());
GCubeUser currUser = PortalContext.getConfiguration().getCurrentUser(getThreadLocalRequest()); GCubeUser currUser = PortalContext.getConfiguration().getCurrentUser(getThreadLocalRequest());
//check if the user belongs to it //check if the user belongs to it
UserBelonging belongEnum = UserBelonging.NOT_BELONGING; UserBelonging belongEnum = UserBelonging.NOT_BELONGING;
if (gm.listGroupsByUser(currUser.getUserId()).contains(selectedVRE)) if (gm.listGroupsByUser(currUser.getUserId()).contains(selectedVRE))
belongEnum = UserBelonging.BELONGING; belongEnum = UserBelonging.BELONGING;
else if (checkPending(currUser.getUserId(), selectedVRE.getGroupId())) else if (checkPending(currUser.getUserId(), selectedVRE.getGroupId()) && mType == VreMembershipType.RESTRICTED)
belongEnum = UserBelonging.PENDING; belongEnum = UserBelonging.PENDING;
//return the selected VRE for this user //return the selected VRE for this user
toReturn = new VRE(groupId, vreName, vreDescription, vreLogoURL, infraScope, friendlyURL, belongEnum, getVREMembershipType(selectedVRE.getMembershipType())); toReturn = new VRE(groupId, vreName, vreDescription, vreLogoURL, infraScope, friendlyURL, belongEnum, mType);
} catch (Exception e) { } catch (Exception e) {
_log.error("Something wrong happened while trying to getSite by id, probably the group id is wrong. " + e.getMessage()); _log.error("Something wrong happened while trying to getSite by id, probably the group id is wrong. " + e.getMessage());
} }

View File

@ -58,7 +58,7 @@ public class LoginServiceUtil {
for (int i = 0; i < allGroups.size(); i++) { for (int i = 0; i < allGroups.size(); i++) {
long grId = allGroups.get(i).getGroupId(); long grId = allGroups.get(i).getGroupId();
String groupScope = groupManager.getInfrastructureScope(grId); String groupScope = groupManager.getInfrastructureScope(grId);
System.out.println("Comparing: " + groupScope + " " + scope); //System.out.println("Comparing: " + groupScope + " " + scope);
if (groupScope.equals(scope)) { if (groupScope.equals(scope)) {
groupId = allGroups.get(i).getGroupId(); groupId = allGroups.get(i).getGroupId();
break; break;