Tried to reduce comment latency when someone is mentioned in comment

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@165173 82a268e6-3cf1-43bd-a215-b396298e98cf
Feature/26194
Massimiliano Assante 6 years ago
parent 941c6f4961
commit 9011d7142d

@ -1400,7 +1400,7 @@ public class NewsFeedPanel extends Composite {
Window.alert("Could not deliver this comment. Please try again in a short while.");
}
else {
Comment comment = (Comment) result.getObject();
Comment comment = (Comment) result.getComment();
owner.addComment(new SingleComment(comment, owner, (comment.getUserid().equals(myUserInfo.getUsername()))));
owner.setCommentingDisabled(false);
owner.updateCommentsNumberCount();
@ -1437,7 +1437,7 @@ public class NewsFeedPanel extends Composite {
//CheckSession.showLogoutDialog();
}
else {
Comment comment = (Comment) result.getObject();
Comment comment = (Comment) result.getComment();
owner.updateSingleComment(comment, commentPanel);
owner.setCommentingDisabled(false);
}

@ -1037,7 +1037,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
else {
PortalContext pContext = PortalContext.getConfiguration();
String userName = pContext.getCurrentUser(getThreadLocalRequest()).getUsername();
ArrayList<ItemBean> allUsers = Utils.getDisplayableItemBeans("/"+PortalContext.getConfiguration().getInfrastructureName(), userName, isWithinPortal());
String context = pContext.getCurrentScope(getThreadLocalRequest());
ArrayList<ItemBean> allUsers = Utils.getDisplayableItemBeans(context, userName, isWithinPortal());
ArrayList<ItemBean> toReturn = new ArrayList<ItemBean>();
for (String fullName : fullNames)
for (ItemBean puser : allUsers) {
@ -1049,6 +1050,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
return toReturn;
}
}
/**
* tell if the user is a portal administrator or not
* @param username

@ -1,23 +1,24 @@
package org.gcube.portlets.user.newsfeed.shared;
import java.io.Serializable;
import org.gcube.portal.databook.shared.Comment;
@SuppressWarnings("serial")
public class OperationResult implements Serializable {
import com.google.gwt.user.client.rpc.IsSerializable;
public class OperationResult implements IsSerializable {
private Boolean success;
private String message;
private Serializable object;
private Comment comment;
public OperationResult() {
super();
}
public OperationResult(Boolean success, String message, Serializable object) {
public OperationResult(Boolean success, String message, Comment comment) {
super();
this.success = success;
this.message = message;
this.object = object;
this.comment = comment;
}
public Boolean isSuccess() {
@ -36,13 +37,11 @@ public class OperationResult implements Serializable {
this.message = message;
}
public Serializable getObject() {
return object;
public Comment getComment() {
return comment;
}
public void setObject(Serializable object) {
this.object = object;
}
public void setComment(Comment comment) {
this.comment = comment;
}
}

Loading…
Cancel
Save