public final class AppointmentUtilities extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_DEFAULT_EXPIRED_TIME_EDIT_APPOINTMENT |
static String |
SESSION_TIMER_SLOT |
static int |
THIRTY_MINUTES |
Modifier and Type | Method and Description |
---|---|
static void |
buildExcelFileWithAppointments(String strIdForm,
javax.servlet.http.HttpServletResponse response,
Locale locale,
List<AppointmentDTO> listAppointmentsDTO,
fr.paris.lutece.plugins.workflowcore.service.state.StateService stateService)
Build the excel fil of the list of the appointments found in the manage appointment viw by filter
|
static List<ResponseRecapDTO> |
buildListResponse(AppointmentDTO appointment,
javax.servlet.http.HttpServletRequest request,
Locale locale)
Build a list of response of the appointment
|
static int |
checkAndReturnNbBookedSeats(String strNbBookedSeats,
AppointmentFormDTO form,
AppointmentDTO appointmentDTO,
Locale locale,
List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> listFormErrors)
Check and validate all the rules for the number of booked seats asked
|
static void |
checkDateOfTheAppointmentIsNotBeforeNow(AppointmentDTO appointmentDTO,
Locale locale,
List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> listFormErrors)
Check that the date of the appointment we try to take is not in the past
|
static void |
checkEmail(String strEmail,
String strConfirmEmail,
AppointmentFormDTO form,
Locale locale,
List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> listFormErrors)
Check that the email is correct and matches the confirm email
|
static boolean |
checkNbDaysBetweenTwoAppointments(AppointmentDTO appointmentDTO,
String strFirstName,
String strLastName,
String strEmail,
AppointmentFormDTO form)
Check that the delay between two appointments for the same use has been respected
|
static boolean |
checkNbDaysBetweenTwoAppointmentsTaken(AppointmentDTO appointmentDTO,
String strEmail,
AppointmentFormDTO form)
Check that the delay between two appointments for the same use has been respected
|
static boolean |
checkNbMaxAppointmentsOnAGivenPeriod(AppointmentDTO appointmentDTO,
String strEmail,
AppointmentFormDTO form)
Check that the number of appointments on a defined period is not above the maximum authorized
|
static boolean |
checkNoAppointmentsImpacted(List<Appointment> listAppointment,
int nIdForm,
LocalDate dateOfModification,
AppointmentFormDTO appointmentForm)
Check if there are appointments impacted by the new week definition
|
static boolean |
checkNoValidatedAppointmentsOnThisSlot(Slot slot)
Check that there is no validated appointments on a slot
|
static void |
fillAppointmentDTO(AppointmentDTO appointmentDTO,
int nbBookedSeats,
String strEmail,
String strFirstName,
String strLastName)
Fill the appoinmentFront DTO with the given parameters
|
static void |
fillInListResponseWithMapResponse(AppointmentDTO appointmentDTO) |
static List<Slot> |
findSlotsImpactedByThisTimeSlot(TimeSlot timeSlot,
int nIdForm,
int nIdWeekDefinition,
boolean bShiftSlot)
Return the slots impacted by the modification of this time slot
|
static LocalTime |
getMaxTimeToDisplay(LocalTime maxEndingTime)
Return the max ending time to display
|
static LocalTime |
getMinTimeToDisplay(LocalTime minStartingTime)
Return the min starting time to display
|
static String[][] |
getPermissions(List<AppointmentFormDTO> listForms,
fr.paris.lutece.portal.business.user.AdminUser user)
Get Form Permissions
|
static void |
killTimer(javax.servlet.http.HttpServletRequest request)
Kill the lock timer on a slot
|
static Timer |
putTimerInSession(javax.servlet.http.HttpServletRequest request,
int nIdSlot,
AppointmentDTO appointmentDTO,
int maxPeoplePerAppointment)
Create a timer on a slot
|
static void |
validateFormAndEntries(AppointmentDTO appointmentDTO,
javax.servlet.http.HttpServletRequest request,
List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> listFormErrors)
Validate the form and the additional entries of the form
|
public static final String SESSION_TIMER_SLOT
public static final String PROPERTY_DEFAULT_EXPIRED_TIME_EDIT_APPOINTMENT
public static final int THIRTY_MINUTES
public static void checkEmail(String strEmail, String strConfirmEmail, AppointmentFormDTO form, Locale locale, List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> listFormErrors)
strEmail
- the emailstrConfirmEmail
- the confirm emailform
- the formlocale
- the locallistFormErrors
- the list of errors that can be fill in with the errors found for the emailpublic static void checkDateOfTheAppointmentIsNotBeforeNow(AppointmentDTO appointmentDTO, Locale locale, List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> listFormErrors)
appointmentDTO
- the appointmentlocale
- the locallistFormErrors
- the list of errors that can be fill in with the error found with the datepublic static boolean checkNbDaysBetweenTwoAppointments(AppointmentDTO appointmentDTO, String strFirstName, String strLastName, String strEmail, AppointmentFormDTO form)
appointmentDTO
- the appointmentstrEmail
- the emailform
- the formpublic static boolean checkNbDaysBetweenTwoAppointmentsTaken(AppointmentDTO appointmentDTO, String strEmail, AppointmentFormDTO form)
appointmentDTO
- the appointmentstrEmail
- the emailform
- the formpublic static boolean checkNbMaxAppointmentsOnAGivenPeriod(AppointmentDTO appointmentDTO, String strEmail, AppointmentFormDTO form)
appointmentDTO
- the appointmentstrEmail
- the email of the userform
- the formpublic static int checkAndReturnNbBookedSeats(String strNbBookedSeats, AppointmentFormDTO form, AppointmentDTO appointmentDTO, Locale locale, List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> listFormErrors)
strNbBookedSeats
- the number of booked seatsform
- the formnbRemainingPlaces
- the number of remaining places on the slot askedlocale
- the localelistFormErrors
- the list of errors that can be fill in with the errors found for the number of booked seatspublic static void fillAppointmentDTO(AppointmentDTO appointmentDTO, int nbBookedSeats, String strEmail, String strFirstName, String strLastName)
appointmentDTO
- the appointmentFront DTOnbBookedSeats
- the number of booked seatsstrEmail
- the email of the userstrFirstName
- the first name of the userstrLastName
- the last name of the userpublic static void validateFormAndEntries(AppointmentDTO appointmentDTO, javax.servlet.http.HttpServletRequest request, List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> listFormErrors)
appointmentDTO
- the appointmentFron DTo to validaterequest
- the requestlistFormErrors
- the list of errors that can be fill with the errors found at the validationpublic static void fillInListResponseWithMapResponse(AppointmentDTO appointmentDTO)
public static List<ResponseRecapDTO> buildListResponse(AppointmentDTO appointment, javax.servlet.http.HttpServletRequest request, Locale locale)
appointment
- the appointmentrequest
- the requestlocale
- the localpublic static void buildExcelFileWithAppointments(String strIdForm, javax.servlet.http.HttpServletResponse response, Locale locale, List<AppointmentDTO> listAppointmentsDTO, fr.paris.lutece.plugins.workflowcore.service.state.StateService stateService)
strIdForm
- the form idresponse
- the responselocale
- the locallistAppointmentsDTO
- the list of the appointments to input in the excel filestateService
- the state servicepublic static void killTimer(javax.servlet.http.HttpServletRequest request)
request
- the requestpublic static Timer putTimerInSession(javax.servlet.http.HttpServletRequest request, int nIdSlot, AppointmentDTO appointmentDTO, int maxPeoplePerAppointment)
slot
- the slotappointmentDTO
- the appointmentmaxPeoplePerAppointment
- the max people per appointmentpublic static String[][] getPermissions(List<AppointmentFormDTO> listForms, fr.paris.lutece.portal.business.user.AdminUser user)
listForms
- request
- public static LocalTime getMinTimeToDisplay(LocalTime minStartingTime)
minStartingTime
- the min starting timepublic static LocalTime getMaxTimeToDisplay(LocalTime maxEndingTime)
maxEndingTime
- the max ending timepublic static boolean checkNoAppointmentsImpacted(List<Appointment> listAppointment, int nIdForm, LocalDate dateOfModification, AppointmentFormDTO appointmentForm)
listAppointment
- the list of appointmentsnIdForm
- the form IddateOfModification
- the date of modification (date of apply of the new week definition)appointmentForm
- the appointment formpublic static boolean checkNoValidatedAppointmentsOnThisSlot(Slot slot)
slot
- the slotpublic static List<Slot> findSlotsImpactedByThisTimeSlot(TimeSlot timeSlot, int nIdForm, int nIdWeekDefinition, boolean bShiftSlot)
timeSlot
- the time slotnIdForm
- the form idnIdWeekDefinition
- the week definition idbShiftSlot
- the boolean value for the shiftCopyright © 2020 City of Paris. All rights reserved.