The i-views namespace
Classes
- AbstractEditorConfiguration
- AbstractNetClient
- AbstractTextDocument
- AccessParameterAssignment
- Action
- ActionResponse
- ActionResult
- ActionView
- AlternativeGroupCondition
- ApplicationConfiguration
- Attribute
- AttributeType
- AttributeValueCondition
- Blob
- Cause
- Choice
- ChoiceRange
- CollectionView
- Color
- Cookie
- Copier
- Crypto
- DataConnection
- Date
- DateTime
- Decision
- Domain
- DOMDocument
- ElasticsearchParameter
- ElasticsearchQuery
- ElasticsearchTerm
- ElementsCondition
- EncryptedAccount
- ExternalCommandJob
- ExternalDataObject
- ExternalDataRow
- ExternalDataSourceValues
- ExternalDataXMLNode
- FlexDateTime
- Folder
- FolderElement
- FormEntryView
- FormSelectView
- FormTypeAheadView
- GeoPosition
- GeoRange
- GraphConfiguration
- HasAttributeCondition
- Hash
- HasPropertyCondition
- HasRelationCondition
- HistoryChangeLogEntry
- Hit
- HitCollection
- HttpConnection
- HttpRequest
- HttpResponse
- ImageWrapper
- Index
- IndexFilter
- InfluxClient
- Instance
- InstanceType
- Interval
- IntervalRange
- Job
- JSONRenderContext
- JWT
- KScript
- KScriptDocument
- LinkedQueryCondition
- MailMessage
- Mapping
- MappingContext
- Measurement
- MQTTClient
- Mustache
- NetEntity
- NewCookie
- NodeCategoryElements
- NullDocument
- Operator
- PanelConfiguration
- PanelView
- PersistentCollection
- PipelineParameter
- Property
- PropertyFilter
- PropertySourceCondition
- PropertyType
- PropertyView
- QuantityKind
- Query
- Query
- Query
- QueryCondition
- QueryParameter
- QueryParameterValue
- QueryReference
- QueryResult
- RDFExporter
- RDFImporter
- RegistryElement
- Relation
- RelationTargetCondition
- RelationTargets
- RelationType
- RuleSet
- Script
- ScriptJob
- SemanticCollection
- SemanticElement
- SemanticElementCollection
- Session
- SharePointAppClient
- SharePointClient
- SmtpConnection
- StructuredQuery
- TableConfiguration
- Tag
- TaggingConfiguration
- TaggingContext
- TagTypeConfiguration
- TextDocument
- Time
- Type
- TypeAheadProposal
- UI
- Unit
- User
- User
- User
- ValueRange
- ValueString
- VCMOptions
- View
- ViewConfiguration
- XMLWriter
- Zip
- ZipContainer
- ZipDirectory
- ZipReader
- ZMQContext
Namespaces
Members
(static) LOG_DEBUG
Log level [DEBUG]
(static) LOG_ERROR
Log level [ERROR]
(static) LOG_NORMAL
Normal log level
(static) LOG_WARNING
Log level [WARNING]
(static) mapInstancesSymbol
Symbol for a class property that returns the mapped internal name. Objects of the type with this internal name will be mapped to the class. Equivalent to the expression $k.mapInstances(mappedInternalName, mappedClass)
The expression Symbol.for('$k.mapInstances')
returns the same symbol
(static) mapSubtypesSymbol
Symbol for a class property that returns the mapped internal name. Subtypes of the type with this internal name will be mapped to the class. Equivalent to the expression $k.mapTypes(mappedInternalName, mappedClass)
The expression Symbol.for('$k.mapSubtypes')
returns the same symbol
(static) out :$k.AbstractTextDocument
Returns the document that represents the output stream of some script environments. The kind of object depends on the environment, but is usually an instance of $k.TextDocument.
$k.out.print("Name: ", this.name());
Methods
(static) abortTransaction()
Aborts the current transaction. All changes will be rolled back. Has no effect if not transaction is active. No error is thrown.
If the transaction function was called with a reject function, then this function is called before rolling back the transaction.
- Since
- 5.1.1
(static) checkAccessRight(context) → {Boolean}
Check access right
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
context | object | List of possible operation types and relevant keys of the context object:
|
- Deprecated
- Use $k.AccessRights.checkOperation()
Unknown operation type
Context is missing
The decision as boolean
- Type:
- Boolean
(static) define(idopt, dependencies, factory)
Defines a module
Name | Type | Attributes | Description |
---|---|---|---|
id | string | <optional> | Optional module ID |
dependencies | Array.<string> | IDs of required modules | |
factory | Factory that returns the value of the module |
(static) elevatedDo(f)
Evaluates the function in an evelated context that does not check any access right. This function is only allowed in scripts that are controlled by administrators, otherwise an error is thrown.
Elevating the context does not grant administration rights, e.g. new users cannot be created by non-admin users.
Name | Type | Description |
---|---|---|
f | function | Function that should be evaluated in a system context |
- Since
- 4.1.0
If an elevated context cannot be activated, e.g. in a script created by a user without administration rights
The return value of the function
(static) filterWithAccessRights(operationType, elements, contextopt, decisionopt) → {Array.<$k.SemanticElement>}
Filter semantic elements in array with access rights
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operationType | string | List of possible operation types and relevant keys of the context object:
| |||||||||||||||||||||||||||||||||||||||||
elements | Array.<$k.SemanticElement> | ||||||||||||||||||||||||||||||||||||||||||
context | object | <optional> | Object containing additional access context.
| ||||||||||||||||||||||||||||||||||||||||
decision | object | <optional> | Default is true |
- Deprecated
- Use $k.AccessRights.filterElements()
Unknown operation type
Only semantic elements in array can be processed
Returns the filtered semantic elements
- Type:
- Array.<$k.SemanticElement>
(static) getAccessRightDecision(context) → {$k.Decision}
Get access right decision
Name | Type | Description |
---|---|---|
context | object | List of possible operation types: createAttribute { attributeType, element }, createCompleteRelation { relationType, sourceElement, targetElement }, createConcept { superType }, createInstance { type }, createRelation { relationType, sourceElement, targetElement }, delete { element }, deleteAttribute { attribute, element }, deleteConcept { element }, deleteExtension { element, object }, deleteInstance { element }, deleteRelation { relation, element }, modify { element }, modifyAttributeValue { attribute, element }, modifySchema { element }, read { element }, readAttribute { attribute, element }, readConcept { type }, readExtension { element }, readInstance { object }, readObjectsOfType { type }, validateAttributeValue { attributeValue, language, attribute, element }, optional can additionally set the user, e.g. $k.checkAccessRight("read", { "user" : |
- Since
- 5.3.2
- Deprecated
- Use $k.AccessRights.getDecision()
Unknown operation type
Context is missing
The decision
- Type:
- $k.Decision
(static) getClientContext(key)
Returns an object from the application client context. The application client context can be used to cache / transfer values across scripts. Use getTransactionContext(key)
if possible. WARNING: do not use this function in REST scripts, "application client" refers to the entire bridge, thus the client context is shared by all users. The client context is resetted if
- the client reconnects
- client caches are flushed
Name | Type | Description |
---|---|---|
key | string | Key of the object |
- Since
- 4.1.1
The object with the given key
(static) getEnvironment(key) → {string}
Returns a value from the application environment. The application environment must be configured in the configuration file or by setting appropriate host environment variables
Example: Define a value with the key 'HOST'
[environment]
HOST=$(env:COMPUTERNAME)
IV_ENV_HOST=%COMPUTERNAME%
The value can then be accessed with $k.getEnvironment('HOST')
Name | Type | Description |
---|---|---|
key | string | Key of the value |
- Since
- 5.4.0
The environment value, or undefined if the key has not been configured.
- Type:
- string
(static) getTransactionContext(key)
Returns an object from the transaction context. The client context can be used to cache / transfer values across scripts within the transaction.
Name | Type | Description |
---|---|---|
key | string | Key of the object |
- Since
- 4.1.1
If no transaction is active
The object with the given key
(static) isDebugEnabled() → {boolean}
Returns true if running in a debugger
- Version
- Experimental feature, might be removed at any time
- Since
- 5.1.1
- Type:
- boolean
(static) kscript(scriptName)
Return a wrappper for the specified KScript
Name | Type | Description |
---|---|---|
scriptName | string | The registered name of the KScript |
- Version
- Experimental feature, might be removed at any time
- Since
- 5.2.2
If the script was not found or is not a KScript
(static) language() → {string}
Returns the current language (ISO 639 2b)
- Since
- 4.1.1
Current language, eg. "eng"
- Type:
- string
(static) languageDo(language, f)
Evaluates the function with the given language as current language
Name | Type | Description |
---|---|---|
language | string | Language to activate. Either ISO 639-1 (2-letter code, e.g. "en") or ISO 639-2B (3-letter code, e.g. "eng") |
f | function | Function that should be evaluated |
- Since
- 4.1.1
If an invalid language was specified
The return value of the function
(static) locale() → {string}
Returns the current locale
- Since
- 4.1.1
Current locale, eg. "en_US"
- Type:
- string
(static) localeDo(locale, f)
Evaluates the function with the given locale as current locale
Name | Type | Description |
---|---|---|
locale | string | Locale, e.g. "en_GB" |
f | function | Function that should be evaluated |
- Since
- 4.1.1
If an invalid locale was specified
The return value of the function
(static) log(object, levelopt, channelopt)
Log an object on the current log stream (if available)
Name | Type | Attributes | Description |
---|---|---|---|
object | Object to log. Will be converted with toString(). | ||
level | <optional> | Log level. Either a number or a string ("debug", "normal", "warning", "error"). | |
channel | string | <optional> | Optional log channel. |
$k.log("New instance created");
$k.log("The cake is a lie", $k.LOG_WARNING, "Portal");
(static) logData(data, messageopt, levelopt, channelopt)
Log an object and additional structured data on the current log stream (if available)
Name | Type | Attributes | Description |
---|---|---|---|
data | object | Data to log | |
message | <optional> | Additional message. Will be converted with toString(). | |
level | <optional> | Log level. Either a number or a string ("debug", "normal", "warning", "error"). | |
channel | string | <optional> | Optional log channel. |
$k.logData({"size":42}, "New instance created");
$k.logData({"companionCube":"dead"}, "The cake is a lie", $k.LOG_WARNING, "Portal");
(static) mapInstances(internalName, proto)
Map the prototype of instances of the type with the internal name to the prototype object
Name | Type | Description |
---|---|---|
internalName | string | Internal name of the type of instances to map |
proto | Prototype object |
function Person() { }
Person.prototype.fullName = function() {
return this.attributeValue("familyName").toUpperCase()
+ ", " + this.attributeValue("firstName");
};
$k.mapInstances("person", Person);
var persons = $k.Registry.type("person").instances();
for (var p =0; persons.length>p; p++)
$k.out.print(persons[p].fullName() + "\n");
(static) mapModule(moduleName, registryID)
Maps a module ID to the ID of a registered script. Allows to register scripts containing modules under a different ID
Name | Type | Description |
---|---|---|
moduleName | string | The ID of the module |
registryID | string | The ID of the registered script |
- Deprecated
- This feature is deprecated
(static) mapTypes(internalName, proto)
Map the prototype of types with the internal name to the prototype object
Name | Type | Description |
---|---|---|
internalName | string | Internal name of the type to map |
proto | Prototype object |
(static) module(moduleName, isLocalopt)
Loads a module
Name | Type | Attributes | Description |
---|---|---|---|
moduleName | string | The registered name of the module | |
isLocal | boolean | <optional> | (Since 4.0.2) True if the module script should be evaluated in a local environment, false if it should be evaluated in the environment of the caller. Default is false" |
If the module was not found or defined more than once
The model exports
(static) noTriggersDo(f)
Evaluates the function without performing any triggers
Name | Type | Description |
---|---|---|
f | function | Function that should be evaluated |
- Since
- 4.1.0
The return value of the function
(static) optimisticTransaction(f)
Evaluates the function in a transaction and returns its return value. Does not check if the transaction has been accepted or rejected. Allows to start a transaction within another transaction, the nested transaction will be a part of the outer transaction
Name | Type | Description |
---|---|---|
f | function | Function that should be evaluated in a transaction |
If a read-only transaction is already active
The return value of the function
(static) require(dependencies, callback)
Calls a function with required modules. Passes the value of each required module
Name | Type | Description |
---|---|---|
dependencies | Array.<string> | IDs of required modules |
callback | function | Callback function |
If a required module was not found or defined more than once
The return value of the callback function
(static) rootType() → {$k.Type}
Returns the root type of the Knowledge Graph
- Deprecated
- Use $k.Type.rootType()
- Type:
- $k.Type
(static) setClientContext(key, value)
Sets an object of the application client context. The application client context can be used to cache / transfer values across scripts. Use setTransactionContext(key, value)
if possible. WARNING: do not use this function in REST scripts, "application client" refers to the entire bridge, thus the client context is shared by all users. The client context is resetted if
- the client reconnects
- client caches are flushed
Name | Type | Description |
---|---|---|
key | string | Key of the object |
value | object | The object to store |
- Since
- 4.1.1
(static) setTransactionContext(key, value)
Sets an object of the transaction context. The client context can be used to cache / transfer values across scripts within the transaction.
Note: Plain objects are serialized, it is not possible to store function objects and other non-serializable properties.
Name | Type | Description |
---|---|---|
key | string | Key of the object |
value | object | The object to store |
- Since
- 4.1.1
(static) shortcutRelationType() → {$k.Type}
Returns the parent type of all shortcut relation types
- Deprecated
- Use $k.Type.shortcutRelationType()
- Type:
- $k.Type
(static) sleep(delayMillis)
Suspends the current thread for a given number of milliseconds. Note: This blocks the whole execution of the current client.
Name | Type | Description |
---|---|---|
delayMillis | number | The number of milliseconds to wait for. The function does not sleep if +-Infinity or NaN is set. |
- Since
- 4.3.0
(static) softwareVersion() → {object}
Returns the core software version
- Since
- 4.4.0
An object containing information about the core software version{major: 4, minor: 4, patch: 0, state: "Release"}
- Type:
- object
(static) symmetricRelationProperties() → {boolean}
Returns true if symmetric relation properties are enabled
- Type:
- boolean
(static) systemRelationType() → {$k.Type}
Returns the parent type of all system relation types
- Deprecated
- Use $k.Type.systemRelationType()
- Type:
- $k.Type
(static) timeLimitedDo(timeout, f, timeoutFunctionopt)
Evaluates the function, but stops execution after the specified time and evaluates the (optional) timeout function.
If the evaluated function has started a transaction, then this transaction will be rolled back. Outer transaction will not be rolled back. To avoid incomplete write operations, an exception is raised if a write transaction is active when calling this function.
Name | Type | Attributes | Description |
---|---|---|---|
timeout | number | Timeout in milliseconds | |
f | function | Function that should be evaluated | |
timeoutFunction | function | <optional> | Function that is evaluated when a timeout occurs. |
- Since
- 4.2.0
If a write transaction is active
The return value of the function, or the value of the timeout function when a timeout occurs, or undefined if no timout function is supplied
$k.timeLimitedDo(1000,
function() { return $k.Registry.query("longRunningQuery").findElements() },
function() { throw "Query did not finish" }
)
(static) topAttributeType() → {$k.Type}
Returns the parent type of all attribute types
- Deprecated
- Use $k.Type.topAttributeType()
- Type:
- $k.Type
(static) topRelationType() → {$k.Type}
Returns the parent type of all relation types
- Deprecated
- Use $k.Type.topRelationType()
- Type:
- $k.Type
(static) topTypes() → {Array.<$k.Type>}
Returns all top types except the top attribute and relation types
- Deprecated
- Use $k.Type.topTypes()
- Type:
- Array.<$k.Type>
(static) transaction(f, rejectFunctionopt)
Evaluates the function in a transaction and returns its return value if the transaction has been accepted. If the transaction is rejected due to concurrency conflicts, the optional reject function is performed. This function does not allow to start a transaction within an outer transaction, use optimisticTransaction() instead.
Name | Type | Attributes | Description |
---|---|---|---|
f | function | Function that should be evaluated in a transaction | |
rejectFunction | function | <optional> | Optional function that is evaluated if the transaction is rejected. |
If another transaction is already active
The return value of the function. If the transaction is rejected, the return value of the reject function (if defined) or undefined is returned.
(static) transactionContext()
- Deprecated
- Use
getTransactionContext(key)
andsetTransactionContext(key, value)
- Use
If no transaction is active
The context object
(static) translatedMessage(message, messageParametersopt)
Returns a translated string for the message. Fills in the message parameters if present. Returns undefined if the message is unknown.
Name | Type | Attributes | Description |
---|---|---|---|
message | string | The internal message identifier. | |
messageParameters | Array | <optional> | Optional message parameters in case of a fill-in-the-blanks message. |
- Since
- 5.4.0
$k.translatedMessage("wouldYouLikeToSaveTheFileMLS");
$k.translatedMessage("delete3MLS",[victim.name()]);
(static) user() → {$k.User}
Returns the current user
- Type:
- $k.User
(static) userDo(user, f)
Runs the function in an context bound to the user. This function is only allowed in scripts that are controlled by administrators, otherwise an error is thrown.
Access rights checking is enabled in the function, call $k.elevatedDo() to disable checks
Name | Type | Description |
---|---|---|
user | $k.User | User or user instance |
f | function | Function that should be evaluated in the user context |
- Version
- Experimental feature, might be removed at any time
- Since
- 5.1.0
If a user context cannot be activated, e.g. in a script created by a user without administration rights
The return value of the function
(static) userRelationType() → {$k.Type}
Returns the parent type of user-defined relation type
- Type:
- $k.Type
(static) uuid() → {string}
Generates a UUID
- Type:
- string
(static) volume() → {string}
Returns the name of the Knowledge Graph
- Type:
- string