Question & Answer
Question
How do templates of APIs get invoked in MCF 8.0?
Answer
If it is an out-of-the-box API, the template is invoked in the following sequence. Once it is found, the template will be picked from the place. The general rule is that the API is going to look if there is any template defined for the document type and organization, then to see if any templates are defined for the organization, after that to see if any templates are defined for the document type. Lastly the API will pick up the default template.
This is the basic rule in MCF 7.x too. In MCF 8.0, API templates are pulled from two places. One is <INSTALL_DIR>/extensions/global/template/api folder, which is generally used to search for out-of-the-box templates, and the other is <INSTALL_DIR>/repository/xapi/template/merged/api, which is generally used to search for custom templates. Let's take getOrderDetails API as example:
From <INSTALL_DIR>/extensions/global/template/api...
1. /global/template/api/extn/getOrderDetails.0001.DEFAULT.xml
2. /global/template/api/getOrderDetails.0001.DEFAULT.xml
3. /getOrderDetails.0001.DEFAULT.xml
1. /global/template/api/extn/getOrderDetails.DEFAULT.xml
2. /global/template/api/getOrderDetails.DEFAULT.xml
3. /getOrderDetails.DEFAULT.xml
1. /global/template/api/extn/getOrderDetails.0001.xml
2. /global/template/api/getOrderDetails.0001.xml
3. /getOrderDetails.0001.xml
1. /global/template/api/extn/getOrderDetails.xml
2. /global/template/api/getOrderDetails.xml
3. /getOrderDetails.xml
From <INSTALL_DIR>/repository/xapi/template/merged/api...
1. /template/api/extn/getOrderDetails.0001.DEFAULT.xml
2. /template/api/getOrderDetails.0001.DEFAULT.xml
3. /getOrderDetails.0001.DEFAULT.xml
1. /template/api/extn/getOrderDetails.DEFAULT.xml
2. /template/api/getOrderDetails.DEFAULT.xml
3. /getOrderDetails.DEFAULT.xml
1. /template/api/extn/getOrderDetails.0001.xml
2. /template/api/getOrderDetails.0001.xml
3. /getOrderDetails.0001.xml
1. /template/api/extn/getOrderDetails.xml
2. /template/api/getOrderDetails.xml
3. /getOrderDetails.xml
All these paths are defined in resource.jar. But if the template name was passed from a custom API call, the program will only start looking for the template from those in the /template/api/extn folder.
Historical Number
HTG2568
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21563418