EventProvider.javagetEvents(DateTime start, DateTime end) returns a collection of events within a given time range (called when FullCalendar fetches data for a visible date range), and getEventForId(String id) retrieves a single event by identifier (called during Ajax callbacks for event clicks, drags, and resizes). Implementations bridge between this contract and ProjectForge's domain layer — typically a DAO-backed provider that queries the database for calendar events, timesheet entries, or vacation records within the requested date window.The interface extends Serializable, which is mandatory in Wicket's component model. EventProvider instances are stored as fields of EventSource, which is serialized as part of the FullCalendar component's page state. Wicket's page store (which may persist pages to disk or a database between requests) requires all objects in the component tree to be serializable.
The getEvents(DateTime start, DateTime end) signature follows FullCalendar's event fetching protocol: the client sends start and end timestamps (as epoch milliseconds) based on the currently visible calendar view, and the server returns only events within that window. This enables lazy loading — a calendar with years of data only loads events for the currently displayed month/week. Implementations use Joda-Time's DateTime for timezone-safe range comparisons.
getEventForId(String id) is the point lookup called during Ajax callbacks. The client sends the event's string ID (typically a database primary key converted to string), and the provider must return the corresponding Event or throw EventNotFoundException. The separation from getEvents allows optimized single-record queries rather than re-scanning the entire date range.
| Commit | What changed |
|---|---|
868d6abb7 through ceb63e8a1 | Six annual copyright header updates. The interface contract has been stable — the two-method design (range query + point lookup) covers all FullCalendar data access patterns used by the application. |