Class SocialMailingUtil


  • public class SocialMailingUtil
    extends Object
    Author:
    Massimiliano Assante, ISTI-CNR, Costantino Perciante, ISTI-CNR
    • Constructor Detail

      • SocialMailingUtil

        public SocialMailingUtil()
    • 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