Fixed ClientFeed exchange problem between this portlet and the share-updates one on posting.
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@122312 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
12726771ff
commit
f663bfe58b
|
@ -4,15 +4,6 @@
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
||||||
<dependent-module archiveName="session-checker-0.5.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/session-checker/session-checker">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<dependent-module archiveName="pickitem-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<dependent-module archiveName="gcube-widgets-1.9.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
||||||
<property name="context-root" value="news-feed"/>
|
<property name="context-root" value="news-feed"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.util.HashSet;
|
||||||
|
|
||||||
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
||||||
import org.gcube.portal.databook.client.util.Encoder;
|
import org.gcube.portal.databook.client.util.Encoder;
|
||||||
|
import org.gcube.portal.databook.shared.Attachment;
|
||||||
import org.gcube.portal.databook.shared.ClientFeed;
|
import org.gcube.portal.databook.shared.ClientFeed;
|
||||||
import org.gcube.portal.databook.shared.Comment;
|
import org.gcube.portal.databook.shared.Comment;
|
||||||
import org.gcube.portal.databook.shared.Feed;
|
import org.gcube.portal.databook.shared.Feed;
|
||||||
|
@ -562,11 +563,33 @@ public class NewsFeedPanel extends Composite {
|
||||||
* @param description
|
* @param description
|
||||||
*/
|
*/
|
||||||
public void addJustAddedFeed(ClientFeed cFeed) {
|
public void addJustAddedFeed(ClientFeed cFeed) {
|
||||||
Feed feed = new Feed(cFeed.getKey(), FeedType.SHARE, cFeed.getUserid(), cFeed.getTime(), "", cFeed.getUri(), cFeed.getLinkUrlThumbnail(),
|
|
||||||
cFeed.getDescription(), PrivacyLevel.CONNECTION, cFeed.getFullName(),
|
Feed feed = new Feed(cFeed.getKey(),
|
||||||
cFeed.getEmail(), cFeed.getThumbnailURL(), cFeed.getLinkTitle(), cFeed.getLinkDescription(), cFeed.getLinkHost());
|
FeedType.SHARE,
|
||||||
|
cFeed.getUserid(),
|
||||||
|
cFeed.getTime(),
|
||||||
|
"",
|
||||||
|
cFeed.getUri(),
|
||||||
|
cFeed.getLinkUrlThumbnail(),
|
||||||
|
cFeed.getDescription(),
|
||||||
|
PrivacyLevel.CONNECTION,
|
||||||
|
cFeed.getFullName(),
|
||||||
|
cFeed.getEmail(),
|
||||||
|
cFeed.getThumbnailURL(),
|
||||||
|
cFeed.getLinkTitle(),
|
||||||
|
cFeed.getLinkDescription(),
|
||||||
|
cFeed.getLinkHost());
|
||||||
|
|
||||||
|
// set attachments property
|
||||||
|
boolean multiAttachments = cFeed.getAttachments() != null;
|
||||||
|
feed.setMultiFileUpload(multiAttachments);
|
||||||
|
|
||||||
EnhancedFeed toAdd = new EnhancedFeed(feed, false, true); //false cuz he could not have liked this yet and true because is the current user's
|
EnhancedFeed toAdd = new EnhancedFeed(feed, false, true); //false cuz he could not have liked this yet and true because is the current user's
|
||||||
|
|
||||||
|
// be careful when converting from List<> to ArrayList<> ...
|
||||||
|
ArrayList<Attachment> attachments = cFeed.getAttachments() == null ? null : new ArrayList<Attachment>(cFeed.getAttachments());
|
||||||
|
toAdd.setAttachments(attachments);
|
||||||
|
|
||||||
final TweetTemplate tt = new TweetTemplate(myUserInfo, toAdd, eventBus, true);
|
final TweetTemplate tt = new TweetTemplate(myUserInfo, toAdd, eventBus, true);
|
||||||
if (isFirstTweet) {
|
if (isFirstTweet) {
|
||||||
newsPanel.clear();
|
newsPanel.clear();
|
||||||
|
@ -574,6 +597,7 @@ public class NewsFeedPanel extends Composite {
|
||||||
isFirstTweet = false;
|
isFirstTweet = false;
|
||||||
}
|
}
|
||||||
newsPanel.insert(tt, 0);
|
newsPanel.insert(tt, 0);
|
||||||
|
|
||||||
Timer t = new Timer() {
|
Timer t = new Timer() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -141,10 +141,12 @@ public class TweetTemplate extends Composite {
|
||||||
} else {
|
} else {
|
||||||
closeImage.removeFromParent();
|
closeImage.removeFromParent();
|
||||||
}
|
}
|
||||||
GWT.log("# attachments: "+myFeed.getAttachments().size());
|
if(myFeed.getAttachments() != null){
|
||||||
if (myFeed.getAttachments().size() > 0) {
|
GWT.log("# attachments: "+myFeed.getAttachments().size());
|
||||||
for (Attachment a : myFeed.getAttachments()) {
|
if (myFeed.getAttachments().size() > 0) {
|
||||||
GWT.log(a.toString());
|
for (Attachment a : myFeed.getAttachments()) {
|
||||||
|
GWT.log(a.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
*/
|
*/
|
||||||
public String getDevelopmentUser() {
|
public String getDevelopmentUser() {
|
||||||
String user = NewsConstants.TEST_USER;
|
String user = NewsConstants.TEST_USER;
|
||||||
// user = "andrea.rossi";
|
// user = "andrea.rossi";
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
<inherits name='com.google.gwt.user.User' />
|
<inherits name='com.google.gwt.user.User' />
|
||||||
|
|
||||||
<!-- To Comment out -->
|
<!-- To Comment out -->
|
||||||
<!-- <set-property name="user.agent" value="safari,gecko1_8" /> -->
|
<!-- <set-property name="user.agent" value="safari,gecko1_8" /> -->
|
||||||
|
|
||||||
<!-- Other module inherits -->
|
<!-- Other module inherits -->
|
||||||
<inherits name="net.eliasbalasis.tibcopagebus4gwt.tibcopagebus4gwt" />
|
<inherits name="net.eliasbalasis.tibcopagebus4gwt.tibcopagebus4gwt" />
|
||||||
<inherits name="org.jsonmaker.gwt.Gwt_jsonmaker" />
|
<inherits name="org.jsonmaker.gwt.Gwt_jsonmaker" />
|
||||||
<inherits
|
<inherits
|
||||||
name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" />
|
name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" />
|
||||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||||
<!-- inherits gCube Widgets Library -->
|
<!-- inherits gCube Widgets Library -->
|
||||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||||
<inherits name='org.gcube.portlets.widgets.userselection.UserSelection' />
|
<inherits name='org.gcube.portlets.widgets.userselection.UserSelection' />
|
||||||
|
|
Loading…
Reference in New Issue