Class FormService
java.lang.Object
fr.paris.lutece.plugins.appointment.service.FormService
Service class for a form
- Author:
- Laurent Payen
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<AppointmentFormDTO>Build all the active forms of the databasestatic List<AppointmentFormDTO>Build all the active formsstatic List<AppointmentFormDTO>Build all the appointForm DTO of the database light because the appointFormDTO is only fill in with the form id, the title and if the form is active or notstatic AppointmentFormDTObuildAppointmentForm(int nIdForm, int nIdReservationRule) Build an appointmentForm DTOstatic AppointmentFormDTObuildAppointmentForm(int nIdForm, ReservationRule reservationRule) Build an appointmentForm DTOstatic AppointmentFormDTObuildAppointmentFormLight(int nIdForm) Build an appointmentForm lightstatic AppointmentFormDTOBuild an appointmentFormDTO lightstatic AppointmentFormDTObuildAppointmentFormWithoutReservationRule(int nIdForm) Build an appointmentForm DTOstatic intMake a copy of form, with all its valuesstatic intcreateAppointmentForm(AppointmentFormDTO appointmentForm) Create a form from an appointmentForm DTOstatic voidfillAppointmentFormWithReservationRulePart(AppointmentFormDTO appointmentForm, ReservationRule reservationRule) Fill the appointmentForm DTO with the Reservation Rulestatic FormfillInFormWithAppointmentForm(Form form, AppointmentFormDTO appointmentForm) Fill the form object with the values of the appointmentForm DTOFind all the active forms that have to be displayed on portlet in databaseFind all the active forms in databaseFind all the forms in the databasestatic fr.paris.lutece.util.ReferenceListBuild a list of all the forms (id, title)static FormfindFormLightByPrimaryKey(int nIdForm) find a form by its primary keyfindFormsByTitle(String strTitle) Find forms by the titlestatic voidremoveForm(int nIdForm) Remove a Form from the databasestatic FormSave a form in databasestatic FormupdateForm(Form form) Update a formstatic FormupdateForm(AppointmentFormDTO appointmentForm) Update a form object with the values of the appointmentForm DTOstatic voidupdateGlobalParameters(AppointmentFormDTO appointmentForm) Update a form with the new values of the Global Parameters of an appointmentForm DTO
-
Method Details
-
copyForm
Make a copy of form, with all its values- Parameters:
nIdForm- the Form Id to copynewNameForCopy- the new Name of the copy- Returns:
- the id of the form created
-
saveForm
Save a form in database- Parameters:
form- the form to save- Returns:
- the form saved (with its id)
-
createAppointmentForm
Create a form from an appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTO- Returns:
- the id of the form created
-
updateGlobalParameters
Update a form with the new values of the Global Parameters of an appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTO
-
buildAllActiveAppointmentForm
Build all the active forms- Returns:
- the list of appointment form dto that are active
-
buildAllAppointmentFormLight
Build all the appointForm DTO of the database light because the appointFormDTO is only fill in with the form id, the title and if the form is active or not- Returns:
- the list of all the appointmentForm DTO
-
findAllInReferenceList
public static fr.paris.lutece.util.ReferenceList findAllInReferenceList()Build a list of all the forms (id, title)- Returns:
- the reference list
-
buildAllActiveAndDisplayedOnPortletAppointmentForm
Build all the active forms of the database- Returns:
- a list of appointmentForm DTO
-
buildAppointmentFormLight
Build an appointmentFormDTO light- Parameters:
form- the form object- Returns:
- the appointmentForm DTO
-
buildAppointmentFormLight
Build an appointmentForm light- Parameters:
nIdForm- the form Id- Returns:
- the appointmentForm DTO
-
buildAppointmentForm
Build an appointmentForm DTO- Parameters:
nIdForm- the Form IdnIdReservationRule- the Reservation Rule Id- Returns:
- the apointmentForm DTO built
-
buildAppointmentForm
Build an appointmentForm DTO- Parameters:
form- the Form objectReservationRule- the Reservation Rule object- Returns:
- the apointmentForm DTO built
-
buildAppointmentFormWithoutReservationRule
Build an appointmentForm DTO- Parameters:
form- the Form object- Returns:
- the apointmentForm DTO built
-
fillAppointmentFormWithReservationRulePart
public static void fillAppointmentFormWithReservationRulePart(AppointmentFormDTO appointmentForm, ReservationRule reservationRule) Fill the appointmentForm DTO with the Reservation Rule- Parameters:
appointmentForm- the appointmentForm DTOreservationRule- the reservation rule
-
updateForm
Update a form object with the values of the appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTO- Returns:
- the Form object updated
-
updateForm
Update a form- Parameters:
form- the form- Returns:
- the form updated
-
fillInFormWithAppointmentForm
Fill the form object with the values of the appointmentForm DTO- Parameters:
form- the form objectappointmentForm- the appointmentForm DTO- Returns:
- the form completed
-
removeForm
public static void removeForm(int nIdForm) Remove a Form from the database- Parameters:
nIdForm- the form id to remove
-
findAllForms
Find all the forms in the database- Returns:
- a list of all the forms
-
findAllActiveForms
Find all the active forms in database- Returns:
- a list of all the active forms
-
findAllActiveAndDisplayedOnPortletForms
Find all the active forms that have to be displayed on portlet in database- Returns:
- a list of all the found forms
-
findFormLightByPrimaryKey
find a form by its primary key- Parameters:
nIdForm- the form Id- Returns:
- the Form
-
findFormsByTitle
Find forms by the title- Parameters:
strTitle- the form title- Returns:
- the Forms with this title
-