git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/liferay62-plugins/user-registration-hook@174484 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4380cc01db
commit
5a0f03e7c1
10
.classpath
10
.classpath
|
@ -17,16 +17,16 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
1
.project
1
.project
|
@ -38,5 +38,6 @@
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||||
|
<nature>com.liferay.ide.core.liferayNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
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.source=1.6
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?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="user-registration-hook">
|
<wb-module deploy-name="user-registration-hook-hook">
|
||||||
<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"/>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<faceted-project>
|
<faceted-project>
|
||||||
<fixed facet="wst.jsdt.web"/>
|
<fixed facet="wst.jsdt.web"/>
|
||||||
<installed facet="java" version="1.6"/>
|
|
||||||
<installed facet="jst.web" version="2.4"/>
|
<installed facet="jst.web" version="2.4"/>
|
||||||
<installed facet="liferay.hook" version="6.0"/>
|
<installed facet="liferay.hook" version="6.0"/>
|
||||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||||
|
<installed facet="java" version="1.8"/>
|
||||||
</faceted-project>
|
</faceted-project>
|
||||||
|
|
25
pom.xml
25
pom.xml
|
@ -13,7 +13,7 @@
|
||||||
<artifactId>user-registration-hook</artifactId>
|
<artifactId>user-registration-hook</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<name>user-registration-hook Hook</name>
|
<name>user-registration-hook Hook</name>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
@ -35,8 +35,8 @@
|
||||||
<version>2.5</version>
|
<version>2.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
<source>1.6</source>
|
<source>1.8</source>
|
||||||
<target>1.6</target>
|
<target>1.8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -65,6 +65,21 @@
|
||||||
<artifactId>notifications-common-library</artifactId>
|
<artifactId>notifications-common-library</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.common</groupId>
|
||||||
|
<artifactId>home-library</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.common</groupId>
|
||||||
|
<artifactId>home-library-jcr</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.common</groupId>
|
||||||
|
<artifactId>home-library-model</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.dvos</groupId>
|
<groupId>org.gcube.dvos</groupId>
|
||||||
<artifactId>usermanagement-core</artifactId>
|
<artifactId>usermanagement-core</artifactId>
|
||||||
|
@ -120,8 +135,10 @@
|
||||||
<profile>
|
<profile>
|
||||||
<id>Liferay-v6.2-CE-(Tomcat-7)-(2)</id>
|
<id>Liferay-v6.2-CE-(Tomcat-7)-(2)</id>
|
||||||
<properties>
|
<properties>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<liferay.version>6.2.5</liferay.version>
|
<liferay.version>6.2.5</liferay.version>
|
||||||
<liferay.maven.plugin.version>6.2.5</liferay.maven.plugin.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.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.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.lib.global.dir>/Users/massi/portal/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext</liferay.app.server.lib.global.dir>
|
||||||
|
|
|
@ -26,6 +26,9 @@ public class MyCreateUserAccountListener extends BaseModelListener<User> {
|
||||||
_log.info("onAfterCreate NewUserAccount listener for: " + user.getScreenName() + " / " + user.getFullName());
|
_log.info("onAfterCreate NewUserAccount listener for: " + user.getScreenName() + " / " + user.getFullName());
|
||||||
Thread emailManagersThread = new Thread(new NewUserAccountNotificationThread(user.getScreenName(), user.getFullName(), user.getEmailAddress()));
|
Thread emailManagersThread = new Thread(new NewUserAccountNotificationThread(user.getScreenName(), user.getFullName(), user.getEmailAddress()));
|
||||||
emailManagersThread.start();
|
emailManagersThread.start();
|
||||||
|
|
||||||
|
Thread WorkspaceAccountCreationThread = new Thread(new WorkspaceCreateAccountThread(user.getScreenName(), user.getFullName(), user.getEmailAddress()));
|
||||||
|
WorkspaceAccountCreationThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
package org.gcube.portal.usersaccount;
|
||||||
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
|
import org.gcube.common.homelibrary.home.HomeLibrary;
|
||||||
|
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
||||||
|
import org.gcube.common.portal.PortalContext;
|
||||||
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class WorkspaceCreateAccountThread implements Runnable {
|
||||||
|
private static Logger _log = LoggerFactory.getLogger(WorkspaceCreateAccountThread.class);
|
||||||
|
|
||||||
|
private String newUserUserName;
|
||||||
|
|
||||||
|
public WorkspaceCreateAccountThread(String newUserUserName, String newUserFullName, String newUserEmailAddress) {
|
||||||
|
super();
|
||||||
|
this.newUserUserName = newUserUserName;
|
||||||
|
_log.info("Calling HomeLibrary for Workspace creation to new user: " + newUserUserName + " ("+newUserFullName+")");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
getWS(newUserUserName, "/"+PortalContext.getConfiguration().getInfrastructureName());
|
||||||
|
}
|
||||||
|
public static Workspace getWS(String currentUsername, String context) {
|
||||||
|
String username = currentUsername;
|
||||||
|
String authorizationToken = PortalContext.getConfiguration().getCurrentUserToken(context, username);
|
||||||
|
SecurityTokenProvider.instance.set(authorizationToken);
|
||||||
|
ScopeProvider.instance.set(context);
|
||||||
|
try {
|
||||||
|
Workspace toReturn = HomeLibrary.getUserWorkspace(username);
|
||||||
|
_log.info("Done Workspace creation for user: " + currentUsername);
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name=user-registration-hook
|
name=user-registration-hook
|
||||||
module-group-id=liferay
|
module-group-id=liferay
|
||||||
module-incremental-version=1
|
module-incremental-version=2
|
||||||
tags=
|
tags=
|
||||||
short-description=
|
short-description=
|
||||||
change-log=
|
change-log=
|
||||||
|
|
Loading…
Reference in New Issue