Class AppointmentServiceImporter

java.lang.Object
fr.paris.lutece.plugins.appointment.modules.importer.service.AppointmentServiceImporter

@ApplicationScoped public class AppointmentServiceImporter extends Object
Creates appointments through the Appointment plugin service.
  • 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 calling importAppointment(int, String, Map, Map, AppointmentFormEntries, List).
      Parameters:
      nFormId - the form identifier
      dtStarting - start of the slot interval
      dtEnding - 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 identifier
      strAdminAccessCode - the access code of the administrator who uploaded the file
      mapGenericAttributes - the values of the standard columns
      mapFormFields - the values of the other columns
      formEntries - the fields of the form
      listSlots - the slots prepared by prepareSlots(int, LocalDateTime, LocalDateTime)
      Returns:
      created appointment identifier