Skip to content

api util

Ayhan Rashidov edited this page Sep 5, 2022 · 2 revisions

$.util API

The util api namespace.

Reference

SAP Help

https://help.sap.com/doc/3de842783af24336b6305a3c0223a369/2.0.03/en-US/$.util.html

Module

https://github.com/codbex/codbex-kronos/tree/main/modules/api/api-xsjs/src/main/resources/META-INF/dirigible/kronos/util

Sample Usage

var util = $.util;
var randomID = util.createUuid(); // return random uuid

// Uint8Array
var arrayBuffer = [84,104,105,115,32,105,115,32,97,32,85,105,110,116,
                          56,65,114,114,97,121,32,99,111,110,118,101,114,116,
                          101,100,32,116,111,32,97,32,115,116,114,105,110,103];

var convertedBuff = util.stringify(arrayBuffer); // return converted arrayBuffer to String

let result = `\n randomID is : ${randomID} `;
result += `\n convertedBuff is: ${arrayBuffer} `;
$.response.setBody(result);

Coverage

Classes Description Status
SAXParser Class for parsing XML. It is based on expat.
Zip Class for manipulation of zip archives. ⚠️
Members Description Type
createUuid() Returns a unique UUID. String
stringify(data) Recieves UintArray and return converted value. String

Unit Tests ⚠️

https://github.com/codbex/codbex-kronos/tree/main/modules/engines/engine-xsjs/src/test/resources/META-INF/dirigible/test/kronos/util

Integration Tests ❌

Wiki icons legend

✅ - Feature implemented and working as supposed.
⚠️ - Feature partially implemented and needs to be finished.
❌ - Feature not implemented yet.

Clone this wiki locally