Provisioning Reference Guide › SPML Service › SPML Service Configuration › Using the SPML Manager's Templating Functionality › Create an SPML Template Request
Create an SPML Template Request
To create an SPML Template request, perform the following steps:
- Create an XML file containing some sample data.
You can find a sample in the SPMLManager\sample Templates directory.
- Using the SPML Manager, connect to an SPML service.
- Use one of the tabs (Add, Modify, Delete, or Extended) to construct an SPML request that conforms to the schema of the SPML service.
The name given to the Exploder Velocity context is REC_, so whenever you want to refer to a variable in the data file, use the syntax ${REC_.variable}.
To hard-code a constant in the generated requests, type the data you want into the attribute fields.
- Click the Raw XML tab to see the SPML Request in XML format.
- Click the Add to Batch Request button when you are happy with your simple variable replacement.
Note: The Add to Batch Request button is only available when viewing the tab in Request mode and is therefore not available in Raw <XML> mode.
- Use the Batch tab to see the addition to batch.
A batch request can contain as many individual requests as you like.
- Save the SPML Batch Request Template to a file.
- Click the Template tab and load your simple SPML Template from your saved Batch Request File.
- Click the Raw <XML> tab to edit your SPML Template:
- In the XML code, insert a velocity directive for each loop at the point in your batch request where you want the request to cycle through loading each row in the CSV into the context and put a #end statement where you want the cycling to end. The format of the syntax for each loop is #foreach ( $REC_ in $RECS_.
- Click Save Template to save your modified template file.
- Load the XML data file that will fill in the data in your request.
- Click the Save button if you want to Save the resulting batch request to a file for inspection or click Submit if you want to submit the resulting Batch Request to the SPML Service.
For each XML record in the data file, a corresponding SPML Request will be generated to initiate a provisioning operation inside the Provisioning Server.
The example files used in this tutorial are in the SPMLManager/sampleTemplates/simple directory.