DataStoreSessionModel
Represents a database session.
implements: hash
bundle: online channel standard (oc)
since 4.2.0
Represents a database session.
This model is made accessible by the OCFreemarkerExtensionService with the global access path 'cs.datastore'.
Status
cs.datastore.isConnected ↦ Boolean, (String)
since 4.4.3
since 2020.2.1
Returns information on whether the current database has a live connection to the application server.
Use compatibility@datastore-connected-model-implements-scalar="false" to disable scalar model.
cs.datastore.isRemote ↦ Boolean
since 4.6.0
Indicates whether the database session is operating on the local or on the application server database.
Obtaining Assets
cs.datastore.getAsset(Number:assetID) ↦ AssetModel
since 4.2.0
Returns the current version of asset with ID 'assetID'
- Example:
cs.datastore.getAsset(12345) - get the asset which ID is '12345'
cs.datastore.query(String:xpath) ↦ QueryResultModel
since 4.2.0
Performs the XPath-query specified in the parameter 'xpath' on the local database and returns the query result.
- Example:
cs.datastore.query("cs:asset()[@censhare:resource-key='censhare:foo']") - query by XPath for asset with resource key 'censhare:foo' 'query'
Obtaining Master Data
cs.datastore.cachedtable(String:tableName) ↦ CachedTableModel
since 4.2.0
Returns the master data table with given name 'tableName'
- Example:
cs.datastore.cachedtable(tableKey) - get the CachedTableModel for 'tableKey'
cs.datastore.feature(String:featureKey, String:featureValue) ↦ FeatureModel or FeatureValueModel
since 4.2.0
Called with one parameter returns the master data of the feature whose feature key is the same as the value of 'featureKey' as FeatureModel.
If paramter 'featureValue' is given as second parameter returns the FeatureValueModel for it.
Should no corresponding feature entry exist, undefined is returned.
- Example:
cs.datastore.query(String:featureKey) - get the FeatureModel for 'featureKey'
cs.datastore. query(featureKey, featureValue) - get the FeatureValueModel for 'featureKey' and 'featureValue'