();
@@ -382,7 +391,8 @@ public class TweetTemplate extends Composite {
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onSuccess() {
- new MailForm(listToLogin);
+ SharePostDialog dlg = new SharePostDialog(myInstance);
+ dlg.openModal();
}
public void onFailure(Throwable reason) {
Window.alert("Could not load this component: " + reason.getMessage());
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/TweetTemplate.ui.xml b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/TweetTemplate.ui.xml
index 0ce6ace..bdd436a 100644
--- a/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/TweetTemplate.ui.xml
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/client/ui/TweetTemplate.ui.xml
@@ -33,7 +33,7 @@
-
-
+
|
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 3016383..a986928 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
@@ -26,6 +26,7 @@ import org.gcube.portal.custom.communitymanager.OrganizationsUtil;
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
import org.gcube.portal.databook.server.DatabookStore;
+import org.gcube.portal.databook.shared.Attachment;
import org.gcube.portal.databook.shared.Comment;
import org.gcube.portal.databook.shared.Feed;
import org.gcube.portal.databook.shared.Like;
@@ -703,6 +704,17 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
ArrayList likedFeeds = (ArrayList) store.getAllLikedFeedIdsByUser(getASLSession().getUsername());
boolean skip = false;
for (Feed feed : toEnhance) {
+
+ boolean isMultiFileUpload = feed.isMultiFileUpload();
+ ArrayList attachments = new ArrayList();
+ if (isMultiFileUpload) {
+ try {
+ attachments = (ArrayList) store.getAttachmentsByFeedId(feed.getKey());
+ } catch (FeedIDNotFoundException e) {
+ _log.error("It looks like sth wrong with this feedid having attachments, could not find feedId = " + feed.getKey() + "\n" + e.getMessage());
+ }
+ }
+
skip = false;
if (! feed.isApplicationFeed()) {
String thumb = getUserImagePortraitUrlLocal(feed.getEntityId());
@@ -730,6 +742,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
toAdd = new EnhancedFeed(feed, liked, checkisAdminUser());
} else
toAdd = new EnhancedFeed(feed, liked, isUsers(feed, username));
+ toAdd.setAttachments(attachments);
toReturn.add(toAdd);
} else {
ArrayList comments = getAllCommentsByFeed(feed.getKey());
@@ -739,7 +752,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
int currCommentsNumber = comments.size();
//if comments are less than $commentsNumberPerFeed they are the more recent, -1 return all the comments
if (currCommentsNumber < commentsNumberPerFeed || commentsNumberPerFeed == -1) {
- EnhancedFeed toAdd = new EnhancedFeed(feed, liked, isUsers(feed, username), comments);
+ EnhancedFeed toAdd = new EnhancedFeed(feed, liked, isUsers(feed, username), comments, attachments);
toReturn.add(toAdd);
} else {
//need to get the last two
@@ -747,10 +760,10 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
for (int i = currCommentsNumber -commentsNumberPerFeed; i < currCommentsNumber; i++) {
comments2Attach.add(comments.get(i));
}
- EnhancedFeed toAdd = new EnhancedFeed(feed, liked, isUsers(feed, username), comments2Attach);
+ EnhancedFeed toAdd = new EnhancedFeed(feed, liked, isUsers(feed, username), comments2Attach, attachments);
toReturn.add(toAdd);
}
- }
+ }
}
}
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/shared/EnhancedFeed.java b/src/main/java/org/gcube/portlets/user/newsfeed/shared/EnhancedFeed.java
index 03ce831..cea762d 100644
--- a/src/main/java/org/gcube/portlets/user/newsfeed/shared/EnhancedFeed.java
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/shared/EnhancedFeed.java
@@ -3,6 +3,7 @@ package org.gcube.portlets.user.newsfeed.shared;
import java.io.Serializable;
import java.util.ArrayList;
+import org.gcube.portal.databook.shared.Attachment;
import org.gcube.portal.databook.shared.Comment;
import org.gcube.portal.databook.shared.Feed;
/**
@@ -17,6 +18,9 @@ public class EnhancedFeed implements Serializable{
private boolean liked;
private boolean isUsers;
private ArrayList comments;
+ private ArrayList attachments;
+
+
public EnhancedFeed() {
super();
}
@@ -34,6 +38,17 @@ public class EnhancedFeed implements Serializable{
this.liked = liked;
this.comments = comments;
}
+
+
+ public EnhancedFeed(Feed feed, boolean liked, boolean isUsers,
+ ArrayList comments, ArrayList attachments) {
+ super();
+ this.feed = feed;
+ this.liked = liked;
+ this.isUsers = isUsers;
+ this.comments = comments;
+ this.attachments = attachments;
+ }
public ArrayList getComments() {
return comments;
}
@@ -57,5 +72,18 @@ public class EnhancedFeed implements Serializable{
}
public void setUsers(boolean isUsers) {
this.isUsers = isUsers;
+ }
+ public ArrayList getAttachments() {
+ return attachments;
+ }
+ public void setAttachments(ArrayList attachments) {
+ this.attachments = attachments;
+ }
+ @Override
+ public String toString() {
+ return "EnhancedFeed [feed=" + feed + ", liked=" + liked + ", isUsers="
+ + isUsers + ", comments=" + comments + ", attachments="
+ + attachments + "]";
}
+
}
diff --git a/src/main/resources/org/gcube/portlets/user/newsfeed/NewsFeed.gwt.xml b/src/main/resources/org/gcube/portlets/user/newsfeed/NewsFeed.gwt.xml
index e1017d5..050aee5 100644
--- a/src/main/resources/org/gcube/portlets/user/newsfeed/NewsFeed.gwt.xml
+++ b/src/main/resources/org/gcube/portlets/user/newsfeed/NewsFeed.gwt.xml
@@ -14,11 +14,9 @@
-
-
diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml
index d01e911..c5b48ee 100644
--- a/src/main/webapp/WEB-INF/web.xml
+++ b/src/main/webapp/WEB-INF/web.xml
@@ -25,27 +25,6 @@
/newsfeed/scopeService
-
- mailWisdgetServlet
- org.gcube.portlets.widgets.wsmail.server.WsMailServiceImpl
-
-
-
- mailWisdgetServlet
- /newsfeed/mailWisdgetServlet
-
-
-
- workspaceExplorer
- org.gcube.portlets.widgets.wsexplorer.server.WorkspaceExplorerServiceImpl
-
-
-
- workspaceExplorer
- /newsfeed/WorkspaceExplorerService
-
-
-
checkServlet
org.gcube.portlets.widgets.sessionchecker.server.SessionCheckerServiceImpl
|