Class JobLogRegion

java.lang.Object
org.apache.juneau.console.views.JobLogRegion

public final class JobLogRegion extends Object
The author-facing declaration of a job-log row-detail region, compiled to a RegionDef.

The console's job-log card, hosted in a row's detail: a form whose submit runs a row-bound job through JuneauViews.jobs, streams its log, and optionally writes its result into a field. toRegion() produces a RegionDef.TYPE_ROW_DETAIL region with populate("job-log"), opts that populator in, and carries the whole declaration as RegionDef.config. The populator ships in the console's joblog pack.

The submit always uses the action envelope {action, targetId, idempotencyKey, fields}: targetId is the row id, and the key comes from submit.keyUrl, an endpoint that answers JobKeyLedger.response(IdempotencyKey). The shape rules live in JobLogChecks, shared with the page card.

Example:

RegionDef region = JobLogRegion.create("restock-species") .submit(JobLogRegion.Submit.create("/jobs/species/{id}/restock", "restock-species", "/jobs/species/{id}/key") .submitLabel("Restock") .field(JobLogRegion.Field.of("count").label("How many").type("number").defaultValue(1)) .field(JobLogRegion.Field.of("species").type("hidden").source("row.species"))) .output(JobLogRegion.Output.field("available").from("row.available")) .toRegion();

Since:
10.0.0
  • Field Details

  • Method Details

    • create

      public static JobLogRegion create(String id)
      Creates a declaration.
      Parameters:
      id - The region id.
      Returns:
      A new declaration.
    • fromMap

      public static JobLogRegion fromMap(String id, Map<String,?> config)
      Creates a declaration from a parsed map (a datatables card's detail.region.config).
      Parameters:
      id - The region id.
      config - The config object; keys must be a subset of KEYS.
      Returns:
      A new declaration (not yet validated).
      Throws:
      IllegalArgumentException - If config is not an object or has an unknown key.
    • submit

      Parameters:
      value - The submit declaration. @return This object.
    • detail

      Parameters:
      value - The optional field grid painted above the form. @return This object.
    • height

      public JobLogRegion height(int px)
      Parameters:
      px - The log pane height, in pixels. @return This object.
    • clearOnSubmit

      public JobLogRegion clearOnSubmit(boolean value)
      Parameters:
      value - Whether a submit clears the log first. @return This object.
    • output

      Parameters:
      value - Where a terminal result is written. @return This object.
    • validate

      Validates this declaration (fail-closed).
      Returns:
      This object.
      Throws:
      IllegalArgumentException - If a rule is broken.
    • toMap

      public Map<String,Object> toMap()
      Returns the config in canonical key order, so the builder and the console-card path emit the same sidecar.
      Returns:
      A new ordered map.
    • toRegion

      public RegionDef toRegion()
      Validates and compiles this declaration.
      Returns:
      A validated row-detail region.