Using templates > Using StreamServe variable to load template

Using StreamServe variable to load template
You can use a StreamServe variable when the template path cannot be specified by a SOM expression, or when the path must be specified by scripting in StreamServe.
The variable is evaluated once for each job, directly after the Process is started. This means that the template is used for all records processed in the job.
The variable is a string and both file paths and URIs (file, HTTP, and repository URIs) are supported. Paths and URIs can be absolute or relative (to the StreamServer working directory).
For HTTP URIs, simple HTTP authentication can be used.
Example 1
File path:
C:\templates\mytemplate.xdp
or
../../MyTemplate.xdp
File URI:
file:///D:/my%20templates/mytemplate.xdp
HTTP URI:
http://examplehost/mytemplate.xdp
Repository URI:
repository:///myfolder/myresource.xdp
 
Example 2
The template file used for a particular user category is stored on disk (or in a database).
A Before Process StreamServe script is used to read a value from the file, based on the user category, and assigns the template path to the variable. The variable is then used for template selection in the Process.
Absolute path example:
$template =”C:\templates\dynamic_invoice.xdp”;
Relative (from working directory) path example:
$template = “../data/XDP_template/ dynamic_invoice.xdp”;
Example 3
The template path is sent to StreamServe as an HTTP header value.
A script extracts the value from the HTTP header and assigns the value to a variable. The variable is then used for template selection in the Process.
 
To load a template during runtime using a StreamServe variable
1
In the Process Tool, select File > Open/Select Template. The Select Template dialog box opens.
2
Select StreamServe variable and enter the name of the variable pointing to the template.
3
If connecting to a Document Services Repository, enter the Runtime repository connection details.
4
If using HTTP URI, and simple HTTP authentication, select Use Simple HTTP Authentication and enter the logon credentials.
5
Click OK. The starting window for the Process tool opens.
OpenText StreamServe 5.6 Updated: 2013-03-01