Class AppointmentTemplateListModel

All Implemented Interfaces:
IEntityListModel<AppointmentTemplate>, IEntityListModelSelectByView<AppointmentTemplate>, IUpdatable, Serializable

public final class AppointmentTemplateListModel extends EntityListModelSelectByView<AppointmentTemplate>
The view model for the AppointmentTemplate - the backend menu for configuring the appointments.
Author:
XIMA MEDIA GmbH
See Also:
  • Constructor Details

    • AppointmentTemplateListModel

      public AppointmentTemplateListModel(de.xima.cmn.criteria.QueryCriteriaManager qcm, Mandant client)
      Parameters:
      qcm - Query criteria manager for the AppointmentTemplate. Should usually restrict the templates to a certain client.
      client - Current client to be used.
  • Method Details

    • addSlotAt

      public void addSlotAt(LocalDateTime dateTime)
      Adds a new slot starting at the given time. Used when the user click on an empty time slot.
      Parameters:
      dateTime - Starting time for the new slot.
    • getClientModel

      public AppointmentClientClosingTimeModel getClientModel()
      Returns:
      The model for the global client-scoped closing hours.
    • getEventModel

      public org.primefaces.model.ScheduleModel getEventModel()
      Returns:
      The event model for the PrimeFaces Schedule component.
    • getEventsInRange

      public List<org.primefaces.model.ScheduleEvent<?>> getEventsInRange(LocalDateTime start, LocalDateTime end)
      Parameters:
      start - Start point of the range.
      end - End point of the range.
      Returns:
      All events of the getEventModel() that lie (partially) in the given range.
    • getEventsInRange

      public List<org.primefaces.model.ScheduleEvent<?>> getEventsInRange(com.google.common.collect.Range<LocalDateTime> targetRange)
      Parameters:
      targetRange - A range to check.
      Returns:
      All events of the getEventModel() that lie (partially) in the given range.
    • getNew

      public AppointmentTemplate getNew()
      Overrides:
      getNew in class EntityListModel<AppointmentTemplate>
    • getTemplateModel

      public AppointmentClosingTimeModel getTemplateModel()
      Returns:
      The model for the closing hours of the selected appointment template.
    • removeSlot

      public void removeSlot(String slotId)
      Removes the AppointmentSlot with the given ID. Used when the user clicks on the delete button of an event.
      Parameters:
      slotId - ID of the AppointmentSlot to remove.
    • save

      public void save(boolean addSuccessMessage, boolean addErrorMessage)
      Overrides:
      save in class EntityListModel<AppointmentTemplate>
    • setEventModel

      public void setEventModel(org.primefaces.model.ScheduleModel eventModel)
      Parameters:
      eventModel - The new event model to set.
    • setSelected

      public void setSelected(AppointmentTemplate selected)
      Description copied from class: EntityListModelSelectByView
      After setting the selected entity to the given entity, stores this selection in the SelectionBean. This allows the selection to be restored when the user revisits the page (during the same session).
      Specified by:
      setSelected in interface IEntityListModel<AppointmentTemplate>
      Overrides:
      setSelected in class EntityListModelSelectByView<AppointmentTemplate>
      Parameters:
      selected - The model to be selected.
    • updateEvent

      public void updateEvent(org.primefaces.model.ScheduleEvent<?> event)
      Takes a changed event and merges it into the current model.
      Parameters:
      event - An event with data to update and merge into this model.