After initialization, most changes to the Viz Mosart Template Database  are performed in AvAutomation and the Template Editor.

These changes may include upgrading the database, adding and removing galleries, adding and removing template sets and adding, removing and editing templates.

This section presents the following topics:

Upgrading the Database

AvAutomation will automatically upgrade the database. All upgrades and current database version are stored in the db_database table.

Note: Automatic upgrades shall never delete or modify any content in the database. The database should be kept backward compatible at all times.
Upgrades normally add new functionality to the database

Upgrade History

The following table summarizes the upgrade history of the Viz Mosart Template Database:

Version

Date

Version

Description

0.1.0

01.06.2012

3.2

Initial version.

1.0.0

01.12.2012

3.2

First version of automatic upgrade. New table: db_database.

1.0.1

01.10.2013

3.2

Added support for sequences. New table: sq_sequence.

1.0.2

07.05.2013

3.3

Added templateset properties. New table: tsp_templatesetproperties.

1.0.3

27.06.2013

3.3

Verified default transitions: Added initial content to the tr_transition table.

1.0.4

05.09.2013

3.5

Added order field in tdfi_connection table. New column: tdfi_order.

1.0.5

26.08.2014

3.5

Added scope to ta_templatetypealias table. New column: ta_scope.

1.1.0

17.01.2016

4.0

Added support for hierarchical template sets. New columns in ts_templateset table: ts_basedon, ts_hidefromuser.

Viz Mosart Template Editor

The Viz Mosart Template Editor is normally used to add, delete and modify Viz Mosart templates. When attached to a Mosart Template database every save operation pushes the changes incrementally to the database. 

Use the Template Editor for the following changes:

  • Adding and removing template sets. Note when adding a new template set it is possible to choose whether the template set shall be shared or gallery specific (local). It is not possible to change this afterwards.

  • Adding, removing and editing templates. This is the normal use case of the template editor.

TemplateSetEditor

TemplateSetEditor is a console application that is part of the Mosart Test Suite. This application may be useful for simple maintenance and is currently the only way to remove galleries from the database.
The TemplateSetEditor was made as part of adding hierarchical templates to the database.

Note: As of Viz Mosart 4.0, the TemplateSetEditor is a standard component.

Configuration of TemplateSetEditor

Tip: Configuration of TemplateSetEditor is done in the application configuration file, TemplateSetEditor.exe.config

userSettings

Within the application configuration file locate the userSettings sections where you can:

  • Select an external tool for showing differences. Used by the compare function

  • Select an external tool for viewing single templates or template sets in XML. Used by the edit function.

  • Select the template database to use with corresponding credentials (connectionstring).

  • Select template respository (future). Only C:\channeltemplates.xml is currently supported.

Configuring the Required Template Database

You can register three different databases to connect to.

  1. Enter the respective connectionstrings using the properties Database1Database2 and Database3.

  2. Select which database to use by assigning the desired server (hostname) to the Database property.

Example

  • Database1: gallery=StudioE;server=localhost;User Id=user;password=password;database=mosarttemplatedb

  • Database2: gallery=StudioE;server=146.148.9.188;User Id=user;password=password;database=mosarttemplatedb

  • Database3: <empty> (not used)

Setting the property Database to localhost makes use of the connectionstring given in the Database1 property, setting the Database property to 146.148.9.188 makes use of the connectionstring given in Database2.

Configuring an External Tool for Displaying Differences

You can reveal differences to template sets or templates by comparing their corresponding XML representations. This is used by the compare function. Register up to three different tools for comparison using the properties DiffTool1DiffTool2 and DiffTool3.
Use {0} and {1} as placeholders for the two different contents to compare. Then select which tool to use by setting the property DiffTool to the name of the desired tool.

Example

Tool

Code Example

DiffTool1:  Visual Studio Code

Name=VSCode;Program=C:\Program Files\Microsoft VS Code\Code.exe;Args=--diff {0} {1}

DiffTool2Beyond Compare

Name=BComp;Program=C:\Program Files\Beyond Compare 4\BCompare.exe;Args={0} {1}

DiffTool3ExamXml

Name=ExamXml;Program=C:\Program Files\ExamXMLPro\examxmlpro.exe;Args=--diff {0} {1}

Setting the property DiffTool to BComp makes use of Beyond Compare as the external tool to use for the comparison.

Configuring an External Editor for XML Content in a Single Template

You can edit or view the XML content of a single template.

Register up to three different tools for editing xml using the properties EditTool1EditTool2 and EditTool3.
Use {0} as placeholder for the content to edit. Then select which tool to use by setting the property EditTool to the name of the desired tool.

Example

Tool

Code Example

EditTool1:  Visual Studio Code

Name=VSCode;Program=C:\Program Files\Microsoft VS Code\Code.exe;Args={0}

EditTool2: XmlMarker

Name=XmlMarker;Program=C:\Program Files (x86)\XML Marker\xmlmarker.exe;Args={0}

EditTool3Notepad++

Name=Notepad++;Program=C:\Program Files\Notepad++\notepad++.exe;Args={0}

Setting the property EditTool to VSCode makes use of Visual Studio Code as the external tool to use for editing.

TemplateSetEditor Commands

Below is a list of commands available in the TemplateSetEditor:

TemplateSetEditor help message

TemplateSetEditor
/? Outputs this help message
Clear Clears the console window
CleanUp Clean up templates, removes depricated stuff etc.
Compare [set] [baseset] [type] [template] Compares template sets or a single template
Copy [set] [newset] Makes a copy of set with name equals newset
Edit [set] [type] [template] Opens a single template in an external xml editor
End Terminates Mosart Template Set Editor
Equals [set] [baseset] [type] [regex] Performs equality test on templateset or set of templates
Exit Terminates Mosart Template Set Editor
Flatten [set] [type] [template] Flattens a templateset or a single template
Gallery [gallery|add|select|delete|rename|list] [gallery] [newname] Gallery operation when using template database, default select
Help Outputs this help message
Info [set] [type] [template] Outputs information of a templateset or a single template
List [set] [type] [regex] List templates / template sets
Open {filename} Opens the given channeltemplates file
Quit Terminates Mosart Template Set Editor
Rebase [set] [baseset] [-c] [-f] Bases a templateset upon another set
Remove [set] [type] [template] Removes templateset or a single template
Rename [set] [newname] Renames templateset
Save Saves channeltemplates
SaveAs [filename] [ChangesOnly] Saves channeltemplates to the given filename. If ChangesOnly is given only changed templates are saved.
Verbose Turns verbose logging to console on/off

Compare [set1] [set2] [type] [template]

Compares two template sets or a single template between two template sets. If any differences are encountered an external diff tool is launched to investigate the differences. Configuration of diff tool is done via the application configuration file, TemplateSetEditor.exe.config.
Syntax:

  • set1: Name of template set one.

  • set2: Name of template set two.

  • type: Template type of single template (optional).

  • template: Name or variant of single template (optional).

Example Compare

# Compares template sets LDN and LDN2
compare LDN LDN2
# Compares template Camera+1 from template sets LDN and LDN2
compare LDN LDN2 0 1
compare LDN LDN2 Camera 1

Copy [set] [newset]

Makes a copy of a template set with name equal to newset.

Equals [set1] [set2] [type] [template]

Performs the equality test on two template sets or for a single template.
Syntax:

  • set1: Name of template set one.

  • set2: Name of template set two.

  • type: Template type of single template (optional).

  • template: Name or variant of single template (optional).

Example Equals

# Performs the equality test on the template sets LDN and LDN2
equals LDN LDN2
# Performs the equality test on template Camera+1 from template sets LDN and LDN2
equals LDN LDN2 0 1
equals LDN LDN2 Camera 1

Edit [set] [type] [template]

Opens a single template in an external xml editor. The tool to use is configured in the application configuration file, TemplateSetEditor.exe.config
Syntax:

  • set: Name of template set.

  • type: Template type of single template.

  • template: Name or variant of single template.

Example: Edit

# Opens template Camera+1 in template sets LDN in an external xml editor
edit LDN 0 1
edit LDN Camera 1

Flatten [set] [type] [template]

Flattens an entire templateset to its base set or a single template.
Syntax:

  • set: Name of template set to flatten.

  • type: Optional: Template type of single template (optional).

  • template: Name or variant of single template (optional).

Example: Flatten

# Flattens template set LDN
flatten LDN
# Flattens template Camera+1 in template sets LDN
flatten LDN 0 1
flatten LDN Camera 1

Gallery [gallery|add|select|delete|rename|list] [gallery] [newname]

Gallery operations. Requires template database.

Tip: The recommended way to remove a gallery from the template database. Currently not possible from the template editor.

Syntax:

  • operation: Gallery operation. Either add,select,delete,rename or list. Default = select.

  • gallery: Name of gallery in the Mosart template database.

  • newname: New gallery name when operation=rename.

Example: Gallery

# List all galleries in the template database
gallery list
# Selects StudioC as the current gallery, both examples are valid
gallery StudioC
gallery select StudioC
# Add StudioR as new gallery to the template database
gallery add StudioR
# Deletes StudioC from the template database. This operation removes all content related to the gallery.
gallery delete StudioC
# Renames StudioB to StudioB2
gallery rename StudioB StudioB2

Info [set] [type] [template]

Outputs the XML content of a templateset or a single template to the console and the Windows clipboard.

Tip: Copies the XML content of a single template to the Windows clipboard.

Syntax:

  • set: Name of template set.

  • type: Template type of single template (optional).

  • template: Name or variant of single template (optional).

Example: Info

# Outputs information of template set LDN
info LDN
# Outputs information of template Camera+1 in template sets LDN
info LDN 0 1
info LDN Camera 1

List [set] [type] [regex] [file=filename]

List all templates sets or templates within a template sets.
Syntax:

  • set: Template set to list templates from (optional).

  • type: Restrict listing to templates of given types (optional).

    • '*' = All types

    • Comma separated list of valid types.

  • regex: Restrict listing to templates matching the given regular expression (optional).

  • filename: filename to store listed templates (optional).

Example: List

# List all template sets within the current channeltemplates.xml file
list
# List all templates within template set LDN
list LDN
# List all camera templates within template set LDN
list LDN 0
list LDN Camera
# List all camera templates within template set LDN where name contains "RIGHT"
list LDN 0 RIGHT
list LDN Camera RIGHT
# List all camera and live templates within template set LDN where name contains "RIGHT"
list LDN 0,3 RIGHT
list LDN Camera,Live RIGHT
# List all templates within template set LDN where name contains "RIGHT"
list LDN * RIGHT

Open [filename]

Opens tempateset / channeltemplates.xml file. Default: C:\channeltemplates\ChannelTemplates.xml.

Rebase [set] [baseset] [-c] [-f]

Bases a template set upon another template set. If a baseset is not given, the given template set is made 'stand alone' (i.e. not based upon any other template set).
Syntax:

  • set: The template set to rebase.

  • baseset: The template set to used as the baseset.

  • -c: Makes a copy of the baseset if the given templateset does not exist.

  • -f: Flattens template set after the rebase operation.

Example: Rebase

# Bases template set LDN2 to template set LDN
rebase LDN2 LDN
# Bases template set LDN2 to template set LDN.
# If LDN2 does not exist, a copy of LDN is made before rebasing
rebase LDN2 LDN -c
# Bases template set LDN2 to template set LDN.
# After rebase, a flattening templateset operation is performed
rebase LDN2 LDN -f
# Makes template set LDN2 'stand alone' (i.e. not based upon any other template set).
rebase LDN2

Remove [set] [type] [template]

Removes the given template set or a single template.

Syntax:

  • set: Name of template set

  • type: Template type of single template (optional).

  • template: Name or variant of single template (optional).

Example: Remove

# Removes template set LDN
remove LDN
# Removes template Camera+1 from template sets LDN
remove LDN 0 1
remove LDN Camera 1

Rename [set] [newname]

Renames the given template set to the given new name.

Save

Saves any changes to the template database and the current channeltemplates.xml file.

SaveAs [filename]

Saves the current templatesets to the given filename.