Asset templates
Table of Contents
This page is the literate source for the assets facet of the
codegen template library. Each section documents one template and
holds its source in a mustache block tangled to the sibling
.mustache file consumed by generator.py. The .mustache files are
generated artefacts — edit this document, then run the tangle
(compass build --direct tangle_codegen_templates or
projects/ores.lisp/src/ores-build-codegen-templates.el directly).
Output paths and profile membership come from
facet_catalogue.org.
Summary
Four singleton templates that fit no code family: two Qt Designer
.ui XML scaffolds (entity detail and history dialogs), the PlantUML
ER diagram, and the shell service-variables file. Each is the only
member of its filename prefix; they are gathered here rather than
given one-doc-per-template. Two are live (qt and service-registry
profiles); plantuml_er is referenced by the plantuml profile but
by no code.
The assets facet
Unlike the code facets, these templates project models onto
non-code artefacts: declarative XML consumed by Qt's uic, a
PlantUML diagram source, and a sourced shell fragment. The Qt pair is
driven by the entity model (domain_entity.qt.detail_fields), the
ER diagram by the schema (tables, columns, relations), and the
service vars by the service registry. They share no data with each
other — the facet is a deliberate catch-all for singleton families,
per the library overview.
Mustache incantations
The Qt .ui templates dispatch on per-field boolean flags —
{{#is_line_edit}}, {{#is_check_box}}, {{#is_dynamic_combo}},
{{#is_nullable_int}}, {{#is_text_edit}} — one section per widget
kind inside the {{#domain_entity.qt.detail_fields}} loop; exactly
one flag is true per field, so the sections act as a switch. The
remaining constructs are the standard ones covered in the group docs.
Archetypes
| Archetype | Description |
|---|---|
| qt_detail_dialog_ui.mustache | Qt Designer XML for {EntityPascal}DetailDialog.ui: a form layout with one row per detail_fields entry, widget chosen by the field's kind flag. Consumed by the qt profile; output projects/ores.qt.{component}/ui/{EntityPascal}DetailDialog.ui — note this is the pre-regroup layout, tracked by the stale facet_catalogue.org capture. |
| qt_history_dialog_ui.mustache | Qt Designer XML for {EntityPascal}HistoryDialog.ui: the read-only twin of the detail dialog, with the same per-field widget switch plus a trailing metadata block (version, recorded-by, recorded-at, comment) positioned via metadata_start_row / metadata_start_row_plus_N computed by the generator. Consumed by the qt profile; output projects/ores.qt.{component}/ui/{EntityPascal}HistoryDialog.ui — same pre-regroup path caveat as the detail dialog. |
| plantuml_er.mustache | PlantUML entity-relationship diagram for a schema: one entity block per table (columns flagged with {{#is_fk}}, coloured via {{color}}), relations drawn with {{cardinality}} between from_table / to_table, stamped with {{generated_at}}. Referenced by no code — only the plantuml profile entry (output output/{entity}_er.puml, untracked) names it; retained pending the profiles-drift audit, like cmake_service_src. The original file had CRLF line endings (the only template that did); the literate migration normalised it to LF. |
| shell_service_vars.mustache | Sourced shell fragment enumerating the service registry: a {{#services}} loop emitting one variable per service {{name}} inside the {{#service_registry}} section. Consumed by the service-registry profile; output projects/ores.sql/service_vars.sh, sourced by the compass environment tooling (env_init.py / compass_db.py). |
See also
- (Parent template group doc:
<group>_group.org.) - Codegen template library — the groups overview.
- Facet — the MASD concept these templates project.
- Assets facet — the facet's modeling reference.
- Applied MASD — the facet catalogue and codegen routes.
- facet_catalogue.org — profile → template/output mapping.