Class AppointmentService
- java.lang.Object
-
- fr.paris.lutece.plugins.appointment.service.AppointmentService
-
public final class AppointmentService extends java.lang.ObjectService class for an appointment- Author:
- Laurent Payen
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddAppointmentResponses(AppointmentDTO appointmentDto)Fill the appointment data transfer object with complementary appointment responsesstatic AppointmentDTObuildAppointmentDTOFromIdAppointment(int nIdAppointment)Build an appointment DTO from the id of an appointment business objectstatic AppointmentDTObuildAppointmentDTOFromRefAppointment(java.lang.String refAppointment)Build an appointment DTO from the reference of an appointment business objectstatic voidbuildListAppointmentSlot(AppointmentDTO appointmentDTO)static voiddeleteAppointment(int nIdAppointment)Delete an appointment (and update the number of remaining places of the related slot)static AppointmentfindAppointmentById(int nIdAppointment)Find an appointment by its primary keystatic java.util.List<AppointmentDTO>findAppointmentByMailAndCategory(int nIdCategory, java.lang.String mail)Find a list of appointments by id category and mailstatic AppointmentfindAppointmentByReference(java.lang.String strReference)Find an appointment by its referencestatic java.util.List<Appointment>findListAppointmentByIdForm(int nIdForm)Find the appointments by formstatic java.util.List<Appointment>findListAppointmentByListSlot(java.util.List<Slot> listSlot)Find all the appointments of the slots given in parameterstatic java.util.List<Appointment>findListAppointmentBySlot(int nIdSlot)Find the appointments of a slotstatic java.util.List<Appointment>findListAppointmentByUserGuid(java.lang.String strGuidUser)Find the appointments of a user by guidstatic java.util.List<Appointment>findListAppointmentByUserId(int nIdUser)Find the appointments of a userstatic java.util.List<Appointment>findListAppointmentsByFilter(AppointmentFilterDTO appointmentFilter)Find a list of appointments matching the filterstatic java.util.List<AppointmentDTO>findListAppointmentsDTOByFilter(AppointmentFilterDTO appointmentFilter)Find a list of appointments matching the filterstatic java.util.List<java.lang.Integer>findListAppointmentsIdsByFilter(AppointmentFilterDTO appointmentFilter)Find a list of appointments ids matching the filterstatic intsaveAppointment(AppointmentDTO appointmentDTO)Save an appointment in databasestatic intsaveAppointment(AppointmentDTO appointmentDTO, javax.servlet.http.HttpServletRequest request)Save an appointment in databasestatic voidupdateAppointment(Appointment appointment)Update an appointment in databasestatic voidupdateAppointmentDTO(int nIdappointment, User user, java.util.List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponse, boolean deleteBoOnly)Update an appointment DTO in database
-
-
-
Method Detail
-
findListAppointmentByListSlot
public static java.util.List<Appointment> findListAppointmentByListSlot(java.util.List<Slot> listSlot)
Find all the appointments of the slots given in parameter- Parameters:
listSlot- the list of slots- Returns:
- a list of the appointments on these slots
-
findListAppointmentBySlot
public static java.util.List<Appointment> findListAppointmentBySlot(int nIdSlot)
Find the appointments of a slot- Parameters:
nIdSlot- the slot Id- Returns:
- the appointments of the slot
-
findListAppointmentByUserId
public static java.util.List<Appointment> findListAppointmentByUserId(int nIdUser)
Find the appointments of a user- Parameters:
nIdUser- the user Id- Returns:
- the appointment of the user
-
findListAppointmentByUserGuid
public static java.util.List<Appointment> findListAppointmentByUserGuid(java.lang.String strGuidUser)
Find the appointments of a user by guid- Parameters:
nIdUser- the user guid- Returns:
- the appointment of the guid
-
findListAppointmentByIdForm
public static java.util.List<Appointment> findListAppointmentByIdForm(int nIdForm)
Find the appointments by form- Parameters:
nIdForm- the form Id- Returns:
- the appointments that matches the criteria
-
findAppointmentById
public static Appointment findAppointmentById(int nIdAppointment)
Find an appointment by its primary key- Parameters:
nIdAppointment- the appointment Id- Returns:
- the appointment
-
findAppointmentByReference
public static Appointment findAppointmentByReference(java.lang.String strReference)
Find an appointment by its reference- Parameters:
strReference- the appointment Reference- Returns:
- the appointment
-
findListAppointmentsDTOByFilter
public static java.util.List<AppointmentDTO> findListAppointmentsDTOByFilter(AppointmentFilterDTO appointmentFilter)
Find a list of appointments matching the filter- Parameters:
appointmentFilter- the filter- Returns:
- a list of appointments
-
findAppointmentByMailAndCategory
public static java.util.List<AppointmentDTO> findAppointmentByMailAndCategory(int nIdCategory, java.lang.String mail)
Find a list of appointments by id category and mail- Parameters:
nIdCategory- the id categorymail- the mail- Returns:
- list of appointments
-
findListAppointmentsByFilter
public static java.util.List<Appointment> findListAppointmentsByFilter(AppointmentFilterDTO appointmentFilter)
Find a list of appointments matching the filter- Parameters:
appointmentFilter-- Returns:
- a list of appointments
-
findListAppointmentsIdsByFilter
public static java.util.List<java.lang.Integer> findListAppointmentsIdsByFilter(AppointmentFilterDTO appointmentFilter)
Find a list of appointments ids matching the filter- Parameters:
appointmentFilter- the filter- Returns:
- a list of appointments
-
addAppointmentResponses
public static void addAppointmentResponses(AppointmentDTO appointmentDto)
Fill the appointment data transfer object with complementary appointment responses- Parameters:
appointmentDto- The appointmentDTO object
-
deleteAppointment
public static void deleteAppointment(int nIdAppointment)
Delete an appointment (and update the number of remaining places of the related slot)- Parameters:
nIdAppointment- the id of the appointment to delete- Throws:
java.lang.Exception- the exception
-
buildAppointmentDTOFromIdAppointment
public static AppointmentDTO buildAppointmentDTOFromIdAppointment(int nIdAppointment)
Build an appointment DTO from the id of an appointment business object- Parameters:
nIdAppointment- the id of the appointment- Returns:
- the appointment DTO
-
buildAppointmentDTOFromRefAppointment
public static AppointmentDTO buildAppointmentDTOFromRefAppointment(java.lang.String refAppointment)
Build an appointment DTO from the reference of an appointment business object- Parameters:
refAppointment- the reference of the appointment- Returns:
- the appointment DTO, or null if the appointment wasn't found
-
updateAppointmentDTO
public static void updateAppointmentDTO(int nIdappointment, User user, java.util.List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponse, boolean deleteBoOnly)Update an appointment DTO in database- Parameters:
nIdappointment- the id appointmentuser- the userlistResponse- the listResponsedeleteBoOnly- if the action is Bo only
-
updateAppointment
public static void updateAppointment(Appointment appointment)
Update an appointment in database- Parameters:
appointment- the appointment to update
-
saveAppointment
public static int saveAppointment(AppointmentDTO appointmentDTO)
Save an appointment in database- Parameters:
appointmentDTO- the appointment dto- Returns:
- the id of the appointment saved
- Throws:
java.lang.Exception
-
saveAppointment
public static int saveAppointment(AppointmentDTO appointmentDTO, javax.servlet.http.HttpServletRequest request)
Save an appointment in database- Parameters:
appointmentDTO- the appointment dto- Returns:
- the id of the appointment saved
- Throws:
java.lang.Exception
-
buildListAppointmentSlot
public static void buildListAppointmentSlot(AppointmentDTO appointmentDTO)
-
-