# Templates

> The station-wide root of the Workspace column: the Reports and Labels libraries every model draws from, their folders, the create and delete verbs, and who may edit them.

**Templates** is the second root of the Process page's Workspace column, between Models
and Histories. It holds the two libraries that belong to no model: **Reports**, the PDF
layouts a run is published with, and **Labels**, the printer command files a label is
printed from. A report layout is referenced by the report commands of any model's
[actions](process-actions) and re-exports any recorded run from Histories; a label
template is reused by the label commands of every model. That is why they live here once,
instead of once per model.

The root is drawn for a role that may look at models or manage them; a role holding only
Edit recipes & evaluations does not see it. Every change to a library (creating, editing,
filing, deleting, printing a sample or a test label) takes **Manage process**: a role
without it reads the libraries and is drawn none of the verbs, and a command that reaches
the service anyway is refused with "Managing this workspace requires the 'Manage process'
permission." Every write is also refused while a unit is running ("Configuration is locked
while a Unit is running.") and while the runtime is stopped ("Runtime stopped").

## The Templates page {#the-templates-page}

Selecting the root opens one card, **Libraries**, with two tiles, Reports and Labels, each
counting its templates. The tree rows carry the same count, or the word "Empty" when a
library holds nothing, so a fresh station can tell an empty library from a list that did
not load. The root itself carries no count and no verb.

## Reports and Labels {#reports-and-labels}

Each library page is a wall of cards, one per template in name order, with the operator's
own folders drawn above the templates nobody filed. Clicking a card opens the template; the
small remove control on a card deletes it after the same confirmation the bar's verb asks.
An empty library reads "No reports yet. Add one." or "No labels yet. Add one, then write or
import its commands."

| Node | Bar verbs (leading) | Danger cluster (trailing) |
| --- | --- | --- |
| Reports | **Report**: creates a layout named "Report" ("Report 2", and so on) at the library's own level and opens it. | none |
| A report layout | **Print sample**: prints the layout filled with the station's most recent finished run ([Report layouts](process-reports#print-sample)). | **Delete report** |
| Labels | **Label**: creates an empty template named "Label" ("Label 2", and so on) and opens it; the commands are then written or imported inside it. | none |
| A label template | none | **Delete label template** |
| A folder | **Report** or **Label** (filed in the folder), **Folder** (a subfolder, until the depth limit: "This folder is already as deep as folders nest."), **Rename folder** | **Remove folder** |

Every verb is greyed under the engineering lock with its reason. The column's own
**New…** button offers "New report" and "New label" at the library level, and "New folder"
with a submenu naming the category (Models, Reports, Labels). Right-clicking a row mirrors
the bar: "Add report" or "Add label" on a library, "Move to" and the delete verb on a
template, the create verbs, "Rename folder" and "Remove folder" on a folder.

Deleting asks first and says what follows:

| Verb | Confirmation | Consequence |
| --- | --- | --- |
| Delete report | "Procedures referencing it stop publishing a PDF; recorded runs are untouched." | Every report command naming the layout degrades to publishing nothing; a run whose procedure named it falls back to the all-sections default when Histories regenerates its PDF. |
| Delete label template | "Procedure actions keep their mappings for review but cannot generate this label. Recorded runs are untouched." | Every label command naming the template loses its reference but keeps its marker mappings; the artifacts already frozen in run files are not touched. |
| Remove folder | "Remove the folder 'X'? Its N reports move back to the Reports root. Nothing is deleted." | The folder's rows, subfolders included, return to the library's own level. |

## Folders {#folders}

Folders are navigation and nothing else: a template is reached by identity, so filing it
rewrites no reference anywhere. **Move to** on a template's right-click menu offers a new
folder (born holding the template), a new subfolder where the depth allows, the library
root and every existing folder except the current one. A new folder opens with its name
field ready; leaving it keeps the name "New folder". Folders nest two levels deep, and a
folder declared under Reports is distinct from a namesake under Labels or Models.

## Who draws from the libraries {#who-draws-from-the-libraries}

| Consumer | Where | What it takes |
| --- | --- | --- |
| A report command of an action | Setup > [Actions](process-actions) | The layout it publishes with at Start or Completion. |
| A label command of an action | Setup > Actions | The template it renders, plus one source per marker. |
| Generate PDF | [Histories](histories-export#pdf) | "(procedure's report)" or any layout of the library. |
| New label with a current template | [Histories](histories-documents#labels) | Any template with printer commands, mapped by hand against the frozen run. |
| Print sample and Send test | The template's own page | A printer queue installed on the station. |

The pages of this group:

| Page | Covers |
| --- | --- |
| [Report layouts](process-reports) | Every field of a layout, the section catalogue and its options, the sample print and what the PDF prints. |
| [Label templates](process-labels) | Name and encoding, the printer commands editor and file import, the marker grammar, the installed queue and the test send. |
| [Emitting labels and reports](process-emission) | What happens at Start and at Completion, the queues, the artifacts and their delivery statuses. |
