Class ResourceManagerResource

  • All Implemented Interfaces:
    org.silverpeas.core.web.rs.ProtectedWebResource, org.silverpeas.core.web.rs.WebAuthenticationValidation, org.silverpeas.core.web.rs.WebAuthorizationValidation, org.silverpeas.core.web.SilverpeasWebResource

    @WebService
    @Path("resourceManager/{componentInstanceId}")
    @Authorized
    public class ResourceManagerResource
    extends AbstractResourceManagerResource
    A REST Web resource giving reservation and resource data.
    Author:
    Yohann Chastagnier
    • Constructor Detail

      • ResourceManagerResource

        public ResourceManagerResource()
    • Method Detail

      • getCategory

        @GET
        @Path("reservations/resources/categories/{categoryId}")
        @Produces("application/json")
        public ResourceCategoryEntity getCategory​(@PathParam("categoryId")
                                                  long categoryId)
        Gets the JSON representation of a category. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        categoryId - the identifier od the aimed category.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked category.
      • getResource

        @GET
        @Path("reservations/resources/{resourceId}")
        @Produces("application/json")
        public ResourceEntity getResource​(@PathParam("resourceId")
                                          long resourceId)
        Gets the JSON representation of a resource. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        resourceId - the identifier od the aimed resource.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked resource.
      • getReservation

        @GET
        @Path("reservations/{reservationId}")
        @Produces("application/json")
        public ReservationEntity getReservation​(@PathParam("reservationId")
                                                long reservationId)
        Gets the JSON representation of a reservation event. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        reservationId - the identifier od the aimed reservation.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked reservation.
      • getResourcesOfReservation

        @GET
        @Path("reservations/{reservationId}/resources")
        @Produces("application/json")
        public Collection<ReservedResourceEntity> getResourcesOfReservation​(@PathParam("reservationId")
                                                                            long reservationId)
        Gets the JSON representation of a list of resources of a reservation. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        reservationId - the identifier od the aimed reservation.
        Returns:
        the response to the HTTP GET request with the JSON representation of list of resources of a reservation.
      • getReservations

        @GET
        @Path("reservations/{periodType}/{year}/{month}/{day}")
        @Produces("application/json")
        public Collection<ReservationEntity> getReservations​(@PathParam("periodType")
                                                             org.silverpeas.core.date.period.PeriodType periodType,
                                                             @PathParam("year")
                                                             int year,
                                                             @PathParam("month")
                                                             int month,
                                                             @PathParam("day")
                                                             int day)
        Gets the JSON representation of a list of reservation event. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        periodType - the aimed period
        year - the aimed year
        month - the aimed month
        day - the aimed day
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked list of reservation.
      • getReservationsByCategory

        @GET
        @Path("reservations/{periodType}/{year}/{month}/{day}/resources/categories/{categoryId}")
        @Produces("application/json")
        public Collection<ReservationEntity> getReservationsByCategory​(@PathParam("periodType")
                                                                       org.silverpeas.core.date.period.PeriodType periodType,
                                                                       @PathParam("year")
                                                                       int year,
                                                                       @PathParam("month")
                                                                       int month,
                                                                       @PathParam("day")
                                                                       int day,
                                                                       @PathParam("categoryId")
                                                                       long categoryId)
        Gets the JSON representation of a list of reservation event. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        periodType - the aimed period
        year - the aimed year
        month - the aimed month
        day - the aimed day
        categoryId - the aimed category of resources
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked list of reservation.
      • getReservationsByResource

        @GET
        @Path("reservations/{periodType}/{year}/{month}/{day}/resources/{resourceId}")
        @Produces("application/json")
        public Collection<ReservationEntity> getReservationsByResource​(@PathParam("periodType")
                                                                       org.silverpeas.core.date.period.PeriodType periodType,
                                                                       @PathParam("year")
                                                                       int year,
                                                                       @PathParam("month")
                                                                       int month,
                                                                       @PathParam("day")
                                                                       int day,
                                                                       @PathParam("resourceId")
                                                                       long resourceId)
        Gets the JSON representation of a list of reservation event. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        periodType - the aimed period
        year - the aimed year
        month - the aimed month
        day - the aimed day
        resourceId - the aimed resource
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked list of reservation.
      • getReservations

        @GET
        @Path("reservations/{periodType}/{year}/{month}/{day}/user/{userId}")
        @Produces("application/json")
        public Collection<ReservationEntity> getReservations​(@PathParam("periodType")
                                                             org.silverpeas.core.date.period.PeriodType periodType,
                                                             @PathParam("year")
                                                             int year,
                                                             @PathParam("month")
                                                             int month,
                                                             @PathParam("day")
                                                             int day,
                                                             @PathParam("userId")
                                                             String userId)
        Gets the JSON representation of a list of reservation event. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        periodType - the aimed period
        year - the aimed year
        month - the aimed month
        day - the aimed day
        userId - the aimed user
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked list of reservation.
      • getReservationsByCategory

        @GET
        @Path("reservations/{periodType}/{year}/{month}/{day}/user/{userId}/resources/categories/{categoryId}")
        @Produces("application/json")
        public Collection<ReservationEntity> getReservationsByCategory​(@PathParam("periodType")
                                                                       org.silverpeas.core.date.period.PeriodType periodType,
                                                                       @PathParam("year")
                                                                       int year,
                                                                       @PathParam("month")
                                                                       int month,
                                                                       @PathParam("day")
                                                                       int day,
                                                                       @PathParam("userId")
                                                                       String userId,
                                                                       @PathParam("categoryId")
                                                                       long categoryId)
        Gets the JSON representation of a list of reservation event. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        periodType - the aimed period
        year - the aimed year
        month - the aimed month
        day - the aimed day
        userId - the aimed user
        categoryId - the aimed category of resources
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked list of reservation.
      • getReservationsByResource

        @GET
        @Path("reservations/{periodType}/{year}/{month}/{day}/user/{userId}/resources/{resourceId}")
        @Produces("application/json")
        public Collection<ReservationEntity> getReservationsByResource​(@PathParam("periodType")
                                                                       org.silverpeas.core.date.period.PeriodType periodType,
                                                                       @PathParam("year")
                                                                       int year,
                                                                       @PathParam("month")
                                                                       int month,
                                                                       @PathParam("day")
                                                                       int day,
                                                                       @PathParam("userId")
                                                                       String userId,
                                                                       @PathParam("resourceId")
                                                                       long resourceId)
        Gets the JSON representation of a list of reservation event. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        periodType - the aimed period
        year - the aimed year
        month - the aimed month
        day - the aimed day
        userId - the aimed user
        resourceId - the aimed resource
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked list of reservation.
      • getReservationsForValidation

        @GET
        @Path("reservations/{periodType}/{year}/{month}/{day}/validation")
        @Produces("application/json")
        public Collection<ReservationEntity> getReservationsForValidation​(@PathParam("periodType")
                                                                          org.silverpeas.core.date.period.PeriodType periodType,
                                                                          @PathParam("year")
                                                                          int year,
                                                                          @PathParam("month")
                                                                          int month,
                                                                          @PathParam("day")
                                                                          int day)
        Gets the JSON representation of a list of reservation event that has to be validated. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        periodType - the aimed period
        year - the aimed year
        month - the aimed month
        day - the aimed day
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked list of reservation.