Package de.xima.fc.gui.model.appointment
Class AppointmentTemplateListModel
java.lang.Object
de.xima.fc.gui.common.utils.msg.I18nUtils
de.xima.fc.gui.common.utils.msg.MessageUtils
de.xima.fc.gui.common.utils.msg.AMessaging
de.xima.fc.gui.model.data.EntityListModel<T>
de.xima.fc.gui.model.data.EntityListModelSelectByView<AppointmentTemplate>
de.xima.fc.gui.model.appointment.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:
-
Field Summary
Fields inherited from class de.xima.fc.gui.model.data.EntityListModel
all, entityClass, filtered, globalFilter, hasAddNewEntity, marked, qcm, selected
-
Constructor Summary
ConstructorsConstructorDescriptionAppointmentTemplateListModel
(de.xima.cmn.criteria.QueryCriteriaManager qcm, Mandant client) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSlotAt
(LocalDateTime dateTime) Adds a new slot starting at the given time.org.primefaces.model.ScheduleModel
List<org.primefaces.model.ScheduleEvent<?>>
getEventsInRange
(com.google.common.collect.Range<LocalDateTime> targetRange) List<org.primefaces.model.ScheduleEvent<?>>
getEventsInRange
(LocalDateTime start, LocalDateTime end) getNew()
void
removeSlot
(String slotId) Removes theAppointmentSlot
with the given ID.void
save
(boolean addSuccessMessage, boolean addErrorMessage) void
setEventModel
(org.primefaces.model.ScheduleModel eventModel) void
setSelected
(AppointmentTemplate selected) After setting the selected entity to the given entity, stores this selection in theSelectionBean
.void
updateEvent
(org.primefaces.model.ScheduleEvent<?> event) Takes a changed event and merges it into the current model.Methods inherited from class de.xima.fc.gui.model.data.EntityListModelSelectByView
getAllowedViewsForSelection, getCurrentViewBean, getEntityClassKey, getSelectionBean, putSelectionToStore, readSelectionFromStore, retrieveSelection, selectDefault, storeSelection
Methods inherited from class de.xima.fc.gui.model.data.EntityListModel
addMarked, addNew, create, delete, delete, deleteEntity, deleteEntity, deleteMarkedEntities, ec, fetchAll, getAll, getAllPlusNew, getDao, getFiltered, getGlobalFilter, getMarked, getName, getSelected, hasEntity, isDetached, isEmptyList, isMarkedDeletable, isNew, loadLazyData, onRowSelect, onRowSelectCheckbox, onRowUnselectCheckbox, onToggleSelect, performDelete, removeMarked, save, setFiltered, setGlobalFilter, setHasAddNewEntity, setMarked, setSelectedFromMarked, update, updateData, updateSelected
Methods inherited from class de.xima.fc.gui.common.utils.msg.MessageUtils
addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsgFromString, addErrorMsgFromString, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsgFromString, addInfoMsgFromString, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addMsg, addMsg, addMsg, addMsg, addMsgs, addMsgs, addMsgToComponent, addMsgToComponent, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsgFromString, addWarnMsgFromString, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, cleanErrorMsg, errorMsg, errorMsg, getErrorMessage, getNewErrorMsg, getNewErrorMsg, getNewErrorMsg, getNewInfoMsg, getNewInfoMsg, getNewMsg, getNewWarnMsg, getNewWarnMsg, msg
Methods inherited from class de.xima.fc.gui.common.utils.msg.I18nUtils
getFacesContext, getLocale, rbValue, rbValue, rbValue, rbValueOrDefault, rbValueOrDefault
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.xima.fc.gui.interfaces.data.IEntityListModel
addMarked, addNew, delete, delete, deleteEntity, deleteEntity, deleteMarkedEntities, getAll, getAllPlusNew, getFiltered, getMarked, getSelected, hasEntity, isEmptyList, isMarkedDeletable, isNew, loadLazyData, onRowSelect, onRowSelectCheckbox, onRowUnselectCheckbox, onToggleSelect, removeMarked, save, setFiltered, setMarked, setSelectedFromMarked, updateSelected
Methods inherited from interface de.xima.fc.gui.interfaces.data.IUpdatable
updateData
-
Constructor Details
-
AppointmentTemplateListModel
- Parameters:
qcm
- Query criteria manager for theAppointmentTemplate
. Should usually restrict the templates to a certain client.client
- Current client to be used.
-
-
Method Details
-
addSlotAt
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
- 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
- Overrides:
getNew
in classEntityListModel<AppointmentTemplate>
-
getTemplateModel
- Returns:
- The model for the closing hours of the selected appointment template.
-
removeSlot
Removes theAppointmentSlot
with the given ID. Used when the user clicks on the delete button of an event.- Parameters:
slotId
- ID of theAppointmentSlot
to remove.
-
save
public void save(boolean addSuccessMessage, boolean addErrorMessage) - Overrides:
save
in classEntityListModel<AppointmentTemplate>
-
setEventModel
public void setEventModel(org.primefaces.model.ScheduleModel eventModel) - Parameters:
eventModel
- The new event model to set.
-
setSelected
Description copied from class:EntityListModelSelectByView
After setting the selected entity to the given entity, stores this selection in theSelectionBean
. This allows the selection to be restored when the user revisits the page (during the same session).- Specified by:
setSelected
in interfaceIEntityListModel<AppointmentTemplate>
- Overrides:
setSelected
in classEntityListModelSelectByView<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.
-