EN · DE · RU · FR · ES

#2786: FullCalendar.events.tpl

projectforge-wicket/src/main/java/net/ftlines/wicket/fullcalendar/FullCalendar.events.tpl Wicket Template (JavaScript callback) · projectforge-wicket/src/main/java/net/ftlines/wicket/fullcalendar/FullCalendar.events.tpl 15 lines · 14 code · 0 comments · 1 blank
A Wicket PackageTextTemplate resource that defines the JavaScript event-fetching callback injected into each FullCalendar event source's configuration. This single template file is the critical bridge between the Wicket server and the FullCalendar client: it generates a JavaScript function that makes a Wicket Ajax GET request to a dynamically-generated URL (unique per event source), passing the calendar's visible date range (start/end as epoch milliseconds), the client's timezone offset, and an anti-cache token. The response is passed directly to FullCalendar's callback as the event data array.

Architecture

Template Processing

The template uses Wicket's TextTemplate variable substitution syntax: ${url} is the only variable. At render time, FullCalendar.setupCallbacks() creates a HashMap with the key "url" set to the event source's Ajax callback URL (generated by Wicket.Ajax.ajax), and calls EVENTS.asString(map) to produce the final JavaScript.

Ajax Protocol

The generated JavaScript makes a Wicket Ajax call with parameters:

Template File Naming Convention

Wicket's PackageTextTemplate locates this file by convention: it must be in the same Java package (net.ftlines.wicket.fullcalendar) as the FullCalendar class and have the same base name. The .tpl extension signals it's a text template resource.

Git History

CommitWhat changed
9ebb88522Added the template file as part of the initial repository commit. The Ajax protocol (Wicket Ajax call with epoch timestamps, timezone offset, and anti-cache token) was established from the beginning and has remained unchanged — a testament to the stability of both Wicket's Ajax API and FullCalendar's event source protocol.