diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index c340b01..f45228c 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -4,7 +4,7 @@ - + uses diff --git a/pom.xml b/pom.xml index 24b7cc1..11331bd 100644 --- a/pom.xml +++ b/pom.xml @@ -104,6 +104,7 @@ org.gcube.applicationsupportlayer aslsocial + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) provided @@ -129,6 +130,7 @@ org.gcube.portal notifications-common-library + [1.3.0-SNAPSHOT, 2.0.0-SNAPSHOT) provided diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsFeed.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsFeed.java index 091f016..868af1a 100644 --- a/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsFeed.java +++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/NewsFeed.java @@ -44,8 +44,7 @@ public class NewsFeed implements EntryPoint { public void init() { mainPanel = new NewsFeedPanel(); - mainPanel.setWidth("620px"); - + RootPanel.get(UNIQUE_DIV).add(mainPanel); ClientFeed notification = new ClientFeed(); diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/panels/NewsFeedPanel.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/panels/NewsFeedPanel.java index 3d079df..f853d39 100644 --- a/src/main/java/org/gcube/portlets/user/newsfeed/client/panels/NewsFeedPanel.java +++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/panels/NewsFeedPanel.java @@ -252,7 +252,7 @@ public class NewsFeedPanel extends Composite { */ public NewsFeedPanel() { bind(); - mainPanel.setWidth("600px"); + mainPanel.setWidth("100%"); mainPanel.add(filterPanelWrapper); filterPanelWrapper.setVisible(false); mainPanel.add(newUpdatesPanel); diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.java index 259e883..e078041 100644 --- a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.java +++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.java @@ -7,6 +7,7 @@ import org.gcube.portlets.user.gcubewidgets.client.elements.Div; import org.gcube.portlets.user.newsfeed.client.event.AddCommentEvent; import org.gcube.portlets.user.newsfeed.client.event.EditCommentEvent; +import com.github.gwtbootstrap.client.ui.Button; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.KeyPressEvent; @@ -17,7 +18,6 @@ import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; -import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTMLPanel; diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.ui.xml b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.ui.xml index bf2c7b9..b07a56c 100644 --- a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.ui.xml +++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/AddCommentTemplate.ui.xml @@ -2,6 +2,7 @@ .important { @@ -9,7 +10,7 @@ } - +
- - + +
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/ShowMoreFeeds.java b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/ShowMoreFeeds.java index 59b5627..8142862 100644 --- a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/ShowMoreFeeds.java +++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/ShowMoreFeeds.java @@ -41,6 +41,7 @@ public class ShowMoreFeeds extends Composite { caption.setHTML("Show more feeds"); //done after panel.getElement().getStyle().setVisibility(Visibility.HIDDEN); + panel.setWidth("260px"); } @UiHandler("caption") diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/SingleComment.ui.xml b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/SingleComment.ui.xml index d382cca..0de2285 100644 --- a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/SingleComment.ui.xml +++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/SingleComment.ui.xml @@ -31,32 +31,4 @@
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/server/NewsServiceImpl.java b/src/main/java/org/gcube/portlets/user/newsfeed/server/NewsServiceImpl.java index 193f5af..5bae44a 100644 --- a/src/main/java/org/gcube/portlets/user/newsfeed/server/NewsServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/newsfeed/server/NewsServiceImpl.java @@ -21,6 +21,7 @@ import org.gcube.application.framework.core.session.ASLSession; import org.gcube.application.framework.core.session.SessionManager; import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager; import org.gcube.applicationsupportlayer.social.NotificationsManager; +import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser; import org.gcube.common.portal.GCubePortalConstants; import org.gcube.common.portal.PortalContext; import org.gcube.common.scope.impl.ScopeBean; @@ -75,7 +76,7 @@ import com.liferay.portal.service.UserLocalServiceUtil; public class NewsServiceImpl extends RemoteServiceServlet implements NewsService { private static final Logger _log = LoggerFactory.getLogger(NewsServiceImpl.class); - + private static final String VRE_LABEL = "VRE_LABEL"; private static final String SHOW_TIMELINE_SOURCE = "SHOW_TIMELINE_SOURCE"; private static final String REFRESH_TIME = "REFRESH_TIME"; @@ -124,6 +125,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService private ASLSession getASLSession() { String sessionID = this.getThreadLocalRequest().getSession().getId(); String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE); + if (user == null) { _log.warn("USER IS NULL setting testing user and Running OUTSIDE PORTAL"); user = getDevelopmentUser(); @@ -137,7 +139,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService */ public String getDevelopmentUser() { String user = NewsConstants.TEST_USER; -// user = "costantino.perciante"; + //user = "costantino.perciante"; return user; } /** @@ -179,7 +181,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService if (username.compareTo(NewsConstants.TEST_USER) != 0 && !isDevelopment) { UserManager um = new LiferayUserManager(); GCubeUser user = um.getUserByUsername(username); - + thumbnailURL = user.getUserAvatarURL(); fullName = user.getFullname(); email = user.getEmail(); @@ -188,7 +190,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService PortalContext.getConfiguration().getSiteLandingPagePath(getThreadLocalRequest())+ GCubePortalConstants.USER_PROFILE_FRIENDLY_URL; String accountURL = profilePageURL; - + try { accountURL = ""; }catch (NullPointerException e) { @@ -334,7 +336,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService } String lowerCaseHashtag = hashtag.toLowerCase(); - + /** * this handles the case where the portlet is deployed outside of VREs (regular) */ @@ -643,8 +645,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService public boolean like(String feedid, String feedText, String feedOwnerId) { boolean likeCommitResult = false; UserInfo user = getUserSettings().getUserInfo(); - - if (user.getUsername().compareTo(NewsConstants.TEST_USER) == 0) { + String username = user.getUsername(); + if (username.compareTo(NewsConstants.TEST_USER) == 0) { return false; } @@ -661,7 +663,11 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService if (likeCommitResult) { //if the user who liked this post is not the user who posted it notify the poster user (Feed owner) if (! user.getUsername().equals(feedOwnerId)) { - NotificationsManager nm = new ApplicationNotificationsManager(getASLSession(), APP_ID); + NotificationsManager nm = new ApplicationNotificationsManager( + getThreadLocalRequest(), + getASLSession().getScopeName(), + new SocialNetworkingUser(username, user.getEmailaddress(), user.getFullName(), user.getAvatarId()), + APP_ID); boolean nResult = nm.notifyLikedFeed(feedOwnerId, feedid, escapeHtml(feedText)); _log.trace("Like Notification added? " + nResult); } @@ -727,7 +733,11 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService //if the comment was correctly delivered && is not an app feed notify users involved if (commentCommitResult && isWithinPortal()) { //if the user who commented this post is not the user who posted it notify the poster user (Feed owner) - NotificationsManager nm = new ApplicationNotificationsManager(getASLSession(), APP_ID); + NotificationsManager nm = new ApplicationNotificationsManager( + getThreadLocalRequest(), + getASLSession().getScopeName(), + new SocialNetworkingUser(user.getUsername(), user.getEmailaddress(), user.getFullName(), user.getAvatarId()), + APP_ID); if (! user.getUsername().equals(feedOwnerId) && (!isAppFeed)) { boolean result = nm.notifyOwnCommentReply(feedOwnerId, feedid, escapedCommentText, comment.getKey()); _log.trace("Comment Notification to post owner added? " + result); @@ -1026,7 +1036,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService return false; } } - + /** * utilty method that convert a URL in a text into a clickable link into the browser * diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/server/Utils.java b/src/main/java/org/gcube/portlets/user/newsfeed/server/Utils.java index c03dd37..551cfd1 100644 --- a/src/main/java/org/gcube/portlets/user/newsfeed/server/Utils.java +++ b/src/main/java/org/gcube/portlets/user/newsfeed/server/Utils.java @@ -44,7 +44,7 @@ public class Utils { GroupManager gm = new LiferayGroupManager(); ScopeBean sb = new ScopeBean(scope); List users = null; - + if (sb.is(Type.INFRASTRUCTURE)) users = um.listUsersByGroup(gm.getRootVO().getGroupId()); else if (sb.is(Type.VRE)) { //must be in VRE @@ -156,11 +156,7 @@ public class Utils { */ protected static String convertMentionPeopleAnchorHTML(String escapedFeedText, ArrayList taggedPeople, HttpServletRequest request) { String userProfilePageURL = ""; - try { - userProfilePageURL = PortalContext.getConfiguration().getSiteLandingPagePath(request)+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL; - } catch (PortalException | SystemException e) { - e.printStackTrace(); - } + userProfilePageURL = PortalContext.getConfiguration().getSiteLandingPagePath(request)+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL; for (ItemBean tagged : taggedPeople) { String taggedHTML = "table.single-comment, .single-comment { border-bottom-width: 1px; border-left: 2px solid #DDD; padding-left: 3px; - width: 495px; + width: 100%; } .comment-bgcolor { @@ -412,7 +456,7 @@ a.person-link { font-size: 14px; line-height: 18px; color: #333; - width: 500px; + width: 100%; word-wrap: break-word; -ms-word-break: break-all; /* Non standard for webkit */ @@ -428,7 +472,7 @@ a.person-link { } .tweet-actions { - width: 500px; + width: 99%; padding-top: 5px; font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; @@ -478,7 +522,7 @@ a.person-link { .div-table { display: table; - width: 590px; + width: 98%; background-clip: border-box; background-image: none; background-origin: padding-box; @@ -544,4 +588,3 @@ a.person-link { transition: background .45s ease-in-out; -moz-transition: background .45s ease-in-out; -webkit-transition: background .45s ease-in-out; -} \ No newline at end of file