fr.paris.lutece.plugins.appointment.service
Class AppointmentSlotService

java.lang.Object
  extended by fr.paris.lutece.plugins.appointment.service.AppointmentSlotService

public class AppointmentSlotService
extends Object

Service to manage appointment forms


Constructor Summary
AppointmentSlotService()
           
 
Method Summary
 boolean checkForDayModification(AppointmentDay day, AppointmentDay dayFromDb, AppointmentForm form)
          Check if a day has changed its appointment duration or has been enabled or disabled, and update slots to be compliant with new parameters of the day.
 boolean checkForFormModification(AppointmentForm appointmentForm, AppointmentForm formFromDb)
          Check if a form has changed its appointment duration or has enabled or disabled a day of the week, and update slots to be compliant with new parameters of the form.
 void computeAndCreateSlotsForDay(AppointmentDay day, AppointmentForm form)
          Compute slots for a given day, and create them
 void computeAndCreateSlotsForForm(AppointmentForm appointmentForm)
          Compute slots for a given day, and create them
static AppointmentSlotService getInstance()
          Get the instance of the service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppointmentSlotService

public AppointmentSlotService()
Method Detail

getInstance

public static AppointmentSlotService getInstance()
Get the instance of the service

Returns:
The instance of the service

computeAndCreateSlotsForDay

public void computeAndCreateSlotsForDay(AppointmentDay day,
                                        AppointmentForm form)
Compute slots for a given day, and create them

Parameters:
day - The day to create slots of. The day must have been inserted in the database.
form - The form associated with the day.

computeAndCreateSlotsForForm

public void computeAndCreateSlotsForForm(AppointmentForm appointmentForm)
Compute slots for a given day, and create them

Parameters:
appointmentForm - The form to create slots of. The form must have been inserted in the database.

checkForDayModification

public boolean checkForDayModification(AppointmentDay day,
                                       AppointmentDay dayFromDb,
                                       AppointmentForm form)
Check if a day has changed its appointment duration or has been enabled or disabled, and update slots to be compliant with new parameters of the day.

Parameters:
day - The day with new values of attributes. New values should be saved in the database before this method is called.
dayFromDb - The day with old values of attributes.
form - The form associated with the day.
Returns:
True if some slots was modified, false otherwise

checkForFormModification

public boolean checkForFormModification(AppointmentForm appointmentForm,
                                        AppointmentForm formFromDb)
Check if a form has changed its appointment duration or has enabled or disabled a day of the week, and update slots to be compliant with new parameters of the form.

Parameters:
appointmentForm - The form with new values of attributes. New values should be saved in the database before this method is called.
formFromDb - The form with old values of attributes.
Returns:
True if some slots was modified, false otherwise


Copyright © 2014 Mairie de Paris. All Rights Reserved.