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 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 CommentEntity |
buildEntityFromComment(org.exoplatform.social.core.activity.model.ExoSocialActivity comment,
String restPath,
String expand,
boolean isBuildList) |
static List<DataEntity> |
buildEntityFromComment(org.exoplatform.social.core.activity.model.ExoSocialActivity activity,
String restPath,
String expand,
int offset,
int limit) |
static List<DataEntity> |
buildEntityFromLike(org.exoplatform.social.core.activity.model.ExoSocialActivity activity,
String restPath,
String expand,
int offset,
int limit) |
static 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 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 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 IdentityEntity |
buildEntityIdentity(String userName,
String restPath,
String expand) |
static ProfileEntity |
buildEntityProfile(org.exoplatform.social.core.identity.model.Profile profile,
String restPath,
String expand) |
static ProfileEntity |
buildEntityProfile(String userName,
String restPath,
String expand) |
static List<DataEntity> |
buildEntityProfiles(String[] userNames,
String restPath,
String expand) |
static 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)
"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"
|
static List<DataEntity> |
buildRelationshipEntities(List<org.exoplatform.social.core.relationship.model.Relationship> relationships,
javax.ws.rs.core.UriInfo uriInfo) |
static SpaceMembershipEntity |
createSpaceMembershipForIgnoredStatus(org.exoplatform.social.core.space.model.Space space,
String userId,
String type,
String restPath,
String expand)
update the SpaceMemberShip between the user and the space as ignored and then update also the MemberShipType used in SpaceMembershipRestResourcesV1.java
|
static 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 IdentityEntity buildEntityIdentity(org.exoplatform.social.core.identity.model.Identity identity, String restPath, String expand)
identity - the provided identitypublic static IdentityEntity buildEntityIdentity(String userName, String restPath, String expand)
userName - restPath - expand - public static ProfileEntity buildEntityProfile(org.exoplatform.social.core.identity.model.Profile profile, String restPath, String expand)
public static ProfileEntity buildEntityProfile(String userName, String restPath, String expand)
userName - restPath - expand - public static List<DataEntity> buildEntityProfiles(String[] userNames, String restPath, String expand)
userNames - restPath - expand - public static SpaceEntity buildEntityFromSpace(org.exoplatform.social.core.space.model.Space space, String userId, String restPath, String expand)
space - the provided spaceuserId - the user's remote idpublic static 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 typepublic static ActivityEntity buildEntityFromActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, String restPath, String expand)
activity - the provided activityexpand - public static CommentEntity buildEntityFromComment(org.exoplatform.social.core.activity.model.ExoSocialActivity comment, String restPath, String expand, boolean isBuildList)
public static List<DataEntity> buildEntityFromComment(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, String restPath, String expand, int offset, int limit)
public static List<DataEntity> buildEntityFromLike(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, String restPath, String expand, int offset, int limit)
public static RelationshipEntity buildEntityRelationship(org.exoplatform.social.core.relationship.model.Relationship relationship, String restPath, String expand, boolean isSymetric)
relationship - the provided relationshippublic static List<DataEntity> buildRelationshipEntities(List<org.exoplatform.social.core.relationship.model.Relationship> relationships, javax.ws.rs.core.UriInfo uriInfo)
public static SpaceMembershipEntity createSpaceMembershipForIgnoredStatus(org.exoplatform.social.core.space.model.Space space, String userId, String type, String restPath, String expand)
space - userId - type - restPath - expand - public static DataEntity getActivityStream(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, org.exoplatform.social.core.identity.model.Identity authentiatedUsed)
activity - authentiatedUsed - the viewerpublic static String getMembersSpaceRestUrl(String id, boolean returnManager, String restPath)
id - the id of spacereturnManager - return managers or memberspublic static String getCommentsActivityRestUrl(String activityId, String restPath)
activityId - activity's idpublic 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–2017 eXo Platform SAS. All rights reserved.