Class BulkMutateDef
ViewTable — the second, INDEPENDENT half of the row-selection /
bulk-mutate separability guarantee.
Two required parameters make it structurally, not conventionally, safe
There is no zero-argument (or permit-less) way to obtain a BulkMutateDef: create(WritePermit, SelectionDef) takes both a WritePermit and the SelectionDef it operates against as
required positional parameters. Omitting either is a compile failure, not a missed javadoc sentence
— the same discipline the console's own WriteGuard uses for its WritePermit. This closes
both halves of the opt-in separability guarantee by construction:
- The
WritePermitproves the caller's own write-gate was consulted before this affordance is even configured — a bulk-mutate control cannot be reached by a caller who forgot to check. - The
SelectionDefproves a stable-row-id selection mechanism already exists for this table to target — aBulkMutateDefcan never float free of the selection it acts on, so the reverse question ("which rows does this bulk action see?") is never ambiguous. This is the only direction of coupling between the two opt-ins: bulk-mutate requires selection, but selection never requires (or even references) bulk-mutate — so enabling selection alone can never surface a bulk-mutate control.
Reuses RowAction and ActionResult verbatim — N per-row writes, per-target results
A bulk action is declared as an ordinary RowAction (the RowAction wire schema is completely
untouched by this type); juneau-views.js executes a bulk action as N independent, per-row invocations
of the SAME single-action submit path (submitRowAction) it already uses for the per-row action menu
— one fail-closed CSRF POST per selected row, each with its OWN data-juneau-inflight marker (the
per-row in-flight model, driven per target) and its OWN typed ActionResult, rendered
independently into that row's own outcome banner. There is deliberately no aggregate "bulk result": a
partial failure among N targets can never be hidden behind an aggregate success, and each target's
data-juneau-inflight marker clears on ITS OWN terminal outcome (success/failure/refusal/unknown) so a
stuck marker on one target can never halt the whole table's polling.
Its own, independent contract version
Unlike SelectionDef (which is pure DOM attributes, never wire data), a bulk action LIST is itself wire
data the client must parse — so it travels as its own JSON sidecar (distinct from the VIEW_META
one), with its own CONTRACT_VERSION, exactly mirroring how ActionResult versions itself
independently of VIEW_META rather than aliasing it. A version bump here can therefore
NEVER force a VIEW_META bump (or vice versa): the two contracts are unrelated, so this
opt-in cannot back the framework into the very lockstep the opt-in separability guard exists to avoid. The
WritePermit carried by this builder is a server-side-only construction guard and is never
serialized — only contractVersion and actions reach the wire.
Example:
SelectionDef
See Also:
- Since:
- 10.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe declared bulk actions, in menu order.static final StringThe frozen bulk-actions contract version — its own discriminator, deliberately NOT aliased toVIEW_META(see the class javadoc).The frozen contract-version discriminator (always "2" for this contract). -
Method Summary
Modifier and TypeMethodDescriptionDeclares the bulk actions.static BulkMutateDefcreate(WritePermit permit, SelectionDef selection) Starts a newBulkMutateDef, requiring proof that the caller's write-gate was consulted and the selection this bulk config will operate against.permit()The permit proving the caller's write-gate was consulted before this config was built.The selection this bulk config operates against.
-
Field Details
-
CONTRACT_VERSION
The frozen bulk-actions contract version — its own discriminator, deliberately NOT aliased toVIEW_META(see the class javadoc). Bumped only on a breaking wire change to this contract.- See Also:
-
contractVersion
The frozen contract-version discriminator (always "2" for this contract). -
actions
The declared bulk actions, in menu order. Each is an ordinary, unmodifiedRowAction.
-
-
Method Details
-
create
Starts a newBulkMutateDef, requiring proof that the caller's write-gate was consulted and the selection this bulk config will operate against.- Parameters:
permit- A permit the caller's OWN write-gate minted after its own checks passed. Must not benull .selection- TheSelectionDefthis bulk config operates against. Must not benull .- Returns:
- A new
BulkMutateDefwith no actions yet declared. - Throws:
IllegalArgumentException- Ifpermitorselectionisnull .
-
actions
Declares the bulk actions.- Parameters:
value- The actions, in menu order. Each declares a mutating request executed once per selected row (see the class javadoc's N-per-row-writes section). Must not benull or empty.- Returns:
- This object.
- Throws:
IllegalArgumentException- Ifvalueisnull or empty.
-
permit
The permit proving the caller's write-gate was consulted before this config was built.- Returns:
- The permit. Never
null .
-
selection
The selection this bulk config operates against.- Returns:
- The selection. Never
null .
-