Enhancement
Critical
Major
Detail
Detail
With the interface CalendarMarker (see #23465) an implementation of an algorithm is possible, which highlights/marks certain days of a DatePicker. The implementation of the CalendarMarker should now also be determined in the model by annotating a factory that produces the corresponding implementation to the property field.
Implementation
The factory needed to annotate the CalendarMarkerwas implemented as a MarkerFactory interface. It contains the getCalendarMarker(TLTypePart attribute, TLObject object, ComplexField field) function that configures and returns the CalendarMarker. \\ The annotation for a MarkerFactory is defined in the com.top_logic.model.annotate.ui.MarkerFactoryAnnotation interface. In com.top_logic.demo.webapp.WEB-INF.model.DemoTypes.model.xml an example of an annotation with a com.top_logic.demo.model.annotations.DemoMarkerFactory to DemoTypes.C.All.dependentDate can be seen. \\ In order to be able to annotate a MarkerFactory in the model and pass parameters, the implementation of the MarkerFactory com.top_logic.model.search.providers.MarkerFactoryByExpression now exists. If this is annotated to a date field, the user can specify start and end time of a period to be marked by a TL script function. He can also set the CSS classes for calendar fields inside or outside the period, define how overlapping periods are evaluated and whether fields outside the period should be made unselectable. There is already a default implementation com.top_logic.layout.form.control.DefaultCalendarMarker of the CalendarMarker interface, which uses these values to calculate how fields should be marked in a DatePicker.
Test
In the demo, for objects of type C` the attribute `dependentDate is annotated with it: The boundaries of the marker are the date and date2 values of the top node. A red or green marker must be visible.