Package com.onec.ui.divkit
Class SurfaceDivBuilder
java.lang.Object
com.onec.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 recordOne detail-header action. -
Method Summary
Modifier and TypeMethodDescriptioncatalogDetail(Map<String, Object> meta, Map<String, Object> row, Map<String, List<Map<String, Object>>> relatedRows, List<SurfaceDivBuilder.HeaderAction> actions, Palette p) A catalog item's detail surface: a header (with edit/delete actions when the caller may write) over a card of its visible system columns (code/description) and attributes, then a read-only table per related-list panel.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-patchofonec-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<com.onec.ui.divkit.Components.Row>, com.onec.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) A document's detail surface: header (+ posting/edit 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-patchofonec-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<com.onec.ui.divkit.Components.Row>, com.onec.ui.divkit.Palette)).entityForm(Map<String, Object> descriptor) Emits the create/edit form as the portableonec-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, List<Map<String, Object>> actions, List<Map<String, Object>> inputs) Theonec-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 anonec-listdiv-customblock (seePageBuilder.list).listSurface(ResolvedListView view, String kind, String name, String newUrl, List<Map<String, Object>> actions, List<Map<String, Object>> inputs) A list surface as theonec-listReact island: a single custom block carrying a descriptor (columns, sort, searchability, the open-route + New url).registerReport(Map<String, Object> meta, List<Map<String, Object>> movements, List<Map<String, Object>> balances, Palette p) Append the comments thread panel to a built detail surface.
-
Method Details
-
listSurface
public static Map<String,Object> listSurface(ResolvedListView view, String kind, String name, String newUrl, List<Map<String, Object>> actions, List<Map<String, Object>> inputs) A list surface as theonec-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. -
listDescriptor
public static Map<String,Object> listDescriptor(ResolvedListView view, String kind, String name, String newUrl, List<Map<String, Object>> actions, List<Map<String, Object>> inputs) Theonec-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 anonec-listdiv-customblock (seePageBuilder.list). -
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-patchofonec-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<com.onec.ui.divkit.Components.Row>, com.onec.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-patchofonec-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<com.onec.ui.divkit.Components.Row>, com.onec.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) A document's detail surface: header (+ posting/edit 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<com.onec.ui.divkit.SurfaceDivBuilder.HeaderAction>, com.onec.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) A catalog item's detail surface: a header (with edit/delete actions when the caller may write) over a card of its visible system columns (code/description) and attributes, then a read-only table per related-list panel. Catalogs have no posting, so it's flatter thandocumentDetail(java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>, java.util.List<com.onec.ui.divkit.SurfaceDivBuilder.HeaderAction>, com.onec.ui.divkit.Palette)— but the related-list tables are the catalog-side analogue of that view's tabular sections.relatedRowsmaps each panel'snameto its preloaded join rows; a panel renders (read-only, no add/remove) iff it isshowInDetailand present in that map (the caller omits panels the user may not read). Empty maps to no panel. -
entityForm
Emits the create/edit form as the portableonec-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 implementsonec-formfrom the same descriptor (the web client renders it in React today; a Flutter client renders its own form later). -
registerReport
-
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 detail surface. The panel is anonec-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 ontocatalogDetail(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<com.onec.ui.divkit.SurfaceDivBuilder.HeaderAction>, com.onec.ui.divkit.Palette)/documentDetail(java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>, java.util.List<com.onec.ui.divkit.SurfaceDivBuilder.HeaderAction>, com.onec.ui.divkit.Palette)without those methods knowing about comments. A no-op if the content has noitemslist (defensive).
-