org.silverpeas.resourcesmanager.web
Class ResourceManagerResource

java.lang.Object
  extended by com.silverpeas.web.RESTWebService
      extended by org.silverpeas.resourcesmanager.web.AbstractResourceManagerResource
          extended by org.silverpeas.resourcesmanager.web.ResourceManagerResource

@Service
@RequestScoped
@Authorized
public class ResourceManagerResource
extends AbstractResourceManagerResource

A REST Web resource giving reservation and resource data.

Author:
Yohann Chastagnier

Nested Class Summary
 
Nested classes/interfaces inherited from class com.silverpeas.web.RESTWebService
com.silverpeas.web.RESTWebService.WebProcess<RETURN_VALUE>, com.silverpeas.web.RESTWebService.WebTreatment<RETURN_VALUE>
 
Field Summary
 
Fields inherited from class com.silverpeas.web.RESTWebService
RESPONSE_HEADER_ARRAYSIZE, REST_WEB_SERVICES_URI_BASE
 
Constructor Summary
ResourceManagerResource()
           
 
Method Summary
 ResourceCategoryEntity getCategory(long categoryId)
          Gets the JSON representation of a category.
 ReservationEntity getReservation(long reservationId)
          Gets the JSON representation of a reservation event.
 Collection<ReservationEntity> getReservations(org.silverpeas.date.PeriodType periodType, int year, int month, int day)
          Gets the JSON representation of a list of reservation event.
 Collection<ReservationEntity> getReservations(org.silverpeas.date.PeriodType periodType, int year, int month, int day, String userId)
          Gets the JSON representation of a list of reservation event.
 Collection<ReservationEntity> getReservationsByCategory(org.silverpeas.date.PeriodType periodType, int year, int month, int day, long categoryId)
          Gets the JSON representation of a list of reservation event.
 Collection<ReservationEntity> getReservationsByCategory(org.silverpeas.date.PeriodType periodType, int year, int month, int day, String userId, long categoryId)
          Gets the JSON representation of a list of reservation event.
 Collection<ReservationEntity> getReservationsByResource(org.silverpeas.date.PeriodType periodType, int year, int month, int day, long resourceId)
          Gets the JSON representation of a list of reservation event.
 Collection<ReservationEntity> getReservationsByResource(org.silverpeas.date.PeriodType periodType, int year, int month, int day, String userId, long resourceId)
          Gets the JSON representation of a list of reservation event.
 Collection<ReservationEntity> getReservationsForValidation(org.silverpeas.date.PeriodType periodType, int year, int month, int day)
          Gets the JSON representation of a list of reservation event that has to be validated.
 ResourceEntity getResource(long resourceId)
          Gets the JSON representation of a resource.
 Collection<ReservedResourceEntity> getResourcesOfReservation(long reservationId)
          Gets the JSON representation of a list of resources of a reservation.
 
Methods inherited from class org.silverpeas.resourcesmanager.web.AbstractResourceManagerResource
asWebEntities, asWebEntities, asWebEntity, asWebEntity, asWebEntity, asWebEntity, buildReservationURI, buildResourceCategoryURI, buildResourceReservationURI, buildResourceURI, getComponentId, getResourceManager
 
Methods inherited from class com.silverpeas.web.RESTWebService
getBundle, getBundleLocation, getGreaterUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getUriInfo, getUserDetail, getUserPreferences, getUserRoles, process, validateUserAuthentication, validateUserAuthorization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManagerResource

public ResourceManagerResource()
Method Detail

getCategory

public ResourceCategoryEntity getCategory(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

public ResourceEntity getResource(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

public ReservationEntity getReservation(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

public Collection<ReservedResourceEntity> getResourcesOfReservation(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

public Collection<ReservationEntity> getReservations(org.silverpeas.date.PeriodType periodType,
                                                     int year,
                                                     int month,
                                                     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

public Collection<ReservationEntity> getReservationsByCategory(org.silverpeas.date.PeriodType periodType,
                                                               int year,
                                                               int month,
                                                               int day,
                                                               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

public Collection<ReservationEntity> getReservationsByResource(org.silverpeas.date.PeriodType periodType,
                                                               int year,
                                                               int month,
                                                               int day,
                                                               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

public Collection<ReservationEntity> getReservations(org.silverpeas.date.PeriodType periodType,
                                                     int year,
                                                     int month,
                                                     int day,
                                                     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

public Collection<ReservationEntity> getReservationsByCategory(org.silverpeas.date.PeriodType periodType,
                                                               int year,
                                                               int month,
                                                               int day,
                                                               String userId,
                                                               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

public Collection<ReservationEntity> getReservationsByResource(org.silverpeas.date.PeriodType periodType,
                                                               int year,
                                                               int month,
                                                               int day,
                                                               String userId,
                                                               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

public Collection<ReservationEntity> getReservationsForValidation(org.silverpeas.date.PeriodType periodType,
                                                                  int year,
                                                                  int month,
                                                                  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.


Copyright © 2016 Silverpeas. All Rights Reserved.