added support for new user site registration email to Site Managers
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/liferay62-plugins/landing-page-library@129955 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
eb49980c5a
commit
f44a79de76
27
pom.xml
27
pom.xml
|
@ -18,24 +18,41 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<liferay.version>6.2.5</liferay.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>LATEST</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common.portal</groupId>
|
||||
<artifactId>portal-manager</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>notifications-common-library</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>portal-service</artifactId>
|
||||
<version>${liferay.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>util-java</artifactId>
|
||||
<version>${liferay.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.portlet</groupId>
|
||||
<artifactId>portlet-api</artifactId>
|
||||
<version>2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -53,12 +70,10 @@
|
|||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.6.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.6.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -5,6 +5,8 @@ import java.util.List;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.portal.notifications.thread.NewUserSiteRegistrationNotificationThread;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -70,9 +72,11 @@ public class LandingPageManager {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (! isRegistered)
|
||||
if (! isRegistered) {
|
||||
_log.debug("But user " + currentUser.getFullName() + " is not registered to " + site.getName() + ". going to register ...");
|
||||
registerUserToSite(currentUser, site);
|
||||
String portalURL = PortalContext.getConfiguration().getGatewayURL(request);
|
||||
registerUserToSite(currentUser, site, portalURL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +87,7 @@ public class LandingPageManager {
|
|||
}
|
||||
return sitePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* this method is used to register the user to the group if does not belong to it yet
|
||||
* IMPORTANT: it does not add the user to the Site's private pages if the Site Membership type is different from Private
|
||||
|
@ -90,9 +95,11 @@ public class LandingPageManager {
|
|||
* @param site
|
||||
* @throws SystemException
|
||||
*/
|
||||
private static void registerUserToSite(User user, Group site) throws SystemException {
|
||||
private static void registerUserToSite(User user, Group site, String siteURL) throws SystemException {
|
||||
UserLocalServiceUtil.addGroupUser(site.getGroupId(), user.getUserId());
|
||||
_log.debug("User " + user.getScreenName() +" registered to " + site.getName());
|
||||
Thread emailSiteManagersThread = new Thread(new NewUserSiteRegistrationNotificationThread(user, site, siteURL));
|
||||
emailSiteManagersThread.start();
|
||||
}
|
||||
|
||||
public static List<Group> getSites(final long userId) throws PortalException, SystemException {
|
||||
|
|
Loading…
Reference in New Issue