java.lang.Object
fr.paris.lutece.plugins.elasticdata.modules.appointment.service.AppointmentSlotUtil

public final class AppointmentSlotUtil extends Object
Utils for the slots (Uid, Url, Item ...)
Author:
Laurent Payen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final DateTimeFormatter
     
  • Method Summary

    Modifier and Type
    Method
    Description
    buildAppointmentDataObject(AppointmentDataObject apptData, List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listSlots, LocalDateTime localTime, AppointmentForm appointmentForm)
     
    static String
    buildQuery(int idForm)
    build query for delete a document into elastic-search
    static String
    buildQueryDateRange(int idForm, long startingDate, long endingDate)
    build query for delete a document into elastic-search
    static String
    buildQueryIdResource(int idResource)
    build query for delete a document into elastic-search
    static int
    calculateConsecutiveSlots(fr.paris.lutece.plugins.appointment.business.slot.Slot slot, List<fr.paris.lutece.plugins.appointment.business.slot.Slot> allSlots)
     
    static List<fr.paris.lutece.plugins.appointment.business.slot.Slot>
    getAllSlots(fr.paris.lutece.plugins.appointment.web.dto.AppointmentFormDTO appointmentForm)
    Get all the slots of a form by calling the method buildListSlot of the plugin RDV
    static List<fr.paris.lutece.plugins.appointment.business.slot.Slot>
    getAllSlots(fr.paris.lutece.plugins.appointment.web.dto.AppointmentFormDTO appointmentForm, int nNbPlacesToTake)
    Get all the slots of a form by calling the method buildListSlot of the plugin RDV
    static List<fr.paris.lutece.plugins.appointment.business.slot.Slot>
    getAllSlotsToFullIndexing(fr.paris.lutece.plugins.appointment.web.dto.AppointmentFormDTO appointmentForm)
    Get all the slots of a form by calling the method buildListSlot of the plugin RDV
    static String
    getSlotUid(fr.paris.lutece.plugins.appointment.business.slot.Slot slot)
    Generate a unique ID for solr.
    static fr.paris.lutece.plugins.workflowcore.business.state.State
    getState(int idAppointment, int idWorkflow)
    Get the state of appointment
    static long
    getTimeUntilAvailability(List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listAvailableSlots, LocalDateTime localTime, LocalDateTime startAppointment)
    Get the state of appointment

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • getSlotUid

      public static String getSlotUid(fr.paris.lutece.plugins.appointment.business.slot.Slot slot)
      Generate a unique ID for solr. Slots don't have ids anymore, so we use the form_id and the slot date as an ID. We try to make a "readable" id with the form id and the slot datetime, using only alphanumerical caracters to avoid potential problems with code parsing this ID.
    • getAllSlots

      public static List<fr.paris.lutece.plugins.appointment.business.slot.Slot> getAllSlots(fr.paris.lutece.plugins.appointment.web.dto.AppointmentFormDTO appointmentForm, int nNbPlacesToTake)
      Get all the slots of a form by calling the method buildListSlot of the plugin RDV
      Parameters:
      appointmentForm - the appointment form
      Returns:
      all the slots of a form
    • getAllSlots

      public static List<fr.paris.lutece.plugins.appointment.business.slot.Slot> getAllSlots(fr.paris.lutece.plugins.appointment.web.dto.AppointmentFormDTO appointmentForm)
      Get all the slots of a form by calling the method buildListSlot of the plugin RDV
      Parameters:
      appointmentForm - the appointment form
      Returns:
      all the slots of a form
    • getAllSlotsToFullIndexing

      public static List<fr.paris.lutece.plugins.appointment.business.slot.Slot> getAllSlotsToFullIndexing(fr.paris.lutece.plugins.appointment.web.dto.AppointmentFormDTO appointmentForm)
      Get all the slots of a form by calling the method buildListSlot of the plugin RDV
      Parameters:
      appointmentForm - the appointment form
      Returns:
      all the slots of a form
    • getState

      public static fr.paris.lutece.plugins.workflowcore.business.state.State getState(int idAppointment, int idWorkflow)
      Get the state of appointment
      Parameters:
      idAppointment - The id appointment
      idWorkflow - The if form
      Returns:
      State of appointment
    • buildQuery

      public static String buildQuery(int idForm)
      build query for delete a document into elastic-search
      Parameters:
      idForm - the Id form
      Returns:
      delete query
    • buildQueryDateRange

      public static String buildQueryDateRange(int idForm, long startingDate, long endingDate)
      build query for delete a document into elastic-search
      Parameters:
      idForm - the Id form
      Returns:
      delete query
    • buildQueryIdResource

      public static String buildQueryIdResource(int idResource)
      build query for delete a document into elastic-search
      Parameters:
      idForm - the Id form
      Returns:
      delete query
    • buildAppointmentDataObject

      public static AppointmentDataObject buildAppointmentDataObject(AppointmentDataObject apptData, List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listSlots, LocalDateTime localTime, AppointmentForm appointmentForm)
      Parameters:
      apptData - the AppointmentDataObject
      listSlots - The list slots
      localTime - The localTime
      appointmentForm - The appointment form
      Returns:
      AppointmentDataObject builded
    • getTimeUntilAvailability

      public static long getTimeUntilAvailability(List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listAvailableSlots, LocalDateTime localTime, LocalDateTime startAppointment)
      Get the state of appointment
      Parameters:
      listAvailableSlots - The list of available slots
      idWorkflow - The if form
      Returns:
      State of appointment
    • calculateConsecutiveSlots

      public static int calculateConsecutiveSlots(fr.paris.lutece.plugins.appointment.business.slot.Slot slot, List<fr.paris.lutece.plugins.appointment.business.slot.Slot> allSlots)