Compare commits
No commits in common. "master" and "v3.0.0" have entirely different histories.
|
@ -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/create-users-portlet-3.0.1/WEB-INF/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/create-users-portlet-3.0.0/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/create-users-portlet-3.0.1/WEB-INF/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/create-users-portlet-3.0.0/WEB-INF/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -36,5 +36,5 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/create-users-portlet-3.0.1/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/create-users-portlet-3.0.0/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,96 +1,57 @@
|
||||||
<?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="create-users-portlet">
|
<wb-module deploy-name="create-users-portlet">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<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="/" 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/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="email-templates-library-1.5.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/email-templates-library/email-templates-library">
|
|
||||||
|
|
||||||
|
<dependent-module archiveName="email-templates-library-1.4.4.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="/create-users/target/subscribe-users-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
<property name="java-output-path" value="/create-users/target/subscribe-users-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<property name="context-root" value="create-users-portlet"/>
|
<property name="context-root" value="create-users-portlet"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -1,23 +1,15 @@
|
||||||
|
|
||||||
# Changelog for create-users-portlet
|
# Changelog for invites-common-livrary
|
||||||
|
|
||||||
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.0.2] - 2022-06-08
|
|
||||||
|
|
||||||
- Released for HL removal in portal
|
|
||||||
|
|
||||||
## [v3.0.1] - 2021-07-08
|
|
||||||
|
|
||||||
- Feature #21777, migrated to new AccessTokenProvider class
|
|
||||||
- Bug fix #21803, create-user-portlet may not add the yet created user to all the context at once
|
|
||||||
|
|
||||||
## [v3.0.0] - 2020-09-24
|
## [v3.0.0] - 2020-09-24
|
||||||
|
|
||||||
- Ported to git
|
Ported to git
|
||||||
|
|
||||||
- #19812 modified to support the new IAM Keycloak based
|
[#19812] modified to support the new IAM Keycloak based
|
||||||
|
|
||||||
|
|
||||||
## [v1.0.0] - 2016-03-28
|
## [v1.0.0] - 2016-03-28
|
||||||
|
|
16
README.md
16
README.md
|
@ -23,20 +23,30 @@ See [Releases](https://code-repo.d4science.org/gCubeSystem/my-vres/releases).
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
|
|
||||||
* **Massimiliano Assante** ([ORCID](https://orcid.org/0000-0002-3761-1492)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/M.Assante)
|
* **Costantino Perciante** - [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
|
||||||
|
* **Massimiliano Assante** - [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
|
||||||
|
|
||||||
## Maintainers
|
## Maintainers
|
||||||
|
|
||||||
* **Massimiliano Assante** ([ORCID](https://orcid.org/0000-0002-3761-1492)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/M.Assante)
|
* **Massimiliano Assante** - [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
|
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
|
||||||
|
|
||||||
|
|
||||||
## 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 Hybrid 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 see [FUNDING.md](FUNDING.md)
|
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 (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);
|
||||||
|
|
10
pom.xml
10
pom.xml
|
@ -13,7 +13,7 @@
|
||||||
<groupId>org.gcube.portlets.admin</groupId>
|
<groupId>org.gcube.portlets.admin</groupId>
|
||||||
<artifactId>create-users-portlet</artifactId>
|
<artifactId>create-users-portlet</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>3.0.2</version>
|
<version>3.0.0</version>
|
||||||
<name>Create users portlet</name>
|
<name>Create users portlet</name>
|
||||||
<description>
|
<description>
|
||||||
Create users portlet allows a VRE-Manager to enter user's personal data and automatically register he/she in the portal.
|
Create users portlet allows a VRE-Manager to enter user's personal data and automatically register he/she in the portal.
|
||||||
|
@ -31,7 +31,10 @@
|
||||||
<gwtVersion>2.8.2</gwtVersion>
|
<gwtVersion>2.8.2</gwtVersion>
|
||||||
<distroDirectory>distro</distroDirectory>
|
<distroDirectory>distro</distroDirectory>
|
||||||
<liferay.version>6.2.5</liferay.version>
|
<liferay.version>6.2.5</liferay.version>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||||
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -48,7 +51,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.4</version>
|
<version>3.6.0</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -59,11 +62,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>event-publisher-library</artifactId>
|
<artifactId>event-publisher-library</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>event-publisher-portal</artifactId>
|
<artifactId>event-publisher-portal</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -73,6 +78,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>oidc-library-portal</artifactId>
|
<artifactId>oidc-library-portal</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.admin.createusers.server;
|
package org.gcube.portlets.admin.createusers.server;
|
||||||
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
||||||
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
@ -12,10 +13,12 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
|
import org.gcube.common.authorization.library.provider.UmaJWTProvider;
|
||||||
import org.gcube.common.portal.PortalContext;
|
import org.gcube.common.portal.PortalContext;
|
||||||
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
||||||
|
import org.gcube.common.storagehub.client.plugins.AbstractPlugin;
|
||||||
|
import org.gcube.common.storagehub.client.proxies.UserManagerClient;
|
||||||
import org.gcube.portal.mailing.message.Recipient;
|
import org.gcube.portal.mailing.message.Recipient;
|
||||||
import org.gcube.portal.mailing.service.EmailTemplateService;
|
import org.gcube.portal.mailing.service.EmailTemplateService;
|
||||||
import org.gcube.portal.mailing.templates.TemplateWelcomeCreatedAccount;
|
import org.gcube.portal.mailing.templates.TemplateWelcomeCreatedAccount;
|
||||||
|
@ -238,16 +241,12 @@ public class CreateUsersImpl extends RemoteServiceServlet implements HandleUsers
|
||||||
logger.info("Create workspace via shub has been done, proceed with user add to VRE");
|
logger.info("Create workspace via shub has been done, proceed with user add to VRE");
|
||||||
// adding to the current VRE
|
// adding to the current VRE
|
||||||
long userId = userManager.getUserId(user.getScreenName());
|
long userId = userManager.getUserId(user.getScreenName());
|
||||||
logger.info("trying to send the event to create the account for this user to the orchestrator");
|
userManager.assignUserToGroup(getCurrentGroupID(), userId);
|
||||||
|
logger.debug("trying to send the event to create the account for this user to the orchestrator");
|
||||||
long currGroupId = pContext.getCurrentGroupId(getThreadLocalRequest());
|
long currGroupId = pContext.getCurrentGroupId(getThreadLocalRequest());
|
||||||
Group theVRE = GroupLocalServiceUtil.getGroup(currGroupId);
|
Group theVRE = GroupLocalServiceUtil.getGroup(currGroupId);
|
||||||
new CreateUserAddToVrePublisher().publish(
|
new CreateUserAddToVrePublisher().publish(
|
||||||
CreateUserAddToVre.newEvent(user.getScreenName(), name, surname, email, INITIAL_PWD, theVRE));
|
CreateUserAddToVre.newEvent(user.getScreenName(), name, surname, email, INITIAL_PWD, theVRE));
|
||||||
logger.debug("... sleeping 5 seconds");
|
|
||||||
Thread.sleep(5000);
|
|
||||||
logger.debug("... now adding his user to the VRE");
|
|
||||||
userManager.assignUserToGroup(getCurrentGroupID(), userId);
|
|
||||||
|
|
||||||
if (sendEmail)
|
if (sendEmail)
|
||||||
sendEmailToUser(email, name + " " + surname);
|
sendEmailToUser(email, name + " " + surname);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
@ -283,7 +282,7 @@ public class CreateUsersImpl extends RemoteServiceServlet implements HandleUsers
|
||||||
|
|
||||||
private boolean workspaceExists(String usernameToCheck) {
|
private boolean workspaceExists(String usernameToCheck) {
|
||||||
String previousToken = SecurityTokenProvider.instance.get();
|
String previousToken = SecurityTokenProvider.instance.get();
|
||||||
String previousUMAToken = AccessTokenProvider.instance.get();
|
String previousUMAToken = UmaJWTProvider.instance.get();
|
||||||
boolean toReturn = false;
|
boolean toReturn = false;
|
||||||
try {
|
try {
|
||||||
//get the super user
|
//get the super user
|
||||||
|
@ -314,11 +313,11 @@ public class CreateUsersImpl extends RemoteServiceServlet implements HandleUsers
|
||||||
StorageHubClient shc = new StorageHubClient();
|
StorageHubClient shc = new StorageHubClient();
|
||||||
toReturn = shc.userExists(usernameToCheck);
|
toReturn = shc.userExists(usernameToCheck);
|
||||||
logger.info("\nshub userExists(" + usernameToCheck + ") returns "+toReturn);
|
logger.info("\nshub userExists(" + usernameToCheck + ") returns "+toReturn);
|
||||||
AccessTokenProvider.instance.set(previousUMAToken);
|
UmaJWTProvider.instance.set(previousUMAToken);
|
||||||
SecurityTokenProvider.instance.set(previousToken);
|
SecurityTokenProvider.instance.set(previousToken);
|
||||||
return toReturn;
|
return toReturn;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
AccessTokenProvider.instance.set(previousUMAToken);
|
UmaJWTProvider.instance.set(previousUMAToken);
|
||||||
SecurityTokenProvider.instance.set(previousToken);
|
SecurityTokenProvider.instance.set(previousToken);
|
||||||
logger.error("Cannot check if worspace exists for " + usernameToCheck, e);
|
logger.error("Cannot check if worspace exists for " + usernameToCheck, e);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue