Global Configurations
- 1 Create new entry
- 1.1 Name (ID)
- 1.2 Type
- 1.2.1 Why typing?
- 2 Working with typed fields
- 2.1 Referencing global entries in the templates
- 2.2 References in global entries
- 2.3 Example template “Meeting invitation”
- 2.3.1 Meeting Invitation Content
- 2.3.1.1 Forms
- 2.3.1.2 Fields
- 2.3.1.3 Placeholder Mapping
- 2.3.2 Meeting Invitation Layout
- 2.3.2.1 Placeholder Definition
- 2.3.1 Meeting Invitation Content
- 2.4 GlobalCode
- 2.4.1 Create GlobalCode
- 2.4.2 Use in fields
- 3 Working with untyped fields (classic)
In the Global Configurations all configurations are stored divided into groups, which are used in several templates. The advantage is that the texts and configurations only have to be changed in one place. If, for example, the configuration for the address providers were built into each template, each template would have to be edited individually when an adjustment had to be made to the configuration. This would be much more time consuming than only adjusting it in one place.
Create new entry
Name (ID)
The Global Configurations have two levels: an entry is in a group and has a name. Both together result in the ID of the global entry. This looks like this, for example: GroupName.EntryName
.
Create new group: If the whole name is replaced with FieldsDefaults.Letter
, a new group "FieldsDefaults" is created with a new entry "Letter".
More levels: You cannot configure a global entry "deeper" than in a group. Even if the UI does not support this visually, you can still provide the ID with further subdivisions using dots if you wish: GroupName.SubGroup1Name.SubGroup2Name.EntryName
Type
A type must be assigned to a global entry. The type is selected depending on the target configuration:
Type | Target configuration |
---|---|
FormsGlobalElements | for fields in the document function Forms Forms elements of the type |
FormsGlobalDataProviders | for Data interfaces in Forms |
FormsGlobalSchemaAndSummary | |
FieldsGlobalFields | for fields in the document function Fields |
FieldsGlobalCode | for saving JavaScript functions, see below |
PlaceholderGlobalMappings | for fields in the document function Placeholder Mapping |
PlaceholderGlobalDefinitions | for fields in the document function Placeholder Definition |
DataGlobalSchem | for schemas for the document function https://primesoft-group.atlassian.net/wiki/pages/resumedraft.action?draftId=517013505&draftShareId=50d40348-9223-4d23-8169-97b677b1b4ef |
Untyped (classic) | For all document functions in classic templates. |
Why typing?
The advantage of typing global entries is the validation that it enables.
Once the type of the global entry has been defined, the XML configuration can be carried out with the corresponding support of element and attribute suggestions as if you were in the corresponding document function. The exception to this is the Untyped type, which is used in classic templates.
It is clear in which document function the corresponding field can be found and referenced. For example, you can only link global entries of type
FieldsGlobalFields
in a Fields configuration of a template.
Working with typed fields
Referencing global entries in the templates
To reference a global entry in a template, the element <Global... Key="GroupName.EntryName" />
is always used.
Global...
Element: The name of the exact element varies depending on the document function (see table below).Key: To reference a global entry eventually, the entire ID of the global entry is required as the key (the EntryName alone or even a field name will not work).
Here is an overview of all <Global... />
elements depending on the document function:
Dokument function | Element to get global entry |
---|---|
Forms |
|
Fields |
|
PlaceholderMapping |
|
PlaceholderDefinition |
|
Data |
|
When editing the XML configuration in one of the five document functions, the correct element is of course always displayed in the list of suggestions.
References in global entries
Global entries can also be referenced in other global entries. This way entire hierarchies can be created.
Example 1
"Letter" template, Forms document function contains
GlobalElement with key
Forms.Recipient-Invitation
. This configuration in turn contains, among other thingsGlobalSchemaAndSummary with key
Recipients.Objects.InternalListSchema
contains the final fields.
GlobalDataProviders with key
Recipients.Objects.DefaultProviders
. This configuration contains the final fields.
Example 2
“Form” template, Fields document function contains
GlobalField with key
Fields.Signers
. This configuration in turn contains,GlobalField with key
Fields.Signers.Signer0
. This configuration contains the final fields.GlobalField with key
Fields.Signers.Signer1
. This configuration contains the final fields.
GlobalField with key
Fields.EmptyDate
. This configuration contains the final fields.
Example template “Meeting invitation”
Let's take a look at an example template "Meeting invitation" that is fully equipped with references from the global configurations.
The aim is always to be able to use a configuration of fields several times if it is used often. Consequently, these references in this example are used because there are several invitation templates that require the same fields.
Meeting Invitation Content
Forms
Directly in template
<FormsConfiguration>
<Elements>
<GlobalElements Key="Forms.Recipient-Invitation" />
<Date Id="Date" Label="Meeting date" RelativeDate="Today" translate-Format="Configuration.DateFormat.WrittenOut" />
</Elements>
</FormsConfiguration>
Global entries
Key: Forms.Recipient-Invitation
<FormsGlobalElements>
<ObjectCollection Id="Participants" Label="Meeting participants">
<GlobalSchemaAndSummary Key="Recipients.Objects.InternalListSchema"/>
</ObjectCollection>
</FormsGlobalElements>
↓ Global entry itself contains a reference:
Key: Recipients.Objects.InternalListSchema
<FormsGlobalSchemaAndSummary>
<Schema>
<Text Id="FirstName" Label="First name" />
<Text Id="LastName" Label="Last name" />
<Text Id="Alias" Label="Alias" />
<YesNo Id="IsLead" Label="Leads the meeting" />
</Schema>
<Summary>
<Field Id="FirstName" />
<Field Id="LastName" />
<Field Id="Alias" />
</Summary>
</FormsGlobalSchemaAndSummary>
Fields
Directly in template
Global entries
Key: Fields.Recipient.ParticipantsLine
Key: Fields.Date
Placeholder Mapping
Directly in template
Global entry
Key: Placeholders.Map.Invitation
Meeting Invitation Layout
NOTE
The content is always based on a layout. The placeholders for the header or footer are defined in the layout.
Placeholder Definition
Directly in template
Global entry
Key: Placeholders.Def.Invitation
GlobalCode
Sometimes different fields in different templates require exactly the same logic but with different values (e.g. other Forms
fields). GlobalCode makes it possible to save a function in the global configurations and use it in Fields fields.
Create GlobalCode
GlobalCode
is created in the global configurations as an entry of the type FieldsGlobalCode.
An example:
A GlobalCode
with Id Code.formatNumber
is stored in the global configurations. It contains a function formatForTable()
with the parameters input
(a string
) and isInCHF
(a Boolean
).
The string input
is first converted into a number and is then output as a string in a country-specific format depending on isInCHF
.
Use in fields
This function can now be referenced in fields.
GlobalCode
is available to all fields, i.e. it does not matter whether GlobalCode is referenced in a field directly in a template or in the global configurations.GlobalCode
can be used for any field type.
For example: In a Fields configuration in a template, a reference to the GlobalCode
created earlier with Key Code.formatNumber
is made between the start and end tag:
Working with untyped fields (classic)
The information is located in data sets (data tag), which in turn are located in groups (group tag). The content in a data set is linked in a configuration according to the following pattern: {[GroupName.DataName]}
.
Example 1 – Text
The globally stored record "Config.Depth" contains the value 5
:
Example 1 - Image
Example 1 - Underlying XML:
The record can now be linked in all XML configurations of the document functions. For example, in the XML configuration of the document function Scripts:
{[Config.Depth]}
is now replaced with 5
each time. The script results are calculated 5 times. If this value needs to be adjusted, this can be done once in the Global Configurations. Consequently, this change will be automatically adjusted in all templates that contain {[Config.Depth]}
.
Example 2 – Whole script
The globally stored record "Salutation" contains a script:
Example 2 - Image
Example 2 - Underlying XML
The "Salutation" script is initially used in all customer solutions as the default script for the salutation in a letter. Therefore, it is linked in correspondence templates in the "Scripts" document function:
{[Scripts.Salutation]}
is now replaced with the corresponding content from the Global Configurations. The content is a script that attracts two Contact elements. So in the document finally the salutation is inserted, which was selected by the user in the recipient dialog.
Example 3 – Whole script with translations
The globally stored record "Enclosures" contains a script with a translation:
Example 3 - Image
Example 3 - Underlying XML
The "Enclosures" script is mainly used in letters, as it creates a list of all enclosures entered in the document parameter. That is why it is linked here in letter templates in the document function "Scripts":
{[Scripts.Enclosures]}
is now replaced with the corresponding content from the Global Configurations. The content is a script with a translation and the reference to a document parameter field. The translation is fetched from the Global Translations using {D[Texts.Enclosures]}
.
Example 4 – Script with translation
The globally stored "Translations" dataset contains several scripts with text content:
Example 4 - Image
Example 4 - Underlying XML
The scripts (e.g. "Texts.Draft") contain translations that can serve in all letters. Therefore the record is linked here in a layout template in the document function "Scripts":
{[Scripts.Translations]}
will now be replaced with the corresponding content from the Global Configurations. In all templates based on this layout template, these translations can be inserted into the template as a text field. If a word needs to be adjusted, this can be done once in the Global Translations. Afterwards, the change will be applied directly in every template that has this translation linked.
PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland