Class AppointmentApp

java.lang.Object
fr.paris.lutece.portal.util.mvc.xpage.MVCApplication
fr.paris.lutece.plugins.appointment.web.AppointmentApp
All Implemented Interfaces:
fr.paris.lutece.portal.web.xpages.XPageApplication, Serializable

@SessionScoped @Named("appointment.xpage.appointment") @Controller(xpageName="appointment", pageTitleI18nKey="appointment.appointmentApp.defaultTitle", pagePathI18nKey="appointment.name") public class AppointmentApp extends fr.paris.lutece.portal.util.mvc.xpage.MVCApplication
This class provides a simple implementation of an Appointment XPage (On Front Office)
Author:
Laurent Payen
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default page title of XPages of this app
    static final String
    Default page of XPages of this app
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fr.paris.lutece.portal.web.xpages.XPage
    displayRecapAppointment(jakarta.servlet.http.HttpServletRequest request)
    Display the recap before validating an appointment
    fr.paris.lutece.portal.web.xpages.XPage
    doCancelAppointment(jakarta.servlet.http.HttpServletRequest request)
    Cancel an appointment
    fr.paris.lutece.portal.web.xpages.XPage
    doMakeAppointment(jakarta.servlet.http.HttpServletRequest request)
    Do save an appointment into the database if it is valid
    fr.paris.lutece.portal.web.xpages.XPage
    doProcessWorkflowAction(jakarta.servlet.http.HttpServletRequest request)
    Do process a workflow action over an appointment
    fr.paris.lutece.portal.web.xpages.XPage
    doValidateForm(jakarta.servlet.http.HttpServletRequest request)
    Do validate data entered by a user to fill a form
    static void
    Fill a model with the active forms displayed on portlet, sorted by title, and their icons
    static boolean
    fillMyAppointmentsModel(jakarta.servlet.http.HttpServletRequest request, Map<String,Object> model)
    Fill a model with the appointments of the signed in user, their workflow actions, the list of forms and the current date time
    fr.paris.lutece.portal.web.xpages.XPage
    getAppointmentCanceled(jakarta.servlet.http.HttpServletRequest request)
    Get the page to confirm that the appointment has been canceled
    fr.paris.lutece.portal.web.xpages.XPage
    getAppointmentCreated(jakarta.servlet.http.HttpServletRequest request)
    Get the page to notify the user that the appointment has been created
    fr.paris.lutece.portal.web.xpages.XPage
    getAppointmentIcs(jakarta.servlet.http.HttpServletRequest request)
    Download the iCalendar file of an appointment, offered by the "add to calendar" button of the confirmation page.
    static String
    Get the URL
    static String
    getCancelAppointmentUrl(jakarta.servlet.http.HttpServletRequest request, Appointment appointment)
    Get the URL
    fr.paris.lutece.portal.web.xpages.XPage
    getFormList(jakarta.servlet.http.HttpServletRequest request)
    Get the view of all the forms on front office side
    static String
    Get the html content of the list of forms
    fr.paris.lutece.portal.web.xpages.XPage
    getMyAppointments(jakarta.servlet.http.HttpServletRequest request)
    Get the page to view the appointments of a user
    static String
    getMyAppointmentsHtml(jakarta.servlet.http.HttpServletRequest request, Locale locale, Map<String,Object> model)
    Get the HTML content of a user's "My appointments" page
    static String
    getMyAppointmentsXPage(jakarta.servlet.http.HttpServletRequest request, Locale locale, Map<String,Object> model)
    static String
    Get the URL
    fr.paris.lutece.portal.web.xpages.XPage
    getViewAppointmentCalendar(jakarta.servlet.http.HttpServletRequest request)
    Get the calendar view
    fr.paris.lutece.portal.web.xpages.XPage
    getViewAppointmentForm(jakarta.servlet.http.HttpServletRequest request)
    Get the form appointment view (front office)
    fr.paris.lutece.portal.web.xpages.XPage
    getViewCancelAppointment(jakarta.servlet.http.HttpServletRequest request)
    Get the view for the user who wants to cancel its appointment
    fr.paris.lutece.portal.web.xpages.XPage
    getViewChangeDateAppointment(jakarta.servlet.http.HttpServletRequest request)
    Return to the display recap view with the new date selected on the calendar
    fr.paris.lutece.portal.web.xpages.XPage
    getWorkflowActionForm(jakarta.servlet.http.HttpServletRequest request)
    Get the workflow action form before processing the action.
    void
    Fill the booking form of a form in advance, with the information another service knows of the user: the next opening of the form of that form in this session shows it filled in.
    void
    setUserInfo(jakarta.servlet.http.HttpServletRequest request, AppointmentDTO appointment)
    Set the user infos to the appointment DTO

    Methods inherited from class fr.paris.lutece.portal.util.mvc.xpage.MVCApplication

    getPage, getRealClass

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AppointmentApp

      public AppointmentApp()
  • Method Details

    • getViewAppointmentCalendar

      @View("getViewAppointmentCalendar") public fr.paris.lutece.portal.web.xpages.XPage getViewAppointmentCalendar(jakarta.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.admin.AccessDeniedException
      Get the calendar view
      Parameters:
      request -
      Returns:
      the Xpage
      Throws:
      fr.paris.lutece.portal.service.admin.AccessDeniedException
    • getViewAppointmentForm

      @View("getViewAppointmentForm") public fr.paris.lutece.portal.web.xpages.XPage getViewAppointmentForm(jakarta.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.security.UserNotSignedException, fr.paris.lutece.portal.service.admin.AccessDeniedException
      Get the form appointment view (front office)
      Parameters:
      request - the request
      Returns:
      the xpage
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException
      fr.paris.lutece.portal.service.admin.AccessDeniedException
    • doValidateForm

      @Action("doValidateForm") public fr.paris.lutece.portal.web.xpages.XPage doValidateForm(jakarta.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.security.UserNotSignedException, fr.paris.lutece.portal.service.admin.AccessDeniedException
      Do validate data entered by a user to fill a form
      Parameters:
      request - The request
      Returns:
      The next URL to redirect to
      Throws:
      fr.paris.lutece.portal.service.message.SiteMessageException
      fr.paris.lutece.portal.service.security.UserNotSignedException
      fr.paris.lutece.portal.service.admin.AccessDeniedException
    • displayRecapAppointment

      @View("displayRecapAppointment") public fr.paris.lutece.portal.web.xpages.XPage displayRecapAppointment(jakarta.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.security.UserNotSignedException, fr.paris.lutece.portal.service.admin.AccessDeniedException
      Display the recap before validating an appointment
      Parameters:
      request - The request
      Returns:
      The HTML content to display or the next URL to redirect to
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException
      fr.paris.lutece.portal.service.admin.AccessDeniedException
    • doMakeAppointment

      @Action("doMakeAppointment") public fr.paris.lutece.portal.web.xpages.XPage doMakeAppointment(jakarta.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.security.UserNotSignedException, fr.paris.lutece.portal.service.admin.AccessDeniedException
      Do save an appointment into the database if it is valid
      Parameters:
      request - The request
      Returns:
      The XPage to display
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException
      fr.paris.lutece.portal.service.admin.AccessDeniedException
    • getAppointmentCreated

      @View("getAppointmentCreated") public fr.paris.lutece.portal.web.xpages.XPage getAppointmentCreated(jakarta.servlet.http.HttpServletRequest request)
      Get the page to notify the user that the appointment has been created
      Parameters:
      request - The request
      Returns:
      The XPage to display
    • getAppointmentIcs

      @View("getAppointmentIcs") public fr.paris.lutece.portal.web.xpages.XPage getAppointmentIcs(jakarta.servlet.http.HttpServletRequest request)
      Download the iCalendar file of an appointment, offered by the "add to calendar" button of the confirmation page. The file holds the title of the form, the dates, the location and the text shown once the appointment is created.
      Parameters:
      request - The request
      Returns:
      The iCalendar file, or the list of forms when the appointment or the option does not exist
    • getViewChangeDateAppointment

      @View("viewChangeDateAppointment") public fr.paris.lutece.portal.web.xpages.XPage getViewChangeDateAppointment(jakarta.servlet.http.HttpServletRequest request)
      Return to the display recap view with the new date selected on the calendar
      Parameters:
      request - the request
      Returns:
      to the display recap view
      Throws:
      fr.paris.lutece.portal.service.admin.AccessDeniedException
      fr.paris.lutece.portal.service.message.SiteMessageException
    • getFormList

      @View(value="getViewFormList", defaultView=true) public fr.paris.lutece.portal.web.xpages.XPage getFormList(jakarta.servlet.http.HttpServletRequest request)
      Get the view of all the forms on front office side
      Parameters:
      request - the request
      Returns:
      the xpage
    • getViewCancelAppointment

      @View("getViewCancelAppointment") public fr.paris.lutece.portal.web.xpages.XPage getViewCancelAppointment(jakarta.servlet.http.HttpServletRequest request)
      Get the view for the user who wants to cancel its appointment
      Parameters:
      request -
      Returns:
      the view
    • doCancelAppointment

      @Action("doCancelAppointment") public fr.paris.lutece.portal.web.xpages.XPage doCancelAppointment(jakarta.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.admin.AccessDeniedException
      Cancel an appointment
      Parameters:
      request -
      Returns:
      the confirmation view of the appointment cancelled
      Throws:
      fr.paris.lutece.portal.service.admin.AccessDeniedException
    • getAppointmentCanceled

      @View("getAppointmentCanceled") public fr.paris.lutece.portal.web.xpages.XPage getAppointmentCanceled(jakarta.servlet.http.HttpServletRequest request)
      Get the page to confirm that the appointment has been canceled
      Parameters:
      request - The request
      Returns:
      The XPage to display
    • getMyAppointments

      @View("getMyAppointments") public fr.paris.lutece.portal.web.xpages.XPage getMyAppointments(jakarta.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.security.UserNotSignedException
      Get the page to view the appointments of a user
      Parameters:
      request - The request
      Returns:
      The XPage to display
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException - If the authentication is enabled and the user has not signed in
    • getMyAppointmentsXPage

      @Deprecated public static String getMyAppointmentsXPage(jakarta.servlet.http.HttpServletRequest request, Locale locale, Map<String,Object> model) throws fr.paris.lutece.portal.service.security.UserNotSignedException
      Get the HTML content of the my appointment page of a user
      Parameters:
      request - The request
      locale - The locale
      Returns:
      The HTML content, or null if the
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException - If the user has not signed in
    • getMyAppointmentsHtml

      public static String getMyAppointmentsHtml(jakarta.servlet.http.HttpServletRequest request, Locale locale, Map<String,Object> model) throws fr.paris.lutece.portal.service.security.UserNotSignedException
      Get the HTML content of a user's "My appointments" page
      Parameters:
      request - The request
      locale - The locale
      Returns:
      The HTML content, or null if the user is not logged in
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException - If the user has not signed in
    • fillMyAppointmentsModel

      public static boolean fillMyAppointmentsModel(jakarta.servlet.http.HttpServletRequest request, Map<String,Object> model) throws fr.paris.lutece.portal.service.security.UserNotSignedException
      Fill a model with the appointments of the signed in user, their workflow actions, the list of forms and the current date time
      Parameters:
      request - The request
      model - The model to fill
      Returns:
      false if the authentication is disabled (the model is left unchanged), true otherwise
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException - If the authentication is enabled and the user has not signed in
    • getFormListHtml

      public static String getFormListHtml(Locale locale, Map<String,Object> model)
      Get the html content of the list of forms
      Parameters:
      locale - The locale
      model - The model
      Returns:
      The HTML content to display
    • fillFormListModel

      public static void fillFormListModel(Map<String,Object> model)
      Fill a model with the active forms displayed on portlet, sorted by title, and their icons
      Parameters:
      model - The model to fill
    • getWorkflowActionForm

      @View("viewWorkflowActionForm") public fr.paris.lutece.portal.web.xpages.XPage getWorkflowActionForm(jakarta.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.security.UserNotSignedException, fr.paris.lutece.portal.service.message.SiteMessageException
      Get the workflow action form before processing the action. An action without form is not processed here: the request asks for a confirmation whose form posts the processing action.
      Parameters:
      request - The request
      Returns:
      The HTML content to display, or the next URL to redirect the user to
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException - if the user is not signed in
      fr.paris.lutece.portal.service.message.SiteMessageException - to display the confirmation of an action without form
    • doProcessWorkflowAction

      @Action("doProcessWorkflowAction") public fr.paris.lutece.portal.web.xpages.XPage doProcessWorkflowAction(jakarta.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.security.UserNotSignedException, fr.paris.lutece.portal.service.message.SiteMessageException
      Do process a workflow action over an appointment
      Parameters:
      request - The request
      Returns:
      The next URL to redirect to
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException - if the user is not signed in
      fr.paris.lutece.portal.service.message.SiteMessageException - when the task form, displayed again on an error, asks for a confirmation
    • getCancelAppointmentUrl

      public static String getCancelAppointmentUrl(jakarta.servlet.http.HttpServletRequest request, Appointment appointment)
      Get the URL
      Parameters:
      request - Get the URL to cancel an appointment in FO
      appointment - The appointment
      Returns:
      The URL to cancel the appointment
    • getCancelAppointmentUrl

      public static String getCancelAppointmentUrl(Appointment appointment)
      Get the URL
      Parameters:
      request - Get the URL to cancel an appointment in FO
      appointment - The appointment
      Returns:
      The URL to cancel the appointment
    • getReportAppointmentUrl

      public static String getReportAppointmentUrl(AppointmentDTO appointment)
      Get the URL
      Parameters:
      request - Get the URL to report an appointment in FO
      appointment - The appointment
      Returns:
      The URL to report the appointment
    • setUserInfo

      public void setUserInfo(jakarta.servlet.http.HttpServletRequest request, AppointmentDTO appointment)
      Set the user infos to the appointment DTO
      Parameters:
      request - the request
      appointment - the appointment DTO
    • prefillAppointment

      public void prefillAppointment(AppointmentDTO appointment)
      Fill the booking form of a form in advance, with the information another service knows of the user: the next opening of the form of that form in this session shows it filled in.
      Parameters:
      appointment - the appointment being prepared, its form id set