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
This commit is contained in:
Massimiliano Assante 2018-03-16 10:36:44 +00:00
parent 941c6f4961
commit 9011d7142d
3 changed files with 18 additions and 16 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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;
}
}