Custom Page Block

This is not a Java SPI. AuraBoot has no PageBlockExtension plugin extension point. Page Block capability is determined jointly by the platform front-end render registry and the back-end DSL whitelist. Here is the real mechanism.

Built-in block types — DslRegistry.BlockType

The source of truth for page block types is the back-end DslRegistry.BlockType enum (com.auraboot.framework.meta.constant.DslRegistry, Java). It defines every built-in blockType, for example: form-section, detail-section, form-buttons, filters, embedded-list, card-grid, chart, gallery, gantt, calendar, heatmap, gauge, funnel, bpm-panel, evidence-panel, activity-timeline, field-history, iframe, image, divider, description, action, composite, custom, and more. A page schema's blocks[].blockType takes these values, with schemaVersion set to 4.

Custom blocks — the front-end BlockRegistry

To add a block the platform doesn't have, the mechanism is to register a renderer on the front end, not to write a Java plugin:

  1. Front-end registration: in web-admin/app/ui/schema-renderer/BlockRegistry.ts, call BlockRegistry.register(blockType, { component, normalizeData })component is the React render component, and the optional normalizeData(raw, block) shapes the raw API payload into the structure the component expects. Components are lazy-loaded by blockType, so not every block is pulled into the main bundle.
  2. Page reference: reference it by that blockType in the page schema's blocks, and configure its data source / properties.
  3. Back end tolerates unknown types: PageSchemaBlockStructureValidator only emits a soft warning S-PAGE-BLOCK-TYPE for a blockType not on the whitelist — it does not hard-reject. This is deliberate forward compatibility, so custom plugin blocks can mount and a new blockType is not rejected by an older back end.

Common mistakes

  • Registering only on the front end, not in the back-end DslRegistry.BlockType: import emits the [S-PAGE-BLOCK-TYPE] soft warning. The block still renders (forward compatibility), but to make it a first-class whitelisted type you must add an enum value to the back-end DslRegistry.BlockType.
  • A records data source without adaptor:table: it defaults to optionList mapping into {value,label} and breaks columns; list / table blocks need adaptor:table on their dataSource.
  • Looking for a custom block as a Java extension point: there is no PageBlockExtension / @PageBlock annotation — rendering lives on the front end, and the back end only does schema validation.

Related