Class SelectionBasketResource

    • Constructor Detail

      • SelectionBasketResource

        public SelectionBasketResource()
    • Method Detail

      • getAll

        @GET
        @Produces("application/json")
        public List<SelectionBasketEntry> getAll()
        Gets all the content of the selection basket, reverse ordered by the time each item has been put, the last resource put at index 0.
        Returns:
        a reverse ordered list of basket entries. The last one put being the first one in the list. An entry is a mapping between the Silverpeas resource that has been selected (and hence put into the basket) and its selection context.
      • putInBasket

        @POST
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response putInBasket​(SelectionBasketEntry entry)
        Puts the specified resource into the basket. It will be placed atop of others items in the basket.
        Parameters:
        entry - a basket entry. An entry is a mapping between the Silverpeas resource that has been selected and its selection context.
        Returns:
        the new state of the basket, that is to say its updated content.
      • pop

        @DELETE
        @Produces("application/json")
        public List<SelectionBasketEntry> pop()
        Pops the item at the head of the basket. Popping is a way to delete the first item in the basket (the last one put into the basket).
        Returns:
        the new state of the basket, that is to say its new content without the deleted item.
      • deleteFromBasket

        @DELETE
        @Produces("application/json")
        @Path("/item/{id}")
        public List<SelectionBasketEntry> deleteFromBasket​(@PathParam("id")
                                                           String itemId)
        Deletes in the basket the item with the specified unique identifier. If no such Silverpeas resource is found in the basket, then a NotFoundException is thrown.
        Parameters:
        itemId - the unique identifier of a Silverpeas resource placed in the basket.
        Returns:
        the new state of the basket, that is to say its new content without the deleted item.
      • removeFromBasket

        @DELETE
        @Produces("application/json")
        @Path("/index/{index}")
        public List<SelectionBasketEntry> removeFromBasket​(@PathParam("index")
                                                           int index)
        Deletes in the basket the item placed at the specified position. If there is no resource at the given position in the basket, then a NotFoundException is thrown.
        Parameters:
        index - the position index of the resource in the basket to remove. The index starts at 0 for the head position.
        Returns:
        the new state of the basket, that is to say its new content without the deleted item.
      • getComponentId

        public String getComponentId()
        Description copied from interface: SilverpeasWebResource
        Gets the identifier of the component instance to which the requested resource belongs to.
        Returns:
        the identifier of the Silverpeas component instance.