Compare commits
No commits in common. "master" and "v3.0.0" have entirely different histories.
|
@ -1,15 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/create-users-portlet-3.1.0-SNAPSHOT/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>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/create-users-portlet-3.1.0-SNAPSHOT/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>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
|
@ -29,7 +28,6 @@
|
|||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
|
||||
|
@ -38,5 +36,5 @@
|
|||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/create-users-portlet-3.1.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/create-users-portlet-3.0.0/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -3,19 +3,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-module deploy-name="create-users-portlet-3.1.0-SNAPSHOT">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-module deploy-name="create-users-portlet">
|
||||
|
||||
|
||||
|
||||
|
@ -25,41 +13,29 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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"/>
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
</dependent-module>
|
||||
|
||||
|
||||
|
||||
|
@ -69,32 +45,14 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<property name="context-root" value="create-users-portlet"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</wb-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</project-modules>
|
||||
|
|
19
CHANGELOG.md
19
CHANGELOG.md
|
@ -1,28 +1,15 @@
|
|||
|
||||
# Changelog for create-users-portlet
|
||||
# Changelog for invites-common-livrary
|
||||
|
||||
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).
|
||||
|
||||
## [v3.1.0-SNAPSHOT] - 2024-09-25
|
||||
|
||||
- Updated storage hub dependency
|
||||
- Removed social-networking-library
|
||||
|
||||
## [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
|
||||
|
||||
- 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
|
||||
|
|
16
README.md
16
README.md
|
@ -23,20 +23,30 @@ See [Releases](https://code-repo.d4science.org/gCubeSystem/my-vres/releases).
|
|||
|
||||
## 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
|
||||
|
||||
* **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
|
||||
|
||||
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
|
||||
|
||||
|
||||
## About the gCube Framework
|
||||
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
|
||||
Infrastructures enabling the dynamic deployment of Virtual Research Environments
|
||||
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);
|
||||
|
55
pom.xml
55
pom.xml
|
@ -1,29 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
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>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.1.0</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>org.gcube.portlets.admin</groupId>
|
||||
<artifactId>create-users-portlet</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.0.0</version>
|
||||
<name>Create users portlet</name>
|
||||
<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.
|
||||
The portlet also sends a temporary password to the just registered user.
|
||||
</description>
|
||||
|
||||
<scm>
|
||||
<connection>
|
||||
scm:git:https://code-repo.d4science.org/gCubeSystem/create-users-portlet.git</connection>
|
||||
<developerConnection>
|
||||
scm:git:https://code-repo.d4science.org/gCubeSystem/create-users-portlet.git</developerConnection>
|
||||
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/create-users-portlet.git</connection>
|
||||
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/create-users-portlet.git</developerConnection>
|
||||
<url>https://code-repo.d4science.org/gCubeSystem/create-users-portlet</url>
|
||||
</scm>
|
||||
|
||||
|
@ -32,7 +31,10 @@
|
|||
<gwtVersion>2.8.2</gwtVersion>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<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>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
@ -49,7 +51,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<version>3.6.0</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
@ -60,11 +62,13 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>event-publisher-library</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>event-publisher-portal</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -74,12 +78,13 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>oidc-library-portal</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common.portal</groupId>
|
||||
|
@ -134,20 +139,9 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>social-library-stubs</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.social-networking</groupId>
|
||||
<artifactId>social-service-client</artifactId>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>social-networking-library</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
@ -173,8 +167,7 @@
|
|||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!-- Output classes directly into the webapp, so that IDEs and "mvn
|
||||
process-classes"
|
||||
<!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes"
|
||||
update them in DevMode -->
|
||||
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
|
||||
|
||||
|
@ -194,8 +187,7 @@
|
|||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<!-- Plugin configuration. There are many available options, see
|
||||
gwt-maven-plugin
|
||||
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
|
||||
documentation at codehaus.org -->
|
||||
<configuration>
|
||||
<runTarget>Statistics.html</runTarget>
|
||||
|
@ -226,6 +218,13 @@
|
|||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- SA Plugin -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.portlets.admin.createusers.server;
|
||||
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
||||
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
@ -12,10 +13,12 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
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.UmaJWTProvider;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
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.service.EmailTemplateService;
|
||||
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");
|
||||
// adding to the current VRE
|
||||
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());
|
||||
Group theVRE = GroupLocalServiceUtil.getGroup(currGroupId);
|
||||
new CreateUserAddToVrePublisher().publish(
|
||||
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)
|
||||
sendEmailToUser(email, name + " " + surname);
|
||||
}catch(Exception e){
|
||||
|
@ -283,7 +282,7 @@ public class CreateUsersImpl extends RemoteServiceServlet implements HandleUsers
|
|||
|
||||
private boolean workspaceExists(String usernameToCheck) {
|
||||
String previousToken = SecurityTokenProvider.instance.get();
|
||||
String previousUMAToken = AccessTokenProvider.instance.get();
|
||||
String previousUMAToken = UmaJWTProvider.instance.get();
|
||||
boolean toReturn = false;
|
||||
try {
|
||||
//get the super user
|
||||
|
@ -314,11 +313,11 @@ public class CreateUsersImpl extends RemoteServiceServlet implements HandleUsers
|
|||
StorageHubClient shc = new StorageHubClient();
|
||||
toReturn = shc.userExists(usernameToCheck);
|
||||
logger.info("\nshub userExists(" + usernameToCheck + ") returns "+toReturn);
|
||||
AccessTokenProvider.instance.set(previousUMAToken);
|
||||
UmaJWTProvider.instance.set(previousUMAToken);
|
||||
SecurityTokenProvider.instance.set(previousToken);
|
||||
return toReturn;
|
||||
} catch (Exception e) {
|
||||
AccessTokenProvider.instance.set(previousUMAToken);
|
||||
UmaJWTProvider.instance.set(previousUMAToken);
|
||||
SecurityTokenProvider.instance.set(previousToken);
|
||||
logger.error("Cannot check if worspace exists for " + usernameToCheck, e);
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue