Class: JDitoUtils

JDitoUtils()

new JDitoUtils()

Class containing miscellaneous utiltiy function extending JDito
Source:

Methods

evalScript(pIdentifier, pScript, pLocalVariables, pImports, pWrapIntoResult, pAlias) → {Object}

A wrapper for process.executeScript
Parameters:
Name Type Description
pIdentifier String req The identifier for the script (for better error logging)
pScript String req The script to execute
pLocalVariables Object opt The local variables which can be accessed within the script
pImports Array opt To add additional imports which will be prepended to the script
pWrapIntoResult Boolean opt To wrap pScript into 'result.string("***")'
pAlias String opt The alias to use within the script
Source:
Returns:
The result of the script
Type
Object

getAliasListByType(pAliasType) → {Array.<String>}

Returns a list of aliasNames with a given type ignores errors when an alias is not confgiured (empty)
Parameters:
Name Type Description
pAliasType project.DATASOURCE_ opt the type of the aliases to load
Source:
Returns:
Array of aliasNames
Type
Array.<String>

getCountries(pLanguage, pData) → {Array.<Array.<String>>}

returns a sorted and translated list of countries ; DE, AT and CH are at the beginning of the list, if pData is undefined
Parameters:
Name Type Description
pLanguage String opt Sprache
pData Array.<Array.<String>> opt if the data should not be gathered automatically it can be given to this parameter. with this, the function can be used to translate country names
Source:
Returns:
consisting of ISO2 and Name
Type
Array.<Array.<String>>

getMaxUniqueNumber(pColumn, pTable)

Delivers the hightest number currently stored in database
Parameters:
Name Type Description
pColumn String req database column that contains unique numbers
pTable String req database table
Source:

getNextUniqueNumber(pColumn, pTable, pStartNumber)

Delivers the next unique number
Parameters:
Name Type Description
pColumn String req database column that contains unique numbers
pTable String req database table
pStartNumber Number opt number to start numeration
Source:

validateUniqueNumber(pNumber, pColumn, pTable)

Checks if the passed number is valid (has to be unique)
Parameters:
Name Type Description
pNumber String number to check
pColumn String req database column that contains unique numbers
pTable String req database table
Source: