Class AppointmentHelper


  • public class AppointmentHelper
    extends BaseAppointmentHelper
    Helper methods for the appointment module.
    Since:
    6.5.0
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • AppointmentHelper

        protected AppointmentHelper()
    • Method Detail

      • findColor

        public static Optional<IGuiColor> findColor​(AppointmentTemplate template)
        Finds the IGuiColor 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 also findColor(AppointmentTemplate).
        styleClasses - String builder for the style classes of the event builder.
      • convertToEvent

        public static org.primefaces.model.ScheduleEvent<?> convertToEvent​(AppointmentTemplate template,
                                                                           AppointmentSlot slot)
        Converts an AppointmentSlot model to the ScheduleEvent for the PrimeFaces Schedule component.
        Parameters:
        template - Appointment template to which the slot belongs.
        slot - A slot to convert.
        Returns:
        The event for the given slot.
      • convertToSlot

        public static AppointmentSlot convertToSlot​(org.primefaces.model.ScheduleEvent<?> event)
        Converts ScheduleEvent of the PrimeFaces Schedule component to the AppointmentSlot model.
        Parameters:
        event - An event to convert.
        Returns:
        The slot for the given event.
      • 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 new AppointmentTemplate.
        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.