project
Methods
getAlias
getAlias(
pName,pKind):string
Returns the database alias of a data model.
Parameters
string | number | booleanThe name of the data model.
numberThe type of the data model. See project.DATAMODEL_KIND_*.
Returns
stringThe alias you were searching for, or an empty String if the data model has no alias.
Throws
May throw an exception.
Example
var alias = project.getAliasInfo("ORG", project.DATAMODEL_KIND_FRAME);
question.showMessage(alias);
getAliasDefinitionStructure
getAliasDefinitionStructure(
pAlias,pTable):any
Returns the structure of the alias definition, if one is available.
Parameters
string | number | booleanThe name of the alias.
string | number | booleanThe name of a table; 'null' for all.
Returns
anyThe structure of the alias.
Throws
May throw an exception.
Example
var structure = project.getAliasDefinitionStructure("AO_DATEN", null);
for ( var table in structure.tables )
{
if ( structure.tables[table].auditMode > 0)
{
var logColumns = [];
for ( var column in structure.tables[table].columns )
{
var colDef = structure.tables[table].columns[column];
if ( colDef.log || colDef.tableRef != null)
{
if ( colDef.keyword == null ) colDef.keyword = "";
if ( colDef.tableRef == null ) colDef.tableRef = "";
if ( colDef.autoMapTrueFalse4Log == null ) colDef.autoMapTrueFalse4Log = "";
if ( colDef.translate4Log == null ) colDef.translate4Log = "";
logColumns.push([column, colDef.title + "\t" + colDef.keyword + "\t" + colDef.tableRef + "\t" + colDef.autoMapTrueFalse4Log + '\t"' + colDef.translate4Log.replace('"', '""', "g") + '"']);
}
}
}
}
getAliasModel
getAliasModel(
pName):Map<any,any>
Returns the details of an alias.
Parameters
string | number | booleanThe name of the alias.
Returns
Map<any, any>A map with the alias properties. The keys used are the constants project.ALIAS_*.
Throws
May throw an exception.
Example
var ai = project.getAliasModel("AO_DATEN");
var ret = "";
ret += ai[project.ALIAS_NAME] + "\n";
ret += ai[project.ALIAS_PROPERTIES]["databasetype"] + "\n";
ret += ai[project.ALIAS_PROPERTIES]["user"] + "\n";
ret += ai[project.ALIAS_PROPERTIES]["password"] + "\n";
question.showMessage(ret);
getAvailableLoginTypes
getAvailableLoginTypes():
any
Provides the configured logins. Uses the local context (neon, swing,...). All types are supplied, which are supported in principle in the environment of the code. No verification of the configuration itself is performed. var loginTypes = project.getAvailableLoginTypes();
Returns
anyThe available login types.
Throws
May throw an exception.
getContextStructure
getContextStructure(
pName):any
Returns information about a context
Parameters
string | number | booleanThe name of the data model.
Returns
anyThe structure of the context
Throws
May throw an exception.
Example
import("system.project");
var contextModel = project.getContextStructure("MyContext");
var contextName = contextModel.name;
var entity = contextModel.entity;
var views = [ contextModel.mainView, contextModel.filterView, contextModel.editView, contextModel.previewView, contextModel.lookupView ];
getDataModel
getDataModel(
pKind,pName):string[]
Returns an array that contains the data model of the kind (type) and name you passed.
The individual entries are again array with the following elements:
Entry [0] = name
Entry [1] = title
Entry [2] = description
Entry [3] = comment (if present in the data model)
Entry [4] = metadata (if present in the data model)
Entry [5] = icon (if present in the data model)
Entry [6] = usePermissions (if present in the data model)
Parameters
numberThe type of the data model. See project.DATAMODEL_KIND_*.
string | number | booleanThe name of the data model.
Returns
string[]Array containing an array with the properties of the data models: [[0] Name, [1] Title, [2] Description ] or 'null' if no data models with the passed kind exists.
Throws
May throw an exception.
Example
var dm = project.getDataModels(project.DATAMODEL_KIND_FRAME, "ORG");
question.showMessage(dm[0].join("\n"));
getDataModels
getDataModels(
pKind,pNames?):string[][]
Returns an array that contains the data model of the kind (type) and name you passed.
The individual entries are again array with the following elements:
Entry [0] = name
Entry [1] = title
Entry [2] = description
Entry [3] = comment (if present in the data model)
Entry [4] = metadata (if present in the data model)
Entry [5] = icon (if present in the data model)
Entry [6] = usePermissions (if present in the data model)
Parameters
numberThe type of the data model. See project.DATAMODEL_KIND_*.
anyThe names of the data models as array.
Returns
string[][]Array containing an array with the properties of the data models: [[0] Name, [1] Title, [2] Description ] or 'null' if no data models with the passed kind exists.
Throws
May throw an exception.
Example
var dm = project.getDataModels(project.DATAMODEL_KIND_FRAME, ["ORG", "PERS"]);
question.showMessage(dm[0].join("\n"));
getEntityStructure
getEntityStructure(
pName):any
Returns the structure information of an entity model
Parameters
string | number | booleanThe name of the data model.
Returns
anyThe structure of the entity model
Throws
May throw an exception.
Example
import("system.logging"); import("system.project")
var model = project.getEntityStructure("My_entity"); logging.log("Name: " + model.name); logging.log("Title: " + model.title); logging.log("Description: " + model.description); logging.log("UsePermissions: " + model.usePermissions); for (fieldName in model.fields) { field = model.fields[fieldName]; logging.log(" Name: " + field.name); logging.log(" Type: " + field.fieldType); logging.log(" Title: " + field.title); logging.log(" Description: " + field.description); logging.log(" Maximum amount of characters (Text): " + new String(field.maxFieldSize == undefined ? "<unlimited>" : field.maxFieldSize)); logging.log(" Maximum amount of integer digits (Numbers):" + new String(field.maxIntegerDigits == undefined ? "<unlimited>" : field.maxIntegerDigits)); logging.log(" Maximum amount of fraction digits (Numbers): " + new String(field.maxFractionDigits == undefined ? "<unlimited>" : field.maxFractionDigits)); logging.log(" UsePermissions: " + field.usePermissions); }
getInstanceConfigValue
getInstanceConfigValue(
pName,pDefault?):string
Returns the value of an instance configuration.
Parameters
string | number | booleanName of the property, you want to read. For custom properties the prefix "custom." is needed.
string | number | booleanReturns
stringThe value of the property as JSON
Example
var mailTo = project.getInstanceConfigValue("custom.ErrorMailTo");
getPreferenceValue
getPreferenceValue(
pName,pDefault?):string
Returns a value of the project preferences
Parameters
string | number | booleanName of the property, for custom properties the prefix "custom." is needed.
string | number | booleanReturns
stringThe value of the property as JSON
Example
var dsgvoActive = project.getPreferenceValue("custom.dsgvo.active");
If "mailBridgeMailserver" is passed in, then an array of active mailserver definitions are returned.
Please have also a look to property "mailBridgeActiveMailservers" in the InstanceConfiguration.
Example
import("system.project");
import("system.logging");
var mailBridgeMailserver = project.getPreferenceValue("mailBridgeMailserver");
var bridgeArray = JSON.parse(mailBridgeMailserver);
for (let i = 0; i < bridgeArray.length; i++)
{
var bridge = bridgeArray[i];
logging.log(bridge.bridgeName);
logging.log(bridge.server);
logging.log(bridge.timeout);
logging.log(bridge.user);
logging.log(bridge.interval);
var filterArray = bridge.filter;
for (let j = 0; j < filterArray.length; j++)
{
logging.log(filterArray[j]);
}
logging.log(bridge.searchFlag.bit);
logging.log(bridge.searchFlagValue);
logging.log(bridge.errorProcess);
logging.log(bridge.process);
logging.log(bridge.storeRepository);
logging.log(bridge.deleteFromServer);
logging.log(bridge.runProcess);
logging.log(bridge.useBlacklist);
logging.log(bridge.attachmentHandling);
logging.log(bridge.maxMailSize);
}
</code>
}
getRecordContainerModel
getRecordContainerModel(
pEntityName,pProvider?):any
Returns the configuration of the recordContainer for the given entity name and provider. Depending on the recordContainer type, the object will contain different properties. Common properties are:
-
name
-
type
-
title
-
description
Additional properties for jDitoRecordContainers:
-
jDitoRecordAlias
-
isFilterable
-
isGroupable
-
isPageable
-
isRequireContainerFiltering
-
isSortable
-
recordFieldMappings
-
aggregateFieldMappings
Additional properties for dbRecordContainers:
-
isPageable
-
isReadOnly
-
isRequireContainerFiltering
-
alias
-
maximumDbRows
-
linkInformation
-
recordFieldMappings
Additional properties for IndexRecordContainers:
-
isActive
-
isGlobal
-
configMode
-
indexRecordAlias
-
indexFieldMappings
-
affectedTables
Additional properties for datalessRecordContainers:
- alias
Parameters
string | number | booleanThe name of the entity
string | number | booleanThe name of the provider, optional
Returns
anyAn object containing info about the recordContainer
Throws
May throw an exception.
getSystemTableAlias
getSystemTableAlias(
pTableName):string
Returns the database alias a system table is located in.
Parameters
string | number | booleanThe name of the system table.
Returns
stringThe alias you were searching for, or an empty String if the data model has no alias.
Throws
May throw an exception.
Properties
Example
var alias = project.getSystemTableAlias("ASYS_BINARIES");
result.string(alias);
ALIAS_DATASOURCETYPE
stringWhen loading the alias model: contains the data source type of the alias.
ALIAS_NAME
stringWhen loading the alias model: contains the name of the alias.
ALIAS_PROPERTIES
stringWhen loading the alias model: contains the properties of the alias.
DATAMODEL_KIND_ALIAS
numberData model: alias (definition)
DATAMODEL_KIND_ALIASCONFIGURATION
numberData model: alias configuration
DATAMODEL_KIND_ALIASDEFINITION
numberData model: alias definition
DATAMODEL_KIND_CONTEXT
numberDatenmodell: Context
DATAMODEL_KIND_ENTITY
numberData model: frame
DATAMODEL_KIND_FRAME
numberData model: frame
DATAMODEL_KIND_PROCESS
numberData model: prozess
DATAMODEL_KIND_REPORT
numberData model: report
DATASOURCE_CALDAV
numberData source: CalDAV
DATASOURCE_DB
numberData source: database
DATASOURCE_DOMINO
DATASOURCE_DOMINO:
number
Data source: Ibm Lotus Domino
Deprecated
This API is deprecated.
DATASOURCE_EXCHANGEWS
numberData source: Exchange Webservice
DATASOURCE_MAILREP_DB
numberData source: mail repository database
DATASOURCE_MAILREP_IMAP
numberData source: mail repository IMAP
DATASOURCE_MAILSERVER_IMAP
numberData source: mail server IMAP
DATASOURCE_UNKNOWN
numberData source: unknown
DATASOURCE_WORKFLOWSERVER
numberData source: workflow server
DOMINO_REST
numberDatasource: Domino REST
ENTITYFIELDTYPE_ACTION
stringEntityField: ACTION
ENTITYFIELDTYPE_ACTIONGROUP
stringEntityField: ACTIONGROUP
ENTITYFIELDTYPE_CONSUMER
stringEntityField: CONSUMER
ENTITYFIELDTYPE_FIELD
stringEntityField: VALUE
ENTITYFIELDTYPE_FIELDGROUP
stringEntityField: FIELDGROUP
ENTITYFIELDTYPE_PARAMETER
stringEntityField: PARAMETER
ENTITYFIELDTYPE_PROVIDER
stringEntityField: PROVIDER
RECORDCONTAINERTYPE_DATALESS
stringRecordContainer type: DATALESS
RECORDCONTAINERTYPE_DB
stringRecordContainer type: DB
RECORDCONTAINERTYPE_INDEX
stringRecordContainer type: INDEX
RECORDCONTAINERTYPE_JDITO
stringRecordContainer type: JDITO