What this is about
A render request only names the key of the template, for example audit-report, and maybe a language. Which edition and which revision really renders is decided by CRMS. This search is called resolution.
The order
flowchart TB
A["Request: key + language"] --> U{"USER edition<br/>of the person?"}
U -->|"published in a<br/>fitting language"| OK["this revision renders"]
U -->|"none, or nothing<br/>published"| T{"TENANT edition<br/>of the tenant?"}
T -->|"published in a<br/>fitting language"| OK
T -->|"none, or nothing<br/>published"| S{"SYSTEM edition?"}
S -->|"published in a<br/>fitting language"| OK
S -->|"none, or nothing<br/>published"| NF["404 template-not-found"]
Within every edition, CRMS tries the languages in this order:
-
1CRMSthe requested language exactly:
de-CH -
2CRMSonly the language, without region:
de -
3CRMSthe default variant of the edition, for example
en -
4CRMSif none of these variants has a published revision, it moves on to the next scope
If the request names no language, CRMS takes the language CIAS chose for the person, otherwise the default language of the installation. More in Language and time zone.
What is skipped
- A scope the installation does not admit (
CODAMAI_CRMS_TEMPLATE_SCOPES). IfUSERis switched off, CRMS does not look for person editions at all. TENANTfor a person without a tenant. There is no tenant whose edition could fit.- An edition without a published revision. If a person only has a draft or a revision in review, this does not break their reports. CRMS simply keeps searching.
Examples
The platform has audit-report with the variants de (default) and en. The tenant acme has its own edition with only de.
| Who asks | Language | Own USER edition | What renders |
|---|---|---|---|
| Person at acme | de | none | TENANT acme, variant de |
| Person at acme | de-CH | none | TENANT acme, variant de (the region is dropped) |
| Person at acme | en | none | TENANT acme, variant de, because de is the default variant there |
| Person at acme | de | only a draft | TENANT acme, variant de. The draft does not count |
| Person at another tenant | en | none | SYSTEM, variant en |
| Person at another tenant | fr | none | SYSTEM, variant de (default variant) |
What the document says about where it came from
Every result names where it came from. Over REST, these details are in headers of the answer:
| Header | Content | Example |
|---|---|---|
Crms-Template-Key | the key | audit-report |
Crms-Template-Scope | the scope of the edition that won | TENANT |
Crms-Template-Variant | the language of the variant that was used | de |
Crms-Template-Revision | the id of the revision | 0b7e… |
Crms-Template-Revision-Hash | the chain hash of this revision | sha-256:9f86… |
A final document keeps the same details for good, see Final documents.