Class FormService
- java.lang.Object
-
- fr.paris.lutece.plugins.appointment.service.FormService
-
public final class FormService extends Object
Service class for a form- Author:
- Laurent Payen
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<AppointmentFormDTO>buildAllActiveAndDisplayedOnPortletAppointmentForm()Build all the active forms of the databasestatic List<AppointmentFormDTO>buildAllActiveAppointmentForm()Build all the active formsstatic List<AppointmentFormDTO>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 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 AppointmentFormDTObuildAppointmentFormLight(Form form)Build an appointmentFormDTO lightstatic AppointmentFormDTObuildAppointmentFormWithoutReservationRule(int nIdForm)Build an appointmentForm DTOstatic intcopyForm(int nIdForm, String newNameForCopy)Make 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 DTOstatic List<Form>findAllActiveAndDisplayedOnPortletForms()Find all the active forms that have to be displayed on portlet in databasestatic List<Form>findAllActiveForms()Find all the active forms in databasestatic List<Form>findAllForms()Find all the forms in the databasestatic fr.paris.lutece.util.ReferenceListfindAllInReferenceList()Build a list of all the forms (id, title)static FormfindFormLightByPrimaryKey(int nIdForm)find a form by its primary keystatic List<Form>findFormsByTitle(String strTitle)Find forms by the titlestatic voidremoveForm(int nIdForm)Remove a Form from the databasestatic FormsaveForm(Form form)Save 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 Detail
-
copyForm
public static int copyForm(int nIdForm, String newNameForCopy)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
public static Form saveForm(Form form)
Save a form in database- Parameters:
form- the form to save- Returns:
- the form saved (with its id)
-
createAppointmentForm
public static int createAppointmentForm(AppointmentFormDTO appointmentForm)
Create a form from an appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTO- Returns:
- the id of the form created
-
updateGlobalParameters
public static void updateGlobalParameters(AppointmentFormDTO appointmentForm)
Update a form with the new values of the Global Parameters of an appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTO
-
buildAllActiveAppointmentForm
public static List<AppointmentFormDTO> buildAllActiveAppointmentForm()
Build all the active forms- Returns:
- the list of appointment form dto that are active
-
buildAllAppointmentFormLight
public static List<AppointmentFormDTO> 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
public static List<AppointmentFormDTO> buildAllActiveAndDisplayedOnPortletAppointmentForm()
Build all the active forms of the database- Returns:
- a list of appointmentForm DTO
-
buildAppointmentFormLight
public static AppointmentFormDTO buildAppointmentFormLight(Form form)
Build an appointmentFormDTO light- Parameters:
form- the form object- Returns:
- the appointmentForm DTO
-
buildAppointmentFormLight
public static AppointmentFormDTO buildAppointmentFormLight(int nIdForm)
Build an appointmentForm light- Parameters:
nIdForm- the form Id- Returns:
- the appointmentForm DTO
-
buildAppointmentForm
public static AppointmentFormDTO buildAppointmentForm(int nIdForm, int nIdReservationRule)
Build an appointmentForm DTO- Parameters:
nIdForm- the Form IdnIdReservationRule- the Reservation Rule Id- Returns:
- the apointmentForm DTO built
-
buildAppointmentForm
public static AppointmentFormDTO buildAppointmentForm(int nIdForm, ReservationRule reservationRule)
Build an appointmentForm DTO- Parameters:
form- the Form objectReservationRule- the Reservation Rule object- Returns:
- the apointmentForm DTO built
-
buildAppointmentFormWithoutReservationRule
public static AppointmentFormDTO buildAppointmentFormWithoutReservationRule(int nIdForm)
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
public static Form updateForm(AppointmentFormDTO appointmentForm)
Update a form object with the values of the appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTO- Returns:
- the Form object updated
-
updateForm
public static Form updateForm(Form form)
Update a form- Parameters:
form- the form- Returns:
- the form updated
-
fillInFormWithAppointmentForm
public static Form fillInFormWithAppointmentForm(Form form, AppointmentFormDTO appointmentForm)
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
public static List<Form> findAllForms()
Find all the forms in the database- Returns:
- a list of all the forms
-
findAllActiveForms
public static List<Form> findAllActiveForms()
Find all the active forms in database- Returns:
- a list of all the active forms
-
findAllActiveAndDisplayedOnPortletForms
public static List<Form> findAllActiveAndDisplayedOnPortletForms()
Find all the active forms that have to be displayed on portlet in database- Returns:
- a list of all the found forms
-
findFormLightByPrimaryKey
public static Form findFormLightByPrimaryKey(int nIdForm)
find a form by its primary key- Parameters:
nIdForm- the form Id- Returns:
- the Form
-
-