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 activity gadget: like/unlike, comment and delete activity.


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)
          Comments an existing activity from a specified activity Id and returns the created comment.
 javax.ws.rs.core.Response destroyActivity(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format)
          Destroys activity and return the JSON/XML format.
 javax.ws.rs.core.Response destroyComment(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String commentId, String format)
          Destroys comments and return the JSON/XML format.
 javax.ws.rs.core.Response destroyLike(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String identityId, String format)
          Destroys like by identityId and return the JSON/XML format.
 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)
          Shows comment list by the JSON/XML format.
 javax.ws.rs.core.Response showComments(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format, Integer offset, Integer limit)
          Shows comment list by the JSON/XML format with limit and offset.
 javax.ws.rs.core.Response showLikes(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format)
          Shows list of like by activityId and return the JSON/XML format.
 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)
          Update comment by the JSON/XML format.
 javax.ws.rs.core.Response updateLike(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format, Like like)
          Updates like by the JSON/XML format.
 
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 activity and return the JSON/XML format.

Parameters:
uriInfo - The request URI information.
portalName - The name of current portal.
activityId - The id of target activity to be destroyed.
format - The response format type, for example: JSON, or XML.
Returns:
The response contains 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
Shows list of like by activityId and return the JSON/XML format.

Parameters:
uriInfo - The request URI information.
portalName - The name of current portal.
activityId - The id of target activity that the like to be showed.
format - The response format type, for example: JSON, or XML.
Returns:
The response contains 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 like by the JSON/XML format.

Parameters:
uriInfo - The request URI information.
portalName - The name of current portal.
activityId - The id of target activity that like to be updated.
format - The response format type, for example: JSON, or XML.
like - The like to be updated.
Returns:
The response contains 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
Destroys like by identityId and return the JSON/XML format.

Parameters:
uriInfo - The request URI information.
portalName - The name of current portal.
activityId - The id of target activity that like to be destroyed.
identityId -
format - The response format type, for example: JSON, or XML.
Returns:
The response contains 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
Shows comment list by the JSON/XML format.

Parameters:
uriInfo - The request URI information.
portalName - The name of current portal.
activityId - The id of target activity that comments to be showed.
format - The response format type, for example: JSON, or XML.
Returns:
The response contains 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
Shows comment list by the JSON/XML format with limit and offset.

Parameters:
uriInfo - The request URI information.
portalName - The name of current portal.
activityId - The id of target activity that comments to be showed.
format - The response format type, for example: JSON, or XML.
offset - Specify the from number of comment to be showed. It must be greater than or equal to 0.
limit - Specify the number of spaces to be showed.
Returns:
The response contains 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 URI request information.
portalName - The name of current portal.
portalContainerName - The associated portal container name.
activityId - The id of target activity.
format - The response format type, for example: JSON, or XML.
Returns:
The response contains 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
Update comment by the JSON/XML format.

Parameters:
uriInfo - The request URI information.
portalName - The name of current portal.
activityId - The id of target comment to be updated.
format - The response format type, for example: JSON, or XML.
comment - The comment to be updated.
Returns:
response The response contains 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)
Comments an existing activity from a specified activity Id and returns the created comment.

Parameters:
uriInfo - The request URI information.
portalName - The associated portal container name.
activityId - The id of target comment to be created.
format - The response format type, for example: JSON, or XML.
text - The content of comment.
Returns:
The response contains 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
Destroys comments and return the JSON/XML format.

Parameters:
uriInfo - The request URI information.
portalName - The name of current portal.
activityId - The id of activity that contain target comment.
commentId - The id of target comment to be destroyed.
format - The response format type, for example: JSON, or XML.
Returns:
response The response contains returned result.
Throws:
Exception


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