After initialization, you perform most changes to the Viz Mosart Template Database in AV Automation 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
AV Automation 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.
Info: 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.
Enter the respective connectionstrings using the properties Database1, Database2 and Database3.
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 using the compare function. Register up to three different tools for comparison using the properties DiffTool1, DiffTool2 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} |
DiffTool2: Beyond Compare | Name=BComp;Program=C:\Program Files\Beyond Compare 4\BCompare.exe;Args={0} {1} |
DiffTool3: ExamXml | 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 EditTool1, EditTool2 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.
Examples
Tool | Code Example | Notes |
|---|---|---|
EditTool1: Visual Studio Code | Name=VSCode;Program=C:\Program Files\Microsoft VS Code\Code.exe;Args={0} | Uses Visual Studio Code as the an external editing tool |
EditTool2: XmlMarker | Name=XmlMarker;Program=C:\Program Files (x86)\XML Marker\xmlmarker.exe;Args={0} | |
EditTool3: Notepad++ | Name=Notepad++;Program=C:\Program Files\Notepad++\notepad++.exe;Args={0} |
TemplateSetEditor Commands
Below is a list of commands available in the TemplateSetEditor:
TemplateSetEditor/? Outputs this help messageClear Clears the console windowCleanUp Clean up templates, removes depricated stuff etc.Compare [set] [baseset] [type] [template] Compares template sets or a single templateCopy [set] [newset] Makes a copy of set with name equals newsetEdit [set] [type] [template] Opens a single template in an external xml editorEnd Terminates Mosart Template Set EditorEquals [set] [baseset] [type] [regex] Performs equality test on templateset or set of templatesExit Terminates Mosart Template Set EditorFlatten [set] [type] [template] Flattens a templateset or a single templateGallery [gallery|add|select|delete|rename|list] [gallery] [newname] Gallery operation when using template database, default selectHelp Outputs this help messageImport [filename] [all|setname] Imports template set from channeltemplates.xml file into databaseInfo [set] [type] [template] Outputs information of a templateset or a single templateList [set] [type] [regex] List templates / template setsOpen {filename} Opens the given channeltemplates fileQuit Terminates Mosart Template Set EditorRebase [set] [baseset] [-c] [-f] Bases a templateset upon another setRemove [set] [type] [template] Removes templateset or a single templateRename [set] [newname] Renames templatesetSave Saves channeltemplatesSaveAs [filename] [ChangesOnly] Saves channeltemplates to the given filename. If ChangesOnly is given only changed templates are saved.SetPrivate [template set name] makes a shared template set privateSetShared [template set name] makes a private template set sharedVerbose Turns verbose logging to console on/offCompare [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 for investigating 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 LDN2compare LDN LDN2# Compares template Camera+1 from template sets LDN and LDN2compare LDN LDN2 0 1compare LDN LDN2 Camera 1Copy [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 LDN2equals LDN LDN2# Performs the equality test on template Camera+1 from template sets LDN and LDN2equals LDN LDN2 0 1equals LDN LDN2 Camera 1Edit [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 editoredit LDN 0 1edit LDN Camera 1Flatten [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 LDNflatten LDN# Flattens template Camera+1 in template sets LDN flatten LDN 0 1flatten LDN Camera 1Gallery [gallery|add|select|delete|rename|list] [gallery] [newname]
Gallery operations. Requires template database.
Tip: This is the recommended way to remove a gallery from the template database. This operation is not possible with 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 databasegallery list# Selects StudioC as the current gallery, both examples are validgallery StudioCgallery select StudioC# Add StudioR as new gallery to the template databasegallery add StudioR# Deletes StudioC from the template database. This operation removes all content related to the gallery.gallery delete StudioC# Renames StudioB to StudioB2gallery rename StudioB StudioB2Import [filename] [all | setname]
Imports template set from channeltemplates.xml file into database
Tip: The filename of the xml containing the sets/templates must not be called channeltemplates.xml if it resides in the c:\channeltemplates folder.
TemplateSetEditor overwrites this file when the app starts and the database is loaded. The file can be in any path and any name. (if not in c:\channeltemplates)
Syntax:
filename: file name and path of channeltemplates.xml file to import
setname: the individual set name to import or ‘all’ to import all sets
All template set names imported will have a prefix of I_ as to not duplicate if there is the same set name.
Imported sets that are based on other set imported will also receive the prefix so all imported sets will match the existing hierarchy and not be separated.
Directakes will be skipped (not imported)
The console command save must be called to write back the imported sets/templates to the TDB after the import command.
Info [set] [type] [template]
Outputs the XML content of a template set or a single template to the console and the Windows clipboard.
Tip: This operation 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 LDNinfo LDN# Outputs information of template Camera+1 in template sets LDN info LDN 0 1info LDN Camera 1List [set] [type] [regex] [file=filename]
List all template sets or templates within a template set.
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: File name for storing listed templates (optional).
Example: List
# List all template sets within the current channeltemplates.xml filelist# List all templates within template set LDNlist LDN# List all camera templates within template set LDNlist LDN 0list LDN Camera# List all camera templates within template set LDN where name contains "RIGHT"list LDN 0 RIGHTlist LDN Camera RIGHT# List all camera and live templates within template set LDN where name contains "RIGHT"list LDN 0,3 RIGHTlist LDN Camera,Live RIGHT# List all templates within template set LDN where name contains "RIGHT"list LDN * RIGHTOpen [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 base set is not given, the given template set is made standalone (is not based upon any other template set).
Syntax:
set: The template set to rebase.
baseset: The template set to used as the base set.
-c: Makes a copy of the base set if the given templateset does not exist.
-f: Flattens template set after the rebase operation.
Example: Rebase
# Bases template set LDN2 to template set LDNrebase LDN2 LDN# Bases template set LDN2 to template set LDN. # If LDN2 does not exist, a copy of LDN is made before rebasingrebase LDN2 LDN -c# Bases template set LDN2 to template set LDN. # After rebase, a flattening templateset operation is performedrebase LDN2 LDN -f# Makes template set LDN2 'stand alone' (i.e. not based upon any other template set).rebase LDN2Remove [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 LDNremove LDN# Removes template Camera+1 from template sets LDN remove LDN 0 1remove LDN Camera 1Rename [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.
SetPrivate [template set name]
Set a current shared template set to private in the currently selected gallery
Syntax:
template set name: the name of the template set to make private
SetShared [template set name]
Set a current private template set in the currently selected gallery to shared
Syntax:
template set name: the name of the template set to make shared