fr.paris.lutece.plugins.appointment.business.calendar
Class AppointmentSlotDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.appointment.business.calendar.AppointmentSlotDAO
All Implemented Interfaces:
IAppointmentSlotDAO

public class AppointmentSlotDAO
extends Object
implements IAppointmentSlotDAO

DAOUtuil for appointment slot


Constructor Summary
AppointmentSlotDAO()
           
 
Method Summary
 void create(AppointmentSlot slot, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Create a new appointment slot
 void delete(int nIdSlot, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove an appointment slot from its id
 void deleteAllByIdForm(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove appointment slots associated with a given form.
 void deleteByIdDay(int nIdDay, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove an appointment slot associated with a given day
 void deleteByIdForm(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove appointment slots associated with a given form.
 void deleteByIdFormAndDayOfWeek(int nIdForm, int nDayOfWeek, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete every slots associated with a given form and a given day of week
 void deleteOldSlots(Date dateMonday, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete every slots that are associated with a day before a given day.
 List<AppointmentSlot> findByIdDay(int nIdDay, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Find every slots associated with a given day
 List<AppointmentSlot> findByIdDayWithFreePlaces(int nIdDay, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of slots associated with a given day, and compute for each slot the number of free places
 List<AppointmentSlot> findByIdForm(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Find every slots associated with a given form and not associated with any day
 List<AppointmentSlot> findByIdFormAndDayOfWeek(int nIdForm, int nDayOfWeek, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of slots associated with a given form for a given day of week.
 List<AppointmentSlot> findByIdFormWithFreePlaces(int nIdForm, int nDayOfWeek, Date dateDay, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of slots associated with a given form for a given day of week.
 AppointmentSlot findByPrimaryKey(int nIdSlot, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Find a slot from its primary key
 AppointmentSlot findByPrimaryKeyWithFreePlaces(int nIdSlot, Date date, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Find a slot from its primary key.
 void setDefaultSlotListSize(int nDefaultSlotListSize)
          Set the default size of slot lists
 void update(AppointmentSlot slot, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update an appointment slot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppointmentSlotDAO

public AppointmentSlotDAO()
Method Detail

create

public void create(AppointmentSlot slot,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Create a new appointment slot

Specified by:
create in interface IAppointmentSlotDAO
Parameters:
slot - The appointment slot to create
plugin - The plugin

update

public void update(AppointmentSlot slot,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update an appointment slot

Specified by:
update in interface IAppointmentSlotDAO
Parameters:
slot - The appointment slot to update
plugin - The plugin

delete

public void delete(int nIdSlot,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove an appointment slot from its id

Specified by:
delete in interface IAppointmentSlotDAO
Parameters:
nIdSlot - The id of the slot to remove
plugin - The plugin

deleteAllByIdForm

public void deleteAllByIdForm(int nIdForm,
                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove appointment slots associated with a given form. Slots that are associated with a day are also removed

Specified by:
deleteAllByIdForm in interface IAppointmentSlotDAO
Parameters:
nIdForm - The id of the form to remove slots from
plugin - The plugin

deleteByIdDay

public void deleteByIdDay(int nIdDay,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove an appointment slot associated with a given day

Specified by:
deleteByIdDay in interface IAppointmentSlotDAO
Parameters:
nIdDay - The id of the day to remove slots from
plugin - The plugin

deleteByIdForm

public void deleteByIdForm(int nIdForm,
                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove appointment slots associated with a given form. Slots that are associated with a day are NOT removed

Specified by:
deleteByIdForm in interface IAppointmentSlotDAO
Parameters:
nIdForm - The id of the form to remove slots from
plugin - The plugin

deleteByIdFormAndDayOfWeek

public void deleteByIdFormAndDayOfWeek(int nIdForm,
                                       int nDayOfWeek,
                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete every slots associated with a given form and a given day of week

Specified by:
deleteByIdFormAndDayOfWeek in interface IAppointmentSlotDAO
Parameters:
nIdForm - The id of the form
nDayOfWeek - The day of the week
plugin - The plugin

deleteOldSlots

public void deleteOldSlots(Date dateMonday,
                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete every slots that are associated with a day before a given day.

Specified by:
deleteOldSlots in interface IAppointmentSlotDAO
Parameters:
dateMonday - The date of the day to remove slots
plugin - The plugin

findByPrimaryKey

public AppointmentSlot findByPrimaryKey(int nIdSlot,
                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find a slot from its primary key

Specified by:
findByPrimaryKey in interface IAppointmentSlotDAO
Parameters:
nIdSlot - the id of the slot to remove
plugin - The plugin
Returns:
The appointment slot

findByPrimaryKeyWithFreePlaces

public AppointmentSlot findByPrimaryKeyWithFreePlaces(int nIdSlot,
                                                      Date date,
                                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find a slot from its primary key. Also load the number of free places for a given date

Specified by:
findByPrimaryKeyWithFreePlaces in interface IAppointmentSlotDAO
Parameters:
nIdSlot - The id of the slot
date - The date of the day to check for places
plugin - The plugin
Returns:
The slot, or null if no slot was found

findByIdForm

public List<AppointmentSlot> findByIdForm(int nIdForm,
                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find every slots associated with a given form and not associated with any day

Specified by:
findByIdForm in interface IAppointmentSlotDAO
Parameters:
nIdForm - the id of the form
plugin - The plugin
Returns:
The list of slots

findByIdFormAndDayOfWeek

public List<AppointmentSlot> findByIdFormAndDayOfWeek(int nIdForm,
                                                      int nDayOfWeek,
                                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of slots associated with a given form for a given day of week.

Specified by:
findByIdFormAndDayOfWeek in interface IAppointmentSlotDAO
Parameters:
nIdForm - the if of the form
nDayOfWeek - The day of the week (1 for Monday, 2 for Tuesday, ...)
plugin - The plugin
Returns:
the list of slots

findByIdDay

public List<AppointmentSlot> findByIdDay(int nIdDay,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find every slots associated with a given day

Specified by:
findByIdDay in interface IAppointmentSlotDAO
Parameters:
nIdDay - the id of the day
plugin - The plugin
Returns:
The list of slots

findByIdDayWithFreePlaces

public List<AppointmentSlot> findByIdDayWithFreePlaces(int nIdDay,
                                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of slots associated with a given day, and compute for each slot the number of free places

Specified by:
findByIdDayWithFreePlaces in interface IAppointmentSlotDAO
Parameters:
nIdDay - The id of the day
plugin - The plugin
Returns:
The list of slots

findByIdFormWithFreePlaces

public List<AppointmentSlot> findByIdFormWithFreePlaces(int nIdForm,
                                                        int nDayOfWeek,
                                                        Date dateDay,
                                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of slots associated with a given form for a given day of week. Also compute the number of free places for each slot

Specified by:
findByIdFormWithFreePlaces in interface IAppointmentSlotDAO
Parameters:
nIdForm - the if of the form
nDayOfWeek - The day of the week (1 for Monday, 2 for Tuesday, ...)
dateDay - The date of the day
plugin - The plugin
Returns:
the list of slots

setDefaultSlotListSize

public void setDefaultSlotListSize(int nDefaultSlotListSize)
Set the default size of slot lists

Parameters:
nDefaultSlotListSize - the default size of slot list


Copyright © 2014 Mairie de Paris. All Rights Reserved.