EN · DE · RU · FR · ES

#2776: AbstractFullCalendar.java

projectforge-wicket/src/main/java/net/ftlines/wicket/fullcalendar/AbstractFullCalendar.java Abstract Wicket Component (FullCalendar Base) · projectforge-wicket/src/main/java/net/ftlines/wicket/fullcalendar/AbstractFullCalendar.java 118 lines · 65 code · 34 comments · 19 blank
The abstract base class for the Wicket FullCalendar component, responsible for header contribution (loading CSS/JS dependencies) and JSON serialization of Joda-Time date types. This class serves as the foundation for FullCalendar (file #2787), separating rendering infrastructure from component behavior. It registers the required FullCalendar CSS, JavaScript (minified or development versions), and a custom extension script, and provides custom Jackson serializers that convert DateTime to ISO-8601 format and LocalTime to 12-hour format (h:mmaa) for JSON embedding.

Architecture

Header Contribution

The renderHead(IHeaderResponse) method contributes four resources in order: jQuery (via Wicket's built-in Ajax jQuery reference), FullCalendar CSS, FullCalendar JS (using the minified version in deployment mode, development version otherwise to aid debugging), and a custom extension script (fullcalendar.ext.js) that adds Wicket-specific FullCalendar methods. The deployment mode check (getApplication().usesDeploymentConfig()) follows Wicket's standard pattern for switching between optimized and debuggable assets.

JSON Serialization Strategy

Two inner static classes extend Jackson's StdSerializer to handle Joda-Time types that Jackson doesn't natively support:

These serializers are registered with the ProjectForge JSON utility class (ToStringUtil) and used by the Config serialization in the renderHead method of FullCalendar.

Class Hierarchy

AbstractFullCalendar extends MarkupContainer implements IHeaderContributor. Extending MarkupContainer (rather than a more specific Wicket component) gives flexibility to attach child behaviors and panels while contributing to the page's <head> section. The concrete FullCalendar class adds callback wiring and event management on top of this base.

Git History

CommitWhat changed
868d6abb7 through ceb63e8a1Six annual copyright header updates. The component's header contribution and serialization logic have been stable across all Wicket upgrades — the FullCalendar JavaScript library's resource loading pattern and Joda-Time serialization requirements have not changed.