|
|
@ -73,10 +73,30 @@ public class StatisticsPanel extends Composite {
|
|
|
|
* Labels
|
|
|
|
* Labels
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private final static String POSTS_LABEL = "Posts";
|
|
|
|
private final static String POSTS_LABEL = "Posts";
|
|
|
|
private final static String LIKES_COMMENTS_MADE_LABEL = "Likes & Replies";
|
|
|
|
private final static String LIKES_COMMENTS_MADE_LABEL = "Yours";
|
|
|
|
private final static String LIKES_COMMENTS_GOT_LABEL = "Got";
|
|
|
|
private final static String LIKES_COMMENTS_GOT_LABEL = "Others";
|
|
|
|
private final static String STORAGE_LABEL = "Space Used";
|
|
|
|
private final static String STORAGE_LABEL = "Space Used";
|
|
|
|
private final static String PROFILE_STRENGTH_LABEL = "Profile Strength";
|
|
|
|
private final static String PROFILE_STRENGTH_LABEL = "Profile Strength";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_POSTS_ROOT_PROFILE = "Posts done during the last year";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_POSTS_VRE = "Posts done in the last year in this VRE";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_FAVORITES_REPLIES_ROOT_PROFILE = "Likes and post replies done during the last year";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_FAVORITES_REPLIES_POSTS_VRE = "Likes and post replies done during the last year in this VRE";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_GOT_ROOT_PROFILE = "Likes and post replies got during the last year";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_GOT_VRE = "Likes and post replies got during the last year in this VRE";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_INFRASTRUCTURE_SPACE = "Total amount of space used in the infrastructure";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_PROFILE_STRENGHT = "Your profile strength";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Specific tooltips
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private final static String TOOLTIP_LIKES_GOT = "Likes got during the last year";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_LIKES_GOT_VRE = "Likes got during the last year in this VRE";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_LIKES_DONE = "Likes done during the last year";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_LIKES_DONE_VRE = "Likes done during the last year in this VRE";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_REPLIES_DONE = "Post replies done during the last year";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_REPLIES_DONE_VRE = "Post replies done during the last year in this VRE";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_REPLIES_GOT = "Post replies got during the last year";
|
|
|
|
|
|
|
|
private final static String TOOLTIP_REPLIES_GOT_VRE = "Post replies got during the last year in this VRE.";
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* improve profile hints
|
|
|
|
* improve profile hints
|
|
|
@ -125,7 +145,7 @@ public class StatisticsPanel extends Composite {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Since the number of likes/comments got can be manipulated, we need a class reference
|
|
|
|
* Since the number of likes/comments got can be manipulated, we need a class reference
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private CommentsAndLikesWidget content;
|
|
|
|
private CommentsAndLikesWidget contentLikesAndCommentsGot;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Number of written posts
|
|
|
|
* Number of written posts
|
|
|
@ -152,6 +172,11 @@ public class StatisticsPanel extends Composite {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private final HandlerManager eventBus = new HandlerManager(null);
|
|
|
|
private final HandlerManager eventBus = new HandlerManager(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Saved current user information bean
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
UserInformation informationBeanRetrieved;
|
|
|
|
|
|
|
|
|
|
|
|
public StatisticsPanel() {
|
|
|
|
public StatisticsPanel() {
|
|
|
|
|
|
|
|
|
|
|
|
//init this object
|
|
|
|
//init this object
|
|
|
@ -196,11 +221,14 @@ public class StatisticsPanel extends Composite {
|
|
|
|
// first of all check if the statistics can be shown to other people
|
|
|
|
// first of all check if the statistics can be shown to other people
|
|
|
|
if(userid != null && !userid.equals(information.getAslSessionUsername()) && !information.isProfileShowable()){
|
|
|
|
if(userid != null && !userid.equals(information.getAslSessionUsername()) && !information.isProfileShowable()){
|
|
|
|
|
|
|
|
|
|
|
|
mainPanel.add(new HTML("Sorry but the user set his Statistics to private"));
|
|
|
|
mainPanel.add(new HTML("Sorry but the user set his/her statistics to private"));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// save it
|
|
|
|
|
|
|
|
informationBeanRetrieved = information;
|
|
|
|
|
|
|
|
|
|
|
|
// is a user profile page? or a vre/home one (this portlet can be also deployed in a vre)
|
|
|
|
// is a user profile page? or a vre/home one (this portlet can be also deployed in a vre)
|
|
|
|
final boolean isProfilePage = isProfilePage();
|
|
|
|
final boolean isProfilePage = isProfilePage();
|
|
|
|
|
|
|
|
|
|
|
@ -253,9 +281,9 @@ public class StatisticsPanel extends Composite {
|
|
|
|
feeds.setHeader(POSTS_LABEL);
|
|
|
|
feeds.setHeader(POSTS_LABEL);
|
|
|
|
|
|
|
|
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
feeds.setToolTip("Posts during the last year");
|
|
|
|
feeds.setToolTip(TOOLTIP_POSTS_ROOT_PROFILE);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
feeds.setToolTip("Posts during the last year in this VRE");
|
|
|
|
feeds.setToolTip(TOOLTIP_POSTS_VRE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
@ -271,9 +299,9 @@ public class StatisticsPanel extends Composite {
|
|
|
|
likesAndCommentsMade.setHeader(LIKES_COMMENTS_MADE_LABEL);
|
|
|
|
likesAndCommentsMade.setHeader(LIKES_COMMENTS_MADE_LABEL);
|
|
|
|
|
|
|
|
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
likesAndCommentsMade.setToolTip("Likes and post replies made during the last year");
|
|
|
|
likesAndCommentsMade.setToolTip(TOOLTIP_FAVORITES_REPLIES_ROOT_PROFILE);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
likesAndCommentsMade.setToolTip("Likes and post replies made during the last year in this VRE");
|
|
|
|
likesAndCommentsMade.setToolTip(TOOLTIP_FAVORITES_REPLIES_POSTS_VRE);
|
|
|
|
|
|
|
|
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
|
Image commentsLikesMadeLoader = new Image(imagePath);
|
|
|
|
Image commentsLikesMadeLoader = new Image(imagePath);
|
|
|
@ -288,9 +316,9 @@ public class StatisticsPanel extends Composite {
|
|
|
|
likesAndCommentsGot.setHeader(LIKES_COMMENTS_GOT_LABEL);
|
|
|
|
likesAndCommentsGot.setHeader(LIKES_COMMENTS_GOT_LABEL);
|
|
|
|
|
|
|
|
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
likesAndCommentsGot.setToolTip("Likes and post replies got during the last year");
|
|
|
|
likesAndCommentsGot.setToolTip(TOOLTIP_GOT_ROOT_PROFILE);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
likesAndCommentsGot.setToolTip("Likes and post replies got during the last year in this VRE");
|
|
|
|
likesAndCommentsGot.setToolTip(TOOLTIP_GOT_VRE);
|
|
|
|
|
|
|
|
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
|
Image commentsLikesLoader = new Image(imagePath);
|
|
|
|
Image commentsLikesLoader = new Image(imagePath);
|
|
|
@ -307,7 +335,7 @@ public class StatisticsPanel extends Composite {
|
|
|
|
if(isRoot || isProfilePage){
|
|
|
|
if(isRoot || isProfilePage){
|
|
|
|
|
|
|
|
|
|
|
|
storage.setHeader(STORAGE_LABEL);
|
|
|
|
storage.setHeader(STORAGE_LABEL);
|
|
|
|
storage.setToolTip("Total amount of space used in the infrastructure");
|
|
|
|
storage.setToolTip(TOOLTIP_INFRASTRUCTURE_SPACE);
|
|
|
|
|
|
|
|
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
|
Image totalSpaceLoader = new Image(imagePath);
|
|
|
|
Image totalSpaceLoader = new Image(imagePath);
|
|
|
@ -317,7 +345,7 @@ public class StatisticsPanel extends Composite {
|
|
|
|
mainPanel.add(storage);
|
|
|
|
mainPanel.add(storage);
|
|
|
|
|
|
|
|
|
|
|
|
profileStrength.setHeader(PROFILE_STRENGTH_LABEL);
|
|
|
|
profileStrength.setHeader(PROFILE_STRENGTH_LABEL);
|
|
|
|
profileStrength.setToolTip("Profile strength");
|
|
|
|
profileStrength.setToolTip(TOOLTIP_PROFILE_STRENGHT);
|
|
|
|
|
|
|
|
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
|
// add loading image that will be replaced by the incoming values
|
|
|
|
Image profileStrengthLoader = new Image(imagePath);
|
|
|
|
Image profileStrengthLoader = new Image(imagePath);
|
|
|
@ -441,34 +469,36 @@ public class StatisticsPanel extends Composite {
|
|
|
|
// update feeds number
|
|
|
|
// update feeds number
|
|
|
|
feeds.clearPanelValues();
|
|
|
|
feeds.clearPanelValues();
|
|
|
|
numberOfFeedsLabel = new Label(formattedNumbers(postsBean.getFeedsNumber()));
|
|
|
|
numberOfFeedsLabel = new Label(formattedNumbers(postsBean.getFeedsNumber()));
|
|
|
|
|
|
|
|
numberOfFeedsLabel.setStyleName("statistic-value");
|
|
|
|
|
|
|
|
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
numberOfFeedsLabel.setTitle("Posts during the last year (" + postsBean.getFeedsNumber() + ")");
|
|
|
|
numberOfFeedsLabel.setTitle(TOOLTIP_POSTS_ROOT_PROFILE + " (" + postsBean.getFeedsNumber() + ")");
|
|
|
|
else
|
|
|
|
else
|
|
|
|
numberOfFeedsLabel.setTitle("Posts during the last year in this VRE (" + postsBean.getFeedsNumber() + ")");
|
|
|
|
numberOfFeedsLabel.setTitle(TOOLTIP_POSTS_VRE + " (" + postsBean.getFeedsNumber() + ")");
|
|
|
|
|
|
|
|
|
|
|
|
// add handler for user that clicks on the numberOfFeedsLabel
|
|
|
|
// add handler for user that clicks on the numberOfFeedsLabel
|
|
|
|
if(!isProfilePage){
|
|
|
|
if(!isProfilePage || information.isOwner()){
|
|
|
|
numberOfFeedsLabel.getElement().getStyle().setCursor(Cursor.POINTER);
|
|
|
|
numberOfFeedsLabel.getElement().getStyle().setCursor(Cursor.POINTER);
|
|
|
|
|
|
|
|
numberOfFeedsLabel.addStyleName("statistic-value-underline");
|
|
|
|
numberOfFeedsLabel.addClickHandler(new ClickHandler() {
|
|
|
|
numberOfFeedsLabel.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
|
|
|
|
|
|
|
eventBus.fireEvent(new ShowFeedsRelatedToUserStatisticsEvent(ShowUserStatisticAction.POSTS_MADE_BY_USER));
|
|
|
|
eventBus.fireEvent(new ShowFeedsRelatedToUserStatisticsEvent(ShowUserStatisticAction.POSTS_MADE_BY_USER, information.getCurrentPageLanding()));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
numberOfWrittenFeeds = postsBean.getFeedsNumber();
|
|
|
|
numberOfWrittenFeeds = postsBean.getFeedsNumber();
|
|
|
|
numberOfFeedsLabel.setStyleName("statistic-value");
|
|
|
|
|
|
|
|
feeds.appendToPanel(numberOfFeedsLabel);
|
|
|
|
feeds.appendToPanel(numberOfFeedsLabel);
|
|
|
|
|
|
|
|
|
|
|
|
// updates comments and likes made
|
|
|
|
// updates comments and likes made
|
|
|
|
likesAndCommentsMade.clearPanelValues();
|
|
|
|
likesAndCommentsMade.clearPanelValues();
|
|
|
|
CommentsAndLikesWidget contentLikesAndCommentsMade = new CommentsAndLikesWidget();
|
|
|
|
CommentsAndLikesWidget contentLikesAndCommentsMade = new CommentsAndLikesWidget();
|
|
|
|
|
|
|
|
|
|
|
|
if(!isProfilePage)
|
|
|
|
if(!isProfilePage || information.isOwner())
|
|
|
|
contentLikesAndCommentsMade.setEventBus(eventBus);
|
|
|
|
contentLikesAndCommentsMade.setEventBus(eventBus);
|
|
|
|
|
|
|
|
|
|
|
|
String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png";
|
|
|
|
String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png";
|
|
|
@ -476,76 +506,84 @@ public class StatisticsPanel extends Composite {
|
|
|
|
contentLikesAndCommentsMade.setLikes(
|
|
|
|
contentLikesAndCommentsMade.setLikes(
|
|
|
|
urlLikesIcon,
|
|
|
|
urlLikesIcon,
|
|
|
|
formattedNumbers(postsBean.getLikesMade()),
|
|
|
|
formattedNumbers(postsBean.getLikesMade()),
|
|
|
|
"Likes made during the last year",
|
|
|
|
TOOLTIP_LIKES_DONE,
|
|
|
|
"Likes made during the last year (" + postsBean.getLikesMade() + ")",
|
|
|
|
TOOLTIP_LIKES_DONE + " (" + postsBean.getLikesMade() + ")",
|
|
|
|
ShowUserStatisticAction.LIKES_MADE_BY_USER);
|
|
|
|
ShowUserStatisticAction.LIKES_MADE_BY_USER,
|
|
|
|
|
|
|
|
information.getCurrentPageLanding());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
contentLikesAndCommentsMade.setLikes(
|
|
|
|
contentLikesAndCommentsMade.setLikes(
|
|
|
|
urlLikesIcon,
|
|
|
|
urlLikesIcon,
|
|
|
|
formattedNumbers(postsBean.getLikesMade()),
|
|
|
|
formattedNumbers(postsBean.getLikesMade()),
|
|
|
|
"Likes made during the last year in this VRE",
|
|
|
|
TOOLTIP_LIKES_DONE_VRE,
|
|
|
|
"Likes made during the last year in this VRE (" + postsBean.getLikesMade() + ")",
|
|
|
|
TOOLTIP_LIKES_DONE_VRE + " (" + postsBean.getLikesMade() + ")",
|
|
|
|
ShowUserStatisticAction.LIKES_MADE_BY_USER);
|
|
|
|
ShowUserStatisticAction.LIKES_MADE_BY_USER,
|
|
|
|
|
|
|
|
information.getCurrentPageLanding());
|
|
|
|
|
|
|
|
|
|
|
|
String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png";
|
|
|
|
String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png";
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
contentLikesAndCommentsMade.setComments(
|
|
|
|
contentLikesAndCommentsMade.setComments(
|
|
|
|
urlCommentsIcon,
|
|
|
|
urlCommentsIcon,
|
|
|
|
formattedNumbers(postsBean.getCommentsMade()),
|
|
|
|
formattedNumbers(postsBean.getCommentsMade()),
|
|
|
|
"Post replies made during the last year",
|
|
|
|
TOOLTIP_REPLIES_DONE,
|
|
|
|
"Post replies made during the last year (" + postsBean.getCommentsMade() + ")",
|
|
|
|
TOOLTIP_REPLIES_DONE + " (" + postsBean.getCommentsMade() + ")",
|
|
|
|
ShowUserStatisticAction.COMMENTS_MADE_BY_USER);
|
|
|
|
ShowUserStatisticAction.COMMENTS_MADE_BY_USER,
|
|
|
|
|
|
|
|
information.getCurrentPageLanding());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
contentLikesAndCommentsMade.setComments(
|
|
|
|
contentLikesAndCommentsMade.setComments(
|
|
|
|
urlCommentsIcon,
|
|
|
|
urlCommentsIcon,
|
|
|
|
formattedNumbers(postsBean.getCommentsMade()),
|
|
|
|
formattedNumbers(postsBean.getCommentsMade()),
|
|
|
|
"Post replies made during the last year in this VRE",
|
|
|
|
TOOLTIP_REPLIES_DONE_VRE,
|
|
|
|
"Post replies made during the last year in this VRE (" + postsBean.getCommentsMade() + ")",
|
|
|
|
TOOLTIP_REPLIES_DONE_VRE +" (" + postsBean.getCommentsMade() + ")",
|
|
|
|
ShowUserStatisticAction.COMMENTS_MADE_BY_USER);
|
|
|
|
ShowUserStatisticAction.COMMENTS_MADE_BY_USER,
|
|
|
|
|
|
|
|
information.getCurrentPageLanding());
|
|
|
|
|
|
|
|
|
|
|
|
likesAndCommentsMade.appendToPanel(contentLikesAndCommentsMade);
|
|
|
|
likesAndCommentsMade.appendToPanel(contentLikesAndCommentsMade);
|
|
|
|
|
|
|
|
|
|
|
|
// updates comments and likes got
|
|
|
|
// updates comments and likes got
|
|
|
|
likesAndCommentsGot.clearPanelValues();
|
|
|
|
likesAndCommentsGot.clearPanelValues();
|
|
|
|
content = new CommentsAndLikesWidget();
|
|
|
|
contentLikesAndCommentsGot = new CommentsAndLikesWidget();
|
|
|
|
|
|
|
|
|
|
|
|
if(!isProfilePage)
|
|
|
|
if(!isProfilePage || information.isOwner())
|
|
|
|
content.setEventBus(eventBus);
|
|
|
|
contentLikesAndCommentsGot.setEventBus(eventBus);
|
|
|
|
|
|
|
|
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
content.setLikes(
|
|
|
|
contentLikesAndCommentsGot.setLikes(
|
|
|
|
urlLikesIcon,
|
|
|
|
urlLikesIcon,
|
|
|
|
formattedNumbers(postsBean.getLikesReceived()),
|
|
|
|
formattedNumbers(postsBean.getLikesReceived()),
|
|
|
|
"Likes got during the last year",
|
|
|
|
TOOLTIP_LIKES_GOT,
|
|
|
|
"Likes got during the last year (" + postsBean.getLikesReceived() + ")",
|
|
|
|
TOOLTIP_LIKES_GOT+ " (" + postsBean.getLikesReceived() + ")",
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
|
|
|
|
|
|
|
information.getCurrentPageLanding());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
content.setLikes(
|
|
|
|
contentLikesAndCommentsGot.setLikes(
|
|
|
|
urlLikesIcon,
|
|
|
|
urlLikesIcon,
|
|
|
|
formattedNumbers(postsBean.getLikesReceived()),
|
|
|
|
formattedNumbers(postsBean.getLikesReceived()),
|
|
|
|
"Likes got during the last year in this VRE",
|
|
|
|
TOOLTIP_LIKES_GOT_VRE,
|
|
|
|
"Likes got during the last year in this VRE (" + postsBean.getLikesReceived() + ")",
|
|
|
|
TOOLTIP_LIKES_GOT_VRE + " (" + postsBean.getLikesReceived() + ")",
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
|
|
|
|
|
|
|
information.getCurrentPageLanding());
|
|
|
|
|
|
|
|
|
|
|
|
numberOfLikesGot = postsBean.getLikesReceived();
|
|
|
|
numberOfLikesGot = postsBean.getLikesReceived();
|
|
|
|
|
|
|
|
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
if(isRoot || isProfilePage)
|
|
|
|
content.setComments(
|
|
|
|
contentLikesAndCommentsGot.setComments(
|
|
|
|
urlCommentsIcon,
|
|
|
|
urlCommentsIcon,
|
|
|
|
formattedNumbers(postsBean.getCommentsReceived()),
|
|
|
|
formattedNumbers(postsBean.getCommentsReceived()),
|
|
|
|
"Post replies got during the last year",
|
|
|
|
TOOLTIP_REPLIES_GOT,
|
|
|
|
"Post replies got during the last year (" + postsBean.getCommentsReceived() + ")",
|
|
|
|
TOOLTIP_REPLIES_GOT + " (" + postsBean.getCommentsReceived() + ")",
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
|
|
|
|
|
|
|
information.getCurrentPageLanding());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
content.setComments(
|
|
|
|
contentLikesAndCommentsGot.setComments(
|
|
|
|
urlCommentsIcon,
|
|
|
|
urlCommentsIcon,
|
|
|
|
formattedNumbers(postsBean.getCommentsReceived()),
|
|
|
|
formattedNumbers(postsBean.getCommentsReceived()),
|
|
|
|
"Post replies got during the last year in this VRE.",
|
|
|
|
TOOLTIP_REPLIES_GOT_VRE,
|
|
|
|
"Post replies got during the last year in this VRE (" + postsBean.getCommentsReceived() + ")",
|
|
|
|
TOOLTIP_REPLIES_GOT_VRE + " (" + postsBean.getCommentsReceived() + ")",
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
|
|
|
|
|
|
|
information.getCurrentPageLanding());
|
|
|
|
|
|
|
|
|
|
|
|
numberOfCommentsGot = postsBean.getCommentsReceived();
|
|
|
|
numberOfCommentsGot = postsBean.getCommentsReceived();
|
|
|
|
likesAndCommentsGot.appendToPanel(content);
|
|
|
|
likesAndCommentsGot.appendToPanel(contentLikesAndCommentsGot);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -605,6 +643,12 @@ public class StatisticsPanel extends Composite {
|
|
|
|
|
|
|
|
|
|
|
|
// get current url
|
|
|
|
// get current url
|
|
|
|
String currentUrl = Window.Location.getHref();
|
|
|
|
String currentUrl = Window.Location.getHref();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if it is a profile page, we have to move the user to the sitelandingpage
|
|
|
|
|
|
|
|
if(isProfilePage()){
|
|
|
|
|
|
|
|
currentUrl = event.getLandingPage();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String[] splittedUrl = currentUrl.split("\\?");
|
|
|
|
String[] splittedUrl = currentUrl.split("\\?");
|
|
|
|
|
|
|
|
|
|
|
|
Window.Location.assign(splittedUrl[0] + "?" + Encoder.encode(GCubeSocialNetworking.SHOW_STATISTICS_ACTION_OID) + "=" + Encoder.encode(actionToTake.toString()));
|
|
|
|
Window.Location.assign(splittedUrl[0] + "?" + Encoder.encode(GCubeSocialNetworking.SHOW_STATISTICS_ACTION_OID) + "=" + Encoder.encode(actionToTake.toString()));
|
|
|
@ -632,9 +676,9 @@ public class StatisticsPanel extends Composite {
|
|
|
|
numberOfWrittenFeeds ++;
|
|
|
|
numberOfWrittenFeeds ++;
|
|
|
|
numberOfFeedsLabel.setText(formattedNumbers(numberOfWrittenFeeds));
|
|
|
|
numberOfFeedsLabel.setText(formattedNumbers(numberOfWrittenFeeds));
|
|
|
|
if(isRoot)
|
|
|
|
if(isRoot)
|
|
|
|
numberOfFeedsLabel.setTitle("Your posts during the last year (" + numberOfWrittenFeeds + ")");
|
|
|
|
numberOfFeedsLabel.setTitle(TOOLTIP_POSTS_ROOT_PROFILE + " (" + numberOfWrittenFeeds + ")");
|
|
|
|
else
|
|
|
|
else
|
|
|
|
numberOfFeedsLabel.setTitle("Your posts during the last year in this VRE (" + numberOfWrittenFeeds + ")");
|
|
|
|
numberOfFeedsLabel.setTitle(TOOLTIP_POSTS_VRE + " (" + numberOfWrittenFeeds + ")");
|
|
|
|
GWT.log("Number of written posts changed to " + numberOfWrittenFeeds);
|
|
|
|
GWT.log("Number of written posts changed to " + numberOfWrittenFeeds);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -661,9 +705,9 @@ public class StatisticsPanel extends Composite {
|
|
|
|
numberOfWrittenFeeds = numberOfWrittenFeeds < 0 ? 0: numberOfWrittenFeeds;
|
|
|
|
numberOfWrittenFeeds = numberOfWrittenFeeds < 0 ? 0: numberOfWrittenFeeds;
|
|
|
|
numberOfFeedsLabel.setText(formattedNumbers(numberOfWrittenFeeds));
|
|
|
|
numberOfFeedsLabel.setText(formattedNumbers(numberOfWrittenFeeds));
|
|
|
|
if(isRoot)
|
|
|
|
if(isRoot)
|
|
|
|
numberOfFeedsLabel.setTitle("Your posts during the last year (" + numberOfWrittenFeeds + ")");
|
|
|
|
numberOfFeedsLabel.setTitle(TOOLTIP_POSTS_ROOT_PROFILE + " (" + numberOfWrittenFeeds + ")");
|
|
|
|
else
|
|
|
|
else
|
|
|
|
numberOfFeedsLabel.setTitle("Your posts during the last year in this VRE (" + numberOfWrittenFeeds + ")");
|
|
|
|
numberOfFeedsLabel.setTitle(TOOLTIP_POSTS_VRE + " (" + numberOfWrittenFeeds + ")");
|
|
|
|
GWT.log("Number of written posts changed to " + numberOfWrittenFeeds);
|
|
|
|
GWT.log("Number of written posts changed to " + numberOfWrittenFeeds);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}});
|
|
|
|
}});
|
|
|
@ -689,19 +733,21 @@ public class StatisticsPanel extends Composite {
|
|
|
|
String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png";
|
|
|
|
String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png";
|
|
|
|
|
|
|
|
|
|
|
|
if(isRoot)
|
|
|
|
if(isRoot)
|
|
|
|
content.setLikes(
|
|
|
|
contentLikesAndCommentsGot.setLikes(
|
|
|
|
urlLikesIcon,
|
|
|
|
urlLikesIcon,
|
|
|
|
formattedNumbers(numberOfLikesGot),
|
|
|
|
formattedNumbers(numberOfLikesGot),
|
|
|
|
"Likes you got during the last year.",
|
|
|
|
TOOLTIP_LIKES_GOT,
|
|
|
|
"Likes you got during the last year (" + numberOfLikesGot + ")",
|
|
|
|
TOOLTIP_LIKES_GOT + " (" + numberOfLikesGot + ")",
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
|
|
|
|
|
|
|
informationBeanRetrieved.getCurrentPageLanding());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
content.setLikes(
|
|
|
|
contentLikesAndCommentsGot.setLikes(
|
|
|
|
urlLikesIcon,
|
|
|
|
urlLikesIcon,
|
|
|
|
formattedNumbers(numberOfLikesGot),
|
|
|
|
formattedNumbers(numberOfLikesGot),
|
|
|
|
"Likes you got during the last year in this VRE",
|
|
|
|
TOOLTIP_LIKES_GOT_VRE,
|
|
|
|
"Likes you got during the last year in this VRE (" + numberOfLikesGot + ")",
|
|
|
|
TOOLTIP_LIKES_GOT_VRE + " (" + numberOfLikesGot + ")",
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
|
|
|
|
|
|
|
informationBeanRetrieved.getCurrentPageLanding());
|
|
|
|
|
|
|
|
|
|
|
|
GWT.log("Number of likes got changed to " + numberOfLikesGot);
|
|
|
|
GWT.log("Number of likes got changed to " + numberOfLikesGot);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -731,19 +777,21 @@ public class StatisticsPanel extends Composite {
|
|
|
|
String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png";
|
|
|
|
String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png";
|
|
|
|
|
|
|
|
|
|
|
|
if(isRoot)
|
|
|
|
if(isRoot)
|
|
|
|
content.setLikes(
|
|
|
|
contentLikesAndCommentsGot.setLikes(
|
|
|
|
urlLikesIcon,
|
|
|
|
urlLikesIcon,
|
|
|
|
formattedNumbers(numberOfLikesGot),
|
|
|
|
formattedNumbers(numberOfLikesGot),
|
|
|
|
"Likes you got during the last year.",
|
|
|
|
TOOLTIP_LIKES_GOT,
|
|
|
|
"Likes you got during the last year (" + numberOfLikesGot + ")",
|
|
|
|
TOOLTIP_LIKES_GOT + " (" + numberOfLikesGot + ")",
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
|
|
|
|
|
|
|
informationBeanRetrieved.getCurrentPageLanding());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
content.setLikes(
|
|
|
|
contentLikesAndCommentsGot.setLikes(
|
|
|
|
urlLikesIcon,
|
|
|
|
urlLikesIcon,
|
|
|
|
formattedNumbers(numberOfLikesGot),
|
|
|
|
formattedNumbers(numberOfLikesGot),
|
|
|
|
"Likes you got during the last year in this VRE",
|
|
|
|
TOOLTIP_LIKES_GOT_VRE,
|
|
|
|
"Likes you got during the last year in this VRE (" + numberOfLikesGot + ")",
|
|
|
|
TOOLTIP_LIKES_GOT_VRE + " (" + numberOfLikesGot + ")",
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
|
|
|
|
|
|
|
informationBeanRetrieved.getCurrentPageLanding());
|
|
|
|
|
|
|
|
|
|
|
|
GWT.log("Number of likes got changed to " + numberOfLikesGot);
|
|
|
|
GWT.log("Number of likes got changed to " + numberOfLikesGot);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -772,19 +820,21 @@ public class StatisticsPanel extends Composite {
|
|
|
|
String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png";
|
|
|
|
String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png";
|
|
|
|
|
|
|
|
|
|
|
|
if(isRoot)
|
|
|
|
if(isRoot)
|
|
|
|
content.setComments(
|
|
|
|
contentLikesAndCommentsGot.setComments(
|
|
|
|
urlCommentsIcon,
|
|
|
|
urlCommentsIcon,
|
|
|
|
formattedNumbers(numberOfCommentsGot),
|
|
|
|
formattedNumbers(numberOfCommentsGot),
|
|
|
|
"Post replies you got during the last year.",
|
|
|
|
TOOLTIP_REPLIES_GOT,
|
|
|
|
"Post replies you got during the last year (" + numberOfCommentsGot + ")",
|
|
|
|
TOOLTIP_REPLIES_GOT + " (" + numberOfCommentsGot + ")",
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
|
|
|
|
|
|
|
informationBeanRetrieved.getCurrentPageLanding());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
content.setComments(
|
|
|
|
contentLikesAndCommentsGot.setComments(
|
|
|
|
urlCommentsIcon,
|
|
|
|
urlCommentsIcon,
|
|
|
|
formattedNumbers(numberOfCommentsGot),
|
|
|
|
formattedNumbers(numberOfCommentsGot),
|
|
|
|
"Post replies you got during the last year in this VRE.",
|
|
|
|
TOOLTIP_REPLIES_GOT_VRE,
|
|
|
|
"Post replies you got during the last year in this VRE (" + numberOfCommentsGot + ")",
|
|
|
|
TOOLTIP_REPLIES_GOT_VRE + " (" + numberOfCommentsGot + ")",
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
|
|
|
|
|
|
|
informationBeanRetrieved.getCurrentPageLanding());
|
|
|
|
|
|
|
|
|
|
|
|
GWT.log("Number of comments got changed to " + numberOfCommentsGot);
|
|
|
|
GWT.log("Number of comments got changed to " + numberOfCommentsGot);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -813,19 +863,21 @@ public class StatisticsPanel extends Composite {
|
|
|
|
numberOfCommentsGot = numberOfCommentsGot < 0 ? 0: numberOfCommentsGot;
|
|
|
|
numberOfCommentsGot = numberOfCommentsGot < 0 ? 0: numberOfCommentsGot;
|
|
|
|
String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png";
|
|
|
|
String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png";
|
|
|
|
if(isRoot)
|
|
|
|
if(isRoot)
|
|
|
|
content.setComments(
|
|
|
|
contentLikesAndCommentsGot.setComments(
|
|
|
|
urlCommentsIcon,
|
|
|
|
urlCommentsIcon,
|
|
|
|
formattedNumbers(numberOfCommentsGot),
|
|
|
|
formattedNumbers(numberOfCommentsGot),
|
|
|
|
"Post replies you got during the last year.",
|
|
|
|
TOOLTIP_REPLIES_GOT,
|
|
|
|
"Post replies you got during the last year (" + numberOfCommentsGot + ")",
|
|
|
|
TOOLTIP_REPLIES_GOT + " (" + numberOfCommentsGot + ")",
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
|
|
|
|
|
|
|
informationBeanRetrieved.getCurrentPageLanding());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
content.setComments(
|
|
|
|
contentLikesAndCommentsGot.setComments(
|
|
|
|
urlCommentsIcon,
|
|
|
|
urlCommentsIcon,
|
|
|
|
formattedNumbers(numberOfCommentsGot),
|
|
|
|
formattedNumbers(numberOfCommentsGot),
|
|
|
|
"Post replies you got during the last year in this VRE.",
|
|
|
|
TOOLTIP_REPLIES_GOT_VRE,
|
|
|
|
"Post replies you got during the last year in this VRE (" + numberOfCommentsGot + ")",
|
|
|
|
TOOLTIP_REPLIES_GOT_VRE + " (" + numberOfCommentsGot + ")",
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER);
|
|
|
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
|
|
|
|
|
|
|
informationBeanRetrieved.getCurrentPageLanding());
|
|
|
|
|
|
|
|
|
|
|
|
GWT.log("Number of comments got changed to " + numberOfCommentsGot);
|
|
|
|
GWT.log("Number of comments got changed to " + numberOfCommentsGot);
|
|
|
|
}
|
|
|
|
}
|
|
|
|