Package lumis.service.activitystream
Class ActivityStreamResource
- java.lang.Object
-
- lumis.service.activitystream.ActivityStreamResource
-
@StableMinor(version="14.2", sinceVersion="8.2") @Path("/lumis/service/activitystream/rest") public class ActivityStreamResource extends Object
REST API for activity stream.- Since:
- 8.0.0
- Version:
- $Revision: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ActivityStreamResource.ActivityDocumentListResult
JAXB entity used to return a list of activity documents.static class
ActivityStreamResource.CountVO
Value object used for returning a numeric count.static class
ActivityStreamResource.MessageVO
Value object used byaddMessage(MessageVO)
.
-
Constructor Summary
Constructors Constructor Description ActivityStreamResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessage(ActivityStreamResource.MessageVO message)
Adds an activity representing a message by the current user.void
deleteActivity(@NotNull String activityId)
Deletes an activity.ActivityStreamResource.ActivityDocumentListResult
getActivities(@NotNull String activityStreamInterfaceInstanceId, DateParam before, int maxResults)
Returns the list ofactivity documents
returned byActivityStreamManager.getRecentActivities
using the given parameters.ActivityStreamResource.CountVO
getUnreadActivitiesCount(@NotNull String activityStreamInterfaceInstanceId, DateParam before)
Returns the number of unread activities the current user has in the specified activity stream interface instance.ActivityStreamResource.CountVO
markActivitiesAsRead(@NotNull String activityStreamInterfaceInstanceId, DateParam before)
Marks all activities displayed in the specified interface instance as read by the current user.void
markActivityAsRead(@NotNull String activityId)
Marks an activity as read by the current user.
-
-
-
Method Detail
-
addMessage
@POST @Path("/messages") @Consumes("application/json") public void addMessage(ActivityStreamResource.MessageVO message) throws Exception
Adds an activity representing a message by the current user.- Parameters:
message
- the message.- Throws:
Exception
- Since:
- 8.2.0
-
getActivities
@GET @Path("/activities") @Produces("application/json") public ActivityStreamResource.ActivityDocumentListResult getActivities(@NotNull @QueryParam("activityStreamInterfaceInstanceId") @NotNull String activityStreamInterfaceInstanceId, @QueryParam("before") DateParam before, @DefaultValue("10") @QueryParam("maxResults") int maxResults) throws PortalException
Returns the list ofactivity documents
returned byActivityStreamManager.getRecentActivities
using the given parameters.- Parameters:
activityStreamInterfaceInstanceId
- the identifier of the activity stream interface instance to use as base for generating the result.beforeTimeMillis
- only consider activities created before this value. Ifnull
it is ignored.maxResults
- maximum number of activities to return.- Returns:
- the corresponding activity documents.
- Throws:
PortalException
- Since:
- 8.2.0
- See Also:
ActivityStreamManager#getRecentActivities(String, String, Long, Integer)
-
deleteActivity
@DELETE @Path("/activities/{activityId:[A-F0-9]{32}}") public void deleteActivity(@PathParam("activityId") @NotNull @NotNull String activityId) throws PortalException
Deletes an activity.- Parameters:
activityId
- the activity identifier.- Throws:
PortalException
- Since:
- 8.0.0
-
getUnreadActivitiesCount
@GET @Path("/activities/unreadCount") @Produces("application/json") public ActivityStreamResource.CountVO getUnreadActivitiesCount(@NotNull @QueryParam("activityStreamInterfaceInstanceId") @NotNull String activityStreamInterfaceInstanceId, @QueryParam("before") DateParam before) throws PortalException
Returns the number of unread activities the current user has in the specified activity stream interface instance.- Parameters:
activityStreamInterfaceInstanceId
- the interface instance identifier.before
- if notnull
, only the activities before the specified date-time will be relevant.- Returns:
- the number of unread activities.
- Throws:
PortalException
- Since:
- 8.2.0
-
markActivityAsRead
@POST @Path("/activities/{activityId:[A-F0-9]{32}}/markAsRead") public void markActivityAsRead(@NotNull @PathParam("activityId") @NotNull String activityId) throws PortalException
Marks an activity as read by the current user.- Parameters:
activityId
- the activity identifier.- Throws:
PortalException
- Since:
- 8.2.0
-
markActivitiesAsRead
@POST @Path("/activities/markAllAsRead") public ActivityStreamResource.CountVO markActivitiesAsRead(@NotNull @QueryParam("activityStreamInterfaceInstanceId") @NotNull String activityStreamInterfaceInstanceId, @QueryParam("before") DateParam before) throws PortalException
Marks all activities displayed in the specified interface instance as read by the current user.- Parameters:
activityStreamInterfaceInstanceId
- the interface instance identifier.before
- if notnull
, only the activities before the specified date-time will be relevant.- Returns:
- the number of activities marked as read.
- Throws:
PortalException
- Since:
- 8.2.0
-
-