Oracle® Retail Xstore Suite 20.0/Oracle® Retail Merchandising Suite 19.2.000 Implementation Guide Release 20.0 F37856-03 |
|
![]() Previous |
![]() Next |
This chapter describes the RTLog Generator component of Xstore Office Cloud. The RTLog Generator Cloud application can be used with both the cloud or on premise Merchanding/Pricing applications.
This chapter describes how configure the RTLog Generator application deployed on cloud.
The RTLog Generator on cloud is a Java and XML based web application that exposes a Spring-JAXWS implemented SOAP web service and JAXRS implemented REST web services. It is usually deployed alongside the other Xstore Office Cloud applications.
The RTLog Generator cloud application can be configured in the following way.
Customize the RTLog Generator's mapping and format configuration via REST services.
Note: For more information on how to customize the RTLog Generator, see the Configuration section in Chapter 6, "RTLog Generator On-Premise" and the Retail Xstore - RTLog Generator Extension Guidelines (Doc ID 2174095.1) onhttps://support.oracle.com. |
This section describes the RTlog Generator Cloud integration.
RTLog Generator Cloud application provides REST services to retrieve, update and delete the RTLogMappingConfig.xml
file. All the three services point to the URL at
https://<hostname>/rtlog-generator/rest/config/file/v1/RTLogMappingConfig
If RTLog generator is deployed on cloud, its mapping configuration file RTLogMappingConfig.xml
is not accessible to a user. To customize the mapping, restful APIs are provided to upload a customized RTLogMappingConfig.xml
to override the default out-of-box one.
Table 7-1 REST Services related to the RTLogMappingConfig.xml
HTTP Protocol | Security Protocol | Response Type | Description |
---|---|---|---|
GET |
OAuth2 |
application/xml |
Returns the active RTLogMappingConfig.xml file. If the customer has not uploaded a customized configuration xml file yet, provides a copy of the default mapping configuration XML file that is provided with the deployment. |
PUT |
OAuth2 |
application/json |
Customer submits the updated RTLogMappingConfig.xml file as the request body. Returns JSON that contains the number of bytes in the uploaded XML file. |
DELETE |
OAuth2 |
No content |
If the customer has uploaded a configuration XML file previously, it will be deleted and HTTP 200 status is returned. If there is no customized RTLogMappingConfig.xml file active yet, HTTP 204 status is returned. The default RTLogMappingConfig.xml that is part of the deployment will resume being the active mapping configuration. |
The examples below show how to retrieve and update the RTLogMappingConfig.xml.
Example 7-1 Get active RTLogMappingConfig.xml - Get Current RTLog Mapping Configuration
$ curl -H "Authorization: Bearer <token>" https://<rlog-generator-host>/rtlog-generator/rest/config/file/v1/RTLogMappingConfig" > RTLogMappingConfig.xml
Example 7-2 Update RTLogMappingConfig.xml - Update the RTLog Mapping Configuration
$ curl -H "Authorization: Bearer <token>" -X PUT -T "/path/to/mapping/file" https://<rlog-generator-host>/rtlog-generator/rest/config/file/v1/RTLogMappingConfig"
Similar to the example above, using the -X option with the value of DELETE
will delete any customer uploaded mapping configuration XML file.
RTLog Generator Cloud application provides REST services to retrieve, update and delete the RTLogFormatConfig.xml file. All the three services point to the URL at:
https://<hostname>/rtlog-generator/rest/config/file/v1/RTLogFormatConfig
If RTLog generator is deployed on cloud, its format configuration file RTLogFormatConfig.xml is not accessible to a user. A format configuration file defines the ReSA RTLog format, and in most cases is not up for customizations. However RTLogFormatConfig.xml file can be customized when:
Customization has been done to ReSA to accept an enhanced RTLog format with additional fields
A retailer has to integrate with an earlier version of ReSA which is not supported out of box, and it accepts a slightly different older RTLog format.
Table 7-2 REST Services related to the RTLogFormatConfig.xml
HTTP Protocol | Security Protocol | Response Type | Description |
---|---|---|---|
GET |
OAuth2 |
application/xml |
Returns the active RTLogFormatConfig.xml file. If the customer has not uploaded a customized configuration xml file yet, provides a copy of the default mapping configuration XML file that is provided with the deployment. |
PUT |
OAuth2 |
application/json |
Customer submits the updated RTLogFormatConfig.xml file as the request body. Returns JSON that contains the number of bytes in the uploaded XML file. |
DELETE |
OAuth2 |
No content |
If the customer has uploaded a configuration XML file previously, it will be deleted and HTTP 200 status is returned. If there is no customized RTLogFormatConfig.xml file active yet, HTTP 204 status is returned. The default RTLogMappingConfig.xml that is part of the deployment will resume being the active mapping configuration. |
The examples below show how to retrieve and update the RTLogFormatConfig.xml.
Example 7-3 Get active RTLogFormatConfig.xml - Get Current RTLog Format Configuration
$ curl -H "Authorization: Bearer <token>" https://<rlog-generator-host>/rtlog-generator/rest/config/file/v1/RTLogFormatConf ig" > RTLogFormatConfig.xml
Example 7-4 Update RTLogFormatConfig.xml - Update the RTLog Format Configuration
$ curl -H "Authorization: Bearer <token>" -X PUT -T "/path/to/format/file" https://<rlog-generator-host>/rtlog-generator/rest/config/file/v1/RTLogFormatConf ig"
Similar to the example above, using the -X option with the value of DELETE will delete any customer uploaded format configuration XML file.
RTLog Generator Cloud application provides two mechanisms to retrieve the published RTLog files.
SFTP service provides a way to transfer RTLog files. This method is commonly used to post RTLog files to ReSA deployed on Merchandising Cloud. A service request has to be filed by a retailer to setup RTLog Generator Cloud to use SFTP.
SFTP host and path are made available to the RTLog Generator Cloud deployment team by the retailer.
SFTP connectivity utilizes public/private key based authentication. Once the key pair is generated, the public key has to be added to the SFTP server. If the SFTP server is hosted by Merchandising Cloud, the public key will be accessible to Merchandising Cloud deployment team to add to the SFTP server; if the SFTP server is hosted on premise, the public key will be handed over to the retailer to add to the SFTP server.
REST service provides a way to download RTLog files in compressed format (zip files). This is the default delivery method. The REST service endpoint URL is
https://<hostname>/rtlog-generator/rest/rtlog/files/v1/published
Table 7-3 REST Services to download RTLog Files
HTTP Protocoal | Security Protocol | Response Type | Description |
---|---|---|---|
GET |
OAuth2 |
application/octet -stream |
Returns the oldest RTLog zip file stream, if available. The content-disposition response header contains the name of the attached zip file. If no zip file is available, a HTTP 204 no content is returned. |
Example 7-5 Get Published RTLogs - OAuth2 token request
$ curl -O -J -H "Authorization: Bearer <token>" "https://<rlog-generator-host>/rtlog-generator/rest/rtlog/files/v1/published"
It is recommended to have a programmable approach to acquire the OAuth2 token and utilizing the token to download the available published RTLog files compared to the command line tools shown as examples above.
RTLog Generator's web services are secured by requiring HTTPS protocol for transport layer security and require OAuth2 authentication for application level security. All of the Xoffice applications on cloud including the RTLog Generator have a valid OAuth Client (Application) registered with a specific tenant of the Oracle Identity Cloud Service.
OAuth2 authentication is a two-step process.
Acquire a valid OAuth2 Bearer token using the IDCS Client Credentials.
Provide the token value in the HTTP Authorization header for all of the web service requests until the token's validity is expired.
In order to acquire a valid IDCS token, the following information is needed beforehand.
IDCS tenant host information to build the URL for requesting a token
https://<IDCS_TENANT_HOST>/oauth2/v1/token
ClientID
and ClientSecret
for the RTLog Generator Client App (that is Sales Audit).
A command line utility or any software that can make HTTP requests with the ability to setup specific header values
"curl" in Linux environments
Access to a command/utility to encode the credentials in base64 format.
"base64" command in Linux environments
"certutil" command in Windows environments
The following example shows how to request a token using the curl command line tool in a Linux environment. Ensure to replace the clientID
, clientSecret
and IDCS_TENANT_HOST
with the appropriate values.
Example 7-6 Request IDCS Oauth2 Token - OAuth2 Token Request
$ curl -i -H "Authorization: Basic $(echo -n clientID:clientSecret | base64)" -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" https://<IDCS_TENANT_HOST>/oauth2/v1/token -d "grant_type=client_credentials&scope=urn:opc:idm:__myscopes__"
You may generate Base64 encoded text of the "clientID:clientSecret"
ahead of the request and use it directly in the curl command for the Basic Authorization header value. The following example shows the response that contains the token.
Example 7-7 IDCS Oauth2 Token Response - OAuth2 Token Response
{"access_token": "<oauth2_token>", "token_type": "Bearer", "expires_in": 3600 }
The response above shows the token value and the expiration time in seconds. Usually, the token is a sequence of random characters of varying length up to a maximum of 16K.
The following example shows how to provide the OAuth2 token while communicating with RTLog Generator REST services. The following example shows how to request the current active RTLogMappingConfig.xml file. Please make sure to replace the "<token>"
with a valid OAuth2 token acquired in the last step and provide the correct RTLog Generator Host value.