updated to liferay 6.2
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/notifications-common-library@126763 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
da60871a27
commit
698c6c9cd7
7
pom.xml
7
pom.xml
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>notifications-common-library</artifactId>
|
<artifactId>notifications-common-library</artifactId>
|
||||||
<version>1.2.1-SNAPSHOT</version>
|
<version>1.3.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<description>
|
<description>
|
||||||
gCube Notifications Common Library is a common library containing shared code for Notification of social events to users.
|
gCube Notifications Common Library is a common library containing shared code for Notification of social events to users.
|
||||||
|
@ -24,6 +24,7 @@
|
||||||
<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/portal/${project.artifactId}</url>
|
<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/portal/${project.artifactId}</url>
|
||||||
</scm>
|
</scm>
|
||||||
<properties>
|
<properties>
|
||||||
|
<liferay.version>6.2.5</liferay.version>
|
||||||
<distroDirectory>distro</distroDirectory>
|
<distroDirectory>distro</distroDirectory>
|
||||||
<maven.compiler.source>1.7</maven.compiler.source>
|
<maven.compiler.source>1.7</maven.compiler.source>
|
||||||
<maven.compiler.target>1.7</maven.compiler.target>
|
<maven.compiler.target>1.7</maven.compiler.target>
|
||||||
|
@ -45,11 +46,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>custom-portal-handler</artifactId>
|
<artifactId>custom-portal-handler</artifactId>
|
||||||
|
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common.portal</groupId>
|
<groupId>org.gcube.common.portal</groupId>
|
||||||
<artifactId>portal-manager</artifactId>
|
<artifactId>portal-manager</artifactId>
|
||||||
|
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -75,6 +78,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.dvos</groupId>
|
<groupId>org.gcube.dvos</groupId>
|
||||||
<artifactId>usermanagement-core</artifactId>
|
<artifactId>usermanagement-core</artifactId>
|
||||||
|
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -86,6 +90,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.liferay.portal</groupId>
|
<groupId>com.liferay.portal</groupId>
|
||||||
<artifactId>portal-service</artifactId>
|
<artifactId>portal-service</artifactId>
|
||||||
|
<version>${liferay.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import org.gcube.portal.databook.server.DatabookStore;
|
||||||
import org.gcube.portal.databook.shared.Comment;
|
import org.gcube.portal.databook.shared.Comment;
|
||||||
import org.gcube.portal.databook.shared.Like;
|
import org.gcube.portal.databook.shared.Like;
|
||||||
import org.gcube.vomanagement.usermanagement.UserManager;
|
import org.gcube.vomanagement.usermanagement.UserManager;
|
||||||
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager;
|
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
||||||
import org.gcube.vomanagement.usermanagement.UserManager;
|
import org.gcube.vomanagement.usermanagement.UserManager;
|
||||||
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager;
|
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
|
||||||
import org.gcube.vomanagement.usermanagement.model.UserModel;
|
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -19,15 +19,22 @@ public class PostNotificationsThread implements Runnable {
|
||||||
|
|
||||||
private String postText;
|
private String postText;
|
||||||
private String postId;
|
private String postId;
|
||||||
private String groupId;
|
private long groupId;
|
||||||
private List<String> hashtags;
|
private List<String> hashtags;
|
||||||
private NotificationsManager nm;
|
private NotificationsManager nm;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param postId
|
||||||
|
* @param postText
|
||||||
|
* @param groupId the LR groupId
|
||||||
|
* @param nm
|
||||||
|
* @param hashtags
|
||||||
|
*/
|
||||||
public PostNotificationsThread(String postId, String postText, String groupId, NotificationsManager nm, List<String> hashtags) {
|
public PostNotificationsThread(String postId, String postText, String groupId, NotificationsManager nm, List<String> hashtags) {
|
||||||
super();
|
super();
|
||||||
this.postId = postId;
|
this.postId = postId;
|
||||||
this.postText = postText;
|
this.postText = postText;
|
||||||
this.groupId = groupId;
|
this.groupId = Long.parseLong(groupId);
|
||||||
this.hashtags = hashtags;
|
this.hashtags = hashtags;
|
||||||
this.nm = nm;
|
this.nm = nm;
|
||||||
}
|
}
|
||||||
|
@ -37,9 +44,9 @@ public class PostNotificationsThread implements Runnable {
|
||||||
UserManager um = new LiferayUserManager();
|
UserManager um = new LiferayUserManager();
|
||||||
String[] hashtagsToPass = hashtags.toArray(new String[hashtags.size()]);
|
String[] hashtagsToPass = hashtags.toArray(new String[hashtags.size()]);
|
||||||
try {
|
try {
|
||||||
for (UserModel user : um.listUsersByGroup(groupId)) {
|
for (GCubeUser user : um.listUsersByGroup(groupId)) {
|
||||||
boolean result = nm.notifyPost(user.getScreenName(), postId, postText, hashtagsToPass);
|
boolean result = nm.notifyPost(user.getUsername(), postId, postText, hashtagsToPass);
|
||||||
_log.trace("Sending Notification for post alert to: " + user.getScreenName() + " result?"+ result);
|
_log.trace("Sending Notification for post alert to: " + user.getUsername() + " result?"+ result);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in New Issue