Class AppointmentHelper
- java.lang.Object
-
- de.xima.fc.appointment.BaseAppointmentHelper
-
- de.xima.fc.gui.common.appointment.AppointmentHelper
-
public class AppointmentHelper extends BaseAppointmentHelper
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 Modifier Constructor Description protectedAppointmentHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapplyEventColors(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 AppointmentSlotconvertToSlot(org.primefaces.model.ScheduleEvent<?> event)static List<AppointmentClosingTime>createDefaultClosingTimes()Creates the defaultAppointmentTemplate.getClosingTimes()when none are set yet.static AppointmentTemplatecreateDefaultTemplate(Mandant client)Sets the default values for a newAppointmentTemplate.static AppointmentClosingTimecreateNewYearClosingTime()Creates the closing time for the new year holiday.static Optional<IGuiColor>findColor(AppointmentTemplate template)Finds theIGuiColorfor 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
-
-
-
-
Method Detail
-
findColor
public static Optional<IGuiColor> findColor(AppointmentTemplate template)
Finds theIGuiColorfor 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
public static AppointmentSlot convertToSlot(org.primefaces.model.ScheduleEvent<?> event)
- Parameters:
event- An event to convert.- Returns:
- The slot for the given event.
-
createDefaultClosingTimes
public static List<AppointmentClosingTime> createDefaultClosingTimes()
Creates the defaultAppointmentTemplate.getClosingTimes()when none are set yet.- 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
public static AppointmentTemplate createDefaultTemplate(Mandant client)
Sets the default values for a newAppointmentTemplate.- Parameters:
client- Client to set on the template.- Returns:
- The newly created template.
-
createNewYearClosingTime
public static AppointmentClosingTime createNewYearClosingTime()
Creates the closing time for the new year holiday.- Returns:
- The new year holiday closing time.
-
-