Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
Massimiliano Assante | fcf36d16ff | |
Massimiliano Assante | 45034760d8 | |
Massimiliano Assante | cb4a950ca7 | |
Massimiliano Assante | c6ed0c8764 | |
Massimiliano Assante | 35213deb22 | |
Massimiliano Assante | a23ed8113e | |
Massimiliano Assante | d6ba384097 | |
Massimiliano Assante | 7cf9dd8700 | |
Massimiliano Assante | 742e5ca99c | |
Massimiliano Assante | 6fa3ec35e3 |
|
@ -1,16 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
|
||||
|
||||
<wb-module deploy-name="accept-invite-portlet">
|
||||
|
||||
|
||||
<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="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<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>
|
||||
<dependent-module archiveName="email-templates-library-1.4.3.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/email-templates-library/email-templates-library">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
||||
|
||||
<property name="context-root" value="accept-invite-portlet"/>
|
||||
|
||||
|
||||
<property name="java-output-path" value="/accept-invite-portlet/target/classes"/>
|
||||
|
||||
|
||||
</wb-module>
|
||||
|
||||
|
||||
</project-modules>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<root>
|
||||
<facet id="jst.jaxrs">
|
||||
<node name="libprov">
|
||||
<attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
|
||||
</node>
|
||||
</facet>
|
||||
</root>
|
|
@ -5,4 +5,5 @@
|
|||
<installed facet="liferay.portlet" version="6.0"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
<installed facet="jst.jaxrs" version="2.0"/>
|
||||
</faceted-project>
|
||||
|
|
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -4,11 +4,18 @@
|
|||
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).
|
||||
|
||||
## [v2.1.0] - 2024-04-22
|
||||
- Fix for Incident #27306
|
||||
|
||||
## [v2.0.1] - 2022-06-16
|
||||
|
||||
- Release for HL portal removal
|
||||
|
||||
## [v2.0.0] - 2020-07-21
|
||||
|
||||
Feature #19463, gestione Inviti include Keycloak per quanto riguarda la creazione dello user account
|
||||
- Feature #19463, gestione Inviti include Keycloak per quanto riguarda la creazione dello user account
|
||||
|
||||
Ported to git
|
||||
- Ported to git
|
||||
|
||||
## [v1.2.0] - 2019-08-10
|
||||
|
||||
|
|
40
pom.xml
40
pom.xml
|
@ -6,13 +6,13 @@
|
|||
<parent>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.2.0</version>
|
||||
</parent>
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>accept-invite-portlet</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>accept-invite-portlet Portlet</name>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
<description>
|
||||
accept-invite-portlet manage the sent invitations
|
||||
</description>
|
||||
|
@ -22,22 +22,20 @@
|
|||
<url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url>
|
||||
</scm>
|
||||
<properties>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<liferay.version>6.2.5</liferay.version>
|
||||
<liferay.maven.plugin.version>6.2.10.12</liferay.maven.plugin.version>
|
||||
<liferay.auto.deploy.dir>/Users/massi/portal/liferay-portal-6.2-ce-ga6/deploy</liferay.auto.deploy.dir>
|
||||
<liferay.app.server.deploy.dir>/Users/massi/portal/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps</liferay.app.server.deploy.dir>
|
||||
<liferay.app.server.lib.global.dir>/Users/massi/portal/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext</liferay.app.server.lib.global.dir>
|
||||
<liferay.app.server.portal.dir>/Users/massi/portal/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT</liferay.app.server.portal.dir>
|
||||
<java-version>1.8</java-version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.7.0</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
@ -47,13 +45,11 @@
|
|||
<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>
|
||||
|
@ -63,7 +59,26 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>social-networking-library</artifactId>
|
||||
<artifactId>social-library-stubs</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.social-networking</groupId>
|
||||
<artifactId>social-service-client</artifactId>
|
||||
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>social-networking-library</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -88,7 +103,6 @@
|
|||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>portal-service</artifactId>
|
||||
<version>${liferay.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -106,7 +120,6 @@
|
|||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>util-java</artifactId>
|
||||
<version>${liferay.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -181,9 +194,6 @@
|
|||
<executions>
|
||||
<execution>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>build-css</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
|
@ -199,8 +209,6 @@
|
|||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
*/
|
||||
|
||||
package org.gcube.portlets.user.acceptinvite;
|
||||
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -24,7 +28,10 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.authorization.library.provider.UserInfo;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
|
||||
import org.gcube.portal.databook.server.DatabookStore;
|
||||
import org.gcube.portal.databook.shared.Invite;
|
||||
|
@ -75,13 +82,16 @@ public class PortletViewController {
|
|||
private static String MODEL_ATTR = "theModel";
|
||||
|
||||
private static DatabookStore store;
|
||||
|
||||
private final static String DEFAULT_ROLE = "OrganizationMember";
|
||||
/**
|
||||
*
|
||||
* @return the unique instance of the store
|
||||
*/
|
||||
public static synchronized DatabookStore getStore() {
|
||||
if (store == null) {
|
||||
PortalContext pContext = PortalContext.getConfiguration();
|
||||
String context = "/" + pContext.getInfrastructureName();
|
||||
ScopeProvider.instance.set(context);
|
||||
store = new DBCassandraAstyanaxImpl();
|
||||
}
|
||||
return store;
|
||||
|
@ -115,6 +125,10 @@ public class PortletViewController {
|
|||
Invite invite = null;
|
||||
|
||||
try {
|
||||
String token = generateAuthorizationToken();
|
||||
SecurityTokenProvider.instance.set(token);
|
||||
|
||||
|
||||
invite = getStore().readInvite(inviteId);
|
||||
} catch (InviteIDNotFoundException | InviteStatusNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -146,7 +160,22 @@ public class PortletViewController {
|
|||
return PAGE_INVITE_PROCESS;
|
||||
}
|
||||
|
||||
|
||||
private static String generateAuthorizationToken() {
|
||||
PortalContext pContext = PortalContext.getConfiguration();
|
||||
String context = "/" + pContext.getInfrastructureName();
|
||||
ScopeProvider.instance.set(context);
|
||||
String username = "roberto.cirillo";
|
||||
List<String> userRoles = new ArrayList<>();
|
||||
userRoles.add(DEFAULT_ROLE);
|
||||
String token;
|
||||
try {
|
||||
token = authorizationService().generateUserToken(new UserInfo(username, userRoles), context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
|
||||
@ResourceMapping(value="createAccount")
|
||||
|
|
Loading…
Reference in New Issue