What this is about
CRMS stands for CodamAI Reporting Management System. It produces reports: PDF, HTML, Word files and spreadsheets. A report is always made of two parts:
- the template: it defines what the report looks like. It is written in FreeMarker, a template language with placeholders like
${customer.name}. - the payload: the data for exactly this one report, for example the customer, the date and the items of an audit.
CRMS puts the payload into the template and returns the finished document.
A report is created
-
1User→Clientclicks "Create report"
-
2Client→CDMSreads the data that belongs in the report and prepares it
-
3Client→CRMSsends a render request: template key, format, mode and payload
-
4CRMS→CIASasks who is calling and in which tenant
-
5CRMSlooks up the published revision of the template that applies to this person
-
6CRMSchecks the payload before the template sees it
-
7CRMSPayload breaks the rules → 422 with every violation
-
8CRMSinserts the payload in a sealed-off environment and produces the format
-
9CRMS→File storagestores a final document encrypted, only in mode
FINAL -
10CRMS→Clientreturns the documentResult: The bytes of the document, plus key, scope, language, revision and hash of the template it came from
Every document says which revision of the template it comes from. A revision is a fixed state of the template that can no longer be changed. This way you can prove later which text a report was produced with.
What CRMS does and what it does not
- manages templates with language variants and revisions
- releases templates through an approval chain
- checks the payload
- renders PDF, HTML, DOCX, XLSX, CSV and ODS
- stores final documents in a hash chain
- verifies them and keeps them until their retention ends
- reads no business data, not from CDMS either
- changes no business data
- does not calculate: no sums, no formulas
- does not decide when a report is created
- manages no users and roles, CIAS does that
Why the application prepares the data
A template is written in the running system, by people with a template role. That is why it may do nothing but insert values:
- No access to Java. The template cannot create classes and cannot call methods. FreeMarker built-ins like
?newand?apiare switched off. - Only prepared values in the payload: text, numbers, booleans, date and point in time, plus lists and objects of these. An arbitrary Java object is refused, because it would hand the template its methods.
- At most two levels deep:
title,customer.name,items[].amount. Whatever the template needs, the application prepares flat. - No files from outside. Images, fonts and style sheets only come from the template itself (
asset:<name>) or from the request (attachment:<name>). Every other address is refused before it is called. - No formulas. A spreadsheet also holds only finished values. A formula assembled from a payload value would be a way in for attackers.
How the payload is checked exactly is described in The payload check.
Three modes
Every render request names a mode. It decides whether the document is stored.
| PREVIEW | FINAL | TRANSIENT | |
|---|---|---|---|
| stored | never | yes, as the next revision of its document chain | never |
| marker | visible watermark and marker crms-preview | none, it is the original | only the marker crms-transient in the metadata |
| what for | check what a report looks like | the report that counts | a copy to download, only from system templates |
The details are described in Preview, final, transient.