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:
Massimiliano Assante 2016-04-05 10:51:52 +00:00
parent da60871a27
commit 698c6c9cd7
3 changed files with 24 additions and 12 deletions

11
pom.xml
View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portal</groupId>
<artifactId>notifications-common-library</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
<description>
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>
</scm>
<properties>
<liferay.version>6.2.5</liferay.version>
<distroDirectory>distro</distroDirectory>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
@ -45,11 +46,13 @@
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common.portal</groupId>
<artifactId>portal-manager</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -72,9 +75,10 @@
<artifactId>social-networking-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -82,10 +86,11 @@
<artifactId>javax.mail</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -9,7 +9,7 @@ import org.gcube.portal.databook.server.DatabookStore;
import org.gcube.portal.databook.shared.Comment;
import org.gcube.portal.databook.shared.Like;
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.LoggerFactory;

View File

@ -4,8 +4,8 @@ import java.util.List;
import org.gcube.applicationsupportlayer.social.NotificationsManager;
import org.gcube.vomanagement.usermanagement.UserManager;
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager;
import org.gcube.vomanagement.usermanagement.model.UserModel;
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -19,15 +19,22 @@ public class PostNotificationsThread implements Runnable {
private String postText;
private String postId;
private String groupId;
private long groupId;
private List<String> hashtags;
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) {
super();
this.postId = postId;
this.postText = postText;
this.groupId = groupId;
this.groupId = Long.parseLong(groupId);
this.hashtags = hashtags;
this.nm = nm;
}
@ -37,9 +44,9 @@ public class PostNotificationsThread implements Runnable {
UserManager um = new LiferayUserManager();
String[] hashtagsToPass = hashtags.toArray(new String[hashtags.size()]);
try {
for (UserModel user : um.listUsersByGroup(groupId)) {
boolean result = nm.notifyPost(user.getScreenName(), postId, postText, hashtagsToPass);
_log.trace("Sending Notification for post alert to: " + user.getScreenName() + " result?"+ result);
for (GCubeUser user : um.listUsersByGroup(groupId)) {
boolean result = nm.notifyPost(user.getUsername(), postId, postText, hashtagsToPass);
_log.trace("Sending Notification for post alert to: " + user.getUsername() + " result?"+ result);
}
} catch (Exception e) {
e.printStackTrace();