Class SocialMailingUtil
- java.lang.Object
-
- org.gcube.applicationsupportlayer.social.mailing.SocialMailingUtil
-
public class SocialMailingUtil extends Object
- Author:
- Massimiliano Assante, ISTI-CNR, Costantino Perciante, ISTI-CNR
-
-
Field Summary
Fields Modifier and Type Field Description static StringWRITE_ABOVE_MESSAGE_REPLYstatic StringWRITE_ABOVE_TO_REPLY
-
Constructor Summary
Constructors Constructor Description SocialMailingUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static StringbuildHtmlDiscussion(String portalURL, String pathToVRE, org.gcube.portal.databook.shared.Notification notification2Save, org.gcube.portal.databook.shared.Feed post, List<org.gcube.portal.databook.shared.Comment> comments, String commentKey)Build up a discussion given the feed and its comments.protected static StringbuildPlainTextDiscussion(org.gcube.portal.databook.shared.Notification notification2Save, org.gcube.portal.databook.shared.Feed feed, List<org.gcube.portal.databook.shared.Comment> comments, String commentKey)Build a plain text discussion given a feed and its comments.protected static StringconvertHTML2Text(String html)Convert html into simple textprotected static StringgetHTMLEmail(String vreName, org.gcube.portal.databook.shared.Notification notification2Save, String userFirstName, String portalURL, String siteLandingPagePath, String email, org.gcube.portal.databook.shared.Feed feed, List<org.gcube.portal.databook.shared.Comment> comments, String commentKey, String... hashtags)protected static StringgetSubjectByNotificationType(org.gcube.portal.databook.shared.Notification notification2Save, String vreName, String userFirstName, Set<String> mentionedVReGroups, String... optionalParams)construct the subjec of the emailprotected static StringgetTextEmail(org.gcube.portal.databook.shared.Notification notification2Save, String userFirstName, String portalURL, String siteLandingPagePath, String email, org.gcube.portal.databook.shared.Feed feed, List<org.gcube.portal.databook.shared.Comment> comments, String commentKey, String[] hashtags)
-
-
-
Field Detail
-
WRITE_ABOVE_MESSAGE_REPLY
public static final String WRITE_ABOVE_MESSAGE_REPLY
- See Also:
- Constant Field Values
-
WRITE_ABOVE_TO_REPLY
public static final String WRITE_ABOVE_TO_REPLY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getHTMLEmail
protected static String getHTMLEmail(String vreName, org.gcube.portal.databook.shared.Notification notification2Save, String userFirstName, String portalURL, String siteLandingPagePath, String email, org.gcube.portal.databook.shared.Feed feed, List<org.gcube.portal.databook.shared.Comment> comments, String commentKey, String... hashtags)
- Parameters:
notification2Save-userFirstName-portalURL-siteLandingPagePath-email-vreName-feed-comments-commentKey-hashtags-- Returns:
-
getTextEmail
protected static String getTextEmail(org.gcube.portal.databook.shared.Notification notification2Save, String userFirstName, String portalURL, String siteLandingPagePath, String email, org.gcube.portal.databook.shared.Feed feed, List<org.gcube.portal.databook.shared.Comment> comments, String commentKey, String[] hashtags)
- Parameters:
notification2Save-userFirstName-portalURL-siteLandingPagePath-email-feed-comments-commentKey-hashtags-- Returns:
-
getSubjectByNotificationType
protected static String getSubjectByNotificationType(org.gcube.portal.databook.shared.Notification notification2Save, String vreName, String userFirstName, Set<String> mentionedVReGroups, String... optionalParams)
construct the subjec of the email- Parameters:
notification2Save-portalURL-vreName-- Returns:
-
convertHTML2Text
protected static String convertHTML2Text(String html)
Convert html into simple text
-
buildHtmlDiscussion
protected static String buildHtmlDiscussion(String portalURL, String pathToVRE, org.gcube.portal.databook.shared.Notification notification2Save, org.gcube.portal.databook.shared.Feed post, List<org.gcube.portal.databook.shared.Comment> comments, String commentKey)
Build up a discussion given the feed and its comments.- Parameters:
notification2Save-post-comments-commentKey- if not null, when building the discussion stop at this comment.- Returns:
- an html string representing the discussion
-
buildPlainTextDiscussion
protected static String buildPlainTextDiscussion(org.gcube.portal.databook.shared.Notification notification2Save, org.gcube.portal.databook.shared.Feed feed, List<org.gcube.portal.databook.shared.Comment> comments, String commentKey)
Build a plain text discussion given a feed and its comments.- Parameters:
feed-comments-commentKey- if not null, when building the discussion stop at this comment.- Returns:
- a string representing the discussion
-
-