LooT Manuals
Deutsch

Templates

Templates are blueprints for node subtrees: create them, freeze them into versions, generate nodes from them and switch those nodes to new versions.

What templates are for#

A template is a blueprint for a node subtree, such as "Pump" with its measurements, units, commands and internal connections. From one template you generate as many identical subtrees as you like. Because every generated node knows which template and version it came from, it can later be switched to a newer version without losing any values. A plain clone does not know this relationship.

A template has two kinds of state:

  • The working state is editable. You edit it like an ordinary subtree.
  • A version is a frozen snapshot of the working state with a consecutive number. Nodes are generated from versions; versions never change.

Templates live per tenant in their own area, Templates, outside the node tree. Their names are unique within the tenant. Templates record no values: nothing can be written to them, queries return nothing, commands are not sent, and there are no connections between a template and the node tree.

Creating a template#

  1. In the Explorer select the node whose subtree should become the blueprint and open the context menu.
  2. Choose Save as template ….
  3. Enter the template name (empty: the node's name) and confirm with Create template.

The subtree becomes the new template with its metadata, exposed values, links, commands, internal connections and layout; values and permission entries do not belong to it, nor do aliases and tags. The template starts at version 1. The node itself stays an ordinary node, keeps recording values, and from then on refers to the template and its version.

You need the Manage permission on the node and Read on everything inside it. Whoever creates the template automatically receives Manage on it.

Viewing and editing templates#

Next to Nodes, the Explorer has the Templates view with all templates of the tenant. It appears only if there are visible templates. A template with several versions carries the number in its name, for example "Pump (v3)".

Clicking a template opens its detail page:

  • The Versions table gives, per version, the save date, the author, the number of nodes in the template and how often the version is used (Used). The Version column appears from the second version on.
  • A note reports "No version saved yet" or Working state changed when the working state differs from the newest version.
  • The toolbar offers Save version, Generate from template …, Working state in editor, Rename, Permissions and Delete ….

You edit the working state in the Explorer, in the graphical editor or in the text editor like any subtree (see Editing nodes): children, descriptions, units, commands, links, internal connections and layout. The root is named like the template; renaming it renames the template. It can be neither deleted nor moved. On the nodes of a template, functions that need values are missing (write value, export, chart).

Nothing can be dragged, moved or cloned between Nodes and Templates. Links from a template to nodes of the node tree are possible.

Default values#

A node in the working state that has a value type (number, Boolean or text) can carry a default value. You set it on the Properties tab with Set default value (canonical text, for example 21.5) and remove it with Remove. When a node is generated, LooT writes the default value as the first time series value, with the timestamp of generation. For the fields of a compound node, the default value applies per field.

Saving a version#

Save version freezes the working state as a new version. Numbers count consecutively; deleted numbers are not reused. If the structure has not changed against the newest version, LooT refuses to save.

The structure includes everything except values, editor layout, descriptions, permissions and the name of the root: children (names and hierarchy), value type, unit, direction, duplicate rule, retention class, exposed values, links, internal connections, commands with parameters and visibility, and default values.

The action is also in the context menu of the template root and requires Manage on the template.

Generating nodes from a template#

  1. In the context menu of the tenant or of a node choose New › From template …, or on a template's detail page Generate from template ….
  2. Choose the template and the version (default: the newest; only saved versions are offered).
  3. Enter the name of the new node and pick the target: the tenant (top level) or a node.
  4. Generate creates the subtree.

The new subtree takes over structure, metadata, value types, directions, units, retention classes, exposed values, commands with their visibility, links (only to existing, readable targets), the layout and internal connections. LooT writes default values as first values. Command connections arise only if you have the Execute permission at the target; otherwise LooT reports how many were skipped. You need Read on the template and Manage on the target.

The dialog also shows the group Standard with the built-in blueprints Point 2D (x, y) and Point 3D (x, y, z). They exist in every tenant and create a compound node with Double fields (see Compound and stream nodes).

On the command line, loot node create <path> --template <template> generates a subtree (see command line).

Origin and deviations#

The root of a generated subtree shows the section Origin on the Properties tab:

RowContent
TemplateName of the template.
Version"n of m", only if the template has several versions.
DeviationsStructural changes against the version the node came from, as a list, or "none". Visible only with Read permission on the template.

Changes to values, layout, descriptions or permissions do not count as deviations.

Switching to a new version#

If a newer version exists, the button Switch to new version … appears under Origin.

  1. The dialog shows the changes from the current to the new version. If several newer versions exist, choose the target under New version.
  2. If switching is not possible, the reason appears under "Switching is not possible:".
  3. Switch carries it out.

Switching preserves your data: existing nodes keep their id, values and permissions, new nodes arise with their default values, and the root keeps its name. LooT switches only if

  • the subtree does not deviate from its current version,
  • no node with values drops out and neither value type nor retention class changes,
  • no connection to the outside hangs on a node or command that drops out or is replaced, or becomes invalid.

Otherwise LooT names the reasons. You need Manage on the node and Read on the template. You can switch only to a newer version, never back. On the command line there is loot node migrate-template.

Turning a generated node into a template again#

Save as template … on the root node of a generated subtree behaves differently depending on the situation:

  • Without deviation the template already exists. The menu entry is missing; if you open the dialog anyway, it says the template already exists.
  • With deviation you choose under Save as between new template and new version of "…". The second option needs Manage on the template; afterwards the node refers to the new version.
  • Without Read permission on the template the deviation cannot be seen; the entry stays, and the server decides.

Deleting templates and versions#

Delete … (detail page or context menu of the root) removes a template with its working state and all versions; the bin icon in the Versions table removes just one version. The dialog first names the number of affected nodes. The nodes stay and only lose their reference to the template. You need Manage on the template.

Permissions on templates#

Templates have their own permissions, which tenant admins grant with the Permissions button on the detail page:

PermissionEffect
ReadSee the template and generate nodes from it.
ManageEdit the working state, save versions, rename, delete.

There are no further permissions. Tenant admins have all permissions on every template; entries on the tenant or on nodes do not act on templates. On the nodes of the working state the template's permissions apply; own entries there are not possible. More on permissions in Permissions.

A product of Rheinwert Datentechnik · rheinwert.deVersion: LooT 0.9.10