Package su.onno.ui.divkit
Class SurfaceDivBuilder
java.lang.Object
su.onno.ui.divkit.SurfaceDivBuilder
Builds the per-surface DivKit content (catalog/document lists, document
detail, register report) from the resolved metadata view + data rows. Returns a
bare content div —
DivKitController wraps it in the app shell.
Composed only from native DivKit primitives so it renders on every official SDK
with no custom code, keeping a future Flutter client cheap.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordform(may be empty): an action-form dialog's field descriptors — the client collects them in a modal before POSTing the action (seeActionSpec.ActionBuilder#form). -
Method Summary
Modifier and TypeMethodDescriptionSurfaceDivBuilder.HeaderActions as the plain-JSON items the action-cluster island consumes (label / icon / url / tone / placement+ optionalform).catalogDetail(Map<String, Object> meta, Map<String, Object> row, Map<String, List<Map<String, Object>>> relatedRows, List<SurfaceDivBuilder.HeaderAction> actions, Palette p) Back-compat overload rendering the English chrome defaults (used by unit tests).catalogDetail(Map<String, Object> meta, Map<String, Object> row, Map<String, List<Map<String, Object>>> relatedRows, List<SurfaceDivBuilder.HeaderAction> actions, Palette p, UiMessages msg) catalogList(ResolvedListView view, List<Map<String, Object>> rows, String routeName, String newUrl, Palette p) catalogRows(ResolvedListView view, List<Map<String, Object>> rows, String routeName, Palette p) The rows stack as adiv-patchofonno-rows— a single replacement node re-carrying that id (seerowsPatch(java.util.List<java.lang.String>, java.util.List<java.lang.String>, java.util.List<su.onno.ui.divkit.Components.Row>, su.onno.ui.divkit.Palette)).documentDetail(Map<String, Object> meta, Map<String, Object> row, List<SurfaceDivBuilder.HeaderAction> actions, Palette p) Back-compat overload for surfaces with no related-list panels (e.g.documentDetail(Map<String, Object> meta, Map<String, Object> row, Map<String, List<Map<String, Object>>> relatedRows, List<SurfaceDivBuilder.HeaderAction> actions, Palette p) Back-compat overload rendering the English chrome defaults (used by unit tests).documentDetail(Map<String, Object> meta, Map<String, Object> row, Map<String, List<Map<String, Object>>> relatedRows, List<SurfaceDivBuilder.HeaderAction> actions, Palette p, UiMessages msg) A document's detail surface: header (+ posting/record actions), a card of its visible system columns and attributes, then a table per tabular section and finally a read-only table per related-list panel.documentList(ResolvedListView view, List<Map<String, Object>> rows, String routeName, String newUrl, Palette p) documentRows(ResolvedListView view, List<Map<String, Object>> rows, String routeName, Palette p) The rows stack as adiv-patchofonno-rows— a single replacement node re-carrying that id (seerowsPatch(java.util.List<java.lang.String>, java.util.List<java.lang.String>, java.util.List<su.onno.ui.divkit.Components.Row>, su.onno.ui.divkit.Palette)).entityForm(Map<String, Object> descriptor) Emits the create/edit form as the portableonno-formcustom component: adiv-customcarrying a plain-JSONformdescriptor (field metadata + the record's initial values + submit target).listDescriptor(ResolvedListView view, String kind, String name, String newUrl, boolean canWrite, List<Map<String, Object>> actions, List<Map<String, Object>> inputs) Theonno-listdescriptor (columns, sort, searchability, routes, actions, inputs) that the React island consumes — without the surface wrapping, so it can be embedded inside a page as anonno-listdiv-customblock (seePageBuilder.list).listDescriptor(ResolvedListView view, String kind, String name, String newUrl, boolean canWrite, List<Map<String, Object>> actions, List<Map<String, Object>> inputs, boolean dynamicActions) listSurface(ResolvedListView view, String kind, String name, String newUrl, boolean canWrite, List<Map<String, Object>> actions, List<Map<String, Object>> inputs) A list surface as theonno-listReact island: a single custom block carrying a descriptor (columns, sort, searchability, the open-route + New url).listSurface(ResolvedListView view, String kind, String name, String newUrl, boolean canWrite, List<Map<String, Object>> actions, List<Map<String, Object>> inputs, boolean dynamicActions) registerSurface(Map<String, Object> meta, String name, Palette p, UiMessages msg) The register surface as anonno-registercustom block: one or more named, paginated list views fed page-by-page from/api/list/registers/....Append the comments thread panel to a built record surface.
-
Method Details
-
listSurface
public static Map<String,Object> listSurface(ResolvedListView view, String kind, String name, String newUrl, boolean canWrite, List<Map<String, Object>> actions, List<Map<String, Object>> inputs) A list surface as theonno-listReact island: a single custom block carrying a descriptor (columns, sort, searchability, the open-route + New url). The island fetches pages from/api/list/...and virtualizes them, so a 10k-row entity never ships whole. -
listSurface
-
listDescriptor
public static Map<String,Object> listDescriptor(ResolvedListView view, String kind, String name, String newUrl, boolean canWrite, List<Map<String, Object>> actions, List<Map<String, Object>> inputs) Theonno-listdescriptor (columns, sort, searchability, routes, actions, inputs) that the React island consumes — without the surface wrapping, so it can be embedded inside a page as anonno-listdiv-customblock (seePageBuilder.list). -
listDescriptor
-
catalogList
-
catalogRows
public static List<Map<String,Object>> catalogRows(ResolvedListView view, List<Map<String, Object>> rows, String routeName, Palette p) The rows stack as adiv-patchofonno-rows— a single replacement node re-carrying that id (seerowsPatch(java.util.List<java.lang.String>, java.util.List<java.lang.String>, java.util.List<su.onno.ui.divkit.Components.Row>, su.onno.ui.divkit.Palette)). -
documentList
-
documentRows
public static List<Map<String,Object>> documentRows(ResolvedListView view, List<Map<String, Object>> rows, String routeName, Palette p) The rows stack as adiv-patchofonno-rows— a single replacement node re-carrying that id (seerowsPatch(java.util.List<java.lang.String>, java.util.List<java.lang.String>, java.util.List<su.onno.ui.divkit.Components.Row>, su.onno.ui.divkit.Palette)). -
documentDetail
public static Map<String,Object> documentDetail(Map<String, Object> meta, Map<String, Object> row, List<SurfaceDivBuilder.HeaderAction> actions, Palette p) Back-compat overload for surfaces with no related-list panels (e.g. unit tests). -
documentDetail
public static Map<String,Object> documentDetail(Map<String, Object> meta, Map<String, Object> row, Map<String, List<Map<String, Object>>> relatedRows, List<SurfaceDivBuilder.HeaderAction> actions, Palette p) Back-compat overload rendering the English chrome defaults (used by unit tests). -
documentDetail
public static Map<String,Object> documentDetail(Map<String, Object> meta, Map<String, Object> row, Map<String, List<Map<String, Object>>> relatedRows, List<SurfaceDivBuilder.HeaderAction> actions, Palette p, UiMessages msg) A document's detail surface: header (+ posting/record actions), a card of its visible system columns and attributes, then a table per tabular section and finally a read-only table per related-list panel. The related-list panels are the document-side parity with the catalog detail (seecatalogDetail(java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.util.List<java.util.Map<java.lang.String, java.lang.Object>>>, java.util.List<su.onno.ui.divkit.SurfaceDivBuilder.HeaderAction>, su.onno.ui.divkit.Palette)) — a booking can surface its guests (the reverse side of a Booking↔Client junction) without entering edit mode (see #110).relatedRowsmaps each panel'snameto its preloaded junction rows; a panel renders iff it isshowInDetailand present in that map (the caller omits panels the user may not read). Empty map → no panels. -
catalogDetail
public static Map<String,Object> catalogDetail(Map<String, Object> meta, Map<String, Object> row, Map<String, List<Map<String, Object>>> relatedRows, List<SurfaceDivBuilder.HeaderAction> actions, Palette p) Back-compat overload rendering the English chrome defaults (used by unit tests). -
catalogDetail
-
entityForm
Emits the create/edit form as the portableonno-formcustom component: adiv-customcarrying a plain-JSONformdescriptor (field metadata + the record's initial values + submit target). Rich controls — styled dropdowns, a calendar picker, a ref picker that can jump to the target catalog's form — need native widgets a DivKit document can't express, so this is deliberately a custom component: every client implementsonno-formfrom the same descriptor (the web client renders it in React today; a Flutter client renders its own form later). -
registerSurface
public static Map<String,Object> registerSurface(Map<String, Object> meta, String name, Palette p, UiMessages msg) The register surface as anonno-registercustom block: one or more named, paginated list views fed page-by-page from/api/list/registers/.... A BALANCE register carries a Balance + a Movements view; a TURNOVER register just Movements. The view switch is a plain React toggle (no DivKit tabs) — React owns which list is mounted, so switching can never blank the surface, and there's no animation. This replaces the old fully-server-rendered table: a packed register no longer streams its whole movement log into one DivKit document. -
withComments
public static Map<String,Object> withComments(Map<String, Object> content, String kind, String name, String id) Append the comments thread panel to a built record surface. The panel is anonno-commentsdiv-customcarrying the entity's(kind, name, id)triple; the React bridge loads and posts the thread itself from/api/comments/.... Returns the same content map (itsitemsreplaced with an extended copy), so callers can chain it ontoentityForm(java.util.Map<java.lang.String, java.lang.Object>)(the combined record surface) without that method knowing about comments. A no-op if the content has noitemslist (defensive). -
actionItems
SurfaceDivBuilder.HeaderActions as the plain-JSON items the action-cluster island consumes (label / icon / url / tone / placement+ optionalform). Shared by theonno-actions-menublock and the entity-form descriptor'sactions— the combined record surface renders the same cluster from the same shape.
-