Class AppointmentHelper
java.lang.Object
de.xima.fc.appointment.BaseAppointmentHelper
de.xima.fc.gui.common.appointment.AppointmentHelper
Helper methods for the appointment module.
- Since:
- 6.5.0
- Author:
- XIMA MEDIA GmbH
-
Field Summary
Fields inherited from class de.xima.fc.appointment.BaseAppointmentHelper
WEEK_START
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyEventColors
(org.primefaces.model.DefaultScheduleEvent.Builder<?> builder, IGuiColor color, StringBuilder styleClasses) Given a schedule event builder, applies the color of the template to the event.static org.primefaces.model.ScheduleEvent<?>
convertToEvent
(AppointmentTemplate template, AppointmentSlot slot) static org.primefaces.model.ScheduleEvent<?>
convertToEvent
(Map<Long, org.apache.commons.lang3.tuple.Pair<AppointmentTemplate, IGuiColor>> templates, AppointmentEventView view) static AppointmentSlot
convertToSlot
(org.primefaces.model.ScheduleEvent<?> event) static AppointmentClosingTime
createDefaultClosingTime
(AppointmentTemplate template) Creates the defaultclosing times
when none are set yet.static AppointmentTemplate
createDefaultTemplate
(Mandant client) Sets the default values for a newAppointmentTemplate
.static AppointmentClosingTime
Creates the closing time for the new year holiday.findColor
(AppointmentTemplate template) Finds theIGuiColor
for an appointment template.static com.google.common.collect.Range<LocalDateTime>
getEventDateTime
(org.primefaces.model.ScheduleEvent<?> event) Methods inherited from class de.xima.fc.appointment.BaseAppointmentHelper
applySlotConstraints, createClosedDateTimeRanges, createDefaultSlots, createSlot, getSlotDateTime, getSlotDateTimeRange, getSlotFromDateTime, getSlotToDateTime, getTimeOnGrid, isSlotOverlapping, mergeOverlappingSlots, mergeOverlappingSlots
-
Constructor Details
-
AppointmentHelper
protected AppointmentHelper()
-
-
Method Details
-
findColor
Finds theIGuiColor
for an appointment template.- Parameters:
template
- A template to process.- Returns:
- The color for the given template.
-
applyEventColors
public static void applyEventColors(org.primefaces.model.DefaultScheduleEvent.Builder<?> builder, IGuiColor color, StringBuilder styleClasses) Given a schedule event builder, applies the color of the template to the event.- Parameters:
builder
- Schedule event builder to modify.color
- Color to use, see alsofindColor(AppointmentTemplate)
.styleClasses
- String builder for the style classes of the event builder.
-
convertToEvent
public static org.primefaces.model.ScheduleEvent<?> convertToEvent(AppointmentTemplate template, AppointmentSlot slot) - Parameters:
template
- Appointment template to which the slot belongs.slot
- A slot to convert.- Returns:
- The event for the given slot.
-
convertToEvent
public static org.primefaces.model.ScheduleEvent<?> convertToEvent(Map<Long, org.apache.commons.lang3.tuple.Pair<AppointmentTemplate, IGuiColor>> templates, AppointmentEventView view) -
convertToSlot
- Parameters:
event
- An event to convert.- Returns:
- The slot for the given event.
-
createDefaultClosingTime
Creates the defaultclosing times
when none are set yet.- Parameters:
template
- The template to be connected to on creation of a fresh closing time.- Returns:
- The default closing times.
-
getEventDateTime
public static com.google.common.collect.Range<LocalDateTime> getEventDateTime(org.primefaces.model.ScheduleEvent<?> event) - Parameters:
event
- A schedule event.- Returns:
- The date time range of the event spans.
-
createDefaultTemplate
Sets the default values for a newAppointmentTemplate
.- Parameters:
client
- Client to set on the template.- Returns:
- The newly created template.
-
createNewYearClosingTime
Creates the closing time for the new year holiday.- Returns:
- The new year holiday closing time.
-