org.exoplatform.social.service.rest.api
Class ActivityResources

java.lang.Object
  extended by org.exoplatform.social.service.rest.api.ActivityResources
All Implemented Interfaces:
org.exoplatform.services.rest.resource.ResourceContainer

public class ActivityResources
extends Object
implements org.exoplatform.services.rest.resource.ResourceContainer

Activity Resources end point.


Constructor Summary
ActivityResources()
           
 
Method Summary
 javax.ws.rs.core.Response createCommentActivityById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format, CommentRestIn comment)
          Posts a new comment on an existing activity.
 javax.ws.rs.core.Response createLikeActivityById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format)
          Allows an authenticated identity to do the "like" action on an existing activity.
 javax.ws.rs.core.Response createNewActivity(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String format, String identityIdStream, ActivityRestIn newActivity)
          Creates an activity to an identity's activity stream.
 javax.ws.rs.core.Response deleteCommentById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format, String commentId)
          Deletes an existing comment by its Id.
 javax.ws.rs.core.Response deleteExistingActivityById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format)
          Deletes an existing activity by its Id using the DELETE method.
 javax.ws.rs.core.Response deleteLikeActivityById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format)
          Allows an identity to remove his "like" action on an activity.
 javax.ws.rs.core.Response getActivityById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format, String showPosterIdentity, int numberOfComments, String showActivityStream, int numberOfLikes)
          Gets an activity object from a specified activity Id.
 javax.ws.rs.core.Response getCommentsByActivityById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format)
          Gets the comments on an activity.
 javax.ws.rs.core.Response getLikesFromIdentityId(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format)
          Gets all the identities who like an existing activity.
 javax.ws.rs.core.Response postDeleteCommentById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format, String commentId)
          Deletes an existing comment by its Id using the POST method.
 javax.ws.rs.core.Response postDeleteLikeActivityById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format)
          Allows an identity to remove his "like" action on an activity.
 javax.ws.rs.core.Response postToDeleteActivityById(javax.ws.rs.core.UriInfo uriInfo, String portalContainerName, String activityId, String format)
          Deletes an existing activity by its Id using the POST method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityResources

public ActivityResources()
Method Detail

getActivityById

public javax.ws.rs.core.Response getActivityById(@Context
                                                 javax.ws.rs.core.UriInfo uriInfo,
                                                 String portalContainerName,
                                                 String activityId,
                                                 String format,
                                                 String showPosterIdentity,
                                                 int numberOfComments,
                                                 String showActivityStream,
                                                 int numberOfLikes)
Gets an activity object from a specified activity Id.

Parameters:
uriInfo - The uri request info.
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
showPosterIdentity - When this parameter is set to true, t or 1, the returned activity will provide more information for the user who posted this activity.
numberOfComments - Specify the number of comments to be displayed along with this activity. By default, _number\_of\_comments=0_. If _number_of_comments_ is a positive number, this number is considered as a limit number that must be equal or less than 100. If the actual number of comments is less than the provided positive number, the number of actual comments must be returned. If the total number of comments is more than 100, it is recommended to use _activity/\:id/comments.format_ instead.
numberOfLikes - Specify the number of latest detailed likes to be returned along with this activity. By default, _number\_of\_likes=0_. If _number\_of\_likes_ is a positive number, this number is considered as a limit number that must be equal or less than 100. If the total number of likes is less than the provided positive number, the number of actual likes must be returned. If the total number of likes is more than 100, it is recommended to use _activity/\:activityId/likes.format_ instead.
showActivityStream - When this parameter is set to true, t or 1, the returned activity will provide more information for the activity stream that this activity belongs to.
Returns:
a response object

createNewActivity

public javax.ws.rs.core.Response createNewActivity(@Context
                                                   javax.ws.rs.core.UriInfo uriInfo,
                                                   String portalContainerName,
                                                   String format,
                                                   String identityIdStream,
                                                   ActivityRestIn newActivity)
Creates an activity to an identity's activity stream. If no _identity\_id_ is specified, the activity will be created to the authenticated identity's activity stream.

Parameters:
uriInfo - the uri request info
portalContainerName - The associated portal container name.
format - The expected returned format.
identityIdStream - The optional identity stream to post this new activity to.
newActivity - A new activity instance.
Returns:
a response object

deleteExistingActivityById

public javax.ws.rs.core.Response deleteExistingActivityById(@Context
                                                            javax.ws.rs.core.UriInfo uriInfo,
                                                            String portalContainerName,
                                                            String activityId,
                                                            String format)
Deletes an existing activity by its Id using the DELETE method. The deleted activity information will be returned in the JSON format.

Parameters:
uriInfo - the uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
Returns:
a response object

postToDeleteActivityById

public javax.ws.rs.core.Response postToDeleteActivityById(@Context
                                                          javax.ws.rs.core.UriInfo uriInfo,
                                                          String portalContainerName,
                                                          String activityId,
                                                          String format)
Deletes an existing activity by its Id using the POST method. The deleted activity information will be returned in the JSON format. It is recommended to use the DELETE method, except the case that clients cannot make request via this method.

Parameters:
uriInfo - The uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
Returns:
a response object

getCommentsByActivityById

public javax.ws.rs.core.Response getCommentsByActivityById(@Context
                                                           javax.ws.rs.core.UriInfo uriInfo,
                                                           String portalContainerName,
                                                           String activityId,
                                                           String format)
Gets the comments on an activity.

Parameters:
uriInfo - The uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
Returns:
a response object

createCommentActivityById

public javax.ws.rs.core.Response createCommentActivityById(@Context
                                                           javax.ws.rs.core.UriInfo uriInfo,
                                                           String portalContainerName,
                                                           String activityId,
                                                           String format,
                                                           CommentRestIn comment)
Posts a new comment on an existing activity. The poster of this comment is an authenticated identity.

Parameters:
uriInfo - The uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
Returns:
a response object

deleteCommentById

public javax.ws.rs.core.Response deleteCommentById(@Context
                                                   javax.ws.rs.core.UriInfo uriInfo,
                                                   String portalContainerName,
                                                   String activityId,
                                                   String format,
                                                   String commentId)
Deletes an existing comment by its Id.

Parameters:
uriInfo - The uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
commentId - The specified comment Id.
Returns:
a response object

postDeleteCommentById

public javax.ws.rs.core.Response postDeleteCommentById(@Context
                                                       javax.ws.rs.core.UriInfo uriInfo,
                                                       String portalContainerName,
                                                       String activityId,
                                                       String format,
                                                       String commentId)
Deletes an existing comment by its Id using the POST method. The deleted activity information will be returned in the JSON format. It is recommended to use the POST method, except the case that clients cannot make request via this method.

Parameters:
uriInfo - The uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
commentId - The specified comment Id.
format - The expected returned format.
Returns:
a response object

getLikesFromIdentityId

public javax.ws.rs.core.Response getLikesFromIdentityId(@Context
                                                        javax.ws.rs.core.UriInfo uriInfo,
                                                        String portalContainerName,
                                                        String activityId,
                                                        String format)
Gets all the identities who like an existing activity.

Parameters:
uriInfo - The uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
Returns:

createLikeActivityById

public javax.ws.rs.core.Response createLikeActivityById(@Context
                                                        javax.ws.rs.core.UriInfo uriInfo,
                                                        String portalContainerName,
                                                        String activityId,
                                                        String format)
Allows an authenticated identity to do the "like" action on an existing activity.

Parameters:
uriInfo - The uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
Returns:
a response object

deleteLikeActivityById

public javax.ws.rs.core.Response deleteLikeActivityById(@Context
                                                        javax.ws.rs.core.UriInfo uriInfo,
                                                        String portalContainerName,
                                                        String activityId,
                                                        String format)
Allows an identity to remove his "like" action on an activity.

Parameters:
uriInfo - The uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
Returns:
a response object

postDeleteLikeActivityById

public javax.ws.rs.core.Response postDeleteLikeActivityById(@Context
                                                            javax.ws.rs.core.UriInfo uriInfo,
                                                            String portalContainerName,
                                                            String activityId,
                                                            String format)
Allows an identity to remove his "like" action on an activity. It is recommended to use the DELETE method, except the case that clients cannot make request via this method.

Parameters:
uriInfo - the uri request uri
portalContainerName - The associated portal container name.
activityId - The specified activity Id.
format - The expected returned format.
Returns:
a response object


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.