Layouts
Layouts define the UI structure of a class — which fields, relations, actions, and navigations are shown, and in what order. Each layout has a kind that determines where it is used.
Definition
{
"class": "my-project.employmentAgreement",
"kind": "OBJECT_DASHBOARD",
"label": "LABEL:contractDetails",
"tabPage": false,
"items": [...]
}
| Property | Type | Description |
|---|---|---|
class | QualifiedName | The class this layout applies to. |
name | string | Identifier for named layout variants (selected via ?name=xxx). |
label | string | Label key for the layout's title (tab or section). See Label keys. |
kind | LayoutKind | Determines where this layout is rendered. See Layout kinds. |
items | LayoutItem[] | Ordered list of items to display. |
tabPage | boolean | When true, this layout is rendered as a tab; when false (default), as the main section. |
order | integer | Controls the display sequence of panels and tabs. On OBJECT_FORM_DASHBOARD, layouts with the same order are presented as alternatives to choose from. Omit to preserve declaration order. |
group | string | Key of a tab group declared on the class. Only meaningful on a tab (tabPage: true) of an OBJECT_DASHBOARD. |
counterFormula | string | INTEGER formula evaluated on the object; the result is the tab's badge. See Counters and visibility. |
visibleFormula | string | BOOLEAN formula evaluated on the object; the tab is shown only when it is true. Omit to always show. |
condition | string | Formula expression evaluated against the current form state. The layout is hidden when the expression evaluates to false. Only meaningful on OBJECT_FORM_DASHBOARD. Omit to always show. |
create | boolean | Whether this layout is shown when creating a new object. Default: true. Only meaningful on OBJECT_FORM_DASHBOARD. |
modify | boolean | Whether this layout is shown when editing an existing object. Default: true. Only meaningful on OBJECT_FORM_DASHBOARD. |
Layout kinds
| Kind | Description |
|---|---|
OBJECT_DASHBOARD | Main detail view for a single object. Usually has a main section and optional tab layouts for related objects. |
RELATED_OBJECT | Content shown for an object when another object's page displays it through a RELATED_OBJECT item. Supports named variants via name. |
OBJECT_FORM_DASHBOARD | Inline creation form for a new object. |
GENERAL_DASHBOARD | Dashboard not tied to a specific object (e.g. a home or search screen). Supports named variants via name. |
CLASS_DASHBOARD | List/table overview for all objects of a class. |
NAVIGATION_PANE | Items shown in the sidebar navigation. Usually contains NAVIGATE items. |
Label keys
Labels used in layouts and layout items (headers, tabs, button captions, static text) are label keys, resolved to translated text. The format is PREFIX:name, for example LABEL:contractDetails or CLASS_PLURAL:commons.document.
| Prefix | Resolves to |
|---|---|
LABEL:key | A general translation key from generalLabels in the class translation. |
CLASS_SINGULAR:class | Singular name of the named class, e.g. CLASS_SINGULAR:commons.document. |
CLASS_PLURAL:class | Plural name of the named class. |
FIELD_LABEL:field | Label for the named field. |
LIST_VALUE:list:key | Label for a standard list item. |
PLAIN_TEXT:text | Literal text, no lookup performed. |
BLANK | Empty string. |
Strings without a recognized prefix are treated as PLAIN_TEXT. Inline HTML is also supported.
Merging layouts across classes
When more than one class contributes a layout of the same kind for the same object — most commonly a commons class and an EXTENSION that targets it — the layouts are combined instead of shown separately. A panel (tabPage: false) merges into the object's main section; a tab (tabPage: true) merges into an existing tab when its label matches another contributing layout's label exactly. If the labels differ, the layouts stay as separate tabs.
This makes a layout's label double as the merge identity for a tab — it's the value an EXTENSION or another class must reuse to land its own fields inside an existing shared tab, rather than opening a second one next to it.
Overriding a shared tab label
Because label is the merge identity, changing it to rename a shared tab splits it into two tabs instead of renaming the original. And a bare, prefix-less label resolves as literal PLAIN_TEXT (see Label keys) with no translation lookup at all, so there is nothing to override.
To keep a shared tab's label overridable, the class that first declares it should use a LABEL: key with a matching generalLabels entry, rather than a plain-text string:
{
"kind": "OBJECT_DASHBOARD",
"tabPage": true,
"label": "LABEL:registrationDetails",
"items": [ ... ]
}
"translations": [
{
"language": "en",
"generalLabels": {
"registrationDetails": "Registration Details"
}
}
]
Another class can then override just the displayed text — without touching label, so the merge stays intact — by declaring its own translation scoped to the class the tab belongs to, using the class property described in Translations:
{
"version": 1,
"class": "my-project.companyExtension",
"kind": "EXTENSION",
"extends": "commons.company",
"translations": [
{
"language": "en",
"class": "commons.company",
"generalLabels": {
"registrationDetails": "Company Registration"
}
}
]
}
The class scope must match the class the merged tab belongs to (here commons.company), not the extension's own class — that's what resolves the override against the tab's LABEL:registrationDetails key.
Deterministic item order in a merged panel
Every layout item accepts an optional order (integer), separate from the layout-level order used for multi-step forms. It controls where an item lands relative to items contributed by other classes to the same merged panel or tab.
Absent order behaves as 0 — the same convention CSS flexbox's order property uses. Items without an explicit order keep their position relative to each other, so a layout where nothing declares order is unaffected by merging. A negative value moves an item toward the front of the merged panel, a large positive value toward the back:
{ "name": "priorityFlag", "order": -1 }
{ "name": "internalNote", "order": 100 }
Use this when your own class contributes a field to a tab that a commons class or another EXTENSION already fills, and that field needs to reliably appear first or last regardless of which other classes also contribute to the tab.
Grouped tabs
A record with many tabs — a company can easily have forty — is hard to scan as one flat row. A class can instead declare groups: the page shows a row of groups, and the tabs of the selected group below it. A class without groups renders its tabs flat, as before.
Declaring groups
Groups are declared on the class, next to layouts:
{
"class": "my-project.company",
"kind": "BASIC",
"groups": [
{ "key": "finance", "label": "CLASS_PLURAL:my-project.financeDossier", "icon": "ti-coins" },
{ "key": "ownership", "label": "LABEL:ownership", "counterFormula": "count(shareholdings[from=company])" },
{ "key": "contracts", "label": "CLASS_PLURAL:my-project.contractDossier", "visibleFormula": "exists(contracts)" }
]
}
| Property | Type | Description |
|---|---|---|
key | string | Identifier the tabs refer to. Unique within the class. |
label | string | A label key. Reusing a CLASS_PLURAL: label of an abstract dossier class keeps group names consistent with the dossier tabs. |
icon | string | Optional icon name, such as ti-coins. Shown in the group row. Tabs themselves never show an icon. |
counterFormula | string | Optional INTEGER formula for the group badge. Overrides the default sum. |
visibleFormula | string | Optional BOOLEAN formula. The group is hidden unless it evaluates to true. |
Groups are scoped to the class that declares them. Declare all of a class's tabs on that class, including tabs for classes that a tenant may not have installed: a tab whose class is absent for the tenant (its module is not installed) is left out, so the set of groups stays stable across tenants.
Group icons
A group can carry an icon: the name of an icon from Tabler Icons, written with the ti- prefix (ti-building, ti-shield-check). The field is optional; a group without it shows its label only. The icon is rendered as a subtle outline icon next to the group label. Tabs within a group stay icon-free.
Icon set. Tabler Icons is the adopted set: MIT-licensed outline icons, self-hostable. MIT (like ISC, the licence of Lucide) only requires that the licence notice is kept in source, not shown in the UI. LGPL is avoided for these assets: it is aimed at code and libraries, and its terms are unclear for loose SVG files. Use an icon name that exists in Tabler Icons.
Convention. One shared set of about ten icons is reused across all classes, one per abstract dossier category. Use the same icon for the same category in every class:
| Group (dossier category) | Icon |
|---|---|
generalDossier | ti-building |
corporateDossier | ti-sitemap |
contractDossier | ti-file-text |
complianceDossier | ti-shield-check |
financeDossier | ti-coins |
taxDossier | ti-receipt-tax |
annualAccountsDossier | ti-report |
legalDossier (claims) | ti-umbrella |
assetDossier | ti-building-warehouse |
humanResourcesDossier | ti-users |
The automatic general group. The general group is not declared in groups, so the metadata carries no icon for it. A host application, such as the content app, supplies the icon itself by projecting an element into the named slot icon-general of <mrd-tab-groups>, next to the icon-{group key} slots of the declared groups. The recommended icon is ti-building, in line with generalDossier above:
<i class="ti ti-building" slot="icon-general" aria-hidden="true"></i>
The slot is named icon-general, not icon-__general, even though the group's internal key is __general. Do not give a group of your own the key general: its icon slot would collide with this one.
Alignment. As soon as the host projects at least one group icon, groups without an icon reserve the same space, so the labels stay aligned. Without any icon nothing changes.
Assigning a tab to a group
A tab names its group with group:
{
"class": "my-project.company",
"kind": "OBJECT_DASHBOARD",
"tabPage": true,
"label": "LABEL:shareholders",
"group": "ownership",
"items": [...]
}
Tabs for dossiers derive their group instead of declaring it: the group is that of the related dossier's abstract parent, found through inheritance. A loanAgreement that inherits financeDossier lands in the group finance without setting group. Tabs that do not show a dossier set group explicitly.
A tab without group, or with a key that matches no group of the class, goes in the automatic general group. It has a default label and is shown first, at the top. A class that declares no groups never shows it, because its tabs are flat.
Counters and visibility
counterFormula and visibleFormula are ordinary formulas, evaluated with the displayed object as context. There is no enum for "show when not empty" — it is written as exists(...). They can be set on a group and on a tab (a layout with tabPage: true). They cannot be set on an entry of alternativeViews.
| Property | Result type | When absent |
|---|---|---|
counterFormula | INTEGER | No badge on a tab. On a group, the badge is the sum of its visible tabs' counters. |
visibleFormula | BOOLEAN | Always visible. When present, shown only when the formula is true. |
The group's default badge is computed by the client from the counters it already has; it costs no extra formula. An explicit counterFormula on the group replaces that sum.
{
"kind": "OBJECT_DASHBOARD",
"tabPage": true,
"label": "CLASS_PLURAL:my-project.agreement",
"group": "contracts",
"counterFormula": "countIf(agreements.active)",
"visibleFormula": "exists(agreements)",
"items": [...]
}
countIf(agreements.active) counts only the active agreements, so the badge reads 3 while the list itself may hold more. The rule visibleFormula hides the tab for objects without any agreement at all.
Hiding a group on access works through the same mechanism: formulas are access-aware, so exists(...) is false for a user who may see none of the related objects. Hiding by module or role is not available yet.
The platform generates both formulas for the tabs it adds automatically for dossiers.
Multi-view tabs
A tab that offers alternative views, for example shareholders and appointments, has one visibleFormula and one counterFormula for the whole tab. Make the tab visible when any of its views has content by combining the views with ||:
{
"kind": "OBJECT_DASHBOARD",
"tabPage": true,
"label": "LABEL:shareholdings",
"group": "ownership",
"visibleFormula": "exists(shareholdings[from=company]) || exists(shareholdings[from=shareholder])",
"counterFormula": "count(shareholdings[from=company])",
"items": [
{
"type": "VIEW",
"class": "my-project.shareholding",
"name": "heldShares",
"alternativeViews": [
{ "name": "holdings", "label": "LABEL:holdings" }
]
}
]
}
The badge does not change when the user switches views. Counts per view, if needed, belong on the labels of the view switch rather than on the tab. See from= for the two roles a company can have in a shareholding.
On a RELATED_VIEW, each view can belong to its own role through fromClass: the primary view through the item's fromClass, each alternative view through its own. An object gets the views of every role it can have, also a role it does not have yet: adding the first related object in the tab is what gives it the role. A company that is not yet a borrower still gets a loan agreements tab, so the first loan agreement can be added there.
- The views of the roles the object already has come first. The first of them is the primary view. A company that is a vendor but not a group company sees the vendor view of a procurements tab first.
- The other views keep their declared order.
- A primary view with
filterClassalways stays first, because an alternative view cannot take over afilterClass. - A view of a role the object can never have (for example a person role on a company) is left out. A tab without any view is left out.
The visibleFormula then decides whether the tab is shown, for example exists(procurements[from=groupCompany]) || exists(procurements[from=vendor]). A hidden tab can be revealed with the ellipsis, see below.
Revealing empty tabs
Tabs whose visibleFormula is false are hidden. A subtle ellipsis control at the end of the tab row reveals the hidden tabs of the current group only; other groups keep their tabs hidden. Adding an object happens in the tab itself, in the context of the view that is open. There is no separate add menu.
Layout items
Each item in items has a type that determines its structure. When type is omitted, FIELD is assumed.
Layout-level defaultValue always takes priority over the schema-level default: the field's defaultValue for FIELD items, RelationDefinition.defaultValue for RELATION items.
Every kind of item also accepts an optional order (integer) used to position it within a merged panel or tab.
FIELD
Displays a field.
{ "name": "jobTitle" }
{ "type": "FIELD", "name": "salary", "header": true }
| Property | Description |
|---|---|
name | The field name to display. |
header | When true, renders this field as the main title of the panel. |
defaultValue | Pre-filled value when the form opens for a new object. Accepts a static value (string, number, or boolean) or a token: today() for the current date, now() for the current date and time. |
showEmpty | When true, keeps the field visible on an OBJECT_DASHBOARD even when it has no value. Default: false — fields without a value are hidden. |
{ "type": "FIELD", "name": "startDate", "defaultValue": "today()" }
{ "type": "FIELD", "name": "hoursPerWeek", "defaultValue": 40 }
Use showEmpty for fields where the absence of a value is itself meaningful and should be visible at a glance, rather than the field silently disappearing from the dashboard:
{ "type": "FIELD", "name": "terminationDate", "showEmpty": true }
HEADER
A section heading.
{ "type": "HEADER", "label": "Employment details" }
| Property | Description |
|---|---|
label | The heading text, a LabelKey string, or inline HTML. |
ACTION
A button that triggers a script, opens a report, or acts on the current object.
{ "type": "ACTION", "name": "sendInvitation", "label": "Send invitation", "actionType": "SCRIPT" }
{ "type": "ACTION", "name": "invoicePDF", "label": "Print invoice", "actionType": "REPORT" }
{ "type": "ACTION", "label": "Delete", "actionType": "REMOVE" }
{ "type": "ACTION", "label": "Edit", "actionType": "MODIFY" }
{ "type": "ACTION", "label": "Merge", "actionType": "MERGE" }
| Property | Description |
|---|---|
name | The script or report name to invoke. Not required for REMOVE, MODIFY, or MERGE. |
label | Button caption or LabelKey string. |
actionType | What happens when the button is clicked. Defaults to SCRIPT when omitted. |
actionType values:
| Value | Description |
|---|---|
SCRIPT | Invokes the named script on the current object. Default when actionType is omitted. |
REPORT | Opens the named report for the current object in a new browser tab. See Reports. |
REMOVE | Deletes the current object. name is ignored. |
MODIFY | Opens the edit form for the current object. name is ignored. |
MERGE | Opens the merge screen for the current object. name is ignored. |
NAVIGATE
A navigation link to another class or screen.
{
"type": "NAVIGATE",
"class": "my-project.invoice",
"navigationKind": "CLASS_DASHBOARD",
"icon": "receipt"
}
| Property | Description |
|---|---|
class | The class to navigate to. Optional — see Omitting class below. |
relatedClass | Optional. Creates an object of relatedClass instead of class, linked to the current object through the relation relatedClass declares against class — see Creating a related object the current object isn't yet eligible for below. |
navigationKind | Which page to open. See the navigation kinds below. |
icon | Optional icon identifier. |
label | Optional LabelKey string for the displayed text. Takes priority over the class-derived fallback below. |
name | Selects a named general dashboard when navigationKind is DASHBOARD. This is a dashboard selector, not a display label — it has no effect on the rendered text. |
navigationKind values:
| Value | Description |
|---|---|
CLASS_DASHBOARD | Opens the list/table page for the target class. |
OBJECT_FORM_DASHBOARD | Opens an inline creation form for the target class (or relatedClass, when set). |
DASHBOARD | Opens a general dashboard, optionally named via name. |
Label resolution
When label is omitted, the displayed text falls back to CLASS_PLURAL:{class} — the plural name of class — and to BLANK when neither label nor class is set. Set label explicitly whenever the item's text shouldn't be tied to a single class's plural, for example a sidebar grouping that spans several classes, or an entry that opens the default dashboard.
Omitting class
class can be omitted entirely when navigationKind is DASHBOARD and name is not set — this opens the default, unnamed general dashboard without requiring an arbitrary anchor class:
{
"type": "NAVIGATE",
"navigationKind": "DASHBOARD",
"label": "LABEL:home",
"icon": "home"
}
Without a class, no plural fallback is available for the label, so declare label explicitly — otherwise the item renders with BLANK text.
Creating a related object the current object isn't yet eligible for
relatedClass, combined with navigationKind: OBJECT_FORM_DASHBOARD, opens a creation form for relatedClass linked to the current object through the relation relatedClass declares against class — even when the current object doesn't hold class in its type set yet, as long as it's structurally eligible for it (see How relations add classes).
{
"type": "NAVIGATE",
"class": "legalmanager.prospect",
"relatedClass": "legalmanager.salesDossier",
"navigationKind": "OBJECT_FORM_DASHBOARD",
"label": "PLAIN_TEXT:Add sales dossier",
"icon": "briefcase"
}
Placed on legalmanager.company's dashboard, this offers "Add sales dossier" even on a company that isn't a legalmanager.prospect yet. Submitting the form creates the sales dossier linked to the company through the relation salesDossier declares against prospect, and grants the company the prospect class as a side effect — no separate step to promote the company to a prospect first.
Without relatedClass, a NAVIGATE item can only open a form for class itself, so this action could only be offered once the current object already held prospect — which is exactly the gap relatedClass closes. Retrieving the created object (or the company, now carrying prospect) relies on the structural-eligibility fallback on GET.
RELATION
An editable relation field.
{ "type": "RELATION", "relatedClass": "commons.company", "editBehavior": "SEARCH" }
| Property | Description |
|---|---|
relatedClass | The class of the related object. |
editBehavior | UI widget for selecting objects: SEARCH (free-text), DROPDOWN, or CHECKBOX (for multiple with few options). |
defaultValue | Pre-filled relation when the form opens for a new object. Use the token me() to resolve to the currently logged-in user (fetched from /accounts/{tenantId}/me — the person the caller's profile links to). |
showEmpty | When true, keeps the relation visible on an OBJECT_DASHBOARD even when no object is linked. Default: false — relations without a value are hidden. |
The me() token is useful when a relation should default to the person who creates the record — for example, assigning a task or project to yourself:
{
"type": "RELATION",
"relatedClass": "commons.person",
"editBehavior": "SEARCH",
"defaultValue": "me()"
}
defaultValue may also be set on the RelationDefinition itself, in which case it applies to every layout showing the relation, including auto-generated ones — a layout item's own defaultValue overrides it. commons.memo's author relation is the reference example; see Memo archetype.
RELATED_OBJECT
Displays a related object inline and read-only: its name as a link, followed by items from a layout on the related class. Use it to show fields of a related object without copying them into the current class through formula fields.
{ "type": "RELATED_OBJECT", "relatedClass": "legalmanager.clientAgreement", "name": "invoiceSummary" }
| Property | Description |
|---|---|
relatedClass | The class of the related object. Must be a relation of the declaring class, or of a class it can be combined with. |
name | Selects a named RELATED_OBJECT layout on the related class. Omit to use the unnamed one. |
The item only names the related class. What is shown below the name comes from a separate layout of kind RELATED_OBJECT declared on the related class itself. Because of this, the same content is reused on every page that shows that related object. That layout may contain any item type, including a VIEW or RELATED_VIEW that lists the related object's own relations.
Rules:
- Single relations only. For relations that hold more than one object, use a
RELATED_VIEW. - No generated default. If the related class has no matching
RELATED_OBJECTlayout, only the name and link are shown. - Left out when the relation is absent. If the object's current set of classes doesn't include the relation to
relatedClass, the item is not rendered. - Reader's rights apply. What the reader may see of the related object follows their rights on the related class.
- Where it can be used. On
OBJECT_DASHBOARD, and in forms (OBJECT_FORM_DASHBOARD), where it appears as a read-only block.
Example: show agreement details on an invoice
The invoice page shows the client agreement's PO number and remarks. The invoice declares the item:
{
"class": "legalmanager.invoice",
"kind": "OBJECT_DASHBOARD",
"items": [
{ "name": "invoiceNumber", "header": true },
{ "name": "amount" },
{ "type": "RELATED_OBJECT", "relatedClass": "legalmanager.clientAgreement", "name": "invoiceSummary" }
]
}
The client agreement declares what is shown:
{
"class": "legalmanager.clientAgreement",
"kind": "RELATED_OBJECT",
"name": "invoiceSummary",
"items": [
{ "name": "poNumber" },
{ "name": "remarks" }
]
}
Field labels, formatting and translations come from clientAgreement, so the invoice no longer needs its own copies such as a poNumber formula field.
RELATED_VIEW
Displays a filtered list of related objects, typically as a tab.
{
"type": "RELATED_VIEW",
"fromClass": "my-project.project",
"relatedClass": "my-project.task",
"showTitle": true
}
| Property | Description |
|---|---|
fromClass | The class the relation originates from: the current object's class or a role it has or can get. The tab is also published for an object that does not have the role yet. See Multi-view tabs. |
relatedClass | The class of the related objects to list. |
filterClass | When set, restricts the list to this subclass of relatedClass. |
label | Optional display text (LabelKey string or literal) that names the primary view in the alternative views dropdown. Falls back to the plural of filterClass, or of relatedClass when filterClass is not set. Also used as the section heading when showTitle is true. |
showTitle | Whether to show a section heading. |
name | Named view on relatedClass to use (omit for default). |
actions | Toolbar actions available on the list. Supported values: "NEW" (add button) and "EXPORT" (export button). Defaults to ["NEW", "EXPORT"] when omitted. |
alternativeViews | Optional list of additional named views the user can switch to. Same structure as for VIEW. class defaults to relatedClass when omitted; fromClass gives a view its own role, see Multi-view tabs. |
navigateBehaviour | How clicking a row opens its target. PAGE (default) navigates to a full page; OVERLAY_PAGE opens the target as an overlay on top of the current page. See Navigate behaviour. |
SEARCH
An embedded search widget for a class.
{ "type": "SEARCH", "class": "commons.person", "showTitle": true }
| Property | Description |
|---|---|
class | The class to search within. |
showTitle | Whether to show a section heading. |
TEXT
A static text block.
{ "type": "TEXT", "label": "This section shows employment history." }
| Property | Description |
|---|---|
label | Text content, a LabelKey string, or inline HTML. |
VIEW
Embeds a named or default View for a class.
{ "type": "VIEW", "class": "my-project.task", "name": "openTasks", "showTitle": true }
| Property | Description |
|---|---|
class | The class whose view is rendered. |
name | The named view to embed (omit for the default view). |
showTitle | Whether to show a section heading. |
actions | Toolbar actions available on the view. Supported values: "NEW" (add button) and "EXPORT" (export button). Defaults to ["NEW", "EXPORT"] when omitted. |
alternativeViews | Optional list of additional named views the user can switch to. When present, a dropdown is rendered next to the filter button. |
navigateBehaviour | How clicking a row opens its target. PAGE (default) navigates to a full page; OVERLAY_PAGE opens the target as an overlay on top of the current page. See Navigate behaviour. |
Each entry in alternativeViews:
| Property | Description |
|---|---|
name | The named view to load when selected. |
label | Optional display text (LabelKey string or literal). Falls back to name when omitted. |
class | Optional class override. Defaults to the item's class when omitted. |
fromClass | RELATED_VIEW only: the role of the object shown that this view lists the related objects for. Optional; when omitted it follows from the relation to class. The view is only offered to objects that have or can get this class. See Multi-view tabs. |
The class of an alternative view counts as shown, like the class of the item itself. No automatic related-view tab is generated for a relation that is already offered through an alternative view, so a RELATED_VIEW whose alternative view has a different class does not get a second tab for that class.
The class and name of each alternative view are validated when the model loads. An alternative view with an unknown class, or a name that is not a view of that class, makes the model fail to load.
{
"type": "VIEW",
"class": "legalmanager.clientAgreement",
"alternativeViews": [
{ "name": "inactiveAgreements", "label": "Inactive" },
{ "name": "archivedAgreements", "label": "Archived" }
]
}
GRAPH
Shows a graph, for example an ownership structure as an orgchart. The graph definition says what the data is; the GRAPH item says which part of it is shown, how, and where.
{
"type": "GRAPH",
"graph": "entityhub.governance",
"display": "ORGCHART",
"mode": "CONNECTED",
"edges": {
"shareholding": { "percentage": "financialInterest", "voting": "votingInterest" },
"directorship": {}
}
}
| Property | Description |
|---|---|
graph | The id of a graph in graphDefinitions. Required. |
display | How the graph is drawn. ORGCHART (default, currently the only display). |
mode | SCOPE (default) or CONNECTED; see Graph API modes and Choosing what is shown below. |
center | The node the graph starts from: a fixed object href, or a system setting. In CONNECTED mode it is the start of the graph; in SCOPE mode only where the display opens. Omit it on an OBJECT_DASHBOARD to use the object shown. |
fromClass | SCOPE mode on an OBJECT_DASHBOARD only: show the edges whose edge object relates to the object shown through a relation to this class, as on a RELATED_VIEW. |
edges | The edge kinds to show (keys) and, per kind, which of its attributes plays which role in the display (values). Omit to show every kind without roles. |
name | Identifies the item. Required when the item depends on the object shown (see Data link); lowerCamelCase and unique in the whole model. |
label | Optional title, a label key. No title by default. |
Roles. A display defines roles that an edge attribute can play. ORGCHART has two:
| Role | Meaning |
|---|---|
percentage | The financial interest, shown on the line and used to calculate consolidated interests. |
voting | The voting interest. |
Roles live on the item, not in the graph, because they belong to one display: an ownership chart needs a percentage, a department tree does not. A kind without roles is written as {}:
"edges": {
"shareholding": { "percentage": "financialInterest", "voting": "votingInterest" },
"directorship": {}
}
The orgchart draws every edge as a parent-child line and has no separate line style per edge kind. The app does not draw GRAPH items yet; the published metadata and the Graph API are available.
Choosing what is shown
| Where | mode | center / fromClass | Shows |
|---|---|---|---|
OBJECT_DASHBOARD | CONNECTED | no center | Everything connected to the object shown. |
OBJECT_DASHBOARD | SCOPE | fromClass | The edges related to the object shown, e.g. all shareholdings of the group. |
| Any | CONNECTED | center | Everything connected to a fixed or configured object. |
| Any | SCOPE | neither | The whole graph. |
Everything a company is connected to, on the company's own page. The company is the center:
{
"class": "commons.company",
"kind": "OBJECT_DASHBOARD",
"tabPage": true,
"label": "LABEL:structure",
"items": [
{
"type": "GRAPH",
"name": "companyStructure",
"graph": "entityhub.governance",
"mode": "CONNECTED",
"edges": { "shareholding": { "percentage": "financialInterest", "voting": "votingInterest" } }
}
]
}
All shareholdings of a group, on the group's page. The group is not a node itself; the shareholdings relate to it through their relation to entityhub.group:
{
"class": "entityhub.group",
"kind": "OBJECT_DASHBOARD",
"tabPage": true,
"label": "LABEL:ownership",
"items": [
{
"type": "GRAPH",
"name": "groupOwnership",
"graph": "entityhub.governance",
"mode": "SCOPE",
"fromClass": "entityhub.group",
"edges": { "shareholding": { "percentage": "financialInterest", "voting": "votingInterest" } }
}
]
}
On the homepage, as a tab of the general dashboard. There is no object shown, so the center comes from a system setting that an administrator can change without a model change:
{
"kind": "GENERAL_DASHBOARD",
"tabPage": true,
"label": "LABEL:groupStructure",
"items": [
{
"type": "GRAPH",
"graph": "entityhub.governance",
"mode": "CONNECTED",
"center": { "systemSetting": "entityhub.defaultCenter" }
}
]
}
Behind a button. Put the GRAPH item on a named general dashboard and open it with a NAVIGATE item:
{
"kind": "GENERAL_DASHBOARD",
"name": "organisationChart",
"items": [
{ "type": "GRAPH", "graph": "hr.organisation", "label": "LABEL:organisationChart" }
]
}
{ "type": "NAVIGATE", "navigationKind": "DASHBOARD", "name": "organisationChart", "label": "LABEL:organisationChart", "icon": "sitemap" }
Data link
A client never builds a graph URL itself. The published item carries either the complete URL or the name of a link on the current object:
-
An item that does not depend on the object shown publishes
href, with the center already filled in:{
"type": "GRAPH",
"graph": "governance",
"display": "ORGCHART",
"mode": "CONNECTED",
"center": "/data/{tenant}/companies/7f3c…",
"href": "/graphs/{tenant}/governance?mode=CONNECTED¢er=%2Fdata%2F…%2Fcompanies%2F7f3c…",
"edges": {
"shareholding": { "label": "Shareholding", "roles": {} },
"directorship": { "label": "Directorship", "roles": {} }
}
}In
CONNECTEDmode without a center (an empty system setting),hrefis left out: there is nothing to connect to. -
An item that does depend on the object shown (
CONNECTEDwithoutcenter, orSCOPEwithfromClass) publisheslink, the key of the object's own link to its graph:{
"type": "GRAPH",
"name": "groupOwnership",
"graph": "governance",
"display": "ORGCHART",
"mode": "SCOPE",
"link": "_graphs.groupOwnership",
"edges": {
"shareholding": { "label": "Shareholding", "roles": { "percentage": "financialInterest", "voting": "votingInterest" } }
}
}Every object shown on that page carries the URL under that key in its
_links, with itself as center or scope:"_links": {
"_graphs.groupOwnership": {
"href": "/graphs/{tenant}/governance?mode=SCOPE&scope=%2Fdata%2F…%2Fgroups%2F5e21…&fromClass=groups&edges=shareholding"
}
}This is why
nameis required for such items and unique in the model: it keys the object's link.
The published edges lists the shown kinds in order, each with its translated label and its roles. An item with a fromClass that the object shown does not have is left out.
Rules:
- Where it can be used. On
OBJECT_DASHBOARDandGENERAL_DASHBOARD, including tab pages and named dashboards. CONNECTEDneeds a center. On a general dashboard, declarecenter; only an object page can fall back to the object shown.fromClassonly on an object page inSCOPEmode, and at least one shown edge kind must have a relation to it.- Edge kinds and roles are checked. Every key of
edgesmust be a kind of the graph, every role must belong to the display, and every attribute must be in that kind'sattributes.
SOURCE
A search widget that calls a producer script and lets the user pick a result. On selection, either an actor script is invoked or the selected fields are used to prefill the form.
{
"type": "SOURCE",
"sourceName": "CompanySearch",
"parameters": [
{ "name": "countryCode", "field": "country.countryCode" }
],
"script": "importCompany"
}
| Property | Description |
|---|---|
sourceName | Name of the producer script to call — matches {sourceName} in POST /sources/{tenantId}/{sourceName}. |
parameters | List of { name, field } entries. field is a dot-notation path into the current form state (e.g. "country.countryCode"). |
script | GENERAL-scope actor script to invoke when the user selects a result. The selected result's fields are passed as script parameters. Mutually exclusive with fieldMapping. |
fieldMapping | Maps result fields to form fields for client-side prefill on selection (e.g. { "registrationNumber": "kvkNumber" }). Mutually exclusive with script. |
A SOURCE item is only useful on an OBJECT_FORM_DASHBOARD. Use script when the selection should trigger server-side logic (create/update, full data enrichment). Use fieldMapping when you just want to prefill a few fields and let the user review before submitting.
System settings as item properties
Some layout item properties can take their value from a system setting instead of a value written in the model. An administrator can then change it per tenant, at any time, without changing the model. Currently this applies to the center of a GRAPH item.
Write the value literally, or refer to a setting by name:
"center": "/data/{tenant}/companies/7f3c…"
"center": { "systemSetting": "entityhub.defaultCenter" }
The setting is a system.systemSetting object whose name is the referenced name and whose value holds the value, here an object href. Create it through the System API:
{ "name": "entityhub.defaultCenter", "value": "/data/{tenant}/companies/7f3c…" }
- Resolved per request. The client always receives the setting's current value, never the reference. A change takes effect on the next page load.
- Missing or empty is
null. When the setting does not exist or has no value, the property is published asnull. For aGRAPHitem inCONNECTEDmode this means an empty graph. - Only system settings, never secrets. The value is sent to the browser, so a reference never reads a
system.secretValue. A secret with that name resolves tonull. - No formulas. A reference is deliberately not a formula:
systemSetting()in a formula also returns secret values, which must never reach the client.
Navigate behaviour
VIEW and RELATED_VIEW items support a navigateBehaviour property that controls what happens when a row is clicked.
| Value | Description |
|---|---|
PAGE | Navigates to a full page for the target object. Default when navigateBehaviour is omitted. |
OVERLAY_PAGE | Opens the target object as an overlay on top of the current page, without leaving the list. |
OVERLAY_PAGE is intended for cases where a full page navigation is disruptive to the surrounding context — for example, a document list where the user wants to quickly preview a file, or line items on an invoice that are more natural to view and edit in place than as a separate page.
{
"type": "RELATED_VIEW",
"fromClass": "my-project.invoice",
"relatedClass": "my-project.invoiceLine",
"navigateBehaviour": "OVERLAY_PAGE"
}
For commons.document and other file-backed classes, combining OVERLAY_PAGE with a FILE-typed field lets the overlay render an inline preview of the file. See Files for how the API determines whether a download URI is served inline or as an attachment.
View-level fallback
A View can also declare its own navigateBehaviour. This is used as a fallback when an embedding VIEW or RELATED_VIEW layout item does not declare navigateBehaviour itself — useful when a view should always open the same way, regardless of how many layout items embed it.
Resolution order:
- The layout item's own
navigateBehaviour, if set. - The embedded view's
navigateBehaviour, if set. PAGE.
{
"name": "openInvoices",
"defaultView": false,
"navigateBehaviour": "OVERLAY_PAGE",
"values": [
{ "name": "invoiceNumber" },
{ "name": "amount" }
]
}
With the view above, any VIEW or RELATED_VIEW layout item that embeds openInvoices opens rows as an overlay without needing to repeat "navigateBehaviour": "OVERLAY_PAGE" on every embed:
{ "type": "VIEW", "class": "my-project.invoice", "name": "openInvoices" }
Multi-step forms
The order and condition properties turn an OBJECT_FORM_DASHBOARD into a guided multi-step flow. Each layout in the form is a step; steps are shown in order sequence as the user fills in the form.
Rules:
- Layouts without
orderare shown in declaration order after any ordered layouts. - When a step has only one layout and its condition is met, it is shown directly.
- When a step has multiple layouts and all their conditions are met, they are shown as alternatives (the user picks one).
- A layout is hidden when its
conditionevaluates tofalse.
Example: add a company via register or manually
"layouts": [
{
"kind": "OBJECT_FORM_DASHBOARD",
"order": 0,
"label": "LABEL:chooseCountry",
"items": [
{ "type": "RELATION", "relatedClass": "commons.country", "editBehavior": "DROPDOWN" }
]
},
{
"kind": "OBJECT_FORM_DASHBOARD",
"order": 1,
"condition": "country.countryCode == 'nl' || country.countryCode == 'gb'",
"label": "LABEL:searchInRegister",
"items": [
{
"type": "SOURCE",
"sourceName": "CompanySearch",
"parameters": [
{ "name": "countryCode", "field": "country.countryCode" }
],
"script": "importCompany"
}
]
},
{
"kind": "OBJECT_FORM_DASHBOARD",
"order": 1,
"condition": "country != null",
"label": "LABEL:companyDetails",
"items": [
{ "name": "name", "header": true },
{ "name": "kvkNumber" },
{ "name": "city" },
{ "name": "postalCode" }
]
}
]
| Step | Situation | Shown |
|---|---|---|
| 0 | Always | Country picker |
| 1 | Unsupported country selected | Manual entry form only |
| 1 | Supported country (nl/gb) | Both alternatives: "Search in register" and "Manual entry" |
When the user searches in the register and selects a result, the importCompany script runs and handles the create-or-update logic server-side. The form does not need a separate review step.
Create vs. modify forms
By default an OBJECT_FORM_DASHBOARD layout is shown for both creating and editing an object. Use the create and modify flags to restrict a layout to one operation.
| Flag | Default | Effect when false |
|---|---|---|
create | true | Layout is hidden when creating a new object |
modify | true | Layout is hidden when editing an existing object |
Example: a field only settable on create
An invitation token should only appear on the create form — once the object exists it cannot be changed.
"layouts": [
{
"class": "my-project.invitation",
"kind": "OBJECT_FORM_DASHBOARD",
"modify": false,
"items": [
{ "type": "FIELD", "name": "token" },
{ "type": "FIELD", "name": "email" }
]
},
{
"class": "my-project.invitation",
"kind": "OBJECT_FORM_DASHBOARD",
"create": false,
"items": [
{ "type": "FIELD", "name": "status" },
{ "type": "FIELD", "name": "email" }
]
}
]
The first layout (with "modify": false) is shown when creating a new invitation and includes the token field. The second layout (with "create": false) is shown when editing an existing invitation and shows the status field instead.
Example: a form shown for both operations
Omitting both flags (or setting both to true) shows the same layout for create and modify — the default behaviour.
{
"class": "my-project.contract",
"kind": "OBJECT_FORM_DASHBOARD",
"items": [
{ "type": "FIELD", "name": "contractType" },
{ "type": "FIELD", "name": "startDate" }
]
}
Example: OBJECT_DASHBOARD layout
{
"class": "my-project.employmentAgreement",
"kind": "OBJECT_DASHBOARD",
"items": [
{ "type": "HEADER", "label": "Contract details" },
{ "type": "FIELD", "name": "contractType" },
{ "type": "FIELD", "name": "salary" },
{ "type": "FIELD", "name": "hoursPerWeek" },
{ "type": "HEADER", "label": "Parties" },
{ "type": "RELATION", "relatedClass": "commons.company", "editBehavior": "SEARCH" },
{ "type": "RELATION", "relatedClass": "commons.employee", "editBehavior": "SEARCH" },
{ "type": "HEADER", "label": "Actions" },
{ "type": "ACTION", "name": "extractFromDocument", "label": "Extract from document" }
]
}
Example: OBJECT_DASHBOARD with a tab
A main section layout and a separate tab for related tasks on the same class:
[
{
"class": "my-project.project",
"kind": "OBJECT_DASHBOARD",
"tabPage": false,
"items": [
{ "type": "FIELD", "name": "projectName", "header": true },
{ "type": "FIELD", "name": "startDate" },
{ "type": "FIELD", "name": "status" }
]
},
{
"class": "my-project.project",
"kind": "OBJECT_DASHBOARD",
"tabPage": true,
"label": "CLASS_PLURAL:my-project.task",
"items": [
{
"type": "RELATED_VIEW",
"fromClass": "my-project.project",
"relatedClass": "my-project.task",
"showTitle": false
}
]
}
]