Classes
Methods
# static clone(obj) → {Object}
Clone/Deep copy this object
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
Object
|
Object
# static compare(obj1, obj2, recursivelyopt) → {boolean}
Compares content of two objects (yet not recursively for objects!)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
obj1 |
Object
|
|||
obj2 |
Object
|
|||
recursively |
boolean
|
<optional> |
false | not implemented yet |
boolean
# static compileFilterString(projectlist, cataloguelist, constraints, property_typeids, ptr_property)
Compile filter string from id, type, name pattern and properties
Parameters:
| Name | Type | Description |
|---|---|---|
projectlist |
*
|
can be empty |
cataloguelist |
*
|
can be empty |
constraints |
*
|
= { 'pattern_object_id' : ' ... ' // AND 'pattern_object_name' : ' ... ' // AND 'pattern_object_type' : ' ... ' // AND } |
property_typeids |
*
|
Search in these property types |
ptr_property |
*
|
Search in each property type for this pattern |
Filterstring according to web service
# static componentToHex(c) → {string}
Convert component (R,G or B) to hex value. 0 => 0 255 => FF
Parameters:
| Name | Type | Description |
|---|---|---|
c |
number
|
string
# static count(obj) → {number}
Count objects/keys in a dictionary.
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
Object
|
Number of 'own' properties
number
# static dbToHtml(str) → {string}
Convert a string which is stored in a db to a string that can be rendered in html.
Parameters:
| Name | Type | Description |
|---|---|---|
str |
*
|
string
# static dbToTxt(str) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string
|
Text to be decoded from DB format to JSON. |
string
# static elideText(str, max_length) → {string|null}
Elide text
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string
|
Text |
max_length |
number
|
Maximum length of text |
Center elided text or null if str = null
string
|
null
# static getSizeAsString(size) → {string}
Get number of bytes as formatted text in suitable units ['Bytes', 'kB', 'MB', 'GB']
Parameters:
| Name | Type | Description |
|---|---|---|
size |
number
|
string
# static getTokenList(str, start, end) → {Array.<string>}
Get tokens specified by start-end string in str Examples start = '[[' , end = ']]'
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string
|
|
start |
string
|
|
end |
string
|
Array with extracted tokens, empty array if no tokens could be extractred
Array.<string>
# static htmlToText(html, all) → {string}
Convert hmtl to plain text.
Parameters:
| Name | Type | Description |
|---|---|---|
html |
string
|
|
all |
boolean
|
if true, get full text content (faster), else if slow get inner text (considering styles like display: none, slightly slower) |
Plain text, empty string if html is invalid
string
# static increaseIndex(str_number) → {string}
Increase Index given as A0, A1, ... , B0, B1, ...
Parameters:
| Name | Type | Description |
|---|---|---|
str_number |
*
|
string
# static isEqual(val1, val2, propertytype, options) → {boolean}
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
val1 |
*
|
||
val2 |
*
|
||
propertytype |
Object
|
||
options |
Object
|
null | { precision: 0.0001, case_sensitive: true } |
boolean
# static matchValue(value, xsdatatype, matchvalue, propertymap) → {boolean}
Check if a property value matches the given values.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
any
|
Value of property. If null or undefined, false will be returned. |
xsdatatype |
string
|
Explicit data type of value ('xs:...') |
matchvalue |
*
|
Values : '*', ["A","B", "C"], [1,2,3], /^abc/g, == 'Text', > 1.234 |
propertymap |
Object
|
Evaluated values for property references [[name##type]] { 'Text##xs:string' : "ABC", 'Number##xs:double' : 1.234 } |
true if match was successful, else false
boolean
# static md5(inputString) → {string}
Create a md5 key from a given string
Parameters:
| Name | Type | Description |
|---|---|---|
inputString |
string
|
MD5 key
string
# static replaceSpecialCharsWithASCII(id) → {String}
replaces each character of !"#$%&'()*+,./:;<=>?@[]^`{|}~ with
Parameters:
| Name | Type | Description |
|---|---|---|
id |
String
|
any String used as id with jquery |
id but each character of !"#$%&'()*+,./:;<=>?@[]^`{|}~ replaced by
String
# static replaceStr(str, olds, news) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
str |
*
|
|
olds |
*
|
|
news |
*
|
string
# static rgbToHex(r, g, b) → {string}
Convert (RGB) color to hex value
(0,0,0) => #000000 (255,255,255) => #FFFFFF
Parameters:
| Name | Type | Description |
|---|---|---|
r |
*
|
|
g |
*
|
|
b |
*
|
string
# static sanitize(id) → {string}
Sanitize ID
Remove :, =, ' '
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string
|
string
# static sanitizeText(str) → {string}
Remove 'invalid'/invisible characters from string which can occur when copy-pasting from html pages Todo: better Black- or Whitelist? Ranges?
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string
|
Sanitized string
string
# static sanitizeTooltip(a) → {string}
Sanitize string 'a' so it can be used in a html tooltip (title).
Parameters:
| Name | Type | Description |
|---|---|---|
a |
string
|
string
# static txtToDb(str) → {string}
Encode text from text to JSON acceptable text. So this text can be transferred and stored in a DB.
\n ->
' -> ```
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string
|
Text to be encoded from JSON |
string
# static txtToHtml(str) → {string}
Encode text from text to HTML acceptable text
\n ->
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string
|
string
# static validateArray(pattern) → {boolean}
Check if pattern is a string representation (JSON) of an array.
Parameters:
| Name | Type | Description |
|---|---|---|
pattern |
string
|
boolean
# static validateEmail(str) → {boolean}
Validates whether a text is a syntactically correct email address. Note: The only way to reliably verify that a supplied email is a working valid email is to send a mail with a verification link
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string
|
String holding the Email address |
True, if validation is successful, else false
boolean
# static validateRegex(pattern) → {boolean}
Check if pattern is a valid regex expression.
Parameters:
| Name | Type | Description |
|---|---|---|
pattern |
string
|
boolean
# static wildcardToRegex(wildcard) → {RegExp}
Parameters:
| Name | Type | Description |
|---|---|---|
wildcard |
string
|
RegExp