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

ActivitiesRestService.java
Provide rest services for activity gadget: like/unlike; comment; delete activity.
apis:
GET: /restContextName/social/activities/{activityId}/likes/show.{format}
POST: /restContextName/social/activities/{activityId}/likes/update.{format}
POST: /restContextName/social/activities/{activityId}/likes/destroy/{identity}.{format}
...
See methods for more api details.

Since:
Dec 29, 2009
Author:
hoatle

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)
          Comment an existing activity from a specified activity Id.
 javax.ws.rs.core.Response destroyActivity(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format)
          Destroy 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)
          Destroy 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)
          Destroy 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)
          Get an activity by its Id.
 javax.ws.rs.core.Response showComments(javax.ws.rs.core.UriInfo uriInfo, String portalName, String activityId, String format)
          Show 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)
          Show 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)
          Show 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)
          Update 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
Destroy activity and return the JSON/XML format.

Parameters:
uriInfo -
activityId -
format -
Returns:
response
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
Show list of like by activityId and return the JSON/XML format.

Parameters:
uriInfo -
activityId -
format -
Returns:
response
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
Update like by the JSON/XML format.

Parameters:
uriInfo -
activityId -
format -
like -
Returns:
response
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
Destroy like by identityId and return the JSON/XML format.

Parameters:
uriInfo -
activityId -
identityId -
format -
Returns:
response
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
Show comment list by the JSON/XML format.

Parameters:
uriInfo -
activityId -
format -
Returns:
response
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
Show comment list by the JSON/XML format with limit and offset.

Parameters:
uriInfo -
activityId -
format -
offset -
limit -
Returns:
response
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)
Get an activity by its Id.

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

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 -
activityId -
format -
comment -
Returns:
response
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)
Comment an existing activity from a specified activity Id. Just returns the created comment.

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

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
Destroy comments and return the JSON/XML format.

Parameters:
uriInfo -
activityId -
commentId -
format -
Returns:
response
Throws:
Exception


Copyright © 2013 eXo Platform SAS. All Rights Reserved.