Package org.apache.juneau.console.views


package org.apache.juneau.console.views
A typed, declarative "rich DataTables view" toolkit that serializes to the frozen VIEW_META JSON wire contract consumed by the first-party client runtime.

This optional module builds on juneau-console-datatables (the server-side query protocol). Table authoring now lives in FTL <@card type="datatables"> catalogs; this module keeps the VIEW_META JSON contract constants (ViewsMixin, ViewTable), region mounting (RegionDef, RegionTable), bulk-mutate / row-action types, and the first-party juneau-views.js/juneau-ribbon.js/juneau-renders.js runtime.

The module owns a dependency-free base .tag chip stylesheet and takes no hard dependency on juneau-console: the base chip keeps client-rendered views legible standalone, while console-ui's palette themes the shared .tag.<domain>.<value> class-name contract when present.

Alongside the DataTables view it also hosts the reusable calendar widget. A page mounts an empty data-juneau-calendar marker; the shipped juneau-calendar.js/juneau-calendar.css runtime hydrates it, and the month layout (grid, spanning-bar lanes, chip order, "+N more") is computed client-side by juneau-calendar.js. The CalendarDef bean itself lives in juneau-console-widgets (bean-only, no dependency on views); views composes it here.

Complex dialogs and nested popups (v1):

A RowAction whose presentation is DIALOG opens a declarative popup dialog described by ModalDef. The dialog may carry a FormDef whose FormDef.Input controls are the seven-type vocabulary — text, textarea, password (masked, write-only, never pre-filled), checkbox, toggle (a role=switch), select (single-select), and action (a button holding an ActionRef that opens a further dialog for a named row action, the composition trigger). Typed inputs are always painted from the model with createElement + .value / .checked / textContent — never as markup — so a live-data or hostile field value can never become an element. The client adds advisory inline validation (required, maxLength, pattern) that blocks the confirm while the server submit stays fully authoritative; a pattern that a browser regex engine rejects fails open rather than blocking a legitimate submit.

At runtime, dialogs, cell popovers, and row-action menus share a single popup layer stack that owns focus trapping, Escape-dismiss of the top layer, focus restore on close, and z-ordering. Cell-anchored surfaces are portalled to document.body as position:fixed so an overflow ancestor cannot clip them; the page-size chooser stays position:absolute. The v1 stack caps dialog-kind layers at two: a third dialog is a visible refusal painted into the current top dialog rather than an unbounded stack.

Both beans implements Widget: each declares a CONTRACT_VERSION and a validate() invariant check, and each guarantees the instance version is present from construction, confirm-only or form-bearing alike — independent of whether the serving path calls checked(). When a form is present the client enforces a fail-loud handshake — BOTH the modal and the nested form version must match the runtime's baked-in version or the dialog refuses to open; a confirm-only dialog (no form) is never version-gated, even though it now carries the same version.

Relocated: the dialog beans now live in the widgets module

ModalDef and FormDef were general enough to belong to the shared widget vocabulary, so they have moved from this package to org.apache.juneau.console.widgets. This is a breaking package relocation with no shim: a deprecated forwarding class left behind here would re-create the views→widgets dependency in reverse, so applications update their imports instead. Only the dialog beans moved — the table/row-action types they are used with (RowAction, IdempotencyKey, ActionResult, WritePermit) stay here. The dialog/form runtime also stays here, inside juneau-views.js: after the move a widgets-module bean is driven by a views-module script, which is deliberate rather than accidental (splitting that monolith is a separate concern).

Follow-ons (not in this cut):
  • A second in-tree dialog-form consumer is a 10.0-destination follow-on.
  • Richer controls (cron editor, rich text) are deferred.
See Also:
Since:
10.0.0
  • Class
    Description
    The typed result a row action's submit returns — the load-bearing half of the write path.
    The outcome discriminator a row-action submit reports.
    A single in-memory, one-shot async job — the streamed-progress + terminal-result unit of a future async write variant.
    The result of AsyncJob.awaitUpdate(int, Duration): the newly-available progress events and the terminal result (null while the job is still running).
    The "job accepted" envelope a row action's submit returns instead of a terminal ActionResult when the write is asynchronous.
    An in-memory, per-process registry of async jobs — the single-process job store a future async write variant runs on.
    Mixin interface that exposes the async-job SSE progress stream and cancel endpoint on any Juneau REST resource.
    A count badge in the page contract, fed by a JSON endpoint and polled by juneau-badges.js.
    placement wire tokens.
    scope.by wire tokens.
    tone wire tokens.
    The bulk-mutate opt-in for a ViewTable — the second, INDEPENDENT half of the row-selection / bulk-mutate separability guarantee.
    The request body of an aggregate-mode bulk action (RowAction.BulkMode.AGGREGATE) — every selected row's stable id, plus a client-generated idempotency key so a retried submit (e.g. after a dropped connection) never double-applies.
    The response shape of an aggregate-mode bulk action (RowAction.BulkMode.AGGREGATE) — one outcome per id submitted in the matching BulkRequest.
    A mutable builder for BulkResult.
    One failed-outcome entry: the id that was submitted, and why it failed.
    Author-declared per-cell popover attached to a Render.
    One datatable column's search configuration — its value SearchType and the optional per-column SearchOperatorSet.
    How a field-grid catalog entry (or a remaining declarative field) is painted.
    How many of a field-grid's columns one catalog entry occupies.
    A sparse, bounded index from 1-based line numbers to byte offsets in one UTF-8 text file that may keep growing while it is read.
    Builder for FileLineIndex.
    The result of a FileLineIndex.refresh().
    A TerminalViewSource over one growing JSON Lines file, one event per line, paged through a FileLineIndex.
    A server-minted idempotency key for a row-action submit, bound at mint time to the (action, targetId) pair it was issued for.
    The stock "record the minted key" store for row-bound job keys: issues an IdempotencyKey bound to (action, targetId[, principal]), and verifies a submitted key value against that recorded binding.
    A successful verify.
    The shared shape checks of a job-log declaration, used by the console's page-level job-log card and by a JobLogRegion, so the two cannot drift.
    Where a job-log declaration lives.
    The author-facing declaration of a job-log row-detail region, compiled to a RegionDef.
    The optional field grid painted above the form, whose slots output.target.field can address.
    One submit.fields entry.
    Where a terminal result is written.
    The submit declaration.
    One labelled value in a CellPopover, bound to a top-level row-data key.
    Serving-path allowlist of populator names that may be named on a region (RegionDef.populate).
    One item in a table's quick-stats strip (quickStats.items[]): a plain tile, a meter (one value against a maximum) or a segmented tile (a proportional bar of labelled counts).
    The tile's visual tone.
    A page "region": a named container whose contents a client-side populator fills in, chosen by name via RegionDef.populate rather than declared inline.
    One entry in the field catalog: a label, an optional named renderer and its meta, an optional href template, a paint format, a grid span, and per-field action-bar ids.
    Builds the server-rendered delivery tree for a RegionDef — an empty data-juneau-region container plus one sidecar per host carrying every region descriptor that host declares.
    A named cell-renderer reference in the VIEW_META wire contract.
    One ribbon (toolbar) entry above a table.
    A per-row action descriptor in the VIEW_META wire contract (the transport-agnostic "row-action intent" model).
    How an action behaves when driven from a bulk-mutate toolbar.
    The non-safe HTTP method a row action submits with.
    What the runtime does with a successful action result.
    How a row action's form/confirmation is presented.
    The visual tone of a row action's confirmation.
    A declarative disable-with-reason rule gating a RowAction on the row's own state, in the VIEW_META wire contract.
    Row-detail panel for a table: the per-row GET endpoint, title template, icon and the row-detail region.
    The action-envelope submit of a row job: {action, targetId, idempotencyKey, fields}, the shape the row-action dialog and the job-log card's envelope: "action" both send.
    The row-selection opt-in for a ViewTable — the first of the view table's two INDEPENDENT opt-ins.
    Where a SelectionDef's row selection lives across a view's lifetime.
    The "$FV{name}" / "$FV{name,default}" server-values variable.
    Serving-path allowlist of renderer ids that may be named on a fill sink (a field-grid catalog render entry or PopoverField.render).
    Java description of one datatables view: data source, columns, ribbon, row styling, row actions, row detail, selection and bulk actions.
    Where a view's rows come from.
    A default-sort direction.
    The author-facing declaration of a terminal-view region, compiled to a RegionDef.
    Static helpers that implement the terminal-view events endpoint.
    A thread-safe, in-memory TerminalViewSource that a producer appends to directly.
    Mixin interface that serves the terminal-view events endpoint.
    One page of a terminal-view event stream: the envelope the events endpoint returns and the client polls.
    The read side of a terminal-view event stream.
    Thrown for an unknown or stale token; endpoints answer 410 Gone.
    A datatable view definition — an ordered set of Column definitions carrying each column's search configuration.
    Mixin that serves the first-party rich-view runtime assets — juneau-views.js, juneau-ribbon.js, juneau-renders.js, juneau-views.css, the opt-in juneau-regions.js region-populate runtime, the opt-in juneau-config.js/juneau-config.css column-chooser runtime — each at its stable path, plus deprecated compatibility mounts for the two assets that have since moved to the widget module.
    Public DOM/CSS contract for a data-juneau-view table.
    A presentation-only visibility rule: the element is shown only when every rule in its list matches.
    Fluent operator picker returned by VisibilityRule.when(String).
    The views-toolkit's own structural gate token for BulkMutateDef: proof that the caller's own write-gate was consulted before a bulk-mutating affordance is configured (the opt-in separability guarantee).