From 698c6c9cd77665e5b27ccd3bda6365e2cc274bf4 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Tue, 5 Apr 2016 10:51:52 +0000 Subject: [PATCH] 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 --- pom.xml | 11 ++++++--- .../thread/CommentNotificationsThread.java | 2 +- .../thread/PostNotificationsThread.java | 23 ++++++++++++------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 2c6c2e6..242288c 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.gcube.portal notifications-common-library - 1.2.1-SNAPSHOT + 1.3.0-SNAPSHOT jar gCube Notifications Common Library is a common library containing shared code for Notification of social events to users. @@ -24,6 +24,7 @@ http://svn.d4science.research-infrastructures.eu/gcube/trunk/portal/${project.artifactId} + 6.2.5 distro 1.7 1.7 @@ -45,11 +46,13 @@ org.gcube.portal custom-portal-handler + [2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT) provided org.gcube.common.portal portal-manager + [2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT) provided @@ -72,9 +75,10 @@ social-networking-library provided - + org.gcube.dvos usermanagement-core + [2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT) provided @@ -82,10 +86,11 @@ javax.mail provided - + com.liferay.portal portal-service + ${liferay.version} provided diff --git a/src/main/java/org/gcube/portal/notifications/thread/CommentNotificationsThread.java b/src/main/java/org/gcube/portal/notifications/thread/CommentNotificationsThread.java index 558e5d4..51112f3 100644 --- a/src/main/java/org/gcube/portal/notifications/thread/CommentNotificationsThread.java +++ b/src/main/java/org/gcube/portal/notifications/thread/CommentNotificationsThread.java @@ -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; diff --git a/src/main/java/org/gcube/portal/notifications/thread/PostNotificationsThread.java b/src/main/java/org/gcube/portal/notifications/thread/PostNotificationsThread.java index 066ba6e..8c1fda3 100644 --- a/src/main/java/org/gcube/portal/notifications/thread/PostNotificationsThread.java +++ b/src/main/java/org/gcube/portal/notifications/thread/PostNotificationsThread.java @@ -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 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 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();