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
This commit is contained in:
Francesco Mangiacrapa 2019-09-25 09:19:32 +00:00
parent b11949fba3
commit fb861ffc92
1 changed files with 12 additions and 8 deletions

View File

@ -97,7 +97,7 @@ public class SocialCommunications {
// post on revert
private static final String POST_ON_REVERT = "Dear members,"
+ "<br>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 = "<a class=\"link\" href=\"" + profilePageURL + "?"+
Base64.getEncoder().encodeToString(USER_PROFILE_OID.getBytes())+"="+
Base64.getEncoder().encodeToString(rInfo.getUserNameCurrentAdmin().getBytes())+"\">"+rInfo.getFullNameCurrentAdmin()+
"</a> ";
*/
String userFullNameHighlightedCurrent = "@"+rInfo.getUserNameCurrentAdmin();
String userFullNameHighlightedOriginal = "<a class=\"link\" href=\"" + profilePageURL + "?"+
/*String userFullNameHighlightedOriginal = "<a class=\"link\" href=\"" + profilePageURL + "?"+
Base64.getEncoder().encodeToString(USER_PROFILE_OID.getBytes())+"="+
Base64.getEncoder().encodeToString(rInfo.getUserNameOriginalAdmin().getBytes())+"\">"+rInfo.getFullNameOriginalAdmin()+
"</a> ";
"</a> ";*/
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 +="<br><br>";
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<String> hashtags = bean.getHashtags();
logger.debug("Hashtags are " + hashtags);
if(hashtags != null && !hashtags.isEmpty()){
message +="<br><br>";
message +="\n\n";
for (String hashtag : hashtags) {
message += " #" + hashtag;
}