If you want to use a template that contains a subset of the elements in the standard
output template, create a dynamic output template.
About this task
If you want the ability to remove some elements from the standard template and perhaps add your
own elements, you do that by passing your XML data or a file name into the YFSEnvironment
object.
To
define and deploy a dynamic template:
Procedure
-
Copy the standard output template for the API that you want to modify from the
<runtime_sandbox>/repository/xapi/template/merged/api/FileName.xml
file as <runtime_sandbox>/extensions/global/template/api/FileName.xml.
When naming your new template file, use the same name as the standard template
The name of the output template corresponds with the name of the API or event associated with it.
For example, the getOrderDetails() API takes the output template file
getOrderDetails.xml.
-
Modify the copied template in the /extensions/global/template/api
directory as required, keeping in mind the best practices for creating custom output XML
templates.
- During user interface extensibility, call the setApiTemplate()
function on the YFSEnvironment object. This enables you to specify
an output template before calling an API, using one of the following
functions: