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:
parent
b11949fba3
commit
fb861ffc92
|
@ -97,7 +97,7 @@ public class SocialCommunications {
|
||||||
|
|
||||||
// post on revert
|
// post on revert
|
||||||
private static final String POST_ON_REVERT = "Dear members,"
|
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";
|
private static final String SOCIAL_NETWORKING_BASE_URL_SESSION_KEY = "SOCIAL_NETWORKING_SESSION_KEY";
|
||||||
|
|
||||||
|
@ -237,23 +237,27 @@ public class SocialCommunications {
|
||||||
// require url
|
// require url
|
||||||
String applicationToken = requireApplicationToken(serviceUrl);
|
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 + "?"+
|
String userFullNameHighlightedCurrent = "<a class=\"link\" href=\"" + profilePageURL + "?"+
|
||||||
Base64.getEncoder().encodeToString(USER_PROFILE_OID.getBytes())+"="+
|
Base64.getEncoder().encodeToString(USER_PROFILE_OID.getBytes())+"="+
|
||||||
Base64.getEncoder().encodeToString(rInfo.getUserNameCurrentAdmin().getBytes())+"\">"+rInfo.getFullNameCurrentAdmin()+
|
Base64.getEncoder().encodeToString(rInfo.getUserNameCurrentAdmin().getBytes())+"\">"+rInfo.getFullNameCurrentAdmin()+
|
||||||
"</a> ";
|
"</a> ";
|
||||||
|
*/
|
||||||
|
|
||||||
String userFullNameHighlightedOriginal = "<a class=\"link\" href=\"" + profilePageURL + "?"+
|
String userFullNameHighlightedCurrent = "@"+rInfo.getUserNameCurrentAdmin();
|
||||||
|
|
||||||
|
/*String userFullNameHighlightedOriginal = "<a class=\"link\" href=\"" + profilePageURL + "?"+
|
||||||
Base64.getEncoder().encodeToString(USER_PROFILE_OID.getBytes())+"="+
|
Base64.getEncoder().encodeToString(USER_PROFILE_OID.getBytes())+"="+
|
||||||
Base64.getEncoder().encodeToString(rInfo.getUserNameOriginalAdmin().getBytes())+"\">"+rInfo.getFullNameOriginalAdmin()+
|
Base64.getEncoder().encodeToString(rInfo.getUserNameOriginalAdmin().getBytes())+"\">"+rInfo.getFullNameOriginalAdmin()+
|
||||||
"</a> ";
|
"</a> ";*/
|
||||||
|
|
||||||
|
String userFullNameHighlightedOriginal = "@"+rInfo.getUserNameOriginalAdmin();
|
||||||
// replace
|
// replace
|
||||||
String message = POST_ON_REVERT.replace("RECORD_URL", rInfo.getRecordUrl()).replace("ADMIN_WHO_CHANGED", userFullNameHighlightedCurrent).replace("ORIGINAL_USER",userFullNameHighlightedOriginal);
|
String message = POST_ON_REVERT.replace("RECORD_URL", rInfo.getRecordUrl()).replace("ADMIN_WHO_CHANGED", userFullNameHighlightedCurrent).replace("ORIGINAL_USER",userFullNameHighlightedOriginal);
|
||||||
|
|
||||||
// add hashtag
|
// add hashtag
|
||||||
message +="<br><br>";
|
message +="\n\n";
|
||||||
message += " #" + HashTagsOnUpdate.REVERTED_MERGE.getString();
|
message += " #" + HashTagsOnUpdate.REVERTED_MERGE.getString();
|
||||||
|
|
||||||
logger.info("The post that is going to be written is -> " + message);
|
logger.info("The post that is going to be written is -> " + message);
|
||||||
|
@ -332,7 +336,7 @@ public class SocialCommunications {
|
||||||
Set<String> hashtags = bean.getHashtags();
|
Set<String> hashtags = bean.getHashtags();
|
||||||
logger.debug("Hashtags are " + hashtags);
|
logger.debug("Hashtags are " + hashtags);
|
||||||
if(hashtags != null && !hashtags.isEmpty()){
|
if(hashtags != null && !hashtags.isEmpty()){
|
||||||
message +="<br><br>";
|
message +="\n\n";
|
||||||
for (String hashtag : hashtags) {
|
for (String hashtag : hashtags) {
|
||||||
message += " #" + hashtag;
|
message += " #" + hashtag;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue