Class AppointmentServiceImporter
java.lang.Object
fr.paris.lutece.plugins.appointment.modules.importer.service.AppointmentServiceImporter
Creates appointments through the Appointment plugin service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintimportAppointment(int nFormId, String strAdminAccessCode, Map<String, String> mapGenericAttributes, Map<String, String> mapFormFields, fr.paris.lutece.plugins.appointment.modules.importer.service.AppointmentFormEntries formEntries, List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listSlots) Creates an appointment from the values of a row and a pre-prepared list of slots.List<fr.paris.lutece.plugins.appointment.business.slot.Slot>prepareSlots(int nFormId, LocalDateTime dtStarting, LocalDateTime dtEnding) Validates the form and prepares (creates if needed) the slots for the given interval.
-
Constructor Details
-
AppointmentServiceImporter
public AppointmentServiceImporter()
-
-
Method Details
-
prepareSlots
public List<fr.paris.lutece.plugins.appointment.business.slot.Slot> prepareSlots(int nFormId, LocalDateTime dtStarting, LocalDateTime dtEnding) Validates the form and prepares (creates if needed) the slots for the given interval. Must be called once per batch before callingimportAppointment(int, String, Map, Map, AppointmentFormEntries, List).- Parameters:
nFormId- the form identifierdtStarting- start of the slot intervaldtEnding- end of the slot interval- Returns:
- the list of persisted slots covering the interval
- Throws:
fr.paris.lutece.plugins.appointment.modules.importer.service.AppointmentImportException- if the form is inactive or the slots are unavailable
-
importAppointment
public int importAppointment(int nFormId, String strAdminAccessCode, Map<String, String> mapGenericAttributes, Map<String, String> mapFormFields, fr.paris.lutece.plugins.appointment.modules.importer.service.AppointmentFormEntries formEntries, List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listSlots) Creates an appointment from the values of a row and a pre-prepared list of slots. The appointment plugin saves it in its own transaction, under a lock on each slot: this method must not open another one around it, otherwise the lock would be released before the data is committed.- Parameters:
nFormId- the form identifierstrAdminAccessCode- the access code of the administrator who uploaded the filemapGenericAttributes- the values of the standard columnsmapFormFields- the values of the other columnsformEntries- the fields of the formlistSlots- the slots prepared byprepareSlots(int, LocalDateTime, LocalDateTime)- Returns:
- created appointment identifier
-