From fb861ffc9249978568f9ebccb5565cb4b506b207 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Wed, 25 Sep 2019 09:19:32 +0000 Subject: [PATCH] Replaced the HTML code and citation with @username in the POST_ON_REVERT git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/grsf-manage-widget@181850 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/manage/SocialCommunications.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/SocialCommunications.java b/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/SocialCommunications.java index 235627f..f375ff6 100644 --- a/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/SocialCommunications.java +++ b/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/SocialCommunications.java @@ -97,7 +97,7 @@ public class SocialCommunications { // post on revert private static final String POST_ON_REVERT = "Dear members," - + "
a merge operation has been reverted on this record RECORD_URL by ADMIN_WHO_CHANGED. The merge was originally proposed by ORIGINAL_USER."; + + "\na merge operation has been reverted on this record RECORD_URL by ADMIN_WHO_CHANGED. The merge was originally proposed by ORIGINAL_USER."; private static final String SOCIAL_NETWORKING_BASE_URL_SESSION_KEY = "SOCIAL_NETWORKING_SESSION_KEY"; @@ -237,23 +237,27 @@ public class SocialCommunications { // require url String applicationToken = requireApplicationToken(serviceUrl); - final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + extractOrgFriendlyURL(userCurrentUrl) + GCubePortalConstants.USER_PROFILE_FRIENDLY_URL; - + //see Feature #17576 updated by Francesco + /*final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + extractOrgFriendlyURL(userCurrentUrl) + GCubePortalConstants.USER_PROFILE_FRIENDLY_URL; String userFullNameHighlightedCurrent = ""+rInfo.getFullNameCurrentAdmin()+ " "; + */ + + String userFullNameHighlightedCurrent = "@"+rInfo.getUserNameCurrentAdmin(); - String userFullNameHighlightedOriginal = ""+rInfo.getFullNameOriginalAdmin()+ - " "; - + " ";*/ + + String userFullNameHighlightedOriginal = "@"+rInfo.getUserNameOriginalAdmin(); // replace String message = POST_ON_REVERT.replace("RECORD_URL", rInfo.getRecordUrl()).replace("ADMIN_WHO_CHANGED", userFullNameHighlightedCurrent).replace("ORIGINAL_USER",userFullNameHighlightedOriginal); // add hashtag - message +="

"; + message +="\n\n"; message += " #" + HashTagsOnUpdate.REVERTED_MERGE.getString(); logger.info("The post that is going to be written is -> " + message); @@ -332,7 +336,7 @@ public class SocialCommunications { Set hashtags = bean.getHashtags(); logger.debug("Hashtags are " + hashtags); if(hashtags != null && !hashtags.isEmpty()){ - message +="

"; + message +="\n\n"; for (String hashtag : hashtags) { message += " #" + hashtag; }