Class DateRegistrationPropagationActionServiceImpl
java.lang.Object
ch.tocco.nice2.optional.reservation.impl.actions.DateRegistrationPropagationActionServiceImpl
- All Implemented Interfaces:
DateRegistrationPropagationActionService
public class DateRegistrationPropagationActionServiceImpl
extends Object
implements DateRegistrationPropagationActionService
-
Constructor Summary
ConstructorDescriptionDateRegistrationPropagationActionServiceImpl
(Context context, TextResources textResources, QueryBuilderFactory queryBuilderFactory, DefaultDisplayService defaultDisplayService, EntityExplorerActionSelectionService entityExplorerActionSelectionService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkEvent
(EntityExplorerActionSelection selection) if the selected Event has no related Reservations or Registrations or the Registration_propagation_status is "manually" anTextInformationException
is thrownload
(EntityExplorerActionSelection selection, String excludedRegistrations) loads the related Registrations into aMap<String, String>
with the PrimaryKey as key and the label ({DefaultDisplay of User} / {earliest Reservation_registration} - {latest Reservation_registration ({number of Reservation_registrations})) as the valuevoid
save
(org.joda.time.LocalDate from, @Nullable org.joda.time.LocalDate to, @Nullable Integer amount, String[] registrations, EntityExplorerActionSelection selection) creates for each selected Registration Reservation_registration Entities starting on the from date and continue to the to-date if it is set.
-
Constructor Details
-
DateRegistrationPropagationActionServiceImpl
public DateRegistrationPropagationActionServiceImpl(Context context, TextResources textResources, QueryBuilderFactory queryBuilderFactory, DefaultDisplayService defaultDisplayService, EntityExplorerActionSelectionService entityExplorerActionSelectionService)
-
-
Method Details
-
checkEvent
Description copied from interface:DateRegistrationPropagationActionService
if the selected Event has no related Reservations or Registrations or the Registration_propagation_status is "manually" anTextInformationException
is thrown- Specified by:
checkEvent
in interfaceDateRegistrationPropagationActionService
- Parameters:
selection
- the selected Event Entity
-
load
public List<Map<String,String>> load(EntityExplorerActionSelection selection, String excludedRegistrations) throws PersistException, RpcExecutionException Description copied from interface:DateRegistrationPropagationActionService
loads the related Registrations into aMap<String, String>
with the PrimaryKey as key and the label ({DefaultDisplay of User} / {earliest Reservation_registration} - {latest Reservation_registration ({number of Reservation_registrations})) as the value- Specified by:
load
in interfaceDateRegistrationPropagationActionService
- Parameters:
selection
- the selected Event Entity- Returns:
- a List of the related Registrations
- Throws:
PersistException
RpcExecutionException
-
save
public void save(org.joda.time.LocalDate from, @Nullable @Nullable org.joda.time.LocalDate to, @Nullable @Nullable Integer amount, String[] registrations, EntityExplorerActionSelection selection) Description copied from interface:DateRegistrationPropagationActionService
creates for each selected Registration Reservation_registration Entities starting on the from date and continue to the to-date if it is set. If the amount field is set, it creates this amount of Reservation_registrations for each Registration- Specified by:
save
in interfaceDateRegistrationPropagationActionService
- Parameters:
from
- the date of the earliest Reservationto
- the date of the last Reservationamount
- the amount of Reservation_registration to create from the startregistrations
- the selected Registration keysselection
- the selected Event Entity
-