Template Panel: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
 
(43 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{stub}}
A Template Panel is a special variant of a [[Panel]], which serves as a definition through which a large amount of [[Panel]]s can be created. They are not directly accessible to end-users, but allow for automation of [[Panel]] creation in the [[editor]].
A Template Panel is a special variant of a [[Panel]], which serves as a definition through which a large amount of [[Panel]]s can be created. They have most properties of ordinary [[Panel]]s. They cannot be displayed to or used by end-users directly. Based on a Template Panel, an amount of [[Panel]]s can be generated automatically. These are known as Instanced Panels (or the Template Panel's instances), which function identically to regular [[Panels]]. A Template pales is linked to a specifc type of data. Instanced Panels have, in general, the same properties as the Template Panel they are derived from, in addition to a location in the [[3D World]] matching the location of the [[Item]] it is applicable to.


When a Template Panel is linked to a specific type of data, an [[Attribute]] filter can be added as well. This means the Template Panel will only be applied to the [[Item]]s matching the specifed type which also have the specified [[Attribute]].
==How Template Panels work==
Template Panels are created like ordinary [[Panel]]s, and share most of their properties with those of ordinary [[Panel]]s. However, they cannot be displayed to or used by end-users directly. Instead, based on a Template Panel, an amount of [[Panel]]s can be generated automatically. These are known as Instanced Panels (or the Template Panel's instances), which function identically to regular [[Panels]], and have the same properties as the Template Panel at the time they are created.


When a Template Panel is "applied", Instanced Panels are created for each [[Item]] of the specified type. Instanced Panels can be modified independantly of their orignal Template Panels (although this is not recommended). A Template Panel can also be modified independantly of its instances. It is only when the Template Panel is reapplied that its instances are affected. If the Template Panel had been applied before, any Instanced Panels previously created based on the same Template Panel are removed before creating the new Instanced Panels. This is also true if the Template Panel is changed to be applicable to a different type of data than its instances currently are.
A Template Panel is linked to a specific type of data, indicating for that data [[Panel]]s should be created. When a Template Panel is "applied", Instanced Panels are created for each [[Item]] of the specified type. Instanced Panels resulting from the Template Panel are placed in the [[3D Visualization]] matching the location of the [[Item]] it is applicable to.


==Types of Template Panels==
When a Template Panel is linked to a specific type of data, filters can be added as well. This means Instanced Panels will only be created for the [[Item]]s matching the specified type which also have the specified [[Attribute]], or the specified relation to a [[Stakeholder]].
There are two types of template panels:
 
{|class=wikitable
===Instanced Panels===
! Type
Instanced Panels are the automatically created [[Panel]]s resulting from applying Template Panels. They can be modified independently of their original Template Panels and of each other. A Template Panel can also be modified independently of its instances. It is only when the Template Panel is reapplied that its instances are affected. If the Template Panel had been applied before, any Instanced Panels previously created based on the same Template Panel are removed before creating the new Instanced Panels. This is also true if the Template Panel is changed to be applicable to a different type of data than its instances currently are.
! Description
|-
| Text Template Panel
| Generates Text Panels. Each Instanced Panel has its own discrete copy of the text content of the Template Panel.
|-
| Excel Template Panel
| Generates Excel Panels. Each Instanced Panel is connected to the same [[Excel]] definition as the Template Panel.
|}


===Target===
Note that it not recommended to edit individual Instanced Panels directly, nor to make changes to a Template Panel without applying it to create new Instanced Panels.
Template Panels can be applied to the following [[Item]]s:
* [[Area]]s
* [[Neighborhood]]s
* [[Zone]]s
* [[Building]]s
* [[Net Cluster]]s


==When to use Template Panels==
==When to use==
There are a number of use-cases for which Template Panels can be desirable.
There are a number of use-cases for which the use of Template Panels can be desirable. Either to automate the process of [[Panel]] creation, or to provide multiple discrete [[Panel]]s where otherwise only a single could be defined.


===Repeated data in project===
===Repeated data in project===
Individual [[Panel]]s can be created and added to the [[3D world]], but depending on how many are desired this may be a lot of menial work. By using a Template Panel to autoamtically generate the desired [[Panel]]s, effort can be saved, changes can be applied to all instances more easily, and the appearance and effects of the [[Panel]]s remains more consistent.
Individual [[Panel]]s can be created and made visible in the [[3D Visualization]], but depending on how many are desired this may be a lot of manual work. By using a Template Panel to automatically generate the desired [[Panel]]s, effort can be saved, changes can be applied to all instances more easily, and the appearance and effects of the [[Panel]]s remains more consistent.


===Spatial data in Template Project===
===Spatial data in Template Project===
Line 39: Line 25:
Template Panels can be used with the Web Interface to serve different information per user.
Template Panels can be used with the Web Interface to serve different information per user.


When a Template Panel is used as part of a [[Web Interface]], either for a frontpage or for custom HTML, an instance of the Template Panel is displayed. Specifically, the displayed instance is the one with an owner which matches the [[Stakeholder]] whom's [[Web Token]] was used to authenticate.
When a Template Panel is used as part of a [[Web Interface]], either for a front-page or for custom HTML, an instance of the Template Panel is displayed. Specifically, the displayed instance is the one with an owner which matches the [[Stakeholder]] whom's [[Web Token]] was used to authenticate.
 
==Types==
There are two types of template panels:
{|class=wikitable
! Type
! Instantiates
! Behavior
|-
| Text Template Panel
| Text Panel
| Each Instanced Panel has its own discrete copy of the text content of the Template Panel. When the text of the Template Panel or any of its instances are changed, it is only changed for that [[Panel]], and not for any of the other [[Panel]]s.
|-
| Excel Template Panel
| Excel Panel
| Each Instanced Panel is connected to the same [[Excel]] definition as the Template Panel. Each Instanced Panel has its own individual copy of the [[Excel]], and when the definition of the [[Excel]] if updated, the Instanced Panels automatically have their copy of the [[Excel]] updated as well, if they still reference the definition which is now updated..
|}


==Properties==
==Properties==
The properties of Template Panels are generally the same as the properties of regular [[Panel]]s. When the Template Panel is applied, its instances are mostly given the same properties and values as the Template Panel, with a few special exceptions.
The properties of Template Panels are generally the same as the properties of regular [[Panel]]s. When the Template Panel is applied, its instances are mostly given the same properties and values as the Template Panel. These are considered "static" properties. A number of properties of the Template Panel can cause the Instanced Panels to have differing properties. These properties are considered "dynamic" properties.
 
Properties are duplicated from the Template Panel to the Instanced Panel when the Template Panel is applied. After that, the properties of the Instanced Panels exist independantly of the Template Panel.
 
It is possible to edit the properties of Instanced Panels in the same manner as editing the properties of regular [[Panel]]s. However, this is not recommended, as the changes will be undone when the Template Panel is reapplied.


===Static properties===
===Static properties===
{{main|Panel#properties|Panel}}
Static properties are configured in the same way as for regular [[Panel]]s, and are used verbatim for the Template Panel's instances.
; Dimensions and location
; Dimensions and location
: The dimensions and on-screen location of the Instanced Panel are identical to how the Template Panel is configured.
: The dimensions and on-screen location of the Instanced Panel are identical to how the Template Panel is configured.
Line 52: Line 60:


; Attributes
; Attributes
: The Instanced Panel has the same [[Attribute]]s as the Template Panel, which also includes the [[Attribute]]s affecting whether the [[Panel]]  is {{linkappend|post= (Panel Attribute)|visible}}, requires {{linkappend|post= (Panel Attribute)|attention}}, and the {{linkappend|post= (Panel Attribute)|popup type}} model used to display the [[Popup]] of the [[Panel]] in the [[3D world]].
: The Instanced Panel has the same [[Attribute]]s as the Template Panel, which also includes the [[Attribute]]s affecting whether the [[Panel]]  is {{linkappend|post= (Panel Attribute)|visible}}, requires {{linkappend|post= (Panel Attribute)|attention}}, and the {{linkappend|post= (Panel Attribute)|popup type}} model used to display the [[Popup]] of the [[Panel]] in the [[3D Visualization]].
 
; Content
: The content of the Instanced Panel is the same as the Template Panel. If the content is text, the content is copied. If the content is an [[Excel]], the [[Panel]]s refer to same [[Excel]]. Using [[Tag]]s or [[ID query (Excel)|ID queries]], the content of the panel can include data of the specific related [[Item]].


===Dynamic properties===
===Dynamic properties===
Dynamic properties of a Template Panel form a basis for how those properties are expressed in the resulting instances.
[[File:panels-right-template-name.jpg|frame|right|Input field for the Template Panel name.]]
[[File:panels-right-template-name.jpg|frame|right|Input field for the Template Panel name.]]
; Name
; Name
: The name of the Instanced Panel is a combination of the Template Panel and the name of the data it is applied to.
: The name of the Instanced Panel is a combination of the Template Panel and the name of the data it is applied to, of the form "Template Panel Name: Item Name".
{{clear}}
{{clear}}
[[File:panels-right-template-stakeholder.jpg|frame|right|Additional settings for assigning stakeholder(s).]]
[[File:panels-right-template-stakeholder.jpg|frame|right|Additional settings for assigning stakeholder(s).]]
; Owner
; Owner
: If the Template Panel has no owner or a single specific owner, the Instanced Panels will all have no owner or the same owner respectively. If a relational filter is configured for the Template Panel, the owner of each Instanced Panel will be the [[Stakeholder]] which has the defined relation to the linked data.
: If the Template Panel has no owner or a single specific owner, the Instanced Panels will all have no owner or the same owner respectively. By checking "Use Owner", rather than specifying a single [[Stakeholder]] for all instances, each [[Panel]] will be owned by the owner of the [[Item]] the Template Panel is applied to.
{{clear}}
{{clear}}
[[File:panels-right-template-template.jpg|frame|right|Options for applying the template panel.]]
 
; Target
===Answers===
: The target to apply the Template Panel on, and the related optional [[Attribute]] filter, are properties reserved for the Template Panel and do not exist in Instanced Panels.
{{main|Answer (Panel)}}
Template Panels can be given {{linkappend|post= (Panel)|Answer}}s, which will cause its instances to also have the same {{linkappend|post= (Panel)|Answer}}s when the Template Panel is applied. However, if the {{linkappend|post= (Panel)|Answer}} has a related [[Event]] which has as a parameter the type of data which the Template Panel is applied on, the {{linkappend|post= (Panel)|Answer}} will automatically have the value for that parameter set to the [[Item]] which the instance is related to. For example, if the Template Panel is applied on [[Neighborhood]]s, and the {{linkappend|post= (Panel)|Answer}} features the NEIGHBORHOOD_SET_ATTRIBUTE [[Event]], each [[Neighborhood]] will have an Instanced Panel, the {{linkappend|post= (Panel)|Answer}} of which will affect that [[Neighborhood]].
 
==Targets==
[[File:panels-right-template-target.jpg|frame|right|Option for setting what type of [[Item]] to apply the [[Template Panel]] on.]]
Template Panels can be applied to the following [[Item]]s:
* [[Area]]s
* [[Neighborhood]]s
* [[Zone]]s
* [[Building]]s
* [[Measure]]s
* [[Net Cluster]]s
{{clear}}
 
===Filters===
The creation of Template Panels can be restricted through the application of filters. Multiple filters are available.
 
====Relational filter====
[[File:panels-right-template-relational.jpg|frame|right|Option for filtering based on the [[Item]]s relation to the [[Panel]]'s stakeholder.]]
For any given [[Item]], the [[Panel]] will only be created if the [[Stakeholder]] for the resulting [[Panel]] also has the specified relation to the [[Item]]. This requires that the Template Panel has an owner configured. This can be either a specific [[Stakeholder]], or via the "Use owner" option. This can be used to selectively generate [[Panel]]s for only a specific [[Stakeholder]].
{{clear}}
 
====Attribute filter====
[[File:panels-right-template-attribute.jpg|frame|right|Option for filtering relevant [[Item]]s based on the presence of an [[Attribute]].]]
For any given [[Item]], the [[Panel]] will only be created if the [[Item]] has a specified [[Attribute]], regardless of the [[Attribute]]'s value. This can be used to create [[Panel]]s only for specifically indicated [[Item]]s.
{{clear}}
 
{{article end
|notes=* If the Template Panel has been applied previously, and instances of it exist in the [[Project]] which do not currently meet the configured filters, those instances will be removed as well when the Template Panel is reapplied.
|howtos=* [[How to add a Template Panel]]
* [[How to remove a Template Panel]]
* [[How to configure a Template Panel]]
* [[How to create deviating behavior for a single instance of a Template Panel]]
* [[How to create prevent the creation of a single instance of a Template Panel]]
* [[How to create a Panel for each of an Item type]]
* [[How to create a Panel for some of an Item type]]
* [[How to create a panel for each Item visible only to its owner]]
* [[How to create a panel for each Item owned by a specific stakeholder]]
|seealso=
* [[Panel]]
* [[ID query (Excel)]]
* [[Tag]]
}}
{{Panel nav}}

Latest revision as of 12:13, 23 February 2023

A Template Panel is a special variant of a Panel, which serves as a definition through which a large amount of Panels can be created. They are not directly accessible to end-users, but allow for automation of Panel creation in the editor.

How Template Panels work

Template Panels are created like ordinary Panels, and share most of their properties with those of ordinary Panels. However, they cannot be displayed to or used by end-users directly. Instead, based on a Template Panel, an amount of Panels can be generated automatically. These are known as Instanced Panels (or the Template Panel's instances), which function identically to regular Panels, and have the same properties as the Template Panel at the time they are created.

A Template Panel is linked to a specific type of data, indicating for that data Panels should be created. When a Template Panel is "applied", Instanced Panels are created for each Item of the specified type. Instanced Panels resulting from the Template Panel are placed in the 3D Visualization matching the location of the Item it is applicable to.

When a Template Panel is linked to a specific type of data, filters can be added as well. This means Instanced Panels will only be created for the Items matching the specified type which also have the specified Attribute, or the specified relation to a Stakeholder.

Instanced Panels

Instanced Panels are the automatically created Panels resulting from applying Template Panels. They can be modified independently of their original Template Panels and of each other. A Template Panel can also be modified independently of its instances. It is only when the Template Panel is reapplied that its instances are affected. If the Template Panel had been applied before, any Instanced Panels previously created based on the same Template Panel are removed before creating the new Instanced Panels. This is also true if the Template Panel is changed to be applicable to a different type of data than its instances currently are.

Note that it not recommended to edit individual Instanced Panels directly, nor to make changes to a Template Panel without applying it to create new Instanced Panels.

When to use

There are a number of use-cases for which the use of Template Panels can be desirable. Either to automate the process of Panel creation, or to provide multiple discrete Panels where otherwise only a single could be defined.

Repeated data in project

Individual Panels can be created and made visible in the 3D Visualization, but depending on how many are desired this may be a lot of manual work. By using a Template Panel to automatically generate the desired Panels, effort can be saved, changes can be applied to all instances more easily, and the appearance and effects of the Panels remains more consistent.

Spatial data in Template Project

When using the Project as a Template, Template Panels can be easily applied to data in the Project, reducing the amount of time it takes to configure a Project based on a Template "out-of-the-box". In fact, after creating a new Project based on a Template, Template Panels are applied automatically.

Web Interface

Template Panels can be used with the Web Interface to serve different information per user.

When a Template Panel is used as part of a Web Interface, either for a front-page or for custom HTML, an instance of the Template Panel is displayed. Specifically, the displayed instance is the one with an owner which matches the Stakeholder whom's Web Token was used to authenticate.

Types

There are two types of template panels:

Type Instantiates Behavior
Text Template Panel Text Panel Each Instanced Panel has its own discrete copy of the text content of the Template Panel. When the text of the Template Panel or any of its instances are changed, it is only changed for that Panel, and not for any of the other Panels.
Excel Template Panel Excel Panel Each Instanced Panel is connected to the same Excel definition as the Template Panel. Each Instanced Panel has its own individual copy of the Excel, and when the definition of the Excel if updated, the Instanced Panels automatically have their copy of the Excel updated as well, if they still reference the definition which is now updated..

Properties

The properties of Template Panels are generally the same as the properties of regular Panels. When the Template Panel is applied, its instances are mostly given the same properties and values as the Template Panel. These are considered "static" properties. A number of properties of the Template Panel can cause the Instanced Panels to have differing properties. These properties are considered "dynamic" properties.

Properties are duplicated from the Template Panel to the Instanced Panel when the Template Panel is applied. After that, the properties of the Instanced Panels exist independantly of the Template Panel.

It is possible to edit the properties of Instanced Panels in the same manner as editing the properties of regular Panels. However, this is not recommended, as the changes will be undone when the Template Panel is reapplied.

Static properties

Main article: Panel

Static properties are configured in the same way as for regular Panels, and are used verbatim for the Template Panel's instances.

Dimensions and location
The dimensions and on-screen location of the Instanced Panel are identical to how the Template Panel is configured.
Overlay
Which Overlay to display when the Panel is opened is identical to how the Template Panel is configured.
Attributes
The Instanced Panel has the same Attributes as the Template Panel, which also includes the Attributes affecting whether the Panel is visible, requires attention, and the popup type model used to display the Popup of the Panel in the 3D Visualization.
Content
The content of the Instanced Panel is the same as the Template Panel. If the content is text, the content is copied. If the content is an Excel, the Panels refer to same Excel. Using Tags or ID queries, the content of the panel can include data of the specific related Item.

Dynamic properties

Dynamic properties of a Template Panel form a basis for how those properties are expressed in the resulting instances.

Input field for the Template Panel name.
Name
The name of the Instanced Panel is a combination of the Template Panel and the name of the data it is applied to, of the form "Template Panel Name: Item Name".
Additional settings for assigning stakeholder(s).
Owner
If the Template Panel has no owner or a single specific owner, the Instanced Panels will all have no owner or the same owner respectively. By checking "Use Owner", rather than specifying a single Stakeholder for all instances, each Panel will be owned by the owner of the Item the Template Panel is applied to.

Answers

Main article: Answer (Panel)

Template Panels can be given Answers, which will cause its instances to also have the same Answers when the Template Panel is applied. However, if the Answer has a related Event which has as a parameter the type of data which the Template Panel is applied on, the Answer will automatically have the value for that parameter set to the Item which the instance is related to. For example, if the Template Panel is applied on Neighborhoods, and the Answer features the NEIGHBORHOOD_SET_ATTRIBUTE Event, each Neighborhood will have an Instanced Panel, the Answer of which will affect that Neighborhood.

Targets

Option for setting what type of Item to apply the Template Panel on.

Template Panels can be applied to the following Items:

Filters

The creation of Template Panels can be restricted through the application of filters. Multiple filters are available.

Relational filter

Option for filtering based on the Items relation to the Panel's stakeholder.

For any given Item, the Panel will only be created if the Stakeholder for the resulting Panel also has the specified relation to the Item. This requires that the Template Panel has an owner configured. This can be either a specific Stakeholder, or via the "Use owner" option. This can be used to selectively generate Panels for only a specific Stakeholder.

Attribute filter

Option for filtering relevant Items based on the presence of an Attribute.

For any given Item, the Panel will only be created if the Item has a specified Attribute, regardless of the Attribute's value. This can be used to create Panels only for specifically indicated Items.