If you use a version of the SDK that is not compatible with the Tealeaf templates installed on your system, you must upgrade the Replay Server to get the latest Tealeaf templates.
Running the Upgrader installs the latest version of the Replay Server and the Tealeaf templates into your environment.
To implement the new templates into your environment perform the following steps:
- Rename the current ReplayServer\TLT directory to preserve any template customization work that you have done.
For example, rename ReplayServer\TLT to ReplayServer\TLT_earlier_version.
- Run the Upgrader to install the latest Replay Server and the Tealeaf templates to your environment.
- Optional: Examine any customizations that were made to the previous templates and then merge the customizations into the TLT directory.
For example, merge any template customizations from ReplayServer\TLT_earlier_version into the ReplayServer\TLT directory.
If no changes were made to shipping template files, and if you implemented customizations by creating a "custom" directory, then copying this "custom" directory is sufficient.
Note: In contrast, if you modified the shipping templates and haven't kept customizations in a "custom" folder, you should maintain a pristine copy of the unmodified templates to use for comparison. A 3-way / 4-pane diff/merge tool is useful for these types of operations.
You have successfully upgraded the Replay Server and your system now has the latest version of the Tealeaf templates installed.
Template customization for Native replay
You can customize Replay Server templates by either modifying the provided templates or creating your own templates.
Modifying the replay server templates that are shipped with Tealeaf
Tealeaf ships with Replay Server
templates. These templates are placed in the ReplayServer\TLT
directory when you install Tealeaf. You can modify these templates to customize mobile device session replay.
Note: Editing the templates in ReplayServer\TLT
as a way of customizing how JSON data is converted to HTML, has certain drawbacks. You will likely need to re-implement any changes you make to the templates when a new version of Tealeaf is installed.
Consult Professional Services if you are considering modifying the templates that are shipped with Tealeaf. Professional Services personnel have the expertise and tools for modifying Replay Server
templates.
Creating your own templates to customize mobile device session replay
You can create custom templates for use with mobile device session replay.
Custom templates are useful if you make changes to the out-of-the-box mobile controls in iOS or Android that result in a subclass of that control that has a different visual appearance. In such a scenario, the replay of that control might not show your customization. By using a custom template, you can make the replay match your customization.
By creating your own templates, you can avoid having to re-implement template changes whenever a new version of Tealeaf is installed.
To create custom templates:
- Create a folder named custom under either the ReplayServer\TLT\iOS or ReplayServer\TLT\Android subdirectories.
The templates shipped with Tealeaf will look in the custom folder and use the contents if present.
- There are four customization points you can utilize by placing content into the custom folder.
-
Each customization point is a file that you can place in the custom folder.
The four files are:
- nativeTypeRemap.json
- The
nativeTypeRemap.json
file is expected to contain a JSON object, where each key in the object is the name of a native iOS or Android type of control, and each corresponding value is the name of a template file that will handle the rendering of that native type.For example, assume that an iOS application developer has sub-classed the
UITableViewCell
control to createEnhancedTableViewCell
that utilizes custom drawing commands. In the logging framework (SDK), this might be displayed as follows:Notice that the tlType is still the default
tableCell
, and by default, the rendering of this control is handled by thecontrol_tableCell.tlt
template. But also notice that the native type property showsEnhancedTableViewCell
, which is the name of the subclass. You can use this name as a key in thenativeTypeRemap.json
file and create a template that customizes how the control type is rendered. For example:{ "EnhancedTableViewCell ": "control_EnhancedTableViewCell.tlt", "ColorfulLabel": "control_ColorfulLabel.tlt" }
The templates look for a file
control_EnhancedTableViewCell.tlt
(also under the custom directory) and use that template instead of the defaultcontrol_tableCell.tlt
template to enable a customized rendering ofEnhancedTableViewCell
controls. - headAdditions1.tlt
- If provided, the contents of the
headAdditions1.tlt
template is inserted in the<HTML>
head element (after the CSS<link>
elements, but before the in-line CSS).Use this template to include any additional CSS file that are required to handle your customization.
- headAdditions2.tlt
- If provided, the contents of this template is inserted at the very end of the
<HTML>
head element.This provides an opportunity to insert any scripts or to override any CSS inline in the HTML document.
- bodyAttrs.tlt
- If provided, this template specifies attributes to be added to the HTML
<body>
element.You might use this template, for example, to add a style attribute and set a background-image to the reply of your application.
-
Template Parser Test tool
The Template Parser Test tool is provided to help develop and test templates.
The usage of this tool is as follows.
templateParserTest.exe templateFileName [paramJsonFilename [envJsonFilename] ]
Used with a single argument, the name of a template file is expected. In this usage, the template that is provided is parsed and tested for validity. Only the template expressions inside {{
}}
are checked. The static text is not checked. With this usage, only the templateFileName
that is passed on the command line is validated. Any other template files that may be invoked from within that template file are not validated.
Used with two arguments, the second parameter is a JSON file that represents the context
input. In this usage, the JSON context
input is rendered through the template to produce a result, and no environment inputs are available to the template. For replay templates, the result is presumably HTML or a subset thereof. This input can be a JSON object or a JSON array.
Used with three arguments, the third parameter is a JSON file that represents the environment
input. In this usage, the JSON context input is rendered in the same manner as with two arguments and the environment inputs are available. This input must be a JSON object where each environment variable is represented as a JSON name-value pair.
When you use templateParserTest.exe, use caution when you use templates that reference sub templates. Sub template paths are relative to the execution directory of templateParserTest.exe, not relative to the templateFileName provided as input. For example, the expected usage is to copy the templateParserTest.exe
utility into the directory containing the root template of the templates being tested.