Configuring the getPage API to retrieve additional data

Create a custom getPage-templates.json file to retrieve the necessary data from existing getPage API calls without the need to write any code.

Save the file to the module's src-custom/assets/custom folder. For example, packages/<route>/src-custom/assets/custom/getPage-templates.json.

You only need to use this file if the custom data that you are trying to retrieve from IBM® Sterling Order Management System is not already retrieved by the default getPage API call. To review what data is already retrieved and to determine what you need to add to the custom file, complete the following steps.

  1. In Order Hub, browse to the page that you want to update. Whenever a page loads, the getPage API is called.
  2. Use the browser's console to find the API name and the template ID that is used to retrieve data. For an example, see Sample log message in browser console.
  3. Refer to the getPage-templates.json that is loaded for the application to see the API templates and what data is already retrieved. Copy only the template that you want to override. For example, the getPage-templates.json for the buc-app-order module includes templates for many APIs such as getDateTypeList and getAuditList, among others. If you simply want to add a property to retrieve a new value from the getAuditList API, copy the getAuditList template only. For more information, see Understanding the getPage-templates.json file.
  4. In your custom getPage-templates.json file, add the template that you want to override. For a sample, see Example of a custom getPage-templates.json file.
    Note: To view a complete set of data that you can retrieve, refer to the IBM Sterling Order Management System API documentation. For information, see Generating and accessing Javadoc.

Sample log message in browser console

Here is a sample console log when you view the Audits tab on the Order details page.
Time since init (ms): 16644. 
Log type: LOG.
Log generator: @buc/svc-angular.
Message: BucCommOmsRestAPIService.getPage():  Invoking API "getAuditList" using template ID "default"

Understanding the getPage-templates.json file

Within the getPage-templates.json file, objects are divided based on the IBM Sterling Order Management System API that is invoked by getPage, and the scenario under which the API is called. The structure of the configuration file is as follows:
{
  "apiName": {
       "scenarioId": { <template ID to use for the scenario> },
       "default": { <template ID to use by default. This is used if a scenario name was not specified when invoking the API> }
}
For example, the following code is a portion of the default getPage-templates.json file. Notice that this sample includes two API templates; getDateTypeList and getAuditList. If you customized the Audits table, you simply need to copy the getAuditList template only.
{
  "getDateTypeList": {
    "default": {
      "DateTypeList": {
        "DateType": [
          {
            "ActualFlag": "",
            "CallingOrganizationCode": "",
            "DateTypeId": "",
            "DateTypeKey": "",
            "Description": "",
            "ExpectedFlag": "",
            "RequestedFlag": "",
            "SystemDefined": "",
            "CommittedFlag": ""
          }
        ]
      }
    }
  },
  "getAuditList": {
    "default": {
      "AuditList": {
        "Audit": {
          "Modifyts": "",
          "Modifyuserid": "",
          "AuditContextId": "",
          "AuditXml": "",
          "Reference1": "",
          "Reference2": "",
          "Reference3": "",
          "Reference4": "",
          "Reference5": "",
          "Reference6": ""
        }
      }
    }
  }
}

Example of a custom getPage-templates.json file

Based on the sample log, if you customized the audit table to include the AuditKey property, you need to instruct the getAuditList API to retrieve the AuditKey value from the datasource. Therefore, add the following code to your custom getPage-templates.json file to include the AuditKey property.
{
  "getAuditList": {
    "default": {
      "AuditList": {
        "Audit": {
          "Modifyts": "",
          "Modifyuserid": "",
          "AuditContextId": "",
          "AuditXml": "",
          "Reference1": "",
          "Reference2": "",
          "Reference3": "",
          "Reference4": "",
          "Reference5": "",
          "Reference6": "",
          "AuditKey": ""
        }
      }
    }
  }
}