Package org.apache.juneau.console.views
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 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:
juneau-calendar.js DataTablesQueryDataTablesColumns- DataTables Server-Side Processing
- Since:
- 10.0.0
-
ClassDescriptionThe 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 terminalActionResultwhen the write is asynchronous.An in-memory, per-process registry ofasync 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 byjuneau-badges.js.placementwire tokens.scope.bywire tokens.tonewire tokens.The bulk-mutate opt-in for aViewTable— the second, INDEPENDENT half of the row-selection / bulk-mutate separability guarantee.The request body of anaggregate-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 anaggregate-mode bulk action (RowAction.BulkMode.AGGREGATE) — one outcome per id submitted in the matchingBulkRequest.A mutable builder forBulkResult.One failed-outcome entry: the id that was submitted, and why it failed.Author-declared per-cell popover attached to aRender.One datatable column's search configuration — its valueSearchTypeand the optional per-columnSearchOperatorSet.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 forFileLineIndex.The result of aFileLineIndex.refresh().ATerminalViewSourceover one growing JSON Lines file, one event per line, paged through aFileLineIndex.Builder forFileTerminalViewSource.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 anIdempotencyKeybound 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-leveljob-logcard and by aJobLogRegion, so the two cannot drift.Where a job-log declaration lives.The author-facing declaration of a job-log row-detail region, compiled to aRegionDef.The optional field grid painted above the form, whose slotsoutput.target.fieldcan address.Onesubmit.fieldsentry.Where a terminal result is written.Thesubmitdeclaration.One labelled value in aCellPopover, 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 viaRegionDef.populaterather 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 aRegionDef— an emptydata-juneau-regioncontainer plus one sidecar per host carrying every region descriptor that host declares.A named cell-renderer reference in theVIEW_METAwire contract.One ribbon (toolbar) entry above a table.A per-row action descriptor in theVIEW_METAwire 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 aRowActionon the row's own state, in theVIEW_METAwire 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'senvelope: "action"both send.The row-selection opt-in for aViewTable— the first of the view table's two INDEPENDENT opt-ins.Where aSelectionDef'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 catalogrenderentry orPopoverField.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 aRegionDef.Static helpers that implement the terminal-view events endpoint.A thread-safe, in-memoryTerminalViewSourcethat 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 answer410 Gone .A datatable view definition — an ordered set ofColumndefinitions 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-injuneau-regions.jsregion-populate runtime, the opt-injuneau-config.js/juneau-config.csscolumn-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 adata-juneau-viewtable.A presentation-only visibility rule: the element is shown only when every rule in its list matches.Fluent operator picker returned byVisibilityRule.when(String).The views-toolkit's own structural gate token forBulkMutateDef: proof that the caller's own write-gate was consulted before a bulk-mutating affordance is configured (the opt-in separability guarantee).