Executing the Script
With a properly configured development environment and script configuration file in place, create an instance of the SAP Fiori Client.
- Open a terminal window.
- Navigate to the SAP Mobile Platform installation's KapselSDK\apps\fiori_client folder.
- Execute the following
commands:
npm install node create_fiori_client.js <configPath>
Where <configPath> is the optional path of the configuration file, config.json. If not specified, the script looks for the configuration file in the current directory.
The first command installs the shelljs node module used by the script. The second command executes the create_fiori_client.js JavaScript application to create the application project and add the required components (the Cordova and Kapsel plugins, and a copy of the application's web application content).
The script performs a lot of steps, so expect the process to take some time. Because of all the things it does and the fact that some required components like the Cordova plugins are being retrieved from a remote location, the process may encounter problems and quit. Watch the terminal window output for any error messages. If you encounter any, you need to fix the error and run the node script again (node create_fiori_client.js).
- Once the script completes, modify appConfig.js with the
appID, fioriURL,
fioriURLIsSMP and passcodePolicy values.
Do not configure the URL value through config.xml, as doing
so is not supported, and will result in a failed initialization of the
application. Provide values in a format similar to the
following:
cordova.define('cordova/appConfig', function(require, exports, module) { module.exports = { "appID": "com.sap.fiori", "fioriURL": "https://example.com:443/index.html", "fioriURLIsSMP": false, "passcodePolicy": { "expirationDays":"0", "hasDigits":"false", "hasLowerCaseLetters":"false", "hasSpecialLetters":"false", "hasUpperCaseLetters":"false", "defaultAllowed":"true", "lockTimeout":"10", "minLength":"6", "minUniqueChars":"0", "retryLimit":"0" } }; });
If you are connecting through SAP Mobile Platform as a proxy to access the SAP Fiori application, set fioriURLIsSMP to true. Under fioriURL, enter the URL of the SAP Mobile Platform Server with the suffix of the endpoint application. This URL is parsed and its components inform the default values in the SAP Mobile Platform registration screen, specifically the values for the host, port and whether HTTPS is used.
If you are connecting directly to a web server, set fioriURLIsSMP to false, and change the fioriURL to reflect the web server that hosts your SAP Fiori applications.
You can set the passcode policy in the SAP Mobile Platform cockpit when fioriURLIsSMP is true, or in appConfig.js, as shown above, when fioriURLIsSMP is false. When the passcode policy setting defaultAllowed is set to true, this enables the ability to disable the passcode screen.