Class AppointmentSlotUtil
- java.lang.Object
-
- fr.paris.lutece.plugins.elasticdata.modules.appointment.service.AppointmentSlotUtil
-
public final class AppointmentSlotUtil extends java.lang.ObjectUtils for the slots (Uid, Url, Item ...)- Author:
- Laurent Payen
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringINSTANCE_NAMEstatic java.lang.StringPROPERTY_SITEstatic java.time.format.DateTimeFormatterSLOT__ID_DATE_FORMATTER
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AppointmentDataObjectbuildAppointmentDataObject(AppointmentDataObject apptData, java.util.List<fr.paris.lutece.plugins.appointment.business.slot.Slot> listSlots, java.time.LocalDateTime localTime, AppointmentForm appointmentForm)static java.lang.StringbuildQuery(int idForm)build query for delete a document into elastic-searchstatic java.lang.StringbuildQueryDateRange(int idForm, long startingDate, long endingDate)build query for delete a document into elastic-searchstatic java.lang.StringbuildQueryIdResource(int idResource)build query for delete a document into elastic-searchstatic intcalculateConsecutiveSlots(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 RDVstatic 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 RDVstatic 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 RDVstatic java.lang.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(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
-
-
-
Field Detail
-
PROPERTY_SITE
public static final java.lang.String PROPERTY_SITE
- See Also:
- Constant Field Values
-
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 appointmentidWorkflow- 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 AppointmentDataObjectlistSlots- The list slotslocalTime- The localTimeappointmentForm- 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 slotsidWorkflow- 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)
-
-