org.exoplatform.social.service.rest
Class ActivitiesRestService

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

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

Provides services for manipulating activities (like/unlike, comment and delete).


Nested Class Summary
static class ActivitiesRestService.CommentList
          CommentList model
static class ActivitiesRestService.LikeList
          LikeList model
 
Constructor Summary
ActivitiesRestService()
          constructor
 
Method Summary
 javax.ws.rs.core.Response createCommentActivityById(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format, String text)
          Add comments to an existing activity.
 javax.ws.rs.core.Response destroyActivity(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format)
          Destroys an activity by its provided Id.
 javax.ws.rs.core.Response destroyComment(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String commentId, String format)
          Removes comments on the activity.
 javax.ws.rs.core.Response destroyLike(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String identityId, String format)
          Removes the "like" information of the 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 by its Id.
 javax.ws.rs.core.Response showComments(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format)
          Gets comments on the activity.
 javax.ws.rs.core.Response showComments(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format, Integer offset, Integer limit)
          Gets a limit number of comments on the activity.
 javax.ws.rs.core.Response showLikes(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format)
          Gets a list of users who like the activity.
 javax.ws.rs.core.Response updateComment(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format, org.exoplatform.social.core.activity.model.ExoSocialActivityImpl comment)
          Updates the comment information on the activity.
 javax.ws.rs.core.Response updateLike(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format, Like like)
          Updates the "like" information of the activity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivitiesRestService

public ActivitiesRestService()
constructor

Method Detail

destroyActivity

public javax.ws.rs.core.Response destroyActivity(@Context
                                                 javax.ws.rs.core.UriInfo uriInfo,
                                                 String portalName,
                                                 String activityId,
                                                 String format)
                                          throws Exception
Destroys an activity by its provided Id.

Parameters:
uriInfo - The requested URI information.
portalName - The name of current portal.
activityId - The Id of the target activity which is destroyed.
format - The format of the returned result, for example, JSON, or XML.
Returns:
The response contains a returned result.
Throws:
Exception

showLikes

public javax.ws.rs.core.Response showLikes(@Context
                                           javax.ws.rs.core.UriInfo uriInfo,
                                           String portalName,
                                           String activityId,
                                           String format)
                                    throws Exception
Gets a list of users who like the activity.

Parameters:
uriInfo - The requested URI information.
portalName - The name of the current portal.
activityId - The Id of the target activity.
format - The format of the returned result, for example, JSON, or XML.
Returns:
The response contains a returned result.
Throws:
Exception

updateLike

public javax.ws.rs.core.Response updateLike(@Context
                                            javax.ws.rs.core.UriInfo uriInfo,
                                            String portalName,
                                            String activityId,
                                            String format,
                                            Like like)
                                     throws Exception
Updates the "like" information of the activity.

Parameters:
uriInfo - The requested URI information.
portalName - The name of the current portal.
activityId - The Id of the target activity.
format - The format of the returned result, for example, JSON, or XML.
like - The object containing the information of users who like the activity.
Returns:
The response contains a returned result.
Throws:
Exception

destroyLike

public javax.ws.rs.core.Response destroyLike(@Context
                                             javax.ws.rs.core.UriInfo uriInfo,
                                             String portalName,
                                             String activityId,
                                             String identityId,
                                             String format)
                                      throws Exception
Removes the "like" information of the activity.

Parameters:
uriInfo - The requested URI information.
portalName - The name of the current portal.
activityId - The Id of the target activity.
identityId - The information of a user who unlikes the activity.
format - The format of the returned result, for example, JSON, or XML.
Returns:
The response contains a returned result.
Throws:
Exception

showComments

public javax.ws.rs.core.Response showComments(@Context
                                              javax.ws.rs.core.UriInfo uriInfo,
                                              String portalName,
                                              String activityId,
                                              String format)
                                       throws Exception
Gets comments on the activity.

Parameters:
uriInfo - The requested URI information.
portalName - The name of the current portal.
activityId - The Id of target activity.
format - The format of the returned result, for example, JSON, or XML.
Returns:
The response contains a returned result.
Throws:
Exception

showComments

public javax.ws.rs.core.Response showComments(@Context
                                              javax.ws.rs.core.UriInfo uriInfo,
                                              String portalName,
                                              String activityId,
                                              String format,
                                              Integer offset,
                                              Integer limit)
                                       throws Exception
Gets a limit number of comments on the activity.

Parameters:
uriInfo - The requested URI information.
portalName - The name of the current portal.
activityId - The Id of the target activity.
format - The format of the returned result, for example, JSON, or XML.
offset - The starting point of the range to get comments. It must be greater than or equal to 0.
limit - The ending point of the range to get comments.
Returns:
The response contains a returned result.
Throws:
Exception

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 by its Id.

Parameters:
uriInfo - The requested URI information.
portalName - The name of the current portal.
portalContainerName - The associated portal container name.
activityId - The Id of the target activity.
format - The format of the returned result, for example: JSON, or XML.
showPosterIdentity - The identity information of the poster.
numberOfComments - The number of comments will be returned.
showActivityStream - Specifies the stream of an activity.
numberOfLikes - The number of likes will be returned.
Returns:
The response contains a returned result.

updateComment

public javax.ws.rs.core.Response updateComment(@Context
                                               javax.ws.rs.core.UriInfo uriInfo,
                                               String portalName,
                                               String activityId,
                                               String format,
                                               org.exoplatform.social.core.activity.model.ExoSocialActivityImpl comment)
                                        throws Exception
Updates the comment information on the activity.

Parameters:
uriInfo - The requested URI information.
portalName - The name of the current portal.
activityId - The Id of the target comment which is updated.
format - The format of the returned result, for example, JSON, or XML.
comment - The comment to be updated.
Returns:
response The response contains a returned result.
Throws:
Exception

createCommentActivityById

public javax.ws.rs.core.Response createCommentActivityById(@Context
                                                           javax.ws.rs.core.UriInfo uriInfo,
                                                           String portalName,
                                                           String activityId,
                                                           String format,
                                                           String text)
Add comments to an existing activity.

Parameters:
uriInfo - The requested URI information.
portalName - The associated portal container name.
activityId - The Id of the activity.
format - The format of the returned result, for example, JSON, or XML.
text - The content of the comment.
Returns:
The response contains a returned result.

destroyComment

public javax.ws.rs.core.Response destroyComment(@Context
                                                javax.ws.rs.core.UriInfo uriInfo,
                                                String portalName,
                                                String activityId,
                                                String commentId,
                                                String format)
                                         throws Exception
Removes comments on the activity.

Parameters:
uriInfo - The requested URI information.
portalName - The name of the current portal.
activityId - The activity Id.
commentId - The Id of the target comment which is destroyed.
format - The format of the returned result, for example, JSON, or XML.
Returns:
response The response contains a returned result.
Throws:
Exception


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