introduction - sap file roambiscript uses a properties file to store the authentication details...
TRANSCRIPT
INTRODUCTION ........................................................................................................................................
2
API CLIENT .................................................................................................................................................
2
PROPERTIES FILE ....................................................................................................................................
2
ROAMBI SCRIPT SYNTAX ......................................................................................................................
4
COMMON COMMANDS ............................................................................................................................
4 UPLOAD ...................................................................................................................................................................... 4 UPDATE ...................................................................................................................................................................... 5 PUBLISH ..................................................................................................................................................................... 5 PUBLISH WITH FILE.................................................................................................................................................. 6
ALL COMMANDS .......................................................................................................................................
7
Introduction RoambiScript is a Java utility which has been designed to automate the steps required to keep your Roambi content up-to-date. Many of the tasks that can be done manually by Publishers and Administrators can be automated to simplify the workflow.
The RoambiScript file:
SAP ROAMBI PUB SDK (SAP Roambi publishing client SDK 1.0) can be downloaded from the SAP MarketPlace: RoambiScript
Create a new API Token Prior to using RoambiScript, a Roambi API token must be created in the Admin interface of the Roambi Cloud account.
1. Go to View Account > API Tokens 2. Give it a name and click + 3. Copy the token and store it somewhere secure
Note: This is the only time you will see the token.
Get the Account UID
1. Go to Invite Users > Info 2. Copy the Account UID
Properties File RoambiScript uses a properties file to store the authentication details needed for access to Roambi Cloud. The properties file can be created manually or via the script utility and has the following format:
access token – To obtain the access token, go to View Account > API Tokens and generate a new token. Server URL - The server URL depends on the location of the Roambi platform you are using. US Platform = https://api.roambi.com
EU Platform = https://eu-api.roambi.com
Account ID - To obtain the account ID, go to Invite Users > Info and
copy the Account UID.
This file can be generated by the RoambiScript jar file using the command detailed below:
java -jar roambi-api-cli.jar configure
The configure command will prompt you to supply the values shown above and generate a properties file called called roambi-api-cli.properties.
Note that as this is a Java utility, all commands are case sensitive.
RoambiScript Syntax Usage: <main class> [options] [command] [command options]
ie: java –jar roambi-api-cli.jar
Options: --continue-on-failure, -C Continue the rest of the script file on failure. Default: false
--file, -f Script File
--help, -h Shows help Default: false
-props, --props Property file location. If not specified, default to roambi-api-cli.properties --verbose
Verbose mode – additional logging detail
Common Commands
Upload
Used to automate the upload of a new Excel source file to the library, apply permissions and optionally change name. Usage: upload [options] Options: --file The local source file you wish to upload --folder The remote folder UID destination in Roambi Cloud --users
The users who can access this file
--groups The groups who can access this file --title (Optional) The title of the new file
java -jar roambi-api-cli.jar –props C:\roambiscript\Properties.txt upload --folder 54f719c6e4b04d1569f7d7d6 --users [email protected] --file "CARD.xlsx" --title "Newfile.xls"
Update
– This is used to overwrite an existing library source file with a new version of the file stored locally. End users will then be able to pick up the new data using either a manual or auto refresh.
Syntax: update Upload and update a file in the Roambi Repository Usage: update [options] Options: --file The path to the local file you with to upload --target The target file UID that you want to replace
java -jar roambi-api-cli.jar -props PROPERTIES_FILE update --file LOCAL_FILE --target TARGET_FILE
Example java -jar roambi-api-cli.jar -props C:\roambiscript\properties.txt update --file C:\roambiscript\CARD.xlsx --target 54589946e4b0d187622fb775
Publish
– This is used to make a copy of the RBI template in a new folder with a new name and using new source data, which has already been uploaded into the Library. This is commonly used in conjunction with Sync folders to ensure that new content is downloaded to the users’ device.
publish Refresh a Roambi document Usage: publish [options] Options: --folder UID The remote folder where the new RBI should be created.
--users
define the users who will be able to access the new file (Optional) --groups define the groups who will be able to access the new file ( Optional) --source The path to the remote source file to be used to create the new file. --template The UID of the template rbi to be used. --title The name of the new RBI you wish to create
Example: java -jar roambi-api-cli.jar -props C:\roambiscript\Properties.txt publish --folder 54f719c6e4b04d1569f7d7d6 --users [email protected] --source "/Source Data/CARD.xlsx" --template 5506ae66e4b026040c17e526 --title "New Card4"
Note that if the path to the source file includes a space, the full path must be enclosed in quotes. Use an editor such as Notepad++ to add quotes to ensure no additional styles are added to the text.
Publish with file
– This is used to create a new Roambi file with new data by copying a template Roambi file that was created using a local data file, providing new source data from a local file and applying permissions.
Usage: publish-with-file [options] Options: --file The path to the local source file --folder The UID of the target folder where you want to create the new RBI --users define the users who will be able to access the new file (Optional) --groups define the groups who will be able to access the new file ( Optional) --template The UID of the template rbi that you wish to copy --title The title for the new document
java -jar roambi-api-cli.jar -props C:\roambiscript\Properties.txt publish-with-file -folder 54f719c6e4b04d1569f7d7d6 --users [email protected] --file "CARD.xlsx" --template 5506ae66e4b026040c17e526 --title "Local Card"
All Commands addPermission add permissions to a file Usage: addPermission [options]
Options: --access
'view' or 'publish' Default: view --groupIds group ids --target target file --userIds user ids
configure Bootstrap a the client .properties file Usage: configure [options]
delete Delete a file in the Roambi Repository
Usage: delete [options]
Options:
--file UID of file to be deleted
ls List folder content Usage: ls [options] Options: --folder UID of parent folder
mkdir Create a folder in the Roambi Repository
Usage: mkdir [options]
Options:
--folder
parent folder
--ignoreFailure Do not report error when failed.
Default: false
--permission set permissions for folder
--title title of the new folder publish Refresh a Roambi document Usage: publish [options] Options: --folder UID of remote folder destination
--permission set permissions for new document
--source remote source file --template
UID of template rbi --title title of the new document
publish-with-file Refresh a Roambi document based on data in a local file Usage: publish-with-file [options] Options: --file local source file --folder remote folder destination --permission set permissions for new document
--template template rbi
--title title of the new document
removePermission remove permissions to a file Usage: removePermission [options] Options:
--groupIds group ids --target target file
--userIds
user ids
rmdir Delete a folder in the Roambi Repository Usage: rmdir [options] Options: --folder folder to be deleted
sync_dir Set sync of folder(s) in Roambi Repository Usage: sync_dir [options] Options: * --folders folders to be updated -s, --sync Enable sync for the folder Default: false
update Upload and update a file in the Roambi Repository Usage: update [options] Options: --file locale file you with to upload
--target target file uid
upload Upload and create a file in the Roambi Repository Usage: upload [options] Options: --file locale file you with to upload --folder remote folder destination --permission set permissions for new file --title title of the new file
version Usage: version [options]