Class ActivityStreamResource


  • @StableMinor(version="14.1",
                 sinceVersion="8.2")
    @Path("/lumis/service/activitystream/rest")
    public class ActivityStreamResource
    extends Object
    REST API for activity stream.
    Since:
    8.0.0
    Version:
    $Revision: 24684 $ $Date: 2021-08-23 18:58:35 -0300 (Mon, 23 Aug 2021) $
    • Constructor Detail

      • ActivityStreamResource

        public ActivityStreamResource()
    • Method Detail

      • getActivities

        @GET
        @Path("/activities")
        @Produces("application/json")
        public ActivityStreamResource.ActivityDocumentListResult getActivities​(@NotNull @QueryParam("activityStreamInterfaceInstanceId")
                                                                               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)
      • getUnreadActivitiesCount

        @GET
        @Path("/activities/unreadCount")
        @Produces("application/json")
        public ActivityStreamResource.CountVO getUnreadActivitiesCount​(@NotNull @QueryParam("activityStreamInterfaceInstanceId")
                                                                       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")
                                       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")
                                                                   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