Class SocialUtils


  • public class SocialUtils
    extends Object
    Utility class.
    • Constructor Detail

      • SocialUtils

        public SocialUtils()
    • Method Detail

      • shareApplicationUpdate

        public static org.gcube.portal.databook.shared.Post shareApplicationUpdate​(String postText,
                                                                                   String uriParams,
                                                                                   String previewTitle,
                                                                                   String previewDescription,
                                                                                   String httpImageUrl,
                                                                                   org.gcube.portal.databook.shared.ApplicationProfile applicationProfile,
                                                                                   org.gcube.common.authorization.library.utils.Caller caller,
                                                                                   boolean notifyGroup)
        Method used when an application needs to publish something.
        Parameters:
        feedText -
        uriParams -
        previewTitle -
        previewDescription -
        httpImageUrl -
        Returns:
        true upon success, false on failure
      • getProfileFromInfrastrucure

        public static org.gcube.portal.databook.shared.ApplicationProfile getProfileFromInfrastrucure​(String idApp,
                                                                                                      String scopeApp)
        This method looks up the applicationProfile profile among the ones available in the infrastructure
        Parameters:
        idApp - as identifier of your application (as reported in the ApplicationProfile)
        scopeApp - the scope of the application
      • shareUserUpdate

        public static org.gcube.portal.databook.shared.Post shareUserUpdate​(String userId,
                                                                            String postText,
                                                                            String vreId,
                                                                            String previewTitle,
                                                                            String previewDescription,
                                                                            String previewHost,
                                                                            String previewUrl,
                                                                            String urlThumbnail,
                                                                            boolean notifyGroup)
        Allows user to post a feed in a certain vre.
        Parameters:
        userId -
        postText -
        vreId -
        previewTitle -
        previewDescription -
        previewHost -
        previewUrl -
        urlThumbnail -
        notifyGroup -
        Returns:
        The written Feed
      • commentPost

        public static org.gcube.portal.databook.shared.Comment commentPost​(String userid,
                                                                           Date time,
                                                                           String postId,
                                                                           String commentText,
                                                                           String postOwnerId,
                                                                           String context)
                                                                    throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
        Allows to comment post in a certain vre.
        Parameters:
        userid - the username
        time - the date and time of the comment
        postId - the key of the post that was commented
        commentText - the text as it is, it will be parsed
        postOwnerId - the username of the user who created the post that was commented
        context - the VRE context
        Returns:
        the Comment instance if ok, null if somwthign went KO
        Throws:
        org.gcube.portal.databook.shared.ex.FeedIDNotFoundException