DOCUMENTS 5 - PortalScripting API
Public Member Functions | Public Attributes | List of all members
Context Class Reference

The Context class is the basic anchor for the most important attributes and methods to customize DOCUMENTS through PortalScripting. More...

Public Member Functions

CustomProperty addCustomProperty (String name, String type, String value)
 Creates a new global custom property. More...
 
Date addTimeInterval (Date ts, number amount, String unit='minutes', boolean useWorkCalendar=true)
 Adds a time interval to a Date object. More...
 
boolean changeScriptUser (String login)
 Change the user context of the PortalScript. More...
 
boolean clearEnumvalCache (String scriptName)
 Clears the cached enumval at the specified PortalScript. More...
 
String convertDateToString (Date dateOrTimeStamp, String locale=user locale)
 Convert a Date object representing a date into a String. More...
 
String convertNumericToString (number value, String decimalSep, String thousandSep, number precision=2)
 Converts a Number into a formatted String. More...
 
String convertNumericToString (number value, String locale=user locale, number precision=2)
 Converts a Number into a formatted String. More...
 
Date convertStringToDate (String dateOrTimeStamp, String locale)
 Convert a String representing a date into a Date object. More...
 
float convertStringToNumeric (String numericValue, String decimalSep, String thousandSep)
 Converts a formated String into a number. More...
 
float convertStringToNumeric (String numericValue, String locale=userlocale)
 Converts a formated String into a number. More...
 
int countPoolFiles (String fileType)
 Retrieve the amount of pool files of the specified filetype in the system. More...
 
AccessProfile createAccessProfile (String profileName)
 Create a new access profile in the DOCUMENTS environment. More...
 
ArchiveServer createArchiveServer (String name, String type)
 Create a new ArchiveServer. More...
 
SystemUser createFellow (String loginName, boolean isDlcUser, String licenseType='named')
 Create a new fellow in the DOCUMENTS environment. More...
 
DocFile createFile (String fileType)
 Create a new file of the specified filetype. More...
 
Folder createFolder (String name, String type)
 Create a new folder of the specified type on the top level. More...
 
boolean createPoolFile (String fileType)
 Create a new pool file of the specified filetype. More...
 
SystemUser createSystemUser (String loginName, boolean isDlcUser, String licenseType='named')
 Create a new user in the DOCUMENTS environment. More...
 
boolean deleteAccessProfile (String profileName)
 Delete a certain access profile in the DOCUMENTS environment. More...
 
boolean deleteFolder (Folder folderObj)
 Delete a folder in DOCUMENTS. More...
 
boolean deleteSystemUser (String loginName)
 Delete a user in the DOCUMENTS environment. More...
 
string doMaintenance (String operationName)
 Calls the specified maintenance operation. More...
 
void enableModules (Object root=undefined)
 Allow dynamic imports of other scripts as modules. More...
 
number extCall (String workDir, String cmd, boolean synced)
 Perform an external command shell call on the Portalserver. More...
 
string [] extProcess (String cmd)
 Perform an external process call on the Portalserver and returns the exitcode of the external process and the standard output. More...
 
AccessProfile findAccessProfile (String profileName)
 Find a certain access profile in the DOCUMENTS environment. More...
 
CustomPropertyIterator findCustomProperties (String filter)
 Searches for CustomProperties. More...
 
SystemUser findSystemUser (String login)
 Retrieve a user by his/her login. More...
 
SystemUser findSystemUserByAlias (String alias)
 Retrieve a user by an alias name. More...
 
AccessProfileIterator getAccessProfiles (boolean includeInvisibleProfiles=false)
 Get an iterator with all access profiles of in the DOCUMENTS environment. More...
 
ArchiveConnection getArchiveConnection (String archiveServerName)
 Get an ArchiveConnection object. More...
 
DocFile getArchiveFile (String key)
 Get a file from the archive. More...
 
ArchiveServer getArchiveServer (String name)
 Get an ArchiveServer identified by its name. More...
 
ArchiveServerIterator getArchiveServers ()
 Get an iterator with all ArchiveServers in the DOCUMENTS environment. More...
 
String getAutoText (String autoText)
 Get the String value of a DOCUMENTS autotext. More...
 
String getClientLang ()
 Get the abbreviation of the current user's portal language. More...
 
int getClientSystemLang ()
 Get the script's execution context portal language index. More...
 
String getClientType ()
 Get the connection info of the client connection. More...
 
String getCurrentUserAttribute (String attributeName)
 Get the String value of an attribute of the current user. More...
 
CustomPropertyIterator getCustomProperties (String nameFilter="", String typeFilter="")
 Get a CustomPropertyIterator with global custom properties. More...
 
number getDatesDiff (Date earlierDate, Date laterDate, String unit='days', boolean useWorkCalendar=true)
 Subtract two Date objects to get their difference. More...
 
Document getDocumentById (String idFile, String idDocument)
 Get the Document by its unique file-id. More...
 
string [] getEnumAutoText (String autoText)
 Get an array with the values of an enumeration autotext. More...
 
String getEnumErgValue (String fileType, String field, String techEnumValue, String locale="")
 Get the ergonomic label of a multilanguage enumeration list value. More...
 
String getEnumValues (String fileType, String field)
 Get an array with enumeration list entries. More...
 
String getFieldErgName (String fileType, String field, String locale="")
 Get the ergonomic label of a file field. More...
 
DocFile getFileById (String idFile)
 Get the file by its unique file-id. More...
 
String getFileTypeErgName (String fileType, String locale="")
 Get the ergonomic label of a filetype. More...
 
String getFileTypeOID (String nameFiletype, boolean oidLow=false)
 Returns the object-id of a filetype. More...
 
int getFolderPosition (Folder folder)
 Retrieve the position of a top level folder in the global context. More...
 
FolderIterator getFoldersByName (String folderPattern, String type="")
 Retrieve a list of folders with identical name. More...
 
String getFromSystemTable (String identifier)
 Retrieve the desired entry of the system messages table. More...
 
object getJSObject (String oid)
 Get a JS_Object by object id. More...
 
String getLastError ()
 Function to get the description of the last error that occurred. More...
 
String getLocaleValue (String value, String locale="")
 Get the value/label of a String with the format "de:rot;en:red;fr:rouge" in the current or defined portal language. More...
 
String getPrincipalAttribute (String attributeName)
 Get the String value of an attribute of the DOCUMENTS principal. More...
 
Float getProgressBar ()
 Gets the current progress value in % of the progress bar in the Documents-Manager during the PortalScript execution. More...
 
DocQueryParams getQueryParams ()
 Get the actual search parameters within an "OnSearch" or "FillSearchScript" exit. More...
 
String getRegisterErgName (String fileTypeName, String registerName, String locale="")
 Get the ergonomic label of a register. More...
 
String getServerInstallPath ()
 Create a String containing the installation path of the portal server. More...
 
SystemUser getSystemUser ()
 Get the current user as a SystemUser object. More...
 
SystemUserIterator getSystemUsers (boolean includeLockedUsers=false)
 Get a list of all users created in the system. More...
 
String getTempPathByToken (String accessToken, boolean dropToken=true)
 Returns the temporary server path, that was ordered by the gadget API for the token. More...
 
String getTmpFilePath ()
 Create a String containing a complete path and filename to a temporary file. More...
 
ArchiveConnection getXMLServer (String archiveServerName="")
 Get an ArchiveConnection object. More...
 
Boolean hasPEMModule (Integer moduleConst)
 Function to check if a module is licenced in the pem. More...
 
boolean reloadCurrentPrincipal (boolean pemReload=false)
 Reloads the current principal. More...
 
boolean reloadPrincipal (String principalName, boolean pemReload=false)
 Reloads the desired principal. More...
 
String sendTCPStringRequest (String server, int port, String request, int responseTimeout=3000)
 Send a String as TCP-Request to a server. More...
 
String setClientLang (String locale)
 Set the abbreviation of the current user's portal language. More...
 
boolean setClientSystemLang (int langIndex)
 Set the script's execution context portal language to the desired language. More...
 
boolean setFolderPosition (Folder folder, int position)
 Place a top level folder a at given position in the global context. More...
 
CustomProperty setOrAddCustomProperty (String name, String type, String value)
 Creates or modifies a global custom property according the name and type. More...
 
boolean setPrincipalAttribute (String attributeName, String value)
 Set an attribute of the DOCUMENTS principal to the desired value. More...
 
void setProgressBar (float value)
 Sets the progress (%) of the progress bar in the Documents-Manager during the PortalScript execution. More...
 
void setProgressBarText (String text)
 Sets the progress bar text in the Documents-Manager during the PortalScript execution. More...
 
boolean writeLogBook (int actionCode, String detail1, String detail2, String detail3)
 Logs an executed action to the logbook. More...
 

Public Attributes

String clientId
 Id of the client / thread which is the execution context of the script. More...
 
String currentUser
 Login of the user who has triggered the script execution. More...
 
Document document
 Document object representing the current document that the script is executed at. More...
 
String errorMessage
 Error message text to be returned by the script. More...
 
String event
 Event which triggered the script execution. More...
 
String fieldName
 Returns in an enumeration script the name of the field where the script is executed for. More...
 
DocFile file
 DocFile object representing the current file that the script is executed at. More...
 
String fileType
 Technical name of the filetype of the file which is the execution context of the script. More...
 
Folder folder
 Current folder in which context the script is running. More...
 
FileResultset folderFiles
 FileResultset with all files of a folder. More...
 
String folderName
 Technical name of the folder the script is called from. More...
 
String qsession
 Session id of the current query-session. More...
 
Register register
 Register object representing the current register that the script is executed at. More...
 
String returnType
 Type of the return value that the script returns. More...
 
String scriptName
 
Name of the executed script. More...
 
ArchiveFileResultset selectedArchiveFiles
 Iterator with the selected archive files of a folder. More...
 
string [] selectedArchiveKeys
 Array with the keys of the selected archive files of a folder. More...
 
DocumentIterator selectedDocuments
 DocumentIterator with the selected Documents (attachments) of the current document register. More...
 
FileResultset selectedFiles
 Iterator with the selected files of a folder. More...
 
String sourceCode
 Script source code of the script after including other scripts by the #import rule. More...
 
String workflowActionId
 
Id of the locking WorkflowStep for the user for the current file. More...
 
String workflowActionName
 Name of the locking WorkflowStep for the user for the current file. More...
 
String workflowControlFlowId
 Id of the ControlFlow the current file currently passes. More...
 
String workflowControlFlowName
 Name of the ControlFlow the current file currently passes. More...
 
WorkflowStep workflowStep
 Returns the current workflowstep if the script is run in context of a workflow. More...
 
PEM Module Constants

These constants build an enumeration of the possible values of the pem license.

See also
Context.hasPEMModule(Integer moduleConst)
Since
DOCUMENTS 5.0c HF2
Integer PEM_MODULE_INVOICE
 
Integer PEM_MODULE_FP_HENR
 
Integer PEM_MODULE_LDAP
 
Integer PEM_MODULE_CONTRACT
 
Integer PEM_MODULE_OUTLOOK_WEB
 
Integer PEM_MODULE_OUTLOOK_SYNC
 
Integer PEM_MODULE_WORDML
 
Integer PEM_MODULE_MOBILE
 
Integer PEM_MODULE_BUSINESS_UNITS
 
Integer PEM_MODULE_CONTROLLING
 
Integer PEM_MODULE_REPORTING
 
Integer PEM_MODULE_EASYHR
 
Integer PEM_MODULE_CONTRACT_SAP
 
Integer PEM_MODULE_GADGETS
 
Integer PEM_MODULE_INBOX
 
Integer PEM_MODULE_IMS
 
Integer PEM_MODULE_CGC
 
Integer PEM_MODULE_CGC_ENT
 
Integer PEM_MODULE_CGC_ENT_PLUS
 
Integer PEM_MODULE_CREATOR
 
Integer PEM_MODULE_DOC_TREE
 
Integer PEM_MODULE_RISK_MANAGEMENT
 
Integer PEM_MODULE_IFRS16
 
Integer PEM_MODULE_SIGN
 
Integer PEM_MODULE_IP_MANAGEMENT
 

Detailed Description

The Context class is the basic anchor for the most important attributes and methods to customize DOCUMENTS through PortalScripting.

There is exactly ONE implicit object of the class Context which is named context. The implicit object context is the root object in any script. With the context object you are able to access to the different DOCUMENTS objects like DocFile, Folder etc. Some of the attributes are only available under certain conditions. It depends on the execution context of the PortalScript, whether a certain attribute is accessible or not. For example, context.selectedFiles is available in a folder userdefined action script, but not in a script used as a signal exit.

Note
It is not possible to create objects of the class Context, since the context object is always available.

Member Function Documentation

◆ addCustomProperty()

CustomProperty Context::addCustomProperty ( String  name,
String  type,
String  value 
)

Creates a new global custom property.

Parameters
nameString value defining the name
typeString value defining the type
valueString value defining the value
Returns
CustomProperty
Since
DOCUMENTS 5.0
Example:
var custProp = context.addCustomProperty("favorites", "string", "peachit");
if (!custProp)
util.out(context.getLastError());
See also
Context.setOrAddCustomProperty(String name, String type, String value)
Context.getCustomProperties(String nameFilter, String typeFilter)

◆ addTimeInterval()

Date Context::addTimeInterval ( Date  ts,
number  amount,
String  unit = 'minutes',
boolean  useWorkCalendar = true 
)

Adds a time interval to a Date object.

Since date manipulation in Javascript is odd sometimes, this useful function allows to conveniently add a given period of time to a given date, e.g. to calculate a due date based upon the current date plus xx days

Parameters
tsDate object to which the period of time should be added
amountinteger value of the period of time to be added
unitString value representing the time unit of the period of time. You may use one of the following unit values:
  • "minutes"
  • "hours"
  • "days"
  • "weeks"
useWorkCalendartrue if work calendar should be taken into account, false if not. The work calendar has to be defined at Documents->Settings
Returns
Date object with the new date.
Since
ELC 3.50e / otrisPORTAL 5.0e
Example:
var actDate = new Date(); // actDate contains now the current date
var newDate = context.addTimeInterval(actDate, 14, "days", false);
util.out(newDate); // should two weeks in the future
See also
Context.getDatesDiff(Date earlierDate, Date laterDate, String unit, boolean useWorkCalendar)
Util.convertDateToString(Date timeStamp, String format)
Util.convertStringToDate(String dateOrTimeStamp, String format)

◆ changeScriptUser()

boolean Context::changeScriptUser ( String  login)

Change the user context of the PortalScript.

In some cases, especially if you make heavy use of access privileges both with files and file fields, it might be neccessary to run a script in a different user context than the user who triggered the script execution. For example, if the current user is not allowed to change any field values, a PortalScript running in this user's context will fail, if it tries to change a field value. In this case it is best practice to switch the user context to some superuser who is allowed to perform the restricted action before that restricted action is executed. You may change the script's user context as often as you need, a change only applies to the instructions following the changeScriptUser() call.

Parameters
loginString value containing the login name of the user to switch to
Returns
true if successful, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
var currentUserLogin = context.currentUser;
var success = context.changeScriptUser("schreiber");
// code runs now in the context of user "schreiber"
....
....
// switch back to the original user
success = context.changeScriptUser(currentUserLogin);

◆ clearEnumvalCache()

boolean Context::clearEnumvalCache ( String  scriptName)

Clears the cached enumval at the specified PortalScript.

Parameters
scriptNameString with the name of the PortalScript
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0c HF1
Example:
var ret = context.clearEnumvalCache("lcmGetAllUser");
if (!ret)
util.out(context.getLastError());

◆ convertDateToString()

String Context::convertDateToString ( Date  dateOrTimeStamp,
String  locale = user locale 
)

Convert a Date object representing a date into a String.

The output String is in the date format of the specified locale. If you leave the locale parameter away the current locale of the script context will be used.

Parameters
dateOrTimeStampDate/Timestamp object representing the desired date
[locale]Locale as String (default = user locale)
Since
DOCUMENTS 4.0c HF1
Example:
var date1 = new Date(2014, 1, 14);
util.out(context.convertDateToString(date1, "de"));
// Output: 14.02.2014
util.out(context.convertDateToString(date1));
// Output: depends on the locale of the script context
var date2 = new Date(2014, 1, 14, 12, 59);
util.out(context.convertDateToString(date2, "en"));
// Output: 02/14/2014 12:59
See also
Util.convertDateToString(Date timeStamp, String format)

◆ convertNumericToString() [1/2]

String Context::convertNumericToString ( number  value,
String  decimalSep,
String  thousandSep,
number  precision = 2 
)

Converts a Number into a formatted String.

The output String may have any format you like. The following parameters defines the format to configure the fromat of the numeric String.

Parameters
valueNumeric object representing the number
decimalSepDecimal-Separator as String
thousandSepThousend-Separator as String
precisionPrecision as number (default=2)
Returns
String representing the desired number
Since
ELC 3.60c / otrisPORTAL 6.0c
Example:
var numVal = 1000 * Math.PI;
context.out(context.convertNumericToString(numVal, ",", ".", 2));
Output: 3.141,59
See also
Context.convertNumericToString(number value, String locale, number precision)

◆ convertNumericToString() [2/2]

String Context::convertNumericToString ( number  value,
String  locale = user locale,
number  precision = 2 
)

Converts a Number into a formatted String.

The output String is formatted like the definition in the locale. If the locale is not defined by parameter, the locale of the current user will be used.

Parameters
valueNumeric object representing the number
localeLocale as String
[precision]Precision as number (default=2)
Returns
String representing the desired number
Since
ELC 3.60c / otrisPORTAL 6.0c
Example:
var numVal = 1000 * Math.PI;
context.out(context.convertNumericToString(numVal, "en", 2));
Output: 3,141.59
See also
Context.convertNumericToString(number value, String decimalSep, String thousandSep, number precision)

◆ convertStringToDate()

Date Context::convertStringToDate ( String  dateOrTimeStamp,
String  locale 
)

Convert a String representing a date into a Date object.

The output Date is in the date format of the specified locale. If you omit the locale parameter the current locale of the script context will be used.

Parameters
dateOrTimeStampString representing a date has to be formatted as the definition in the specified locale, e.g. "TT.MM.JJJJ" for the locale "de".
localeOptional String value with the locale abbreviation (according to the principal's configuration).
Since
DOCUMENTS 5.0a HF2
Example:
var dateString = "19.09.1974";
var birthDay = context.convertStringToDate(dateString, "de");
See also
Util.convertStringToDate(String dateOrTimeStamp, String format)

◆ convertStringToNumeric() [1/2]

float Context::convertStringToNumeric ( String  numericValue,
String  decimalSep,
String  thousandSep 
)

Converts a formated String into a number.

The input String may have any format you like. The following parameters defines the format to configure the format of the numeric String.

Parameters
numericValueFormatted numeric String
decimalSepDecimal-Separator as String
thousandSepThousend-Separator as String
Returns
the numeric number (float) or NULL if fail
Since
ELC 3.60c / otrisPORTAL 6.0c
Example:
var numString = "1.000,99";
var floatVal = context.convertStringToNumeric(numString, ",", ".");
See also
Context.convertStringToNumeric(String numericValue, String locale)

◆ convertStringToNumeric() [2/2]

float Context::convertStringToNumeric ( String  numericValue,
String  locale = userlocale 
)

Converts a formated String into a number.

The input String has to be formatted like the definition in the locale. If the locale is not defined by parameter, the locale of the current user will be used.

Parameters
numericValueFormatted numeric String
localeLocale as String
Returns
the numeric number (float) or NULL if fail
Since
ELC 3.60c / otrisPORTAL 6.0c
Example:
var numString = "1,000.99";
var floatVal = context.convertStringToNumeric(numString, "en");
See also
Context.convertStringToNumeric(String numericValue, String decimalSep, String thousandSep)

◆ countPoolFiles()

int Context::countPoolFiles ( String  fileType)

Retrieve the amount of pool files of the specified filetype in the system.

Parameters
fileTypethe technical name of the desired filetype
Returns
Integer amount of pool files
Note
This function is only for experts.
Since
ELC 3.50j / otrisPORTAL 5.0j
Example:
var fileType = "Standard"; // filetype
var poolSize = context.countPoolFiles(fileType); // amount of pool files
for (var i = poolSize; i < 3000; i++)
{
context.createPoolFile(fileType);
}
See also
Context.createPoolFile(String fileType)

◆ createAccessProfile()

AccessProfile Context::createAccessProfile ( String  profileName)

Create a new access profile in the DOCUMENTS environment.

If the access profile already exist, the method returns an error.

Parameters
profileNametechnical name of the access profile
Returns
AccessProfile object as a representation of the access profile in DOCUMENTS, null in case of any error
Since
ELC 3.60i / otrisPORTAL 6.0i
Example:
var office = context.createAccessProfile("office");
if (!office)
util.out(context.getLastError());

◆ createArchiveServer()

ArchiveServer Context::createArchiveServer ( String  name,
String  type 
)

Create a new ArchiveServer.

This function creates a new ArchiveServer for the specified archive software on the top level. These types are available:

  • EEI
  • EEX_native
  • EBIS_store
  • NOAH
  • None
Parameters
nameThe technical name of the ArchiveServer to be created.
typeThe desired archive software of the ArchiveServer.
Returns
New created ArchiveServer object or null if failed.
Since
DOCUMENTS 5.0a
Example:
var as = context.createArchiveServer("Invoice2016", "NOAH") // EDA
if (as)
util.out(as.name);
else
util.out(context.getLastError());

◆ createFellow()

SystemUser Context::createFellow ( String  loginName,
boolean  isDlcUser,
String  licenseType = 'named' 
)

Create a new fellow in the DOCUMENTS environment.

Parameters
loginNamelogin of the fellow
isDlcUserautomatically grant DOCUMENTS access (true/false)
licenseTypeoptional definition of the license type for that user (allowed values are "named", "concurrent_standard", "concurrent_open" and "shared" (deprecated: "concurrent")
Returns
SystemUser object as a representation of the newly created fellow; if the creation fails (e.g. due to a lack of appropriate licenses), the method returns null
Note
The license type "shared" is only available for pure archive retrieval users. It is not possible to create a shared user with DOCUMENTS access!
Since
ELC 3.60f / otrisPORTAL 6.0f
DOCUMENTS 4.0d HF3 / DOCUMENTS 5.0 (new licenseType "concurrent_standard", "concurrent_open")
Example:
var schreiber = context.createFellow("schreiber", true, "named"); // this will create a named user with DOCUMENTS access
See also
Context.deleteSystemUser(String loginName)

◆ createFile()

DocFile Context::createFile ( String  fileType)

Create a new file of the specified filetype.

This function creates a new file of the given filetype. Since the script is executed in the context of a particular user, it is mandatory that user possesses sufficient access privileges to create new instances of the desired filetype, otherwise the method will fail.
If an error occurs during creation of the file the return value will be null and you can access an error message describing the error with getLastError().

Parameters
fileTypeName of the filetype
Returns
New created file as DocFile object or null if failed.
Remarks
DOCUMENTS 5.0c HF1 and newer: The function directly creates a file for an EAS or EBIS store, if "@server" has been appended to the filetype's name and if appropriate permissions are granted. In this case the returned DocFile must be saved with DocFile.commit() instead of DocFile.sync().
Since
ELC 3.50 / otrisPORTAL 5.0
DOCUMENTS 5.0c HF1 (support for EDA/EAS and EBIS stores)
Example:
var newFile = context.createFile("Standard");
if (newFile)
util.out(newFile.getAutoText("title"));
else
util.out(context.getLastError());

◆ createFolder()

Folder Context::createFolder ( String  name,
String  type 
)

Create a new folder of the specified type on the top level.

This function creates a new folder of the specified type on the top level. There are three types available:

  • public
  • dynamicpublic
  • onlysubfolder
Parameters
nameThe technical name of the folder to be created.
typeThe desired type of the folder.
Returns
New created folder as Folder object or null if failed.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("myFolder", "public")
if (folder)
util.out(folder.type);
else
util.out(context.getLastError());

◆ createPoolFile()

boolean Context::createPoolFile ( String  fileType)

Create a new pool file of the specified filetype.

The script must run in the context of a user who has sufficient access privileges to create new files of the specified filetype, otherwise this method will fail.

Parameters
fileTypethe technical name of the desired filetype
Returns
true if successful, false in case of any error
Since
ELC 3.50j / otrisPORTAL 5.0j
See also
Context.countPoolFiles(String fileType)

◆ createSystemUser()

SystemUser Context::createSystemUser ( String  loginName,
boolean  isDlcUser,
String  licenseType = 'named' 
)

Create a new user in the DOCUMENTS environment.

Parameters
loginNamelogin of the user
isDlcUserautomatically grant DOCUMENTS access (true/false)
licenseTypeoptional definition of the license type for that user (allowed values are "named", "concurrent" and "shared")
Returns
SystemUser object as a representation of the newly created user; if the creation fails (e.g. due to a lack of appropriate licenses), the method returns null
Note
The license type "shared" is only available for pure archive retrieval users. It is not possible to create a shared user with DOCUMENTS access!
Since
ELC 3.51e / otrisPORTAL 5.1e
DOCUMENTS 4.0d HF3 / DOCUMENTS 5.0 (new licenseType "concurrent_standard", "concurrent_open")
Example:
var schreiber = context.createSystemUser("schreiber", true, "concurrent"); // this will create a concurrent user with DOCUMENTS access
See also
Context.deleteSystemUser(String loginName)

◆ deleteAccessProfile()

boolean Context::deleteAccessProfile ( String  profileName)

Delete a certain access profile in the DOCUMENTS environment.

Parameters
profileNametechnical name of the access profile
Returns
true in case of successful deletion, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
var profileName = "office"
var success = context.deleteAccessProfile(profileName);
if (success)
{
util.out("Deletion of access profile " + profileName + " successful");
}

◆ deleteFolder()

boolean Context::deleteFolder ( Folder  folderObj)

Delete a folder in DOCUMENTS.

Parameters
folderObjan object of the Class Folder which represents the according folder in DOCUMENTS
Returns
true if successful, false in case of any error
Since
ELC 3.50l01 / otrisPORTAL 5.0l01
Example:
var itFD = context.getFoldersByName("Invoice");
var fd = itFD.first();
if (fd)
{
var success = context.deleteFolder(fd);
}

◆ deleteSystemUser()

boolean Context::deleteSystemUser ( String  loginName)

Delete a user in the DOCUMENTS environment.

Parameters
loginNamelogin of the user
Returns
true if the deletion was successful, false in case of any error
Since
ELC 3.50e / otrisPORTAL 5.0e
Example:
var login = "schreiber";
var success = context.deleteSystemUser(login);
if (success)
{
util.out("Successfully deleted user " + login);
}
See also
Context.createSystemUser(String loginName, boolean isDlcUser, String licenseType);

◆ doMaintenance()

string Context::doMaintenance ( String  operationName)

Calls the specified maintenance operation.

Parameters
operationNameString with the name of the maintenance operation
Returns
String with the return message of the of the maintenance operation.
Since
DOCUMENTS 5.0c HF1
Example:
var msg = context.doMaintenance("BuildAclCache lcmContract");
util.out(msg);

◆ enableModules()

void Context::enableModules ( Object  root = undefined)

Allow dynamic imports of other scripts as modules.

This function defines a function named require(), either in a passed object or in the global scope of the calling script. In sequence require('<scriptname>') can be used to import other portal scripts, which are implemented in the style of Node.js modules.

Parameters
rootAn optional Object to define the require() function as a property. Use this parameter, if the name "require" is already reserved in the script's global namespace.
Returns
undefined.
Remarks
Only top-level scripts should call enableModules() and they should call it only once. Scripts loaded by require() always see the function as a global parameter. DOCUMENTS exposes a generic 'module' and an initially empty 'exports' object to each imported script. Other features of the module concept of Node.js are not available.
Since
DOCUMENTS 5.0d
Example:
// The main script
context.enableModules();
var mymath = require('MyMath');
var test = mymath.square(42);
util.out("square(42) is " + test);
// End of main script
// The 'MyMath' module script
// "module.exports" is initially an empty object.
// require() will return whatever the script places here.
//
// "exports" is a shortcut reference to "module.exports".
// This works as long as only properties need to be added.
// Directly assigning a new value to "exports" or
// "module.exports" would break the reference.
exports.square = function(x) { return x*x; };
// End of module script

◆ extCall()

number Context::extCall ( String  workDir,
String  cmd,
boolean  synced 
)

Perform an external command shell call on the Portalserver.

In the context of a work directory, an external command shell call is executed, usually a batch file. You can decide whether the scripting engine must wait for the external call to complete or whether the script execution continues asynchonously. If the script waits for the external call to complete, this method returns the errorcode of the external call as an integer value.

Parameters
workDirString containing a complete directory path which should be used as the working directory
cmdString containing the full path and filename to the batch file which shall be executed
syncedboolean value which defines whether the script must wait for the external call to finish (true) or not (false)
Returns
number containing the errorcode (ERRORLEVEL) of the batch call
Since
ELC 3.51 / otrisPORTAL 5.1
Example:
// execute testrun.bat in "c:\tmp" and wait for the call to complete
var errorLevel = context.extCall("c:\\tmp", "c:\\tmp\\testrun.bat", true);
util.out(errorLevel);

◆ extProcess()

string [] Context::extProcess ( String  cmd)

Perform an external process call on the Portalserver and returns the exitcode of the external process and the standard output.

An external process call is executed, e.g. a batch file. The methods returns an array of the size 2. The first array value is the exit code of the external process. The second array value contains the content that the external process has written to the standard output.

Parameters
cmdString containing the full path and filename to the program which shall be executed
Returns
a string array with the exit code and the content of the standard output
Since
ELC 3.60g / otrisPORTAL 6.0g
Example:
// execute testrun.bat and wait for the call to complete
var res = context.extProcess("c:\\tmp\\testrun.bat");
var exitcode = res[0];
var stdout = res[1];
util.out(exitcode + ": " + stdout);

◆ findAccessProfile()

AccessProfile Context::findAccessProfile ( String  profileName)

Find a certain access profile in the DOCUMENTS environment.

Parameters
profileNametechnical name of the access profile
Returns
AccessProfile object as a representation of the access profile in DOCUMENTS, null in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b
Example:
var office = context.findAccessProfile("office");

◆ findCustomProperties()

CustomPropertyIterator Context::findCustomProperties ( String  filter)

Searches for CustomProperties.

Parameters
filterOptional String value defining the search filter (specification see example)
Returns
CustomPropertyIterator
Since
DOCUMENTS 5.0
Example:
// Specification of the filter:
// ----------------------------
// Possible filter-columns:
// name: String - name of the custom property
// type: String - type of the custom property
// to_Systemuser: Integer (oid-low) - connected SystemUser
// to_AccessProfile: Integer (oid-low) - connected AccessProfile
// to_DlcFile : Integer (oid-low) - connected Filetype
//
// Operators:
// &&: AND
// ||: OR
var oidUser = context.findSystemUser("schreiber").getOID(true);
var oidAP1 = context.findAccessProfile("Service").getOID(true);
var oidAP2 = context.findAccessProfile("Customer").getOID(true);
var oidFileType = context.getFileTypeOID("ftRecord", true);
var filter = "name='Prop1'";
filter += "&& to_Systemuser=" + oidUser;
filter += "&& (to_AccessProfile=" + oidAP1 + " || to_AccessProfile=" + oidAP2 + ")";
filter += "&& to_DlcFile =" + oidFileType;
var it = context.findCustomProperties(filter);
for (var cp=it.first(); cp; cp=it.next())
{
util.out(cp.value);
}
See also
Context.getCustomProperties(String nameFilter, String typeFilter)
AccessProfile.getCustomProperties(String nameFilter, String typeFilter)
SystemUser.getCustomProperties(String nameFilter, String typeFilter)

◆ findSystemUser()

SystemUser Context::findSystemUser ( String  login)

Retrieve a user by his/her login.

If the user does not exist, then the return value will be null.

Parameters
loginname of the user
Returns
User as SystemUser object
Since
ELC 3.50b / otrisPORTAL 5.0b
Example:
var myUser = context.findSystemUser("schreiber");
See also
Context.findSystemUserByAlias(String alias)
Context.getSystemUser()
Context.getSystemUsers()
AccessProfile.getSystemUsers()

◆ findSystemUserByAlias()

SystemUser Context::findSystemUserByAlias ( String  alias)

Retrieve a user by an alias name.

If the alias does not exist or is not connected to a user then the return value will be null.

Parameters
aliastechnical name of the desired alias
Returns
User as SystemUser object
Since
ELC 3.51c / otrisPORTAL 5.1c
Example:
var myUser = context.findSystemUserByAlias("CEO");
See also
Context.findSystemUser(String login)
Context.getSystemUser()
Context.getSystemUsers()

◆ getAccessProfiles()

AccessProfileIterator Context::getAccessProfiles ( boolean  includeInvisibleProfiles = false)

Get an iterator with all access profiles of in the DOCUMENTS environment.

Note
This method can only return access profiles which are checkmarked as being visible in DOCUMENTS lists.
Parameters
includeInvisibleProfilesoptional boolean value to define, if access profiles that are not checkmarked as being visible in DOCUMENTS lists should be included
Returns
AccessProfileIterator object with all AccessProfile in DOCUMENTS
Since
ELC 3.51g / otrisPORTAL 5.1g
ELC 3.60e / otrisPORTAL 6.0e (new parameter includeInvisibleProfiles)
Example:
var itAP = context.getAccessProfiles(false);
for (var ap = itAP.first(); ap; ap = itAP.next())
{
util.out(ap.name);
}

◆ getArchiveConnection()

ArchiveConnection Context::getArchiveConnection ( String  archiveServerName)

Get an ArchiveConnection object.

With this method you can get an ArchiveConnection object. This object offers several methods to use the EAS Interface, EBIS or the EASY ENTERPRISE XML-Server.

Parameters
archiveServerNameOptional string containing the archive server name; If the archive server is not defined, then the main archive server will be used
Returns
ArchiveConnection-Object or NULL, if failed
Since
DOCUMENTS 5.0a
Example:
var xmlserver = context.getArchiveConnection("myeex")
if (!xmlserver) // failed
util.out(context.getLastError());
else
{
...
}
See also
ArchiveServer.getArchiveConnection()

◆ getArchiveFile()

DocFile Context::getArchiveFile ( String  key)

Get a file from the archive.

With this method you can get a file from the archive using the archive key. You need the necessary access rights on the archive side.

Returns
DocFile or NULL, if failed
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
var key = "Unit=Default/Instance=Default/Pool=DEMO/Pool=PRESSE/Document=Waz.4E1D1F7E28C611DD9EE2000C29FACDC2@eex1";
var file = context.getArchiveFile(key)
if (!file) // failed
util.out(context.getLastError());
else
{
...
}

◆ getArchiveServer()

ArchiveServer Context::getArchiveServer ( String  name)

Get an ArchiveServer identified by its name.

Parameters
nameThe technical name of the ArchiveServer.
Returns
ArchiveServer object or null if failed.
Since
DOCUMENTS 5.0a
Example:
var as = context.getArchiveServer("ebis1");
if (as)
util.out(as.name);

◆ getArchiveServers()

ArchiveServerIterator Context::getArchiveServers ( )

Get an iterator with all ArchiveServers in the DOCUMENTS environment.

Since
DOCUMENTS 5.0a
Example:
var itAS = context.getArchiveServers();
for (var as = itAS.first(); as; as = itAS.next())
{
util.out(as.name);
}

◆ getAutoText()

String Context::getAutoText ( String  autoText)

Get the String value of a DOCUMENTS autotext.

Parameters
autoTextthe rule to be parsed
Returns
String containing the parsed value of the autotext
Since
ELC 3.50e / otrisPORTAL 5.0e
Example:
util.out(context.getAutoText("currentDate"));

◆ getClientLang()

String Context::getClientLang ( )

Get the abbreviation of the current user's portal language.

If you want to return output messages through scripting, taking into account that your users might use different portal languages, this function is useful to gain knowledge about the portal language used by the current user, who is part of the script's runtime context. This function returns the current language as the two letter abbreviation as defined in the principal's settings in the Windows Portal Client (e.g. "de" for German).

Returns
String containing the abbreviation of the current user's portal language
Since
ELC 3.51 / otrisPORTAL 5.1
Example:
util.out(context.getClientLang());
See also
Context.setClientLang(String locale)
Context.getEnumErgValue(String fileType, String field, String techEnumValue, String locale)
Context.getFieldErgName(String fileType, String field, String locale)
Context.getFileTypeErgName(String fileType, String locale)
Context.getEnumValues(String fileType, String field)
Context.getFromSystemTable(String identifier)

◆ getClientSystemLang()

int Context::getClientSystemLang ( )

Get the script's execution context portal language index.

Returns
integer value of the index of the current system language
Since
ELC 3.51g / otrisPORTAL 5.1g
Example:
util.out(context.getClientSystemLang());
var erg = context.setClientSystemLang(0); // first portal language
See also
Context.getEnumErgValue(String fileType, String field, String techEnumValue, String locale)
Context.getFieldErgName(String fileType, String field, String locale)
Context.getFileTypeErgName(String fileType, String locale)
Context.getEnumValues(String fileType, String field)
Context.getFromSystemTable(String identifier)

◆ getClientType()

String Context::getClientType ( )

Get the connection info of the client connection.

You can analyze the connection info to identify e.g. a client thread of the HTML5 Web-Client

HTML5-Client: CL[Windows 7/Java 1.7.0_76], POOL[SingleConnector], INF[SID[ua:docsclient, dca:2.0, docs_cv:5.0]]
Classic-Client: CL[Windows 7/Java 1.7.0_76], POOL[SingleConnector]
SOAP-Client: Documents-SOAP-Proxy (In-Server-Client-Library) on Win32
Returns
String containing the connection info
Since
DOCUMENTS 5.0
Example:
function isHTML5Client()
{
return context.getClientType().indexOf("docs_cv:5.0") > -1;
}
if (isHTML5Client())
util.out("HTML5-Client");
else
util.out("NO HTML5-Client");

◆ getCurrentUserAttribute()

String Context::getCurrentUserAttribute ( String  attributeName)

Get the String value of an attribute of the current user.

Parameters
attributeNamethe technical name of the desired attribute
Returns
String containing the value of the attribute
Since
ELC 3.50f / otrisPORTAL 5.0f
Example:
util.out(context.getCurrentUserAttribute("particulars.lastName"));
See also
Context.getPrincipalAttribute(String attributeName)
Context.setPrincipalAttribute(String attributeName, String value)

◆ getCustomProperties()

CustomPropertyIterator Context::getCustomProperties ( String  nameFilter = "",
String  typeFilter = "" 
)

Get a CustomPropertyIterator with global custom properties.

Parameters
nameFilterString value defining an optional filter depending on the name
typeFilterString value defining an optional filter depending on the type
Returns
CustomPropertyIterator
Since
DOCUMENTS 5.0
Example:
var itProp = context.getCustomProperties();
for (var prop = itProp.first(); prop; prop = itProp.next())
{
util.out(prop.name + ": " + prop.value);
}
See also
Context.findCustomProperties(String filter)
Context.setOrAddCustomProperty(String name, String type, String value)
Context.addCustomProperty(String name, String type, String value)

◆ getDatesDiff()

number Context::getDatesDiff ( Date  earlierDate,
Date  laterDate,
String  unit = 'days',
boolean  useWorkCalendar = true 
)

Subtract two Date objects to get their difference.

This function calculates the time difference between two Date objects, for example if you need to know how many days a business trip takes. By default this function takes the work calendar into account if it is configured and enabled for the principal.

Parameters
earlierDateDate object representing the earlier date
laterDateDate object representing the later date
unitoptional String value defining the unit, allowed values are "minutes", "hours" and "days" (default)
useWorkCalendaroptional boolean to take office hours into account or not (requires enabled and configured work calendar)
Returns
integer value representing the difference between the two dates
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
var start = util.convertStringToDate("01.04.2006", "dd.mm.yyyy");
var end = util.convertStringToDate("05.04.2006", "dd.mm.yyyy");
var duration = context.getDatesDiff(start, end) ;
util.out("Difference: " + duration); // should be 4

◆ getDocumentById()

Document Context::getDocumentById ( String  idFile,
String  idDocument 
)

Get the Document by its unique file-id.

If the Document does not exist or the user in whose context the script is executed is not allowed to access the file, then the return value will be null.

Parameters
idFileUnique id of the file
idDocumentUnique id of the document
Returns
Document as Document object.
Since
DOCUMENTS 5.0e
Example:
var doc = context.getDocumentById("dopaag_fi20160000000423", "dopaagdc0000000000000256");
if (!doc)
util.out(context.getLastError());
else
util.out(doc.fullname)

◆ getEnumAutoText()

string [] Context::getEnumAutoText ( String  autoText)

Get an array with the values of an enumeration autotext.

Parameters
autoTextto be parsed
Returns
Array containing the values for the autotext
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
var values = context.getEnumAutoText("%accessProfile%")
if (values)
{
for (var i = 0; i < values.length; i++)
{
util.out(values[i]);
}
}

◆ getEnumErgValue()

String Context::getEnumErgValue ( String  fileType,
String  field,
String  techEnumValue,
String  locale = "" 
)

Get the ergonomic label of a multilanguage enumeration list value.

Enumeration lists in multilanguage DOCUMENTS installations usually are translated into the different portal languages as well. This results in the effect that only a technical value for an enumeration is stored in the database. So, if you need to display the label which is usually visible instead in the enumeration field through scripting, this function is used to access that ergonomic label.

Parameters
fileTypeString value containing the technical name of the desired filetype
fieldString value containing the technical name of the desired enumeration field
techEnumValueString value containing the desired technical value of the enumeration entry
localeoptional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
Returns
String containing the ergonomic value of the enumeration value in the appropriate portal language
Since
ELC 3.51 / otrisPORTAL 5.1
Example:
util.out(context.getEnumErgValue("Standard", "Priority", "1", "de"));
See also
Context.getEnumErgValue(String fileType, String field, String techEnumValue, String locale)
Context.getFieldErgName(String fileType, String field, String locale)
Context.getFileTypeErgName(String fileType, String locale)
Context.getEnumValues(String fileType, String field)
Context.getFromSystemTable(String identifier)

◆ getEnumValues()

String Context::getEnumValues ( String  fileType,
String  field 
)

Get an array with enumeration list entries.

In some cases it might be useful not only to access the selected value of an enumeration file field, but the list of all possible field values as well. This function creates an Array of String values (zero-based), and each index is one available value of the enumeration field. If the enumeration field is configured to sort the values alphabetically, this option is respected.

Parameters
fileTypeString value containing the technical name of the desired filetype
fieldString value containing the technical name of the desired enumeration field
Returns
Array containing all possible values of the enumeration field
Since
ELC 3.51 / otrisPORTAL 5.1
Example:
var valueList = context.getEnumValues("Standard", "Priority");
if (valueList.length > 0)
{
for (var i = 0; i < valueList.length; i++)
{
util.out(valueList[i]);
}
}
See also
Context.getEnumErgValue(String fileType, String field, String techEnumValue, String locale)
Context.getFieldErgName(String fileType, String field, String locale)
Context.getFileTypeErgName(String fileType, String locale)
Context.getEnumValues(String fileType, String field)
Context.getFromSystemTable(String identifier)

◆ getFieldErgName()

String Context::getFieldErgName ( String  fileType,
String  field,
String  locale = "" 
)

Get the ergonomic label of a file field.

In multilanguage DOCUMENTS environments, usually the file fields are translated to the different locales by using the well known ergonomic label hack. The function is useful to output scripting generated information in the appropriate portal language of the web user who triggered the script execution.

Parameters
fileTypeString value containing the technical name of the desired filetype
fieldString value containing the technical name of the desired field
localeoptional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
Returns
String containing the ergonomic description of the file field in the appropriate portal language
Since
ELC 3.51 / otrisPORTAL 5.1
Example:
util.out(context.getFieldErgName("Standard", "Prioritaet", "de"));
See also
Context.getEnumErgValue(String fileType, String field, String techEnumValue, String locale)
Context.getFieldErgName(String fileType, String field, String locale)
Context.getFileTypeErgName(String fileType, String locale)
Context.getEnumValues(String fileType, String field)
Context.getFromSystemTable(String identifier)

◆ getFileById()

DocFile Context::getFileById ( String  idFile)

Get the file by its unique file-id.

If the file does not exist or the user in whose context the script is executed is not allowed to access the file, then the return value will be null.

Parameters
idFileUnique id of the file
Returns
File as DocFile object.
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
var file = context.getFileById("toastupfi_20070000002081");
if (file)
util.out(file.getAutoText("title"));
else
util.out(context.getLastError());
See also
Context.file

◆ getFileTypeErgName()

String Context::getFileTypeErgName ( String  fileType,
String  locale = "" 
)

Get the ergonomic label of a filetype.

In multilanguage DOCUMENTS environments, usually the filetypes are translated to the different locales by using the well known ergonomic label hack. The function is useful to output scripting generated information in the appropriate portal language of the web user who triggered the script execution.

Parameters
fileTypeString value containing the technical name of the desired filetype
localeoptional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
Returns
String containing the ergonomic description of the filetype in the appropriate portal language
Since
ELC 3.51 / otrisPORTAL 5.1
Example:
util.out(context.getFileTypeErgName("Standard", "de"));
See also
Context.getEnumErgValue(String fileType, String field, String techEnumValue, String locale)
Context.getFieldErgName(String fileType, String field, String locale)
Context.getFileTypeErgName(String fileType, String locale)
Context.getEnumValues(String fileType, String field)
Context.getFromSystemTable(String identifier)

◆ getFileTypeOID()

String Context::getFileTypeOID ( String  nameFiletype,
boolean  oidLow = false 
)

Returns the object-id of a filetype.

Parameters
nameFiletypeString value containing the technical name of the filetype.
oidLowOptional flag:
If true only the id of the filetype object (m_oid) will be returned.
If false the id of the filetype object will be returned together with the id of the corresponding class in the form class-id:m_oid.
The default value is false.
Returns
String with the object-id or false if filetype does not exist
Since
DOCUMENTS 5.0

◆ getFolderPosition()

int Context::getFolderPosition ( Folder  folder)

Retrieve the position of a top level folder in the global context.

This method can be used to get the position of a top level folder (public, public dynamic or only subfolders folder with no parent) in the global context.

Parameters
folderFolder object whose position to be retrieved.
Returns
internal position number of the folder as integer or -1 in case of any error.
Since
DOCUMENTS 5.0a
Example:
var folder = context.getFoldersByName("MyPublicFolder").first();
var pos = context.getFolderPosition(folder);
if (pos < 0)
throw context.getLastError();
See also
Context.setFolderPosition(Folder folder, int position)
Folder.getPosition(Folder subFolder)
Folder.setPosition(Folder subFolder, int position);

◆ getFoldersByName()

FolderIterator Context::getFoldersByName ( String  folderPattern,
String  type = "" 
)

Retrieve a list of folders with identical name.

Different folders might match an identical pattern, e.g. "DE_20*" for each folder like "DE_2004", "DE_2005" and so on. If you need to perform some action with the different folders or their contents, it might be useful to retrieve an iterator (a list) of all these folders to loop through that list.

Parameters
folderPatternthe name pattern of the desired folder(s)
typeoptional parameter, a String value defining the type of folders to look for; allowed values are "public", "dynamicpublic" and "onlysubfolder"
Returns
FolderIterator containing a list of all folders matching the specified name pattern
Since
ELC 3.50l01 / otrisPORTAL 5.0l01
Example:
var folderIter = context.getFoldersByName("Inv*");

◆ getFromSystemTable()

String Context::getFromSystemTable ( String  identifier)

Retrieve the desired entry of the system messages table.

It might be inconvenient to maintain the different output Strings of localized PortalScripts, if this requires to edit the scripts themselves. This function adds a convenient way to directly access the system messages table which you may maintain in the Windows Portal Client. This enables you to add your own system message table entries in your different portal languages and to directly access them in your scripts.

Parameters
identifierString value containing the technical identifer of a certain system message table entry
Returns
String containing the value of the desired entry in the current user's portal language
Since
ELC 3.50o / otrisPORTAL 5.0o
Example:
// requires an entry with that name in your system message table
util.out(context.getFromSystemTable("myOwnTableEntry"));
See also
Context.getEnumErgValue(String fileType, String field, String techEnumValue, String locale)
Context.getFieldErgName(String fileType, String field, String locale)
Context.getFileTypeErgName(String fileType, String locale)
Context.getEnumValues(String fileType, String field)
Context.getFromSystemTable(String identifier)

◆ getJSObject()

object Context::getJSObject ( String  oid)

Get a JS_Object by object id.

With this method you can get a JS-Object by the object id. Depending of the class of the object you get a JS-Object of the classes AccessProfile, DocFile, Document, Folder, Register, SystemUser or WorkflowStep

Parameters
oidString containing the id of the object
Returns
JS-Object or NULL, if failed
Since
ELC 3.60c / otrisPORTAL 6.0c
Example:
var docFile1 = context.file;
var objectId = docFile1.getOID();
var docFile2 = context.getJSObject(objectId);
// docFile1 and docFile2 are both of the class DocFile
// and reference the same ELC-file object

◆ getLastError()

String Context::getLastError ( )

Function to get the description of the last error that occurred.

Returns
Text of the last error as String
Since
ELC 3.50 / otrisPORTAL 5.0
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Note
All classes have their own error functions. Only global errors are available through the context getLastError() method.
Example:
util.out(context.getLastError());
See also
DocFile.getLastError()

◆ getLocaleValue()

String Context::getLocaleValue ( String  value,
String  locale = "" 
)

Get the value/label of a String with the format "de:rot;en:red;fr:rouge" in the current or defined portal language.

Parameters
valueString with the complete value string
localeOptional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically.
Returns
String containing the valuein the appropriate portal language.
Since
DOCUMENTS 5.0c HF1
Example:
var title = "de:Rechnung 001; en:Invoice 001"
var deVal = context.getLocaleValue(title, "de");
util.out(deVal); // deVal = Rechnung 001
var valInCurrentLanguage = context.getLocaleValue(title);

◆ getPrincipalAttribute()

String Context::getPrincipalAttribute ( String  attributeName)

Get the String value of an attribute of the DOCUMENTS principal.

Parameters
attributeNamethe technical name of the desired attribute
Returns
String containing the value of the attribute
Since
ELC 3.50f / otrisPORTAL 5.0f
Example:
util.out(context.getPrincipalAttribute("executive.eMail"));
See also
Context.getCurrentUserAttribute(String attributeName)
Context.setPrincipalAttribute(String attributeName, String value)

◆ getProgressBar()

Float Context::getProgressBar ( )

Gets the current progress value in % of the progress bar in the Documents-Manager during the PortalScript execution.

Returns
progress as float (value >= 0 and value <= 100)
Since
DOCUMENTS 5.0c
Example:
context.setProgressBarText("Calculating...");
context.setProgressBar(0.0); // set progress bar to 0.0%
for (var i; i<100; i++) {
// do something
context.setProgressBar(i);
}
See also
Context.setProgressBarText(String text)
Context.setProgressBar(Float value)

◆ getQueryParams()

DocQueryParams Context::getQueryParams ( )

Get the actual search parameters within an "OnSearch" or "FillSearchScript" exit.

Returns
A DocQueryParams object on success, otherwise null.
Remarks
The return value is null, if the calling script is not running as an "OnSearch" or "FillSearchMask" handler. It can also be null, if the script has called changeScriptUser(). In order to access the search parameters, the script needs to restore the original user context.
Since
DOCUMENTS 4.0c
Example:
var queryParams = context.getQueryParams();

◆ getRegisterErgName()

String Context::getRegisterErgName ( String  fileTypeName,
String  registerName,
String  locale = "" 
)

Get the ergonomic label of a register.

Parameters
fileTypeNameString value containing the technical name of the desired filetype
registerNameString value containing the technical name of the desired register
localeoptional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
Returns
String containing the ergonomic description of the register in the appropriate portal language
Since
DOCUMENTS 4.0d HF1
Example:
util.out(context.getRegisterErgName("Standard", "Reg1", "de"));
See also
Context.getFieldErgName(String fileType, String field, String locale)
Context.getFileTypeErgName(String fileType, String locale)

◆ getServerInstallPath()

String Context::getServerInstallPath ( )

Create a String containing the installation path of the portal server.

Returns
String containing the portal server installation path
Since
ELC 3.60a / otrisPORTAL 6.0a
Example:
var installDir = context.getServerInstallPath();
util.out(installDir);

◆ getSystemUser()

SystemUser Context::getSystemUser ( )

Get the current user as a SystemUser object.

Returns
SystemUser object representing the current user.
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
var su = context.getSystemUser();
if (su)
util.out(su.login); // output login name of current user
See also
Context.findSystemUser(String)
Context.findSystemUserByAlias(String alias)
Context.getSystemUsers()

◆ getSystemUsers()

SystemUserIterator Context::getSystemUsers ( boolean  includeLockedUsers = false)

Get a list of all users created in the system.

Note
The method can only return users which are checkmarked as being visible in DOCUMENTS lists.
Parameters
includeLockedUsersoptional definition, if locked users also should be returned
Returns
SystemUserIterator object containing a list of all (visible) users created in the system.
Since
ELC 3.50b / otrisPORTAL 5.0b
DOCUMENTS 4.0c new optional parameter includeLockedUsers
Example:
var itSU = context.getSystemUsers();
for (var su = itSU.first(); su; su = itSU.next())
{
util.out(su.login);
}
See also
Context.findSystemUser(String login)
Context.getSystemUser()
Context.findSystemUserByAlias(String alias)

◆ getTempPathByToken()

String Context::getTempPathByToken ( String  accessToken,
boolean  dropToken = true 
)

Returns the temporary server path, that was ordered by the gadget API for the token.

Parameters
accessTokenString value with the token
dropTokenOptional Boolean value that indicates the server to forget the token
Returns
String with temporary path or Emptystring if accessToken is unknown
Since
DOCUMENTS 5.0d

◆ getTmpFilePath()

String Context::getTmpFilePath ( )

Create a String containing a complete path and filename to a temporary file.

The created file path may be used without any danger of corrupting any important data by accident, because DOCUMENTS assures that there is no such file with the created filename yet.

Returns
String containing the complete "safe" path and filename
Since
ELC 3.50n / otrisPORTAL 5.0n
Example:
var tmpFilePath = context.getTmpFilePath();
util.out(tmpFilePath);

◆ getXMLServer()

ArchiveConnection Context::getXMLServer ( String  archiveServerName = "")

Get an ArchiveConnection object.

With this method you can get an ArchiveConnection object. This object offers several methods to use the EAS Interface, EBIS or the EASY ENTERPRISE XML-Server.

Parameters
archiveServerNameOptional string containing the archive server name; If the archive server is not defined, then the main archive server will be used
Returns
ArchiveConnection-Object or NULL, if failed
Since
ELC 3.60d / otrisPORTAL 6.0d
archiveServerName: Documents 4.0
Deprecated:
since DOCUMENTS 5.0a - Use Context.getArchiveConnection(String archiveServerName) instead

◆ hasPEMModule()

Boolean Context::hasPEMModule ( Integer  moduleConst)

Function to check if a module is licenced in the pem.

Parameters
moduleConstfrom PEM Module Constants.
Returns
true if licenced, otherwise false
Since
DOCUMENTS 5.0c HF2
Example:
util.out(context.hasPEMModule(context.PEM_MODULE_GADGETS));

◆ reloadCurrentPrincipal()

boolean Context::reloadCurrentPrincipal ( boolean  pemReload = false)

Reloads the current principal.

This function invalidates or clears caches (e.g. PortalScriptCache and ScriptEnumCache) in order to reload them. Where appropriate you can also with this method reload the pem-file for the current principal via the parameter pemReload.

Parameters
pemReloadOptional boolean indicating whether the pem-file for the current principal to be reloaded. The default value is false.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0e
Example:
if (!context.reloadCurrentPrincipal(true))
util.out(context.getLastError());
See also
Context.reloadPrincipal(String principalName, boolean pemReload)

◆ reloadPrincipal()

boolean Context::reloadPrincipal ( String  principalName,
boolean  pemReload = false 
)

Reloads the desired principal.

This function invalidates or clears caches (e.g. PortalScriptCache and ScriptEnumCache) in order to reload them. Where appropriate you can also with this method reload the pem-file for the desired principal via the parameter pemReload.

Parameters
principalNameString containing the name of the principal to be reloaded.
pemReloadOptional boolean indicating whether the pem-file for the desired principal to be reloaded. The default value is false.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0e
Example:
if (!context.reloadPrincipal("peachit", true))
util.out(context.getLastError());
See also
Context.reloadCurrentPrincipal(boolean pemReload)

◆ sendTCPStringRequest()

String Context::sendTCPStringRequest ( String  server,
int  port,
String  request,
int  responseTimeout = 3000 
)

Send a String as TCP-Request to a server.

With this method it is possible to send a String via TCP to a server. The return value of the function is the response of the server. Optional you can define a timeout in ms this function waits for the response of a server

Parameters
serverString containing the IP address or server host
portint containing the port on which the server is listening
requestString with the request that should be sent to the server
responseTimeoutint with the timeout for the response in ms. Default value is 3000ms
Returns
String containing the response and NULL on error
Remarks
The responseTimeout is effective only after a request has successfully been sent. Timeouts for connecting and sending are determined by the underlying OS.
Since
ELC 3.60b / otrisPORTAL 6.0b
Example:
var response = context.sendTCPStringRequest("192.168.1.1", "4010", "Hello World", 5000);
if (!response)
util.out(context.getLastError());
else
util.out(response);

◆ setClientLang()

String Context::setClientLang ( String  locale)

Set the abbreviation of the current user's portal language.

If you want to set the portal language different from the current users language, you can use this method. As parameter you have to use the two letter abbreviation as defined in the principal's settings in the Windows DOCUMENTS Manager (e.g. "de" for German).

Parameters
localeString containing the two letter abbreviation for the locale
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
Example:
context.setClientLang("en"));
See also
Context.getClientLang()

◆ setClientSystemLang()

boolean Context::setClientSystemLang ( int  langIndex)

Set the script's execution context portal language to the desired language.

Parameters
langIndexinteger value of the index of the desired system language
Returns
true if successful, false in case of any error
Since
ELC 3.51g / otrisPORTAL 5.1g
Deprecated:
since DOCUMENTS 4.0c use setClientLang(String locale) instead
Example:
util.out(context.getClientSystemLang());
var erg = context.setClientSystemLang(0); // first portal language

◆ setFolderPosition()

boolean Context::setFolderPosition ( Folder  folder,
int  position 
)

Place a top level folder a at given position in the global context.

This method can be used to set the position of a top level folder (public, public dynamic or only subfolders folder with no parent) in the global context.

Parameters
folderFolder object whose position to be set.
positionnew internal position number of folder.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0a
Example:
// Create a folder B and place it before a folder A
var folderA = context.getFoldersByName("folderA").first();
var posA = context.getFolderPosition(folderA);
var folderB = context.createFolder("folderB", "public");
if (!context.setFolderPosition(folderB, posA - 1))
throw context.getLastError();
See also
Context.getFolderPosition(Folder folder)
Folder.getPosition(Folder subFolder)
Folder.setPosition(Folder subFolder, int position);

◆ setOrAddCustomProperty()

CustomProperty Context::setOrAddCustomProperty ( String  name,
String  type,
String  value 
)

Creates or modifies a global custom property according the name and type.

Parameters
nameString value defining the name
typeString value defining the type
valueString value defining the value
Returns
CustomProperty
Since
DOCUMENTS 5.0
Example:
var custProp = context.setOrAddCustomProperty("favorites", "string", "peachit");
if (!custProp)
util.out(context.getLastError());
See also
Context.getCustomProperties(String nameFilter, String typeFilter)
Context.addCustomProperty(String name, String type, String value)

◆ setPrincipalAttribute()

boolean Context::setPrincipalAttribute ( String  attributeName,
String  value 
)

Set an attribute of the DOCUMENTS principal to the desired value.

Parameters
attributeNamethe technical name of the desired attribute
valuethe value that should be assigned
Returns
true if successful, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
context.setPrincipalAttribute("executive.eMail", "test@mail.de");
util.out(context.getPrincipalAttribute("executive.eMail"));
See also
Context.getCurrentUserAttribute(String attributeName)
Context.getPrincipalAttribute(String attributeName)

◆ setProgressBar()

void Context::setProgressBar ( float  value)

Sets the progress (%) of the progress bar in the Documents-Manager during the PortalScript execution.

Parameters
valueFloat with in % of the execution (value >= 0 and value <= 100)
Since
DOCUMENTS 5.0c
Example:
context.setProgressBarText("Calculating...");
context.setProgressBar(0.0); // set progress bar to 0.0%
for (var i; i<100; i++) {
// do something
context.setProgressBar(i);
}
See also
Context.setProgressBarText(String text)
Context.getProgressBar()

◆ setProgressBarText()

void Context::setProgressBarText ( String  text)

Sets the progress bar text in the Documents-Manager during the PortalScript execution.

Parameters
textString with the text to displayed in the progress bar
Since
DOCUMENTS 5.0c
Example:
context.setProgressBarText("Calculating...");
context.setProgressBar(0.0); // set progress bar to 0.0%
for (var i; i<100; i++) {
// do something
context.setProgressBar(i);
}
See also
Context.setProgressBar(float value)
Context.getProgressBar()

◆ writeLogBook()

boolean Context::writeLogBook ( int  actionCode,
String  detail1,
String  detail2,
String  detail3 
)

Logs an executed action to the logbook.

Parameters
actionCodeThe integer code of the executed action to be logged. Range: 0 to 35 described as follows:
  • 0 : Create file
  • 1 : Start edit file
  • 2 : Cancel edit file
  • 3 : Save file
  • 4 : Archive file
  • 5 : Delete file
  • 6 : Start workflow
  • 7 : Receive file
  • 8 : Forward file
  • 9 : Change filetype
  • 10 : Workflow escalation
  • 11 : Workflow decision
  • 12 : XML-Export
  • 13 : Workflow receive-signal
  • 14 : Workflow finished
  • 15 : Filetype created
  • 16 : Filetype changed
  • 17 : Filetype deleted
  • 18 : Filetype-field created
  • 19 : Filetype-field changed
  • 20 : Filetype-field deleted
  • 21 : Filetype-register created
  • 22 : Filetype-register changed
  • 23 : Filetype-register deleted
  • 24 : User created
  • 25 : User changed
  • 26 : User deleted
  • 27 : Access profile created
  • 28 : Access profile changed
  • 29 : Access profile deleted
  • 30 : Added user to access profile
  • 31 : Removed user from access profile
  • 32 : Delete file to trash
  • 33 : Recovery from trash
  • 34 : Delete archive file
  • 35 : Maintenance operation performed
detail1Optional String with length <= 255 containing additional information of the action. if the string length > 255, only the first 255 characters will be displayed.
detail2Optional String with length <= 60 containing additional information of the action. if the string length > 60, only the first 60 characters will be displayed.
detail3Optional String with length <= 60 containing additional information of the action. if the string length > 60, only the first 60 characters will be displayed.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0e
Example:
context.writeLogBook(32, "info1", "info2", "info3");

Member Data Documentation

◆ clientId

String Context::clientId

Id of the client / thread which is the execution context of the script.

This property is helpful to identify the clients at scripts running concurrently (for debugging purposes).

Returns
thread id as String
Since
ELC 3.51e / otrisPORTAL 5.1e
Note
This property is readonly.
Example:
util.out(context.clientId);

◆ currentUser

String Context::currentUser

Login of the user who has triggered the script execution.

If the script is running e.g. as action in the workflow the user is the logged in user, who has initiated the action.

Returns
Login name of the user
Since
ELC 3.50 / otrisPORTAL 5.0
Note
This property is readonly.
Example:
util.out(context.currentUser);

◆ document

Document Context::document

Document object representing the current document that the script is executed at.

Returns
Document or null
Note
This property is readonly. If the script is not executed in a document context then the return value is null.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var doc = context.document;

◆ errorMessage

String Context::errorMessage

Error message text to be returned by the script.

The error message will be displayed as Javascript alert box in the web client if the script is called in context of a web client.

Returns
String with error message
Note
You can get and set this property.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
context.errorMessage = "You are not authorized to run this script";
return -1; // neccessary to indicate an error

◆ event

String Context::event

Event which triggered the script execution.

According to the context where the portal script has been called this property contains a key name for this event.

The following events are available:

  • "afterMail"
  • "afterSave"
  • "attributeSetter"
  • "autoText"
  • "condition"
  • "custom"
  • "fileAction"
  • "folderAction"
  • "moveTrash"
  • "newFile"
  • "onAutoLogin"
  • "onArchive"
  • "onDelete"
  • "onDeleteAll"
  • "onEdit"
  • "onLogin"
  • "onSave"
  • "test"
  • "workflow"
Returns
Name of event as String
Since
ELC 3.50n / otrisPORTAL 5.0n
Note
This property is readonly.
Example:
if (context.event == "fileAction")
{
util.out("Action at the file");
}

◆ fieldName

String Context::fieldName

Returns in an enumeration script the name of the field where the script is executed for.

If the script is an enumeration script, this member contains the field name of the current field where the script is executed. This is particularly helpful when the script is set at more than one enumeration field and the behaviour of the script should depend on the field.

Returns
current field name
Since
DOCUMENTS 5.0c HF2
Note
This property is readonly.

◆ file

DocFile Context::file

DocFile object representing the current file that the script is executed at.

Returns
DocFile or null
Note
This property is readonly. If the script is not executed in a file context then the return value is null.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var file = context.file;

◆ fileType

String Context::fileType

Technical name of the filetype of the file which is the execution context of the script.

This property contains the technical name of the filetype of the file which is the execution context of the script.

Returns
String with the name of the filetype.
Note
This property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
util.out(context.fileType);
See also
Context.file

◆ folder

Folder Context::folder

Current folder in which context the script is running.

Returns
Folder of the current folder or null
Note
This property is readonly.
Since
DOCUMENTS 5.0d
Example:
var folder = context.folder;

◆ folderFiles

FileResultset Context::folderFiles

FileResultset with all files of a folder.

This property allows to retrieve a list of all files of a folder if this script is run as user defined action at the folder. You can then iterate through this list for further use of the distinct files.

Returns
FileResultset with all files of a folder.
Note
This property is readonly. If there is no file inside the folder you will receive a valid empty FileResultset.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var it = context.folderFiles;

◆ folderName

String Context::folderName

Technical name of the folder the script is called from.

This property contains the technical name of the folder which is the execution context of the script.

Returns
String with the name of the folder.
Note
This property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
util.out(context.folderName);

◆ qsession

String Context::qsession

Session id of the current query-session.

Returns
Session id as String
Since
DOCUMENTS 5.0d HF1
Note
This property is readonly.

◆ register

Register Context::register

Register object representing the current register that the script is executed at.

Returns
Register or null
Note
This property is readonly. If the script is not executed in a register context then the return value is null.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var reg = context.register;

◆ returnType

String Context::returnType

Type of the return value that the script returns.

User defined actions attached to a file or a folder allow to influence the behaviour of the Web-Client. As soon as you define a return type you explicitely have to return a value.

The following types of return values are available:

  • "html" - The return value contains html-content.
  • "stay" - The continues to display the current file (this is the default behaviour).
  • "showFile" - The return value contains the file-id and optional the register-id of a file to be displayed after the script has been executed. Syntax: file-id[&dlcRegisterId=register-id].
  • "showFolder" - The return value contains the folder-id of a folder to be displayed.
  • "updateTree" - The return value contains the folder-id of a folder to be displayed. The folder tree will be updated as well.
  • "showNewFile" - The return value contains the file-id of a file to be displayed. This file will automatically open in edit mode and will be deleted at cancellation by the user.
  • "showEditFile" - The return value contains the file-id of a file to be displayed. This file will automatically open in edit mode.
  • "file:filename" - The web user will be asked to download the content of the return value (usually a String variable) to his client computer; The filename filename will be proposed as a default.
  • "download:filename" - The web user will be asked to download the blob, that is specified in the return value (server-sided path to the blob), to his client computer; The filename filename will be proposed as a default.
Returns
If reading the property: String with the current return type.
Note
You may read from and write to this property.
Since
ELC 3.50 / otrisPORTAL 5.0 resp. ELC 3.50c / otrisPORTAL 5.0c (showNewFile, updateTree, file)
DOCUMENTS 4.0c showFile with return value of file-id and register-id
Example:
// Example 1: showFile
context.returnType = "showFile";
var idFile = docFile.getAutoText("id");
return idFile;
Example:
// Example 2: showFile with specific register
context.returnType = "showFile";
var idFile = docFile.getAutoText("id");
var idRegister = docFile.getRegisterByName("internal_documents").getAttribute("id");
return idFile + "&dlcRegisterId=" + idRegister;
Example:
// Example 3:
var itFolders = context.getFoldersByName("Invoice");
var folder = itFolders.first();
if (folder == null)
{
context.returnType = "html";
return "<h1>Unable to find folder Invoice</h1>";
}
context.returnType = "showFolder";
return folder.id;
Example:
// Example 4:
var csv = "row11;row12;row13\n";
csv += "row21;row22;row23";
context.returnType = "file:example.csv";
return csv;

◆ scriptName

String Context::scriptName


Name of the executed script.

Returns
script name as String
Since
ELC 3.50 / otrisPORTAL 5.0
Note
This property is readonly.
Example:
util.out(context.scriptName);

◆ selectedArchiveFiles

ArchiveFileResultset Context::selectedArchiveFiles

Iterator with the selected archive files of a folder.

This property allows to retrieve a list of the selected archive files of a folder if this script is run as user defined action at the folder. You can then iterate through this list for further use of the distinct files.

Returns
ArchiveFileResultset with the selected archive files of a folder.
Note
This property is readonly. If there is no file selected you will receive a valid empty ArchiveFileResultset.
Since
ELC 3.60j / otrisPORTAL 6.0j
Example:
var it = context.selectedArchiveFiles;
var archiveFile = it.first()
while (archiveFile)
{
util.out(archiveFile.getAutoText("title"));
archiveFile = it.next();
}

◆ selectedArchiveKeys

string [] Context::selectedArchiveKeys

Array with the keys of the selected archive files of a folder.

This property allows to retrieve an array with the keys of the selected archive files of a folder if this script is run as user defined action at the folder.

Returns
Array with the keys of the selected archive files of a folder.
Note
This property is readonly. If there is no archive file selected you will receive a valid empty array.
Since
ELC 3.60j / otrisPORTAL 6.0j
Example:
var keys = context.selectedArchiveKeys;
util.out(keys.length)

◆ selectedDocuments

DocumentIterator Context::selectedDocuments

DocumentIterator with the selected Documents (attachments) of the current document register.

This property allows to retrieve a list of all selected Documents of a register if this script is run as user defined action at the register.

Returns
DocumentIterator containing all selected Document objects stored on the Register
Note
This property is readonly. If there is no document inside the Register you will receive a valid empty DocumentIterator.
Since
DOCUMENTS 4.0b HF1
Example:
var it = context.selectedDocuments;

◆ selectedFiles

FileResultset Context::selectedFiles

Iterator with the selected files of a folder.

This property allows to retrieve a list of the selected files of a folder if this script is run as user defined action at the folder. You can then iterate through this list for further use of the distinct files.

Returns
FileResultset with the selected files of a folder.
Note
This property is readonly. If there is no file selected you will receive a valid empty FileResultset.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var it = context.selectedFiles;

◆ sourceCode

String Context::sourceCode

Script source code of the script after including other scripts by the #import rule.

This property is useful for debugging purposes, if you need to have a look for a certain line of code to find an error, but the script contains other imported sub scripts which mangle the line numbering.

Returns
Script source code as String
Since
ELC 3.50b / otrisPORTAL 5.0b
Note
This property is readonly.
Example:
util.out(context.sourceCode);

◆ workflowActionId

String Context::workflowActionId


Id of the locking WorkflowStep for the user for the current file.

Returns
WorkflowStep/WorkflowAction id as String
Since
ELC 3.50 / otrisPORTAL 5.0
Note
This property is readonly.
Example:
util.out(context.workflowActionId);

◆ workflowActionName

String Context::workflowActionName

Name of the locking WorkflowStep for the user for the current file.

Returns
WorkflowStep/WorkflowAction name as String
Since
ELC 3.50 / otrisPORTAL 5.0
Note
This property is readonly.
Example:
util.out(context.workflowActionName);

◆ workflowControlFlowId

String Context::workflowControlFlowId

Id of the ControlFlow the current file currently passes.

Returns
ControlFlow id as String
Since
ELC 3.50 / otrisPORTAL 5.0
Note
This property is readonly.
Example:
util.out(context.workflowControlFlowId);

◆ workflowControlFlowName

String Context::workflowControlFlowName

Name of the ControlFlow the current file currently passes.

Returns
ControlFlow name as String
Since
ELC 3.50 / otrisPORTAL 5.0
Note
This property is readonly.
Example:
util.out(context.workflowControlFlowName);

◆ workflowStep

WorkflowStep Context::workflowStep

Returns the current workflowstep if the script is run in context of a workflow.

E.g. as guard or decision script.

Returns
actuell WorkflowStep
Since
DOCUMENTS 5.0
Note
This property is readonly.

This documentation refers DOCUMENTS 5.0e (2105).
Created at 11-09-2019. - © 1998-2019 otris software AG, Königswall 21, D-44137 Dortmund. support@otris.de