Class AppointmentSlotUtil


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static AppointmentDataObject buildAppointmentDataObject​(AppointmentDataObject apptData, java.util.List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listSlots, java.time.LocalDateTime localTime, AppointmentForm appointmentForm)  
      static java.lang.String buildQuery​(int idForm)
      build query for delete a document into elastic-search
      static java.lang.String buildQueryDateRange​(int idForm, long startingDate, long endingDate)
      build query for delete a document into elastic-search
      static java.lang.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, java.util.List<fr.paris.lutece.plugins.appointment.business.slot.Slot> allSlots)  
      static java.util.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 java.util.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 java.util.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 java.lang.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​(java.util.List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listAvailableSlots, java.time.LocalDateTime localTime, java.time.LocalDateTime startAppointment)
      Get the state of appointment
      • Methods inherited from class java.lang.Object

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

      • SLOT__ID_DATE_FORMATTER

        public static final java.time.format.DateTimeFormatter SLOT__ID_DATE_FORMATTER
      • INSTANCE_NAME

        public static final java.lang.String INSTANCE_NAME
    • Method Detail

      • getSlotUid

        public static java.lang.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 java.util.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 java.util.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 java.util.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 java.lang.String buildQuery​(int idForm)
        build query for delete a document into elastic-search
        Parameters:
        idForm - the Id form
        Returns:
        delete query
      • buildQueryDateRange

        public static java.lang.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 java.lang.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,
                                                                       java.util.List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listSlots,
                                                                       java.time.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​(java.util.List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listAvailableSlots,
                                                    java.time.LocalDateTime localTime,
                                                    java.time.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,
                                                    java.util.List<fr.paris.lutece.plugins.appointment.business.slot.Slot> allSlots)