Class SocialUtils
- java.lang.Object
-
- org.gcube.portal.social.networking.ws.utils.SocialUtils
-
public class SocialUtils extends Object
Utility class.
-
-
Field Summary
Fields Modifier and Type Field Description static intCACHING_TIME_TO_EXPIRATIONstatic StringDISABLED_USERS_NOTIFICATIONS_NAMESPACEstatic StringNEWS_FEED_PORTLET_CLASSNAMEstatic StringNO_TEXT_FILE_SHARE
-
Constructor Summary
Constructors Constructor Description SocialUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.gcube.portal.databook.shared.CommentcommentPost(String userid, Date time, String postId, String commentText, String postOwnerId, String context)Allows to comment post in a certain vre.static org.gcube.portal.databook.shared.ApplicationProfilegetProfileFromInfrastrucure(String idApp, String scopeApp)This method looks up the applicationProfile profile among the ones available in the infrastructurestatic org.gcube.portal.databook.shared.PostshareApplicationUpdate(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.static org.gcube.portal.databook.shared.PostshareUserUpdate(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.
-
-
-
Field Detail
-
NO_TEXT_FILE_SHARE
public static final String NO_TEXT_FILE_SHARE
- See Also:
- Constant Field Values
-
CACHING_TIME_TO_EXPIRATION
public static final int CACHING_TIME_TO_EXPIRATION
- See Also:
- Constant Field Values
-
DISABLED_USERS_NOTIFICATIONS_NAMESPACE
public static final String DISABLED_USERS_NOTIFICATIONS_NAMESPACE
- See Also:
- Constant Field Values
-
NEWS_FEED_PORTLET_CLASSNAME
public static final String NEWS_FEED_PORTLET_CLASSNAME
- See Also:
- Constant Field Values
-
-
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 usernametime- the date and time of the commentpostId- the key of the post that was commentedcommentText- the text as it is, it will be parsedpostOwnerId- the username of the user who created the post that was commentedcontext- the VRE context- Returns:
- the Comment instance if ok, null if somwthign went KO
- Throws:
org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
-