Class SimpleResourcesManager
- java.lang.Object
-
- org.silverpeas.components.resourcesmanager.service.SimpleResourcesManager
-
- All Implemented Interfaces:
Serializable
,ResourcesManager
@Service public class SimpleResourcesManager extends Object implements ResourcesManager, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleResourcesManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createCategory(Category category)
Creating a new resource category.void
createResource(Resource resource)
void
deleteCategory(Long id, String componentId)
void
deleteReservation(Long id, String componentId)
void
deleteResource(Long id, String componentId)
List<Category>
getCategories(String instanceId)
Category
getCategory(Long id)
List<ResourceValidator>
getManagers(long resourceId)
Reservation
getReservation(String instanceId, Long reservationId)
List<Reservation>
getReservationForValidation(String instanceId, String userId, org.silverpeas.core.date.period.Period period)
List<Reservation>
getReservationOfUser(String instanceId, Integer userId, org.silverpeas.core.date.period.Period period)
List<Reservation>
getReservations(String instanceId)
List<Reservation>
getReservationWithResource(String instanceId, Integer userId, org.silverpeas.core.date.period.Period period, Long resourceId)
List<Reservation>
getReservationWithResourcesOfCategory(String instanceId, Integer userId, org.silverpeas.core.date.period.Period period, Long categoryId)
List<Resource>
getReservedResources(String instanceId, List<Long> resources, Date startDate, Date endDate)
Get from the given aimed resources those that are unavailable on the given period.List<Resource>
getReservedResources(String instanceId, List<Long> aimedResourceIds, Date startDate, Date endDate, Long reservationIdToSkip)
Get from the given aimed resources those that are unavailable on the given period.Resource
getResource(Long id)
String
getResourceOfReservationStatus(Long resourceId, Long reservationId)
List<Resource>
getResourcesByCategory(Long categoryId)
List<Resource>
getResourcesOfReservation(String instanceId, Long reservationId)
List<Resource>
getResourcesReservable(String instanceId, Date startDate, Date endDate)
List<Reservation>
getUserReservations(String instanceId, String userId)
void
indexResourceManager(String instanceId)
boolean
isManager(long userId, long resourceId)
void
saveReservation(Reservation reservation, List<Long> resourceIds)
void
updateCategory(Category category)
void
updateReservation(Reservation reservation, List<Long> resourceIds, boolean updateDate)
void
updateReservedResourceStatus(long reservationId, long resourceId, String status)
void
updateResource(Resource updatedResource, List<Long> managerIds)
-
-
-
Method Detail
-
createCategory
public void createCategory(Category category)
Creating a new resource category.- Specified by:
createCategory
in interfaceResourcesManager
- Parameters:
category
- the category to create
-
getCategories
public List<Category> getCategories(String instanceId)
- Specified by:
getCategories
in interfaceResourcesManager
-
getCategory
public Category getCategory(Long id)
- Specified by:
getCategory
in interfaceResourcesManager
-
updateCategory
public void updateCategory(Category category)
- Specified by:
updateCategory
in interfaceResourcesManager
-
deleteCategory
public void deleteCategory(Long id, String componentId)
- Specified by:
deleteCategory
in interfaceResourcesManager
-
createResource
public void createResource(Resource resource)
- Specified by:
createResource
in interfaceResourcesManager
-
getResource
public Resource getResource(Long id)
- Specified by:
getResource
in interfaceResourcesManager
-
getResourcesByCategory
public List<Resource> getResourcesByCategory(Long categoryId)
- Specified by:
getResourcesByCategory
in interfaceResourcesManager
-
deleteResource
public void deleteResource(Long id, String componentId)
- Specified by:
deleteResource
in interfaceResourcesManager
-
getResourcesReservable
public List<Resource> getResourcesReservable(String instanceId, Date startDate, Date endDate)
- Specified by:
getResourcesReservable
in interfaceResourcesManager
-
getResourcesOfReservation
public List<Resource> getResourcesOfReservation(String instanceId, Long reservationId)
- Specified by:
getResourcesOfReservation
in interfaceResourcesManager
-
updateReservation
public void updateReservation(Reservation reservation, List<Long> resourceIds, boolean updateDate)
- Specified by:
updateReservation
in interfaceResourcesManager
-
getReservedResources
public List<Resource> getReservedResources(String instanceId, List<Long> resources, Date startDate, Date endDate)
Get from the given aimed resources those that are unavailable on the given period.- Specified by:
getReservedResources
in interfaceResourcesManager
- Parameters:
instanceId
- the current component instance identifierresources
- the list of resource identifiersstartDate
- the start dateendDate
- the end date- Returns:
- a list of reserved resources
-
getReservedResources
public List<Resource> getReservedResources(String instanceId, List<Long> aimedResourceIds, Date startDate, Date endDate, Long reservationIdToSkip)
Get from the given aimed resources those that are unavailable on the given period. Resources attached to reservationIdToSkip are excluded (but can still be returned if they are attached to another reservation on the given period).- Specified by:
getReservedResources
in interfaceResourcesManager
- Parameters:
instanceId
- the current component instance identifieraimedResourceIds
- the identifiers of the resources to get.startDate
- the start dateendDate
- the end datereservationIdToSkip
- the unique identifier of the reservation to skip.- Returns:
- a list of reserved resources.
-
getReservations
public List<Reservation> getReservations(String instanceId)
- Specified by:
getReservations
in interfaceResourcesManager
-
getUserReservations
public List<Reservation> getUserReservations(String instanceId, String userId)
- Specified by:
getUserReservations
in interfaceResourcesManager
-
getReservation
public Reservation getReservation(String instanceId, Long reservationId)
- Specified by:
getReservation
in interfaceResourcesManager
-
deleteReservation
public void deleteReservation(Long id, String componentId)
- Specified by:
deleteReservation
in interfaceResourcesManager
-
getReservationForValidation
public List<Reservation> getReservationForValidation(String instanceId, String userId, org.silverpeas.core.date.period.Period period)
- Specified by:
getReservationForValidation
in interfaceResourcesManager
-
getReservationOfUser
public List<Reservation> getReservationOfUser(String instanceId, Integer userId, org.silverpeas.core.date.period.Period period)
- Specified by:
getReservationOfUser
in interfaceResourcesManager
-
getReservationWithResourcesOfCategory
public List<Reservation> getReservationWithResourcesOfCategory(String instanceId, Integer userId, org.silverpeas.core.date.period.Period period, Long categoryId)
- Specified by:
getReservationWithResourcesOfCategory
in interfaceResourcesManager
-
getReservationWithResource
public List<Reservation> getReservationWithResource(String instanceId, Integer userId, org.silverpeas.core.date.period.Period period, Long resourceId)
- Specified by:
getReservationWithResource
in interfaceResourcesManager
-
getResourceOfReservationStatus
public String getResourceOfReservationStatus(Long resourceId, Long reservationId)
- Specified by:
getResourceOfReservationStatus
in interfaceResourcesManager
-
indexResourceManager
public void indexResourceManager(String instanceId)
- Specified by:
indexResourceManager
in interfaceResourcesManager
-
getManagers
public List<ResourceValidator> getManagers(long resourceId)
- Specified by:
getManagers
in interfaceResourcesManager
-
saveReservation
public void saveReservation(Reservation reservation, List<Long> resourceIds)
- Specified by:
saveReservation
in interfaceResourcesManager
-
updateReservedResourceStatus
public void updateReservedResourceStatus(long reservationId, long resourceId, String status)
- Specified by:
updateReservedResourceStatus
in interfaceResourcesManager
-
isManager
public boolean isManager(long userId, long resourceId)
- Specified by:
isManager
in interfaceResourcesManager
-
updateResource
public void updateResource(Resource updatedResource, List<Long> managerIds)
- Specified by:
updateResource
in interfaceResourcesManager
-
-