
Viz Mosart Administrator Guide
Version 3.9 | Published November 04, 2019 ©
TemplateSetEditor
The 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 hierarchial templates to the database.
The TemplateSetEditor is a beta product, used at own risk, and is only estimated to be supported from Mosart 4.0.
Configuration of TemplateSetEditor
All configuration of TemplateSetEditor is done in the application configuration file, TemplateSetEditor.exe.config
Within the application configuration file locate the userSettings sections. Here it is possible to do the following configuration:
-
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)
-
Selecting template respository (future). Only c:\channeltemplates.xml currently supported.
Configuring the template database to use
It is possible to register three different databases to connect to. This is done by entering respective connectionstrings using the properties Database1, Database2 and Database3.
Then select which database to use by assigning the desired server (hostname) to the Database property.
As an 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 will make use of the connectionstring given in the Database1 property whilst setting the Database property to 146.148.9.188 will make use of the connectionstring given in Database2
Configuring an external tool for showing differences
This is useful to compare 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 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:
-
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 will make use of Beyond Compare as the external tool to use for the comparison.
Configuring an external tool to edit / view xml content of a single template
This is useful to either 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.
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}
-
-
EditTool3: Notepad++
-
Name=Notepad++;Program=C:\Program Files\Notepad++\notepad++.exe;Args={0}
-
Setting the property EditTool to VSCode will make 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
/? 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 will be 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 encounted 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 1
-
set2 - Name of template set 2
-
type - Optional: Template type of single template.
-
template - Optional: Name or variant of single template
# 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 equals 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 1
-
set2 - Name of template set 2
-
type - Optional: Template type of single template.
-
template - Optional: Name or variant of single template.
# 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.
# 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.
-
template - Optional: Name or variant of single template.
# 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.
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
# 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 will remove 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.
Copies the xml content of a single template to the Windows clipboard
Syntax:
-
set - Name of template set
-
type - Optional: Template type of single template.
-
template - Optional: Name or variant of single template.
# 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 - Optional: Template set to list templates from
-
type - Optional: Restrict listing to templates of given types
-
'*' = All types
-
Comma separeted list of valid types:
-
-
regex - Optional: Restrict listing to templates matching the given regular expression.
-
filename - Optional: filename to store listed templates.
# 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 will be 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 - Will make a copy of the baseset if the given templateset does not exist
-
-f - Will do a flatten template set operation after the rebase operation.
# 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 will be made before rebasing
rebase LDN2 LDN -c
# Bases template set LDN2 to template set LDN.
# After rebase, a flattening templateset operation will be 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 - Optional: Template type of single template.
-
template - Optional: Name or variant of single template.
# 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.