2013-04-04 15:41:17 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-04-11 13:02:15 +02:00
|
|
|
package org.gcube.portlets.user.newsfeed.client.ui;
|
2013-04-04 15:41:17 +02:00
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2016-08-03 16:29:59 +02:00
|
|
|
import java.util.Date;
|
2015-12-11 14:16:21 +01:00
|
|
|
import java.util.Iterator;
|
2013-04-04 15:41:17 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2016-04-06 16:35:20 +02:00
|
|
|
import org.gcube.common.portal.GCubePortalConstants;
|
2013-04-04 15:41:17 +02:00
|
|
|
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
2013-07-18 19:01:36 +02:00
|
|
|
import org.gcube.portal.databook.client.util.Encoder;
|
2016-01-19 10:25:30 +01:00
|
|
|
import org.gcube.portal.databook.shared.Attachment;
|
2013-04-04 15:41:17 +02:00
|
|
|
import org.gcube.portal.databook.shared.Comment;
|
2016-02-04 18:04:25 +01:00
|
|
|
import org.gcube.portal.databook.shared.EnhancedFeed;
|
2013-04-04 15:41:17 +02:00
|
|
|
import org.gcube.portal.databook.shared.Feed;
|
|
|
|
import org.gcube.portal.databook.shared.UserInfo;
|
|
|
|
import org.gcube.portlets.user.newsfeed.client.event.AddLikeEvent;
|
|
|
|
import org.gcube.portlets.user.newsfeed.client.event.DeleteFeedEvent;
|
2013-07-11 12:19:36 +02:00
|
|
|
import org.gcube.portlets.user.newsfeed.client.event.OpenFeedEvent;
|
2013-04-04 15:41:17 +02:00
|
|
|
import org.gcube.portlets.user.newsfeed.client.event.SeeCommentsEvent;
|
|
|
|
import org.gcube.portlets.user.newsfeed.client.event.SeeLikesEvent;
|
2014-04-08 23:40:13 +02:00
|
|
|
import org.gcube.portlets.user.newsfeed.client.event.UnLikeEvent;
|
2013-04-04 15:41:17 +02:00
|
|
|
import org.gcube.portlets.user.newsfeed.client.panels.NewsFeedPanel;
|
2016-01-22 18:54:30 +01:00
|
|
|
import org.gcube.portlets.widgets.imagepreviewerwidget.client.EnhancedImage;
|
|
|
|
import org.gcube.portlets.widgets.imagepreviewerwidget.client.ui.Carousel;
|
2013-04-04 15:41:17 +02:00
|
|
|
|
2016-09-26 17:07:44 +02:00
|
|
|
import com.github.gwtbootstrap.client.ui.Button;
|
2013-04-04 15:41:17 +02:00
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
import com.google.gwt.core.client.RunAsyncCallback;
|
2016-09-26 17:07:44 +02:00
|
|
|
import com.google.gwt.dom.client.Style.Unit;
|
2013-04-04 15:41:17 +02:00
|
|
|
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
|
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
|
import com.google.gwt.event.dom.client.MouseOutEvent;
|
|
|
|
import com.google.gwt.event.dom.client.MouseOverEvent;
|
|
|
|
import com.google.gwt.event.shared.HandlerManager;
|
|
|
|
import com.google.gwt.i18n.client.DateTimeFormat;
|
|
|
|
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
|
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;
|
2016-04-06 16:35:20 +02:00
|
|
|
import com.google.gwt.user.client.Window.Location;
|
2013-04-04 15:41:17 +02:00
|
|
|
import com.google.gwt.user.client.ui.Composite;
|
|
|
|
import com.google.gwt.user.client.ui.HTML;
|
|
|
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
|
import com.google.gwt.user.client.ui.Image;
|
|
|
|
import com.google.gwt.user.client.ui.Label;
|
|
|
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
|
import com.google.gwt.user.client.ui.Widget;
|
|
|
|
|
|
|
|
/**
|
2016-01-19 18:43:15 +01:00
|
|
|
* @author Massimiliano Assante at ISTI-CNR
|
|
|
|
* @author Costantino Perciante at ISTI-CNR
|
2013-04-04 15:41:17 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class TweetTemplate extends Composite {
|
|
|
|
|
|
|
|
private static TweetTemplateUiBinder uiBinder = GWT
|
|
|
|
.create(TweetTemplateUiBinder.class);
|
|
|
|
|
|
|
|
interface TweetTemplateUiBinder extends UiBinder<Widget, TweetTemplate> {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static final String loading = GWT.getModuleBaseURL() + "../images/loading-comments.gif";
|
2016-09-26 17:07:44 +02:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
private static final int MAX_SHOWTEXT_LENGTH = 256;
|
|
|
|
|
|
|
|
private EnhancedFeed myFeed;
|
|
|
|
private UserInfo myUserInfo;
|
|
|
|
|
|
|
|
private HandlerManager eventBus;
|
|
|
|
private ArrayList<SingleComment> myComments;
|
|
|
|
private boolean commentingDisabled = false;
|
|
|
|
private boolean commentsFetched = false;
|
|
|
|
private int totalComments = 0;
|
|
|
|
private HTML showAllComments = new HTML();
|
|
|
|
private boolean isAppFeed = false;
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2016-01-19 10:25:30 +01:00
|
|
|
private TweetTemplate myInstance;
|
2013-04-08 17:25:37 +02:00
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
// Carousel from the image-previewer widget
|
|
|
|
private Carousel carousel;
|
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
/**
|
|
|
|
* tell if this tweet is belonging to the current user
|
|
|
|
*/
|
|
|
|
private boolean isUsers = false;
|
|
|
|
|
|
|
|
@UiField
|
|
|
|
HTML contentArea;
|
|
|
|
@UiField
|
|
|
|
HTML seeMore;
|
|
|
|
@UiField
|
|
|
|
HTML timeArea;
|
|
|
|
@UiField
|
|
|
|
HTML likeArea;
|
|
|
|
@UiField
|
|
|
|
HTML commentArea;
|
|
|
|
@UiField
|
2016-01-19 10:25:30 +01:00
|
|
|
HTML sharePostArea;
|
2013-04-04 15:41:17 +02:00
|
|
|
@UiField
|
|
|
|
Image avatarImage;
|
|
|
|
@UiField
|
2014-04-12 19:13:17 +02:00
|
|
|
AvatarReplacement avatarReplacement;
|
|
|
|
@UiField
|
2013-04-04 15:41:17 +02:00
|
|
|
HTMLPanel mainHTML;
|
|
|
|
@UiField
|
2016-09-26 17:07:44 +02:00
|
|
|
Button likesNo;
|
2013-04-04 15:41:17 +02:00
|
|
|
@UiField
|
2016-09-26 17:07:44 +02:00
|
|
|
Button commentsNo;
|
2013-04-04 15:41:17 +02:00
|
|
|
@UiField
|
|
|
|
VerticalPanel commentsPanel;
|
|
|
|
@UiField
|
|
|
|
HTML closeImage;
|
|
|
|
@UiField
|
2013-07-11 12:19:36 +02:00
|
|
|
HTML openImage;
|
|
|
|
@UiField
|
2014-03-10 16:47:02 +01:00
|
|
|
HTML vreSource;
|
|
|
|
@UiField
|
2013-04-04 15:41:17 +02:00
|
|
|
VerticalPanel previewPanel;
|
2016-01-19 18:43:15 +01:00
|
|
|
@UiField
|
2016-01-20 18:49:31 +01:00
|
|
|
Placeholder attachmentPreviewPanel;
|
2013-04-04 15:41:17 +02:00
|
|
|
@UiField
|
|
|
|
Label messageSeparator;
|
|
|
|
/**
|
|
|
|
* used when fetching tweets from server
|
|
|
|
* @param myUserInfo
|
|
|
|
* @param myFeed
|
|
|
|
* @param isUsers
|
2013-04-19 14:24:54 +02:00
|
|
|
* @param displaySingle tells if you're displaying a single fedd or not
|
2013-04-04 15:41:17 +02:00
|
|
|
* @param eventBus
|
|
|
|
*/
|
2014-03-10 16:47:02 +01:00
|
|
|
public TweetTemplate(boolean displaySingle, boolean showTimelineSource, UserInfo myUserInfo, EnhancedFeed myFeed, HandlerManager eventBus) {
|
2013-04-04 15:41:17 +02:00
|
|
|
initWidget(uiBinder.createAndBindUi(this));
|
2016-09-26 17:07:44 +02:00
|
|
|
commentsNo.getElement().getStyle().setPaddingTop(0, Unit.PX);
|
|
|
|
likesNo.getElement().getStyle().setPaddingTop(0, Unit.PX);
|
2016-09-27 16:24:00 +02:00
|
|
|
likesNo.getElement().getStyle().setPaddingRight(2, Unit.PX);
|
|
|
|
commentsNo.getElement().getStyle().setPaddingRight(2, Unit.PX);
|
|
|
|
likesNo.getElement().getStyle().setPaddingLeft(2, Unit.PX);
|
|
|
|
commentsNo.getElement().getStyle().setPaddingLeft(2, Unit.PX);
|
|
|
|
|
2016-01-19 10:25:30 +01:00
|
|
|
myInstance = this;
|
2013-04-04 15:41:17 +02:00
|
|
|
this.myUserInfo = myUserInfo;
|
2014-03-10 16:47:02 +01:00
|
|
|
this.vreSource.setVisible(false);
|
2013-04-04 15:41:17 +02:00
|
|
|
this.myFeed = myFeed;
|
|
|
|
isAppFeed = myFeed.getFeed().isApplicationFeed();
|
|
|
|
Feed feed = myFeed.getFeed();
|
|
|
|
this.eventBus = eventBus;
|
|
|
|
this.isUsers = myFeed.isUsers();
|
2016-01-22 18:54:30 +01:00
|
|
|
this.carousel = new Carousel();
|
2013-04-04 15:41:17 +02:00
|
|
|
myComments = new ArrayList<SingleComment>();
|
2014-03-10 16:47:02 +01:00
|
|
|
|
2014-02-14 15:11:09 +01:00
|
|
|
if (isUsers || myUserInfo.isAdmin()) {
|
2013-04-04 15:41:17 +02:00
|
|
|
closeImage.setStyleName("closeImage");
|
2014-02-14 15:11:09 +01:00
|
|
|
closeImage.setTitle(myUserInfo.isAdmin() ? "Delete (Administrator Mode)" : "delete");
|
|
|
|
} else {
|
|
|
|
closeImage.removeFromParent();
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
2016-01-19 18:43:15 +01:00
|
|
|
|
2016-01-25 15:40:03 +01:00
|
|
|
// if there is one attachment or a link preview, maintain backward compatibility
|
2016-01-21 14:29:46 +01:00
|
|
|
if (feed.getUri() != null && feed.getUri().compareTo("") != 0 && feed.getLinkTitle() != null && feed.getLinkTitle().compareTo("") != 0 && !feed.isMultiFileUpload()) {
|
|
|
|
|
|
|
|
// hide the attachments panel
|
|
|
|
attachmentPreviewPanel.setVisible(false);
|
2016-01-22 18:54:30 +01:00
|
|
|
|
|
|
|
LinkPreviewer linkPreviewer = new LinkPreviewer(feed.getLinkTitle(), feed.getLinkDescription(), feed.getLinkHost(), feed.getUriThumbnail(), feed.getUri());
|
|
|
|
|
|
|
|
// enable the image previewer if it is an image (mime)
|
|
|
|
if(feed.getLinkHost().contains("image/")){
|
|
|
|
|
|
|
|
ArrayList<EnhancedImage> listOfEnhancedImages;
|
|
|
|
|
|
|
|
EnhancedImage enhancedImage = new EnhancedImage(
|
2016-11-21 12:30:12 +01:00
|
|
|
feed.getUri(),
|
2016-01-29 11:44:11 +01:00
|
|
|
feed.getLinkTitle() +
|
|
|
|
" (" + feed.getLinkDescription() + ", type:" + feed.getLinkHost() +")",
|
2016-01-22 18:54:30 +01:00
|
|
|
feed.getLinkTitle(),
|
|
|
|
feed.getUri()
|
|
|
|
);
|
|
|
|
|
|
|
|
listOfEnhancedImages = new ArrayList<EnhancedImage>();
|
|
|
|
listOfEnhancedImages.add(enhancedImage);
|
|
|
|
carousel.updateImages(listOfEnhancedImages);
|
|
|
|
|
2016-01-26 18:28:08 +01:00
|
|
|
// set handler on the linkpreviewer image to show this carousel and on the image title too
|
2016-01-22 18:54:30 +01:00
|
|
|
linkPreviewer.onImageClickOpenCarousel(carousel);
|
2016-01-26 18:28:08 +01:00
|
|
|
linkPreviewer.onFileNameClickOpenCarousel(carousel);
|
2016-01-25 18:49:31 +01:00
|
|
|
|
2016-01-25 15:40:03 +01:00
|
|
|
// remove next and prev buttons of the carousel since we have only an image
|
|
|
|
carousel.hideArrows();
|
2016-01-22 18:54:30 +01:00
|
|
|
|
|
|
|
}
|
2016-01-25 18:49:31 +01:00
|
|
|
|
2016-01-25 15:40:03 +01:00
|
|
|
// add link preview to the preview panel
|
2016-01-22 18:54:30 +01:00
|
|
|
previewPanel.add(linkPreviewer);
|
2016-01-21 14:29:46 +01:00
|
|
|
}
|
|
|
|
|
2016-01-19 18:43:15 +01:00
|
|
|
// in case there are attachments, we have to fill attachmentPreviewPanel instead of the previewPanel
|
2016-01-20 18:49:31 +01:00
|
|
|
if(feed.isMultiFileUpload()){
|
|
|
|
|
2016-01-21 14:29:46 +01:00
|
|
|
// set style to the attachment container
|
|
|
|
attachmentPreviewPanel.setStyleName("attachment-preview-container");
|
|
|
|
|
|
|
|
// hide link preview panel
|
|
|
|
previewPanel.setVisible(false);
|
2016-01-19 18:43:15 +01:00
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
// prepare the carousel
|
|
|
|
ArrayList<EnhancedImage> listOfEnhancedImages = new ArrayList<EnhancedImage>();
|
|
|
|
|
2016-01-19 18:43:15 +01:00
|
|
|
// remember that one attachment is stored in the fields: uri, uriThumbnail, linkTitle, linkDescription, linkHost
|
|
|
|
Attachment firstAttachment = new Attachment(
|
|
|
|
feed.getKey(), // it is meaningless but it's needed
|
|
|
|
feed.getUri(),
|
|
|
|
feed.getLinkTitle(),
|
|
|
|
feed.getLinkDescription(),
|
|
|
|
feed.getUriThumbnail(),
|
|
|
|
feed.getLinkHost());
|
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
// create first attachment previewer and pass it the carousel
|
|
|
|
AttachmentPreviewer firstAttachmentPreviewer = new AttachmentPreviewer(firstAttachment);
|
2016-01-25 18:49:31 +01:00
|
|
|
|
2016-01-28 11:57:31 +01:00
|
|
|
// determine if the left/right arrows must be removed
|
|
|
|
int imagesAvailableInCarousel = 0;
|
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
// check if it is an image
|
|
|
|
if(firstAttachment.getMimeType().contains("image/")){
|
|
|
|
|
|
|
|
EnhancedImage enhancedImage = new EnhancedImage(
|
2016-11-21 12:30:12 +01:00
|
|
|
feed.getUri(),
|
2016-01-29 17:23:35 +01:00
|
|
|
feed.getLinkTitle() +
|
2016-01-29 11:44:11 +01:00
|
|
|
" (" + feed.getLinkDescription() + ", type:" + feed.getLinkHost() +")",
|
2016-01-22 18:54:30 +01:00
|
|
|
feed.getLinkTitle(),
|
|
|
|
feed.getUri()
|
|
|
|
);
|
|
|
|
|
|
|
|
listOfEnhancedImages.add(enhancedImage);
|
2016-01-25 15:40:03 +01:00
|
|
|
firstAttachmentPreviewer.onImageClickOpenCarousel(carousel, enhancedImage);
|
2016-01-22 18:54:30 +01:00
|
|
|
|
2016-01-28 11:57:31 +01:00
|
|
|
// increment the images
|
|
|
|
imagesAvailableInCarousel ++;
|
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
}
|
2016-01-25 18:49:31 +01:00
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
// add the first attachment to the panel
|
|
|
|
attachmentPreviewPanel.add(firstAttachmentPreviewer);
|
2016-01-19 18:43:15 +01:00
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
// check the others
|
2016-01-20 18:49:31 +01:00
|
|
|
for (Attachment otherAttachment : myFeed.getAttachments()) {
|
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
AttachmentPreviewer attachmentPreviewer = new AttachmentPreviewer(otherAttachment);
|
|
|
|
|
|
|
|
if(otherAttachment.getMimeType().contains("image/")){
|
|
|
|
|
|
|
|
EnhancedImage enhancedImage = new EnhancedImage(
|
2016-11-21 12:30:12 +01:00
|
|
|
otherAttachment.getUri(),
|
2016-01-29 11:44:11 +01:00
|
|
|
otherAttachment.getName() +
|
|
|
|
" (" + otherAttachment.getDescription() + ", type:" + feed.getLinkHost() +")",
|
2016-01-22 18:54:30 +01:00
|
|
|
otherAttachment.getName(),
|
|
|
|
otherAttachment.getUri()
|
|
|
|
);
|
|
|
|
|
|
|
|
listOfEnhancedImages.add(enhancedImage);
|
2016-01-25 18:49:31 +01:00
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
// pass the carousel
|
2016-01-25 15:40:03 +01:00
|
|
|
attachmentPreviewer.onImageClickOpenCarousel(carousel, enhancedImage);
|
2016-01-22 18:54:30 +01:00
|
|
|
|
2016-01-28 11:57:31 +01:00
|
|
|
// increment the images
|
|
|
|
imagesAvailableInCarousel ++;
|
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
}
|
|
|
|
|
2016-01-20 18:49:31 +01:00
|
|
|
// try to build the attachment viewer
|
2016-01-22 18:54:30 +01:00
|
|
|
attachmentPreviewPanel.add(attachmentPreviewer);
|
2016-01-19 18:43:15 +01:00
|
|
|
|
2016-01-28 12:04:42 +01:00
|
|
|
// hide arrows if there is no more than 1 image
|
2016-01-28 11:57:31 +01:00
|
|
|
if(imagesAvailableInCarousel <= 1)
|
|
|
|
carousel.hideArrows();
|
|
|
|
|
2016-01-19 10:25:30 +01:00
|
|
|
}
|
2016-01-25 18:49:31 +01:00
|
|
|
|
2016-01-22 18:54:30 +01:00
|
|
|
// update the carousel's images
|
|
|
|
carousel.updateImages(listOfEnhancedImages);
|
2016-01-21 14:29:46 +01:00
|
|
|
|
2016-01-20 18:49:31 +01:00
|
|
|
// invoke append label
|
|
|
|
attachmentPreviewPanel.appendShowMoreLabel();
|
2016-01-19 10:25:30 +01:00
|
|
|
}
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2013-07-11 12:19:36 +02:00
|
|
|
openImage.setStyleName("openImage");
|
|
|
|
openImage.setTitle("Open this feed separately");
|
2014-04-08 23:40:13 +02:00
|
|
|
//show if the user has already liked this or not
|
|
|
|
setFavoritedUI(myFeed.isLiked());
|
2014-04-12 19:13:17 +02:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
commentArea.setHTML("<a>" + NewsFeedPanel.COMMENT_LABEL + "</a>");
|
|
|
|
|
|
|
|
String feedText = feed.getDescription();
|
2013-04-21 19:05:18 +02:00
|
|
|
String descWithoutHTML = new HTML(feedText).getText();
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2013-04-21 19:05:18 +02:00
|
|
|
if ( (! feedText.startsWith("<span")) && descWithoutHTML.length() > MAX_SHOWTEXT_LENGTH && !displaySingle) {
|
2015-07-15 18:47:28 +02:00
|
|
|
final int TEXT_TO_SHOW_LENGHT = (descWithoutHTML.length() < 500) ? (feedText.length() - (feedText.length() / 3)) : 500;
|
|
|
|
feedText = feedText.substring(0, TEXT_TO_SHOW_LENGHT) + "...";
|
2013-04-04 15:41:17 +02:00
|
|
|
seeMore.setHTML("<a class=\"seemore\"> See More </a>");
|
|
|
|
}
|
2014-04-12 19:13:17 +02:00
|
|
|
|
|
|
|
avatarImage.setUrl(feed.getThumbnailURL());
|
|
|
|
avatarImage.setPixelSize(50, 50);
|
|
|
|
|
2014-04-10 17:45:50 +02:00
|
|
|
//replace the < & and >
|
|
|
|
feedText = feedText.replaceAll("<","<").replaceAll(">",">");
|
|
|
|
feedText = feedText.replaceAll("&","&");
|
2016-08-03 16:29:59 +02:00
|
|
|
|
2017-03-01 12:09:16 +01:00
|
|
|
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + NewsFeedPanel.extractOrgFriendlyURL(Location.getHref()) +GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
2016-08-03 16:29:59 +02:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
if (! isAppFeed) {
|
2016-08-03 16:29:59 +02:00
|
|
|
// sharePostArea.setHTML("<a>" + NewsFeedPanel.SHARE_FWD_LABEL + "</a>");
|
2016-04-06 16:35:20 +02:00
|
|
|
contentArea.setHTML("<a class=\"link\" href=\""+profilePageURL
|
2013-07-18 19:01:36 +02:00
|
|
|
+"?"+
|
|
|
|
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
|
|
|
Encoder.encode(feed.getEntityId())+"\">"+feed.getFullName()+"</a> " + feedText);
|
2014-04-12 19:13:17 +02:00
|
|
|
|
2014-10-10 14:41:38 +02:00
|
|
|
this.vreSource.setVisible(true);
|
2014-03-10 16:47:02 +01:00
|
|
|
//show the vreid iff the info is present
|
|
|
|
if (showTimelineSource && feed.getVreid() != null && feed.getVreid().compareTo("") != 0) {
|
|
|
|
String vreName = feed.getVreid().substring(feed.getVreid().lastIndexOf("/")+1);
|
|
|
|
vreSource.setHTML("<a class=\"link\" style=\"font-size: 10px; white-space: nowrap;\" href=\"/group/"+vreName.toLowerCase()+"\">[" +vreName + "]</a>");
|
2014-10-13 15:44:46 +02:00
|
|
|
}
|
2014-04-12 19:13:17 +02:00
|
|
|
//check if the user has his own avatar
|
2016-05-30 18:46:44 +02:00
|
|
|
if (feed.getThumbnailURL().contains("img_id=0") || !feed.getThumbnailURL().contains("?")) { //it means no avatar is set
|
2014-04-12 19:13:17 +02:00
|
|
|
avatarImage.setVisible(false);
|
|
|
|
String f = "A";
|
|
|
|
String s = "Z";
|
|
|
|
if (feed.getFullName() != null) {
|
|
|
|
String[] parts = feed.getFullName().split("\\s");
|
|
|
|
if (parts.length > 0) {
|
|
|
|
f = parts[0].toUpperCase();
|
|
|
|
s = parts[parts.length-1].toUpperCase();
|
|
|
|
} else {
|
|
|
|
f = feed.getFullName().substring(0,1);
|
|
|
|
s = feed.getFullName().substring(1,2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
avatarReplacement.setInitials(feed.getEntityId(), f, s);
|
|
|
|
avatarReplacement.setVisible(true);
|
|
|
|
}
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
// messageSeparator.setVisible(false);
|
|
|
|
contentArea.setHTML("<a class=\"link\" href=\""+feed.getUri()+"\">"+feed.getFullName()+"</a> " + feedText);
|
|
|
|
if (isAppFeed) {
|
2014-02-14 15:11:09 +01:00
|
|
|
if (myUserInfo.isAdmin())
|
|
|
|
closeImage.setTitle("Delete this Application feed (Administrator Only)");
|
|
|
|
else
|
|
|
|
closeImage.removeFromParent();
|
2013-04-04 15:41:17 +02:00
|
|
|
try{
|
|
|
|
String vreName = feed.getVreid().substring(feed.getVreid().lastIndexOf("/")+1);
|
2016-02-01 17:36:01 +01:00
|
|
|
sharePostArea.setHTML("<a class=\"link\" style=\"white-space: nowrap;\" href=\""+feed.getUri()+"\"> - go App [" +vreName + "] - </a>");
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
catch (Exception e) {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-12 19:13:17 +02:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
try {
|
2016-08-03 16:29:59 +02:00
|
|
|
Date now = new Date();
|
|
|
|
String formattedTime;
|
|
|
|
// TODO java.util.Calendar is not yet available in GWT
|
|
|
|
if(now.getYear() != feed.getTime().getYear())
|
|
|
|
formattedTime = DateTimeFormat.getFormat("MMMM dd yyyy, h:mm a").format(feed.getTime());
|
|
|
|
else
|
|
|
|
formattedTime = DateTimeFormat.getFormat("MMMM dd, h:mm a").format(feed.getTime());
|
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
timeArea.setHTML(formattedTime);
|
2015-10-23 17:33:28 +02:00
|
|
|
String formattedTimeWithYear = DateTimeFormat.getFormat("dd MMMM yyyy h:mm a ").format(feed.getTime());
|
|
|
|
timeArea.setTitle(formattedTimeWithYear);
|
2016-09-26 17:07:44 +02:00
|
|
|
if (! feed.getCommentsNo().equals("0")) {
|
|
|
|
commentsNo.setVisible(true);
|
|
|
|
commentsNo.setText(feed.getCommentsNo());
|
|
|
|
commentsNo.setTitle(feed.getCommentsNo() + " people commented this.");
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
if (! feed.getLikesNo().equals("0")) {
|
2016-09-26 17:07:44 +02:00
|
|
|
likesNo.setVisible(true);
|
|
|
|
likesNo.setText(feed.getLikesNo());
|
2013-04-04 15:41:17 +02:00
|
|
|
likesNo.setTitle("Show People who have " + NewsFeedPanel.LIKED_LABEL + " this.");
|
|
|
|
}
|
|
|
|
totalComments = Integer.parseInt(feed.getCommentsNo());
|
|
|
|
}
|
|
|
|
catch (NumberFormatException e) {
|
|
|
|
totalComments = 0;
|
|
|
|
}
|
|
|
|
catch (Exception e) {
|
|
|
|
timeArea.setHTML("just now");
|
|
|
|
}
|
|
|
|
commentsPanel.setStyleName("commentsPanel");
|
|
|
|
if (myFeed.getComments() != null && myFeed.getComments().size() > 0) {
|
2013-04-19 14:24:54 +02:00
|
|
|
if (totalComments > 2 && !displaySingle) {
|
2013-04-04 15:41:17 +02:00
|
|
|
showAllComments = getShowAllCommentsLink(totalComments);
|
|
|
|
commentsPanel.add(showAllComments);
|
2016-09-26 17:07:44 +02:00
|
|
|
commentsNo.setVisible(true);
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
for (Comment comment : myFeed.getComments()) {
|
2015-12-11 14:16:21 +01:00
|
|
|
addComment(new SingleComment(comment, this, (comment.getUserid().equals(myUserInfo.getUsername()))));
|
2014-04-11 00:49:53 +02:00
|
|
|
}
|
2014-04-11 12:50:23 +02:00
|
|
|
showAddCommentForm(false);
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* used when getting tweets from the client
|
|
|
|
* @param myUserInfo
|
|
|
|
* @param feed
|
|
|
|
* @param eventBus
|
|
|
|
* @param hidden
|
|
|
|
*/
|
|
|
|
public TweetTemplate(UserInfo myUserInfo, EnhancedFeed feed, HandlerManager eventBus, boolean hidden) {
|
2014-03-10 16:47:02 +01:00
|
|
|
this(false, false, myUserInfo, feed, eventBus);
|
2013-04-04 15:41:17 +02:00
|
|
|
contentArea.getElement().getParentElement().getParentElement().setClassName("div-table-col content hidden");
|
|
|
|
}
|
|
|
|
|
|
|
|
@UiHandler("contentArea")
|
|
|
|
public void onHover(MouseOutEvent event) {
|
|
|
|
if (isUsers)
|
|
|
|
closeImage.removeStyleName("uiCloseButton");
|
2013-07-11 12:19:36 +02:00
|
|
|
openImage.removeStyleName("uiOpenButton");
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@UiHandler("contentArea")
|
|
|
|
public void onHover(MouseOverEvent event) {
|
2014-02-14 15:11:09 +01:00
|
|
|
if (isUsers) {
|
2013-04-04 15:41:17 +02:00
|
|
|
closeImage.addStyleName("uiCloseButton");
|
2014-02-14 15:11:09 +01:00
|
|
|
GWT.log("this belong to user");
|
|
|
|
}
|
2013-07-11 12:19:36 +02:00
|
|
|
openImage.addStyleName("uiOpenButton");
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@UiHandler("closeImage")
|
|
|
|
void onDeleteFeedClick(ClickEvent e) {
|
2016-01-25 18:49:31 +01:00
|
|
|
if (isUsers || myUserInfo.isAdmin()){
|
2013-04-04 15:41:17 +02:00
|
|
|
eventBus.fireEvent(new DeleteFeedEvent(this));
|
2016-01-25 18:49:31 +01:00
|
|
|
}
|
2014-02-14 15:11:09 +01:00
|
|
|
else {
|
|
|
|
GWT.log("not belong to user");
|
|
|
|
}
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
2014-03-10 16:47:02 +01:00
|
|
|
|
2013-07-11 12:19:36 +02:00
|
|
|
@UiHandler("openImage")
|
|
|
|
void onOpenFeedClick(ClickEvent e) {
|
|
|
|
eventBus.fireEvent(new OpenFeedEvent(this));
|
|
|
|
}
|
2014-03-10 16:47:02 +01:00
|
|
|
|
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
@UiHandler("seeMore")
|
|
|
|
void onSeeMoreClick(ClickEvent e) {
|
2014-11-18 18:23:58 +01:00
|
|
|
String feedText = myFeed.getFeed().getDescription();
|
|
|
|
//replace the < & and >
|
|
|
|
feedText = feedText.replaceAll("<","<").replaceAll(">",">");
|
|
|
|
feedText = feedText.replaceAll("&","&");
|
2016-08-03 16:29:59 +02:00
|
|
|
|
2017-03-01 12:09:16 +01:00
|
|
|
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + NewsFeedPanel.extractOrgFriendlyURL(Location.getHref()) +GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
2016-04-06 16:35:20 +02:00
|
|
|
|
2016-08-03 16:29:59 +02:00
|
|
|
|
2016-04-06 16:35:20 +02:00
|
|
|
contentArea.setHTML("<a class=\"link\"href=\"" + profilePageURL + "?"+
|
2014-03-10 16:47:02 +01:00
|
|
|
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
|
|
|
Encoder.encode(myFeed.getFeed().getEntityId())+"\">"+
|
2014-11-18 18:23:58 +01:00
|
|
|
myFeed.getFeed().getFullName()+"</a> " + feedText);
|
2014-03-10 16:47:02 +01:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
seeMore.setHTML("");
|
|
|
|
}
|
|
|
|
|
2014-04-08 23:40:13 +02:00
|
|
|
private void setFavoritedUI(boolean favorited) {
|
|
|
|
if (favorited) {
|
|
|
|
likeArea.setHTML("<a style=\"color:#6E8CCC;\">" + NewsFeedPanel.LIKED_LABEL + "</a>");
|
2016-09-01 14:35:31 +02:00
|
|
|
likeArea.setTitle("Unlike this");
|
2014-04-08 23:40:13 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
likeArea.setHTML("<a>" + NewsFeedPanel.LIKE_LABEL + "</a>");
|
|
|
|
}
|
|
|
|
}
|
2014-04-12 19:13:17 +02:00
|
|
|
|
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
|
|
|
|
@UiHandler("likeArea")
|
|
|
|
void onLikeClick(ClickEvent e) {
|
2014-04-08 23:40:13 +02:00
|
|
|
//if is not liked
|
2013-04-04 15:41:17 +02:00
|
|
|
if (!likeArea.getText().equals(NewsFeedPanel.LIKED_LABEL)) {
|
|
|
|
try {
|
|
|
|
int cur = Integer.parseInt(myFeed.getFeed().getLikesNo());
|
|
|
|
cur++;
|
|
|
|
if (cur == 1) {
|
|
|
|
myFeed.getFeed().setLikesNo("1");
|
2016-09-26 17:07:44 +02:00
|
|
|
likesNo.setText("1");
|
2013-04-04 15:41:17 +02:00
|
|
|
likesNo.setTitle("People who have " + NewsFeedPanel.LIKED_LABEL + " this");
|
2016-09-26 17:07:44 +02:00
|
|
|
likesNo.setVisible(true);
|
2013-04-04 15:41:17 +02:00
|
|
|
} else {
|
|
|
|
myFeed.getFeed().setLikesNo(""+cur);
|
2016-09-26 17:07:44 +02:00
|
|
|
likesNo.setText(""+cur);
|
|
|
|
likesNo.setVisible(true);
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
eventBus.fireEvent(new AddLikeEvent(this, myFeed.getFeed().getKey()));
|
2014-04-08 23:40:13 +02:00
|
|
|
setFavoritedUI(true);
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
catch (NumberFormatException ex) {
|
|
|
|
likeArea.setHTML("Error on the server");
|
|
|
|
}
|
2014-04-08 23:40:13 +02:00
|
|
|
} else {
|
|
|
|
//it is liked
|
|
|
|
int cur = Integer.parseInt(myFeed.getFeed().getLikesNo());
|
|
|
|
cur--;
|
|
|
|
if (cur == 0) {
|
|
|
|
myFeed.getFeed().setLikesNo("0");
|
2016-09-26 17:07:44 +02:00
|
|
|
likesNo.setText("");
|
|
|
|
likesNo.setVisible(false);
|
2014-04-08 23:40:13 +02:00
|
|
|
likesNo.setTitle("");
|
|
|
|
} else {
|
|
|
|
myFeed.getFeed().setLikesNo(""+cur);
|
2016-09-26 17:07:44 +02:00
|
|
|
likesNo.setText(""+cur);
|
|
|
|
likesNo.setVisible(true);
|
2014-04-08 23:40:13 +02:00
|
|
|
}
|
|
|
|
eventBus.fireEvent(new UnLikeEvent(this, myFeed.getFeed().getKey()));
|
|
|
|
setFavoritedUI(false);
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@UiHandler("commentArea")
|
|
|
|
void onAddCommentClick(ClickEvent e) {
|
|
|
|
if (! commentingDisabled) {
|
|
|
|
if (! commentsFetched && totalComments > 2) { //if so, need to load all comments before adding a comment
|
|
|
|
fireSeeComments(true);
|
|
|
|
}
|
2014-04-11 00:49:53 +02:00
|
|
|
else {
|
2014-04-11 12:50:23 +02:00
|
|
|
showAddCommentForm(true);
|
2014-04-11 00:49:53 +02:00
|
|
|
}
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
GWT.log("Commenting disabled");
|
|
|
|
}
|
|
|
|
|
2016-01-19 10:25:30 +01:00
|
|
|
@UiHandler("sharePostArea")
|
2013-04-04 15:41:17 +02:00
|
|
|
void onMessageClick(ClickEvent e) {
|
|
|
|
if (! isAppFeed) {
|
|
|
|
final List<String> listToLogin = new ArrayList<String>();
|
|
|
|
listToLogin.add(myFeed.getFeed().getEntityId());
|
|
|
|
GWT.runAsync(new RunAsyncCallback() {
|
|
|
|
@Override
|
|
|
|
public void onSuccess() {
|
2016-01-19 10:25:30 +01:00
|
|
|
SharePostDialog dlg = new SharePostDialog(myInstance);
|
|
|
|
dlg.openModal();
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
public void onFailure(Throwable reason) {
|
|
|
|
Window.alert("Could not load this component: " + reason.getMessage());
|
|
|
|
}
|
|
|
|
});
|
2014-03-10 16:47:02 +01:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-11 12:50:23 +02:00
|
|
|
public void showAddCommentForm(boolean focus) {
|
2013-04-04 15:41:17 +02:00
|
|
|
final AddCommentTemplate toAdd = new AddCommentTemplate(this, myUserInfo, eventBus);
|
|
|
|
commentsPanel.add(toAdd);
|
|
|
|
commentingDisabled = true;
|
|
|
|
final Timer t = new Timer() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
2014-04-11 12:50:23 +02:00
|
|
|
toAdd.setStyleName("comment-show");
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
};
|
2014-04-11 12:50:23 +02:00
|
|
|
if (focus)
|
|
|
|
toAdd.setFocus();
|
2013-04-04 15:41:17 +02:00
|
|
|
t.schedule(10);
|
|
|
|
}
|
|
|
|
|
|
|
|
private HTML getShowAllCommentsLink(int commentsNo) {
|
|
|
|
final HTML toReturn = new HTML("<div class=\"more-comment\"><a class=\"link\" style=\"font-size:11px;\">Show all " + commentsNo + " comments<a/></div>");
|
|
|
|
toReturn.addClickHandler(new ClickHandler() {
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
fireSeeComments(false);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return toReturn;
|
|
|
|
}
|
|
|
|
|
|
|
|
private void fireSeeComments(boolean commentForm2Add) {
|
|
|
|
eventBus.fireEvent(new SeeCommentsEvent(this, commentForm2Add));
|
|
|
|
}
|
|
|
|
|
|
|
|
@UiHandler("likesNo")
|
|
|
|
void onSeeLikes(ClickEvent e) {
|
|
|
|
eventBus.fireEvent(new SeeLikesEvent(myFeed.getFeed().getKey()));
|
|
|
|
}
|
2016-09-26 17:07:44 +02:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
@UiHandler("commentsNo")
|
|
|
|
void onSeeComments(ClickEvent e) {
|
|
|
|
fireSeeComments(false);
|
2016-09-26 17:07:44 +02:00
|
|
|
}
|
2013-04-04 15:41:17 +02:00
|
|
|
|
|
|
|
public void setcontentAreaStyle(String cssclass) {
|
|
|
|
contentArea.getElement().getParentElement().getParentElement().setClassName("div-table-col content visible");
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isCommenting() {
|
|
|
|
return commentingDisabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCommentingDisabled(boolean commenting) {
|
|
|
|
this.commentingDisabled = commenting;
|
|
|
|
}
|
|
|
|
public String getFeedKey() {
|
|
|
|
return myFeed.getFeed().getKey();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void remove(Widget w) {
|
|
|
|
mainHTML.remove(w);
|
|
|
|
}
|
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
public void addComment(SingleComment comment) {
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
commentsPanel.add(comment);
|
2013-04-04 15:41:17 +02:00
|
|
|
myComments.add(comment);
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
}
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
public void updateSingleComment(Comment edited, HTMLPanel commentPanel){
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
commentPanel.clear();
|
|
|
|
SingleComment sc = new SingleComment(edited, this, true);
|
|
|
|
commentPanel.add(sc);
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
// replace the new SingleComment in the list
|
|
|
|
int index = 0;
|
|
|
|
Iterator<SingleComment> iterator = this.myComments.iterator();
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
for (;iterator.hasNext();) {
|
|
|
|
SingleComment singleComment = (SingleComment) iterator.next();
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
if(singleComment.getCommentKey().equals(edited.getKey())){
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
iterator.remove();
|
|
|
|
this.myComments.add(index, sc);
|
|
|
|
break;
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2015-12-11 14:16:21 +01:00
|
|
|
}
|
|
|
|
index ++;
|
|
|
|
}
|
2016-01-19 14:35:27 +01:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void clearComments() {
|
|
|
|
myComments.clear();
|
|
|
|
commentsPanel.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void showLoadingComments() {
|
|
|
|
showAllComments.setHTML("<div class=\"more-comment\"><img style=\"padding-right:15px;\"src=\""+ loading +"\" /></div>");
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isCommentsFetched() {
|
|
|
|
return commentsFetched;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCommentsFetched(boolean commentsFetched) {
|
|
|
|
this.commentsFetched = commentsFetched;
|
|
|
|
}
|
|
|
|
public HandlerManager getEventBus() {
|
|
|
|
return eventBus;
|
|
|
|
}
|
|
|
|
public void updateCommentsNumberCount() {
|
|
|
|
if (myComments.size() == 1) {
|
2016-09-26 17:07:44 +02:00
|
|
|
//commentsNo.setStyleName("show-comments-number");
|
2013-04-04 15:41:17 +02:00
|
|
|
commentsNo.setTitle("Persons who have commented this.");
|
|
|
|
}
|
2016-09-26 17:07:44 +02:00
|
|
|
//commentsNo.setHTML(commentIcon.getElement().toString()+"<span> </span>"+myComments.size());
|
|
|
|
commentsNo.setText(""+myComments.size());
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|
|
|
|
public UserInfo getMyUserInfo() {
|
|
|
|
return myUserInfo;
|
|
|
|
}
|
2014-03-10 16:47:02 +01:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
public String getMyFeedUserId() {
|
|
|
|
return myFeed.getFeed().getEntityId();
|
|
|
|
}
|
2014-03-10 16:47:02 +01:00
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
public String getMyFeedText() {
|
|
|
|
return myFeed.getFeed().getDescription();
|
|
|
|
}
|
2014-03-10 16:47:02 +01:00
|
|
|
|
2013-04-08 17:25:37 +02:00
|
|
|
public boolean isAppFeed() {
|
|
|
|
return isAppFeed;
|
|
|
|
}
|
2016-01-26 18:28:08 +01:00
|
|
|
|
|
|
|
public boolean isUser() {
|
|
|
|
return isUsers;
|
|
|
|
}
|
2016-01-28 15:28:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of comments this post has
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public int numberOfComments(){
|
|
|
|
|
|
|
|
// quite easy..
|
|
|
|
return myComments.size();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of likes this post has
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public int numberOfLikes(){
|
|
|
|
|
|
|
|
// not so easy
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
try{
|
2016-01-29 17:23:35 +01:00
|
|
|
|
2016-09-26 17:07:44 +02:00
|
|
|
ret = Integer.parseInt(likesNo.getText());
|
2016-01-28 15:28:06 +01:00
|
|
|
|
|
|
|
}catch(NumberFormatException e){
|
|
|
|
|
|
|
|
GWT.log(e.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-04-04 15:41:17 +02:00
|
|
|
}
|