You can override the XML templates that are in the product with template extensions.
About this task
Many APIs use an output XML template to define what is
returned. Each API has its own XML template, which is picked up from
the INSTALL_DIR/repository/xapi/template/merged/api/apiName.xml
file. The files in this directory are part of the product and should
not be altered. However, these templates can be overridden by implementing
template extensions.
To
extend a template file:
Procedure
- Copy the template INSTALL_DIR/repository/xapi/template/merged/api/apiName.xml
file to the INSTALL_DIR/extensions/global/template/api/
directory, keeping the same file name.
If the /global/template/api/
directory does not exist, create the required directory structure.
- Modify the copied file, as needed. To extend a template
file, add the Extn tag under the entity tag.
For example, if you have added a column EXTN_COLOR to
YFS_ITEM table, you also must add the tag Extn under
the tag Item in the getItemDetails.xml file
as follows:
<Item ItemKey=""....>
<PrimaryInfo MasterCatalogID="" .../>
...
<Extn ExtnColor=""/>
</Item>
Note: If you are extending an output
XML template, place your extended files in the INSTALL_DIR/extensions/global/template/api
folder. But when providing the name of the template.api file during
service definition, the path should be /global/template/api/CUSTOM-TEMPLATE-API.