Class ActivityStreamResource


  • @StableMinor(version="17.0",
                 sinceVersion="8.2")
    @Path("/lumis/service/activitystream/rest")
    public class ActivityStreamResource
    extends java.lang.Object
    REST API for activity stream.
    Since:
    8.0.0
    Version:
    $Revision$ $Date$
    • Constructor Detail

      • ActivityStreamResource

        public ActivityStreamResource()
    • Method Detail

      • addMessage

        @POST
        @Path("/messages")
        @Consumes("application/json")
        public void addMessage​(ActivityStreamResource.MessageVO message)
                        throws java.lang.Exception
        Adds an activity representing a message by the current user.
        Parameters:
        message - the message.
        Throws:
        java.lang.Exception
        Since:
        8.2.0
      • getActivities

        @GET
        @Path("/activities")
        @Produces("application/json")
        public ActivityStreamResource.ActivityDocumentListResult getActivities​(@NotNull @QueryParam("activityStreamInterfaceInstanceId")
                                                                               @NotNull java.lang.String activityStreamInterfaceInstanceId,
                                                                               @QueryParam("before")
                                                                               DateParam before,
                                                                               @DefaultValue("10") @QueryParam("maxResults")
                                                                               int maxResults)
                                                                        throws PortalException
        Returns the list of activity documents returned by ActivityStreamManager.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. If null 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 java.lang.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 java.lang.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 not null, 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 java.lang.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 java.lang.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 not null, 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