Skip to main content

Two-Tier Architecture

The Gantt chart operates as a client-server system within Polarion. The server tier is a Java plugin that runs inside the Polarion application server. It handles data retrieval, field mapping, calendar resolution, and persistence. The client tier is a JavaScript application that renders the interactive chart in the browser, manages user interactions (drag, resize, lightbox editing), and communicates changes back to the server. Think of it like a spreadsheet application: the server is the database that stores and validates data, while the client is the visual interface where you interact with it. diagram

Data Loading Sequence

When a Polarion page containing a Gantt chart loads, the following sequence occurs:
  1. Initialization — The server reads chart parameters (data source, field mappings, calendar settings) and resolves the configuration into a typed configuration object
  2. Data retrieval — The server queries Polarion for work items matching the configured dataset, resolves parent-child relationships using the configured parentRoles, and builds dependency links from dependsRoles
  3. Task conversion — Each work item is converted into a task object with properties like start_date, end_date, duration, progress, parent, and type. Custom fields listed in the field filter are included as additional fields
  4. Calendar resolution — If working calendars are enabled (wCal_GLOBAL), the server computes working hours per day for each resource, including user calendars and team assignments
  5. JSON serialization — The complete dataset (tasks, links, resource collections, and load statistics) is serialized to JSON and sent to the client
  6. Client rendering — The JavaScript application parses the JSON, applies the configuration, and renders the Gantt chart with its grid, timeline, and optional resource view

The Data Payload

The server returns a structured JSON payload containing four key sections:
SectionContentPurpose
dataArray of task objectsWork items or plan items to display as task bars
linksArray of link objectsDependency relationships (FS, SS, FF, SF) between tasks
collectionsMap with resources and loadInfoResource definitions and capacity metadata for the resource view
Load statisticsItem counts, errors, server load timeFooter status bar showing what was loaded and any issues
The load statistics track how many items were loaded, skipped (due to limits), filtered, hidden, or unresolvable. When tasks reference work items that cannot be accessed (due to permissions or deletion), they appear as unresolvable items in the error count.

Configuration Flow

Configuration reaches the Gantt through two channels, each with a different scope:
  • Per-instance parameters are set on each Gantt chart through the Polarion page editor. They control data source, field mappings, visual options, and feature toggles for that specific chart. Examples: Start Field, End Field, Parent Role, Show Resource View.
  • Administration properties are set globally via Polarion Configuration Properties (nextedy.gantt.*). They control system-wide behavior like auto-scheduling defaults, calendar project references, and license caching. Examples: nextedy.gantt.default.auto_scheduling, nextedy.gantt.workitemCalendar.projectId.
For more on how these two layers interact, see Configuration Layers and Precedence.
When the same setting is available at both levels (such as the today’s date override), the per-instance parameter value takes precedence over the administration property.

Persistence Model

Nextedy GANTT uses an optimistic persistence model. When you drag a task bar, resize it, or edit fields in the lightbox, the changes are staged locally in the browser. A modified indicator appears on affected tasks. Changes are only written back to Polarion when you click Save in the toolbar. The save operation sends each modified task to the server, which updates the corresponding Polarion work item fields: startField, endField, durationField, progressField, resourceField, and any custom fields from the field filter. Dependency link changes (add or remove) update Polarion work item link roles.
The Gantt uses a last-save-wins model. If two users edit the same work item simultaneously, the last save overwrites the previous one. There is no built-in conflict detection for concurrent edits.

Scripting Extension Points

Nextedy GANTT provides two server-side scripting hooks for customization:
  • Item Script — Executes on the server for each work item during data loading. The script receives the source work item object and the task object being built, allowing you to read additional fields and pass custom data to the client. This is commonly used for custom color logic, computed labels, or baseline date injection.
  • Page Script — Executes once during page rendering, providing access to the full Gantt configuration and Polarion page context. Used for dynamic configuration adjustments.
Both scripts run in a server-side JavaScript environment, not in the browser. They prepare data before it reaches the client.
KB ArticlesSource Code
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/widget/GanttWidget.java
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/widget/GanttWidgetConfig.java
  • prod-gantt-src/com.nextedy.polarion.gantt/src/META-INF/hivemodule.xml
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/model/impl/types/TypeConfigWidgetParameters.java
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/model/Data.java