Class AppointmentSlotUtil
java.lang.Object
fr.paris.lutece.plugins.elasticdata.modules.appointment.service.AppointmentSlotUtil
Utils for the slots (Uid, Url, Item ...)
- Author:
- Laurent Payen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final DateTimeFormatter -
Method Summary
Modifier and TypeMethodDescriptionstatic AppointmentDataObjectbuildAppointmentDataObject(AppointmentDataObject apptData, List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listSlots, LocalDateTime localTime, AppointmentForm appointmentForm) static StringbuildQuery(int idForm) Build the delete-by-query body matching every document of a form.static StringbuildQueryDateRange(int idForm, long startingDate, long endingDate) Build the delete-by-query body matching the documents of a form whose timestamp lies in a range.static StringbuildQueryIdResource(int idResource) Build the delete-by-query body matching the history documents of an appointment of this site.static intcalculateConsecutiveSlots(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 RDVstatic 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 RDVstatic 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 RDVstatic StringgetSlotUid(fr.paris.lutece.plugins.appointment.business.slot.Slot slot) Generate a unique ID for solr.static fr.paris.lutece.plugins.workflowcore.business.state.StategetState(int idAppointment, int idWorkflow) Get the state of appointmentstatic longgetTimeUntilAvailability(List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listAvailableSlots, LocalDateTime localTime, LocalDateTime startAppointment) Get the state of appointment
-
Field Details
-
PROPERTY_SITE
- See Also:
-
SLOT__ID_DATE_FORMATTER
-
INSTANCE_NAME
-
-
Method Details
-
getSlotUid
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 appointmentidWorkflow- The if form- Returns:
- State of appointment
-
buildQuery
Build the delete-by-query body matching every document of a form.- Parameters:
idForm- the Id form- Returns:
- delete query
-
buildQueryDateRange
Build the delete-by-query body matching the documents of a form whose timestamp lies in a range.- Parameters:
idForm- the Id formstartingDate- the start of the range, epoch millisecondsendingDate- the end of the range, epoch milliseconds- Returns:
- delete query
-
buildQueryIdResource
Build the delete-by-query body matching the history documents of an appointment of this site.- Parameters:
idResource- the Id resource- 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 AppointmentDataObjectlistSlots- The list slotslocalTime- The localTimeappointmentForm- 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 slotslocalTime- The local timestartAppointment- The start appointment- 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)
-