Xplain.XTools
- Xplain.XTools()
- This class provides a set of simple tools used within the Xplain.* packages. 
Xplain.XTools.IdToString
- Xplain.XTools.IdToString(s)
- Basically an inverse function to - Xplain.XTools.stringToId. Takes a string as input and replaces all escaped dots (“/.”) with dots (“.”).- Parameters
- s (string) – the string to be converted 
- Returns
- {string} the converted string 
 
Xplain.XTools.generateRandomString
- Xplain.XTools.generateRandomString(len)
- Generates a random string with a given length. - Parameters
- len (integer) – the length of the string 
- Returns
- {string} the generated string 
 
Xplain.XTools.getLastQueryMetaStats
- Xplain.XTools.getLastQueryMetaStats()
- returns the stats set for the last query only. 
Xplain.XTools.getLastXhrStatus
- Xplain.XTools.getLastXhrStatus()
- Returns the last jqXHR object as returned by jQuery. Basically, the jqXHR object consists of information about the last Ajax HTTP request, e.g. the HTTP-Status etc. See [the jQuery manual](http://api.jquery.com/jQuery.ajax/#jqXHR) for more information. 
Xplain.XTools.getQueryMetaStats
- Xplain.XTools.getQueryMetaStats()
- returns the query stats set. 
Xplain.XTools.parseAttributeReference
- Xplain.XTools.parseAttributeReference()
- A synonym for {@link Xplain.XTools.parseReference the - parseReferencemethod}- Returns
- {boolean|object|string}. False if an error occurred. The reference in object notation, e.g. {object: o, dimension: d, attribute: a} or in string notation, e.g. “object.dimension.attribute”. 
 
Xplain.XTools.parseReference
- Xplain.XTools.parseReference()
- Takes an string or object as input and checks if a) the string is in the form “Object.Dimension.Attribute” or b) the object is something like {object: o, dimension: d, attribute: a}. Note: if one of the parts within the string (name of the object, dimension or attribute) contains a dot “.”, this should be escaped using “/.”. For instance, if the name of the attribute is “Abbrev.Name” then “Object.Dimension.Abbrev.Name” would be an invalid notation whereas “Object.Dimension.Abbrev/.Name” would be valid. Returns the reference in object format. - Returns
- {boolean|object|string}. False if an error occurred. The reference in object notation, e.g. {object: o, dimension: d, attribute: a} or in string notation, e.g. “object.dimension.attribute”. 
 
Xplain.XTools.replaceAt
- Xplain.XTools.replaceAt()
- Simple helper function that replaces a character at a given position within a string with another character or string. - Returns
- {string} the converted string 
 
Xplain.XTools.serialiseObjectToURI
- Xplain.XTools.serialiseObjectToURI(the)
- Serialize an object (1 level deep) into URL parameters… - Parameters
- the (object) – object to serialize 
- Returns
- {string} the objects in a serialized string 
 
Xplain.XTools.setQueryMetaStats
- Xplain.XTools.setQueryMetaStats()
- A simple helper (for internal use only) function that stores the query-metastats (which for instance holds information about the query response time, etc.) in an array. 
Xplain.XTools.sleep
- Xplain.XTools.sleep()
- A little helper function that basically puts a process to sleep. Can you be used like this: - async function delayed() {
- console.log(“Hello”); await Xplain.XTools.sleep(2000); console.log(“World!”); await Xplain.XTools.sleep(2000); console.log(“Goodbye!”); 
 - } Example and code from https://www.sitepoint.com/delay-sleep-pause-wait/ 
Xplain.XTools.split
- Xplain.XTools.split(s, c)
- Helper function that splits a string - sby a delimiter- cinto an array. If- cis a dot, it takes escaped dots into account.- Parameters
- s (string) – the string to be split 
- c (string) – the delimiter 
 
- Returns
- {array} an array of strings 
 
Xplain.XTools.stringToId
- Xplain.XTools.stringToId(s)
- Takes a string as input and changes all dots (“.”) in this string into escaped dots (“/.”) - Parameters
- s (string) – the string to be converted into an Id 
- Returns
- {string} the converted string