Class RestUtils
java.lang.Object
org.exoplatform.social.service.rest.RestUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final intstatic final intstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildEntityFromActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, String restPath, String expand) Get a hash map from an activity in order to build a json object for the rest servicebuildEntityFromIdentity(org.exoplatform.social.core.identity.model.Identity identity, String restPath, String expand) Get a hash map from an identity in order to build a json object for the rest servicebuildEntityFromRelationship(org.exoplatform.social.core.relationship.model.Relationship relationship, String restPath, String expand, boolean isSymetric) Get a hash map from a relationship in order to build a json object for the rest servicebuildEntityFromSpace(org.exoplatform.social.core.space.model.Space space, String userId, String restPath, String expand) Get a hash map from a space in order to build a json object for the rest servicebuildEntityFromSpaceMembership(org.exoplatform.social.core.space.model.Space space, String userId, String type, String restPath, String expand) Get a hash map from a space in order to build a json object for the rest servicegetActivityStream(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, org.exoplatform.social.core.identity.model.Identity authentiatedUsed) Get the activityStream's information related to the activity.static org.exoplatform.social.core.identity.model.IdentityReturns the social identity of the authenticated userstatic StringReturns the username of the authenticated userstatic javax.ws.rs.core.MediaTypeGets the json media typestatic booleanCheck if the authenticated user is a member of the admin group
-
Field Details
-
DEFAULT_LIMIT
public static final int DEFAULT_LIMIT- See Also:
-
DEFAULT_OFFSET
public static final int DEFAULT_OFFSET- See Also:
-
HARD_LIMIT
public static final int HARD_LIMIT- See Also:
-
USERS_TYPE
- See Also:
-
USERS_RELATIONSHIP_TYPE
- See Also:
-
USER_ACTIVITY_TYPE
- See Also:
-
IDENTITIES_TYPE
- See Also:
-
SPACES_TYPE
- See Also:
-
SPACES_MEMBERSHIP_TYPE
- See Also:
-
SPACE_ACTIVITY_TYPE
- See Also:
-
ACTIVITIES_TYPE
- See Also:
-
LIKES_TYPE
- See Also:
-
KEY
- See Also:
-
VALUE
- See Also:
-
SUPPORT_TYPE
- See Also:
-
ADMIN_GROUP
- See Also:
-
-
Constructor Details
-
RestUtils
public RestUtils()
-
-
Method Details
-
buildEntityFromIdentity
public static Map<String,Object> buildEntityFromIdentity(org.exoplatform.social.core.identity.model.Identity identity, String restPath, String expand) Get a hash map from an identity in order to build a json object for the rest service- Parameters:
identity- the provided identity- Returns:
- a hash map
-
buildEntityFromSpace
public static Map<String,Object> buildEntityFromSpace(org.exoplatform.social.core.space.model.Space space, String userId, String restPath, String expand) Get a hash map from a space in order to build a json object for the rest service- Parameters:
space- the provided spaceuserId- the user's remote id- Returns:
- a hash map
-
buildEntityFromSpaceMembership
public static Map<String,Object> buildEntityFromSpaceMembership(org.exoplatform.social.core.space.model.Space space, String userId, String type, String restPath, String expand) Get a hash map from a space in order to build a json object for the rest service- Parameters:
space- the provided spaceuserId- the user's remote idtype- membership type- Returns:
- a hash map
-
buildEntityFromActivity
public static Map<String,Object> buildEntityFromActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, String restPath, String expand) Get a hash map from an activity in order to build a json object for the rest service- Parameters:
activity- the provided activityexpand-- Returns:
- a hash map
-
buildEntityFromRelationship
public static Map<String,Object> buildEntityFromRelationship(org.exoplatform.social.core.relationship.model.Relationship relationship, String restPath, String expand, boolean isSymetric) Get a hash map from a relationship in order to build a json object for the rest service- Parameters:
relationship- the provided relationship- Returns:
- a hash map
-
getActivityStream
public static Map<String,String> getActivityStream(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, org.exoplatform.social.core.identity.model.Identity authentiatedUsed) Get the activityStream's information related to the activity.- Parameters:
authentiatedUsed- the vieweractivity-- Returns:
- activityStream object, null if the viewer has no permission to view activity
-
getJsonMediaType
public static javax.ws.rs.core.MediaType getJsonMediaType()Gets the json media type- Returns:
- a media type
-
isMemberOfAdminGroup
public static boolean isMemberOfAdminGroup()Check if the authenticated user is a member of the admin group- Returns:
-
getCurrentUsername
Returns the username of the authenticated user- Returns:
- the username of the authenticated user
-
getCurrentIdentity
public static org.exoplatform.social.core.identity.model.Identity getCurrentIdentity()Returns the social identity of the authenticated user- Returns:
- The social identity of the authenticated user
-