public class EntityBuilder extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTIVITIES_TYPE |
static String |
COMMENTS_TYPE |
static String |
IDENTITIES_TYPE |
static String |
KEY |
static String |
LIKES_TYPE |
static String |
SPACE_ACTIVITY_TYPE |
static String |
SPACES_MEMBERSHIP_TYPE |
static String |
SPACES_TYPE |
static String |
USER_ACTIVITY_TYPE |
static String |
USERS_RELATIONSHIP_TYPE |
static String |
USERS_TYPE |
static String |
VALUE |
| Constructor and Description |
|---|
EntityBuilder() |
| Modifier and Type | Method and Description |
|---|---|
static org.exoplatform.social.rest.entity.ActivityEntity |
buildEntityFromActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity,
String restPath,
String expand)
Get a ActivityEntity from an activity in order to build a json object for the rest service
|
static org.exoplatform.social.rest.entity.CommentEntity |
buildEntityFromComment(org.exoplatform.social.core.activity.model.ExoSocialActivity comment,
String restPath,
String expand,
boolean isBuildList) |
static List<org.exoplatform.social.rest.entity.DataEntity> |
buildEntityFromComment(org.exoplatform.social.core.activity.model.ExoSocialActivity activity,
String restPath,
String expand,
int offset,
int limit) |
static List<org.exoplatform.social.rest.entity.DataEntity> |
buildEntityFromLike(org.exoplatform.social.core.activity.model.ExoSocialActivity activity,
String restPath,
String expand,
int offset,
int limit) |
static org.exoplatform.social.rest.entity.SpaceEntity |
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
|
static org.exoplatform.social.rest.entity.SpaceMembershipEntity |
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
|
static org.exoplatform.social.rest.entity.IdentityEntity |
buildEntityIdentity(org.exoplatform.social.core.identity.model.Identity identity,
String restPath,
String expand)
Get a IdentityEntity from an identity in order to build a json object for the rest service
|
static org.exoplatform.social.rest.entity.IdentityEntity |
buildEntityIdentity(String userName,
String restPath,
String expand) |
static org.exoplatform.social.rest.entity.ProfileEntity |
buildEntityProfile(org.exoplatform.social.core.identity.model.Profile profile,
String restPath,
String expand) |
static org.exoplatform.social.rest.entity.ProfileEntity |
buildEntityProfile(String userName,
String restPath,
String expand) |
static List<org.exoplatform.social.rest.entity.DataEntity> |
buildEntityProfiles(String[] userNames,
String restPath,
String expand) |
static org.exoplatform.social.rest.entity.RelationshipEntity |
buildEntityRelationship(org.exoplatform.social.core.relationship.model.Relationship relationship,
String restPath,
String expand,
boolean isSymetric)
Get a RelationshipEntity from a relationship in order to build a json object for the rest service
|
static Object |
buildLinkForHeader(Object entity,
String requestPath)
{@code
"https://localhost:8080/rest/users?
|
static List<org.exoplatform.social.rest.entity.DataEntity> |
buildRelationshipEntities(List<org.exoplatform.social.core.relationship.model.Relationship> relationships,
javax.ws.rs.core.UriInfo uriInfo) |
static org.exoplatform.social.rest.entity.DataEntity |
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.
|
static String |
getCommentsActivityRestUrl(String activityId,
String restPath)
Get the rest url in order to load all comments of an activity
|
static String |
getMembersSpaceRestUrl(String id,
boolean returnManager,
String restPath)
Get the rest url to load all members or managers of a space
|
static javax.ws.rs.core.Response |
getResponse(Object entity,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.Response.Status status)
Gets the response object constructed from the provided params.
|
public static final String USERS_TYPE
public static final String USERS_RELATIONSHIP_TYPE
public static final String USER_ACTIVITY_TYPE
public static final String IDENTITIES_TYPE
public static final String SPACES_TYPE
public static final String SPACES_MEMBERSHIP_TYPE
public static final String SPACE_ACTIVITY_TYPE
public static final String ACTIVITIES_TYPE
public static final String COMMENTS_TYPE
public static final String LIKES_TYPE
public static final String KEY
public static final String VALUE
public static org.exoplatform.social.rest.entity.IdentityEntity buildEntityIdentity(org.exoplatform.social.core.identity.model.Identity identity,
String restPath,
String expand)
identity - the provided identityrestPath - rest Pathexpand - expandpublic static org.exoplatform.social.rest.entity.IdentityEntity buildEntityIdentity(String userName, String restPath, String expand)
userName - userNamerestPath - rest Pathexpand - expandpublic static org.exoplatform.social.rest.entity.ProfileEntity buildEntityProfile(org.exoplatform.social.core.identity.model.Profile profile,
String restPath,
String expand)
public static org.exoplatform.social.rest.entity.ProfileEntity buildEntityProfile(String userName, String restPath, String expand)
userName - user NamerestPath - rest Pathexpand - expandpublic static List<org.exoplatform.social.rest.entity.DataEntity> buildEntityProfiles(String[] userNames, String restPath, String expand)
userNames - user namesrestPath - rest Pathexpand - expandpublic static org.exoplatform.social.rest.entity.SpaceEntity buildEntityFromSpace(org.exoplatform.social.core.space.model.Space space,
String userId,
String restPath,
String expand)
space - the provided spaceuserId - the user's remote idrestPath - rest Pathexpand - expandpublic static org.exoplatform.social.rest.entity.SpaceMembershipEntity buildEntityFromSpaceMembership(org.exoplatform.social.core.space.model.Space space,
String userId,
String type,
String restPath,
String expand)
space - the provided spaceuserId - the user's remote idtype - membership typerestPath - rest Pathexpand - expandpublic static org.exoplatform.social.rest.entity.ActivityEntity buildEntityFromActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity,
String restPath,
String expand)
activity - the provided activityexpand - expandrestPath - rest Pathpublic static org.exoplatform.social.rest.entity.CommentEntity buildEntityFromComment(org.exoplatform.social.core.activity.model.ExoSocialActivity comment,
String restPath,
String expand,
boolean isBuildList)
public static List<org.exoplatform.social.rest.entity.DataEntity> buildEntityFromComment(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, String restPath, String expand, int offset, int limit)
public static List<org.exoplatform.social.rest.entity.DataEntity> buildEntityFromLike(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, String restPath, String expand, int offset, int limit)
public static org.exoplatform.social.rest.entity.RelationshipEntity buildEntityRelationship(org.exoplatform.social.core.relationship.model.Relationship relationship,
String restPath,
String expand,
boolean isSymetric)
relationship - the provided relationshiprestPath - rest Pathexpand - expandisSymetric - booleanpublic static List<org.exoplatform.social.rest.entity.DataEntity> buildRelationshipEntities(List<org.exoplatform.social.core.relationship.model.Relationship> relationships, javax.ws.rs.core.UriInfo uriInfo)
public static org.exoplatform.social.rest.entity.DataEntity getActivityStream(org.exoplatform.social.core.activity.model.ExoSocialActivity activity,
org.exoplatform.social.core.identity.model.Identity authentiatedUsed)
authentiatedUsed - the vieweractivity - activitypublic static String getMembersSpaceRestUrl(String id, boolean returnManager, String restPath)
id - the id of spacereturnManager - return managers or membersrestPath - rest Pathpublic static String getCommentsActivityRestUrl(String activityId, String restPath)
activityId - activity's idrestPath - rest Pathpublic static javax.ws.rs.core.Response getResponse(Object entity, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.Response.Status status)
entity - the identityuriInfo - the uri request infomediaType - the media type to be returnedstatus - the status codepublic static Object buildLinkForHeader(Object entity, String requestPath)
"https://localhost:8080/rest/users?offset=50&limit=25"
Link: <https://localhost:8080/rest/users?offset=25&limit=25>; rel="previous",
<https://localhost:8080/rest/users?offset=75&limit=25>; rel="next"
entity - requestPath - Copyright © 2003–2016 eXo Platform SAS. All rights reserved.