DOCUMENTS 5 - PortalScripting API: Introduction

DOCUMENTS 5 - PortalScripting API
Introduction

The DOCUMENTS Server supports an embedded scripting language called PortalScript. This language uses the Mozilla JavaScript engine SpiderMonkey 24 that implements ECMAScript 5.1 and parts of ECMAScript 6.

Notes

  • The PortalScripting API environment is only available in fully activated DOCUMENTS licenses, it cannot be used inside pure retrieval principals (EasyWEB principals).
  • A history of the PortalScripting API can be found at the Changelog
  • See also Firefox JavaScript Changelog
  • (DOCUMENTS 4 uses SpiderMonkey 1.8.5 from Firefox 4)

Script Exits

The PortalScripting allows to widely customize the behaviour of your system. For this purpose, PortalScripts (JavaScript files that use PortalScripting) can be called at special points in the system. These points are called Script Exits. To use this feature, you can simply create a PortalScript and attach it to one of the Script Exits. You'll find the Script Exits in the DOCUMENTS Manager.

You can find the entire list and documentation in chapter Script Exits. The following list just shows a small overview:

  • Common file actions like
    • creating new files
    • activating the edit mode of a file
    • saving a file (both before and after)
    • archiving a file
    • deleting a file
  • User defined actions attached to filetypes or folders
  • As a signal exit shape within workflows
  • Using actions to set field values in workflows
  • Definitions of the enumeration values using an enumeration-type field
  • Script-execution at user login

Features

PortalScripts may also be used to implement special requirements in DOCUMENTS, such as:

  • Dropdown lists which enumeration values depend on another field's value
  • Access an external database to fill dropdown lists or field values
  • Complex guard-conditions that can't be defined in a simple term
  • Calculate data
  • Create reports
  • Access to xml-data with integrated DOMParser
    • E4X is removed from DOCUMENTS since 5.0! See details: E4X
    • See example
  • Realization of daily housekeeping jobs
  • Call external DLLs to trigger third-party systems

The PortalScript runtime environment grants access to a couple of properties of files or fields. You can also read out named constants (AutoTexts) like the current user or the name of the current workflow step. Prerequisites to implement PortalScripts are at least basic skills in general JavaScript programming and knowledge of classes, objects and properties allocated by the DOCUMENTS scripting interface (PortalScripting API).

Classes and Predefined Objects

In the following list you will find a small overview of all available classes and predefined objects. Predefined objects are explained in a contextual usage (i.e. when editing a file, fill a dropdown list etc.).

Predefined objects:

  • Context (implicit object) - root object which refers to DOCUMENTS objects via PortalScript (i.e. file, folder)
  • Util (implicit object) - global object, providing several utility functions
  • PropertyCache - this class makes it possible to store / cache data over the end of the run time of a script.
  • enumval (implicit array) - Definition of enumeration values using a script

Some classes and interfaces:

  • AccessProfile / AccessProfileIterator - represents an access profile (group)
  • SystemUser / SystemUserIterator - represents DOCUMENTS Users
  • CustomProperty / CustomPropertyIterator - represents a class for storing user specific properties
  • FileResultset - represents a list of DOCUMENTS files
  • ArchiveFileResultset - represents a list of archive files
  • Folder / FolderIterator - this class grants access to all kinds of (public) folders
  • HitResultset / DocHit - classes allow comprehensive search operations in Documents and in connected archives.
  • DocFile - represents a certain file of a filetype
  • ArchivingDescription - class to specify archiving option for a DocFile
  • Register / RegisterIterator - represents a (public) folder of a file
  • Document / DocumentIterator - represents a certain document that is stored on a document register of a file
  • WorkflowStep / WorkflowStepIterator - represents a workflow step
  • ControlFlow / ControlFlowIterator - represents the controlflows in the workflow-engine
  • DOMParser - provides basic methods to parse or synthesize XML documents using the DOM.
  • DOMDocument - represents the root of a DOM tree.
  • DOMNode - the base class of all tree elements in a DOMDocument.
  • DOMNodeList - a dynamic, ordered list of DOMNodes.
  • DOMNamedNodeMap - a kind of index for a set of DOMNodes, in which each node has got a unique name.
  • DOMElement - represents a HTML or XML element in the DOM.
  • DOMCharacterData - represents text-like nodes in the DOM tree.
  • DOMAttr - this class models a single attribute of a DOMElement.
  • DOMDocumentType - a container for Document Type Declaration (DTD) information associated with a DOMDocument.
  • DOMProcessingInstruction - represents a processing instruction node in the DOM tree.
  • DOMEntity - represents either an entity in an XML document or a notation in a DTD.
  • DOMException - represents DOMExceptions thrown by the DOM API functions.
  • File - class granting access to the physical file system of the machine running the DOCUMENTS-Server
  • DBConnection / DBResultSet - These classes grant access to ODBC data sources and databases
  • XMLExport / XMLExportDescription - classes to specify XML-export options to Documents elements.
  • XMLServer - provides "raw" access to the EASY ENTERPRISE XML-Server
  • ScriptCall - this class allows asynchronous calling a script from another script.
  • Email - this class allows to create and send an email.
  • XMLHTTPRequest - represents a HTTP request using XML in Windows.
  • UserAction - represents a user-defined action of DOCUMENTS.
  • XLSXWriter - allows creating files in the Excel 2007+ XLSX file format.
  • XLSXWorksheet - represents the Excel worksheet.
  • XLSXChartsheet - represents the Excel chartsheet.
  • XLSXFormat - allows formatting cells in Excel.
  • XLSXChart - allows creating an Excel chart.
  • XLSXChartSeries - represents the Excel chart data series.
  • XLSXChartAxis - represents the Excel chart axis.
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


DOCUMENTS 5 - PortalScripting API: Availabe Script Exits

Script Exits

Overview

Creating, Editing, Deleting Files

  • on creating a file
  • before editing a file
  • on editing a file
  • after setting reference field
  • on saving a file
  • after saving a file
  • after cancelling editing
  • on uploading document
  • after uploading document
  • on deleting a file
  • on undeleting a file
  • after docimport

Workflow

  • on forwarding a file
  • after forwarding a file
  • on workflow action
  • on connecting file to inbox
  • hide receivers for indirect forwarding
  • hide options for indirect forwarding

E-Mail

  • after sending email
  • available blobs in email

Check-In / Check-Out

  • after check-in of a document
  • after canceling check-out

Archive

  • on archiving a file
  • after archiving a file
  • after reactivating a file
  • on loading an archived file

User

  • on login
  • after login
  • on login with single sign on
  • after login with single sign on
  • set password
  • on logout
  • on EASY authentication

Access Rights

  • allowed actions
  • decrease field right in file view
  • hide register in file view
  • decrease search archives
  • decrease search stores
  • decrease search file types
  • access script
  • hide mail template in file view
  • hide print template in file view
  • hide document template in edit mode

Document Retrieval

  • on search request
  • on preparation of a search formular

Global Scripts

  • modify support form

Creation, Editing, Deletion of a File

on creating a file

Where to define | On register Scripting at filetype: On creating new files
Context.event | newFile
return value | no
Available properties | Context.currentUser, Context.file
This script exit will be called after creation of a new file with the default values and before the file is send into the workflow (if a workflow is defined at the filetype). The exit will also be called on direct creation of a DOCUMENTS (EAS) archive file.

before editing a file

Where to define | Property at filetype: beforeEditScript=ScriptName
Context.event | beforeEdit
return value | return value != 0 will be evaluated as error and the EDIT-action will be canceled.
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName

This script will be called if a user presses the EDIT button on a file. At start time of the script execution, the file is in its original state. A scratch copy does not yet exist. If the script returns a value != 0, the EDIT action will be canceled and the value of Context.errorMessage will be display in an alert window.

You can use this exit e.g. to deny the edit-access in dependency of the logged in user. In connection with EAS/EDA, the exit will also be called for an EDIT action on an archived file, but not for a REACTIVATE action.

on editing a file

Where to define | On register Scripting at filetype: On editing
Context.event | onEdit
return value | no
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName

This script exit will be called if an user press the EDIT button at a file. At starting time of the script's execution, the file is in edit mode. The script works with a scratch copy.

In connection with EAS/EDA, the exit will also be called for an EDIT or a REACTIVATE action on an archived file.

after setting reference field

Where to define | Property at filetype field of data type reference or filetype: afterSetReferenceFieldScript=Scriptname
Since | 4.0d
Context.event | afterReferenceFieldSelect / afterReferenceFieldDeselect
return value | No
Available properties | Context.currentUser, Context.file, referenceFieldName

This script exit allows to run a PortalScript after a field of the datatype "Reference" is set or unset. The property can be defined at the filetype field or global at the filetype. A global definition at the file type will be used for all reference fields of this file type.

util.out("context.event:" + context.event);
util.out("referencefieldName: " + referenceFieldName);
var docFile = context.file;
util.out(docFile.getAutoText("id"));
if (docFile.getScratchCopy())
{
util.out("context.file is an original");
}
else if (docFile.getOriginal())
{
util.out("context.file is a scratch copy");
}
if (context.event == "afterReferenceFieldSelect")
{
var refFile = docFile.getReferenceFile(referenceFieldName);
util.out("Reference-file: " + refFile.getAutoText("title"));
}
else if (context.event == "afterReferenceFieldDeselect")
{
var refFile = docFile.getReferenceFile(referenceFieldName);
if (refFile != null)
{
util.out("Error! RefFile must be null!");
}
}

on saving a file

Where to define | On register Scripting at filetype: On saving
Context.event | onSave
return value | return value != 0 will be evaluated as error and the SAVE-action will be canceled.
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName

This script exit will be called if an user press the SAVE button at a file. At starting time of the script's execution, the file is still a scratch copy. If you return a value != 0 the value of Context.errorMessage will be display in an alert window. The file will still be in edit mode.

You can use this exit e.g. to validate the input, that the user has entered for the fields. The exit is not available for archived files.

after saving a file

Where to define | On register Scripting at filetype: After saving
Context.event | afterSave
Available Context.returnType | showFile
return value | 0 or returnType
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName
This script exit will be called after an user press the SAVE button at a file. At starting time of the script's execution, the file is again an active file, not a scratch copy. The exit is not available for archived files.

after cancelling editing

Where to define | Property at filetype: afterCancelEditScript=ScriptName
Context.event | afterCancelEdit
return value | value != 0 for an alert window
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName
This script exit will be called if an user press the CANCEL button in the edit mode of a file. At starting time of the script's execution, the file is not in edit mode anymore. If the script returns a value != 0, the value of Context.errorMessage will be display in an alert window.

on uploading document

Where to define | Property at filetype, register, documents-settings: onUploadDocumentScript=Scriptname
Context.event | onUploadDocument / onUploadNewDocument
return value | return value != 0 will abort the upload
Available properties | Context.currentUser, Context.file, Context.register, param.fileName, param.filePath

This script exit will be called if an user uploads a new document or overwrites an existing document. At starting time of the script's execution, the document is uploaded to the server-side, but not yet in the document-repository. Therefore you can cancel the upload with this exit. The parameter param.filePath and param.fileName contains the path to the server-sided temporary directory where the uploaded document is located. The parameter param.fileName contains the name incl. extension of document. You have read/write access to these both parameter. Therefore you can e.g. modify the document name or check the size of the document if you want to realize a size-limit.

// Sample: size limit for new documents of 1MB
if (context.event == "onUploadNewDocument")
{
if (util.fileSize(param.filePath) > 1024*1024)
{
util.out("Size limit exceeded for document: " + param.fileName);
return -1;
}
}

after uploading document

Where to define | Property at filetype, register, documents-dettings: afterUploadDocumentScript=Scriptname
Context.event | afterUploadNewDocument / afterUploadDocument
return value | No
Available properties | Context.currentUser, Context.file, Context.register, param.fileName, param.filePath
This script exit will be called after an user uploaded a document.

on deleting a file

Where to define

On register Scripting at filetype: On deleting
Context.event | onDelete / moveTrash / onDeleteAll
return value | return value != 0 will abort the delete action
Available properties | Context.currentUser, Context.file

This script exit will be called if an user deletes a file. At starting time of the script's execution, the file is still existing. If the script returns a value != 0, the delete action will be canceled and the value of Context.errorMessage will be display in an alert window.

It is also possible to use this exit with a DOCUMENTS (EAS) store, but not trivial. In such an environment, please pay attention to the following technical notes.

  • Prior to DOCUMENTS 4.0c the exit was not called for archived files, when the user triggered a delete action in a list view.
  • Since DOCUMENTS 4.0c, the exit is by default also called for archived files in a list-oriented delete operation.
  • The additional calls of the exit can be deactivated again by setting the property EASTriggerOnDeleteFromList to 0 or false. Single delete operations (from a file view) and active files are not affected. The property can be applied to a single EAS store. Using the DOCUMENTS/settings window, it can be applied at once to all the stores, which have not got an individual setting.
  • Before DOCUMENTS can call the exit for an archived file, it must have created a corresponding temporary file in its database. Otherwise it only requires the (already known) external id. Thus the onDelete exit may significantly slow down the process of deleting multiple archive files at once.
  • Starting with DOCUMENTS 4.0d, users may get an option to delete all archived versions of a file at once. In this use case the exit is called for each selected file, but not for each version of each selected file. Context.event indicates this case with the value "onDeleteAll".

on undeleting a file

Where to define | Property at Filetype: onUndeleteScript=ScriptName
Context.event | onDelete
return value | return value != 0 will abort the undelete action
Available properties | Context.currentUser, Context.file
This script exit will be called if an user moves a file from the trash folder into the in-work folder. At starting time of the script's execution, the file is still in the trash-folder. If the script returns a value != 0, the undelete action will be canceled and the value of Context.errorMessage will be display in an alert window.

after docimport

Where to define | Property at filetype: afterDocimportScript=ScriptName
Context.event | afterDocimport
return value | no
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName
This script exit will be called after importing a file by use of docimport.

Workflow

on forwarding a file

Where to define | Property at Filetype: onForwardFileScript=Scriptname
Context.event | workflow
return value | return value != 0 will abort the action
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName
This script exit will be called if a user presses a forward action in a workflow (only workflow engine, not distribution lists). At starting time of the script's execution, the file is still not forwarded. If the script returns a value != 0, the workflow action will be canceled and the value of Context.errorMessage will be displayed in an alert window.

on connecting file to inbox

Where to define | Property at Filetype, SystemUser or Documents-Settings: onConnectInboxScript=Scriptname
Context.event | onConnectInbox
return value | No
Available properties | Context.currentUser, Context.file, Context.folder, Context.workflowStep
This script exit will be called if a file is connected to a users inbox (workflow, follow-up etc). Context.folder is a reference to the inbox folder. Context.currentUser is the executing user not the owner of the Context.folder (s. Folder.systemUser)

after forwarding a file

Where to define | Property at Filetype: afterForwardFileScript=Scriptname
Context.event | workflow
return value | No
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName, workflowErrorCode, workflowErrorMessage
This script exit will be called after a user has pressed a forward action in a workflow (only workflow engine, not distribution lists) and the forward action is completed.

on workflow action

Where to define | Property at Filetype: onReceiveWorkflowActionScript=Scriptname
Context.event | workflow
return value | return value != 0 will abort the action
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName
This script exit will be called if a user presses an action in a workflow (only workflow engine, not distribution lists).

hide options for indirect forwarding

Where to define | Property at filetype: hideForwardOptionScript=Scriptname
Context.event | hideForwardOption
return value | No
Available properties | Context.currentUser, Context.file, Context.workflowStep, Context.workflowControlFlowId, enumval

This script exit allows you to hide the options ('Forward to' and 'Confer with') on the forwarding file dialog displayed after a user has pressed a indirect forwarding action in a workflow (only workflow engine, not distribution lists). Indirect forwarding is obtained by deselecting the 'Forward directly' option at the Control flow of the Action. The object enumval contains both options 'forwardTo' and 'conferWith'. Overwrite one with an empty string to hide the option on the forwarding file dialog.

var docFile = context.file;
if (!docFile)
return;
var currentUser = context.getSystemUser();
if (!currentUser)
{
enumval.clear();
throw "Error: currentUser == NULL";
}
for (var i=0; i<enumval.length; i++)
{
// Both options 'Forward to' and 'Confer with' should be hidden on the dialog.
if (enumval[i] == "forwardTo" || enumval[i] == "conferWith")
enumval[i] = ""
}

hide receivers for indirect forwarding

Where to define | Property at filetype: hideForwardReceiverScript=Scriptname
Context.event | hideForwardReceiver
return value | No
Available properties | Context.currentUser, Context.file, Context.workflowStep, Context.workflowControlFlowId, enumval

This script exit allows you to hide receivers on the forwarding file dialog displayed after a user has pressed a indirect forwarding action in a workflow (only workflow engine, not distribution lists). Indirect forwarding is obtained by deselecting the 'Forward directly' option at the Control flow of the Action. The object enumval contains all possible user login names and alias names. Overwrite a name with an empty string to hide the user or alias in the receiver list.

var docFile = context.file;
if (!docFile)
return;
var currentUser = context.getSystemUser();
if (!currentUser)
{
enumval.clear();
throw "Error: currentUser == NULL";
}
for (var i=0; i<enumval.length; i++)
{
// The user with login name 'user1' should be hidden in the receiver list.
if (enumval[i] == "user1")
enumval[i] = ""
}

E-Mail

after sending email

Where to define | Property at Filetype: afterMailScript=Scriptname
Since | 5.0
Context.event | afterMail
return value | none
Available properties | Context.currentUser, Context.file, mailFrom, mailTo, mailCc, mailBcc, mailSubject, mailBody
This script exit will be called after an email is send by an user in the web client.

available blobs in email

Where to define | Property at Filetype: mailAvailableBlobsScript=Scriptname
Since | 5.0e
Context.event | mailAvailableBlobs
return value | none
Available properties | Context.currentUser, Context.file, enumval

If a user wants to send a file as email in the web client, this exit will be called to modify the possible attachments, that are available to send. The enumval contains the documents-ids of the attachments of the file. It is possible to remove ids and to add ids e.g. from other files.

// Sample: Remove first document and add different one
if (context.event == "mailAvailableBlobs")
{
if (enumval.length > 0)
enumval.shift();
var otherFile = context.getFileById("dopaagfi_20180000000012");
try {
var doc = otherFile.getRegisters("documents").first().getDocuments().first();
enumval.push(doc.id)
} catch (err) {
util.out(err);
}
}

Check-in / Check-out

after check-in of a document

Where to define | Property at Filetype: afterCheckInScript=Scriptname
Context.event |
return value | No
Available properties | Context.currentUser, Context.file, documentOID, Context.workflowActionId, Context.workflowActionName
This script exit will be called after an user checked-in a document.

after canceling check-out

Where to define | Property at Filetype: afterCancelCheckOutScript=Scriptname
Context.event | onSave
return value | No
Available properties | Context.currentUser, Context.file, Context.workflowActionId, Context.workflowActionName, documentOID
This script exit will be called after an user cancels the check-out of a document.

Archive

on archiving a file

Where to define | On register Scripting at Filetype: On archiving
Context.event | onArchive
return value | No
Available properties | Context.currentUser, Context.file

This script exit will be called, when DOCUMENTS has got a request to store a file in an archive. It does not matter, if the request comes directly from the web interface, from a workflow step or from another script.

The object, which the exit passes to the script as Context.file, is either an active file or a modified file from the DOCUMENTS (EAS) archive. In the first case, the file is an original. In the second case it is a special kind of scratch copy, because archive files are immutable for the most part.

There is one special case, where this exit cannot be called: The internal SOAP-API method "createFile2" has got an option to create a file directly in EAS. This works completely without DocFiles, so the exit is bypassed.

after archiving a file

Where to define | Property at Filetype: afterArchiveScript=ScriptName
Context.event | afterArchive
return value | No
Available properties | Context.currentUser, Context.file, archiveErrorCode, archiveErrorMessage
This script exit will be called if a user archived a file.

after reactivating a file

Where to define | Property at Filetype: afterReactivateScript=ScriptName
Context.event | afterReactivate
return value | No
Available properties | Context.currentUser, Context.file
This script exit will be called if a user reactivates an archived file. At starting time of the script's execution, the file is not yet in edit mode.

on loading an archived file

Where to define | Property at Filetype: onLoadArchiveFileScript=ScriptName
Context.event | onLoadArchiveFile
return value | No
Available properties | Context.currentUser, Context.file
This script exit will be called when an archived file is loaded.

User

on login

Where to define | Property at Principal: loginScript=Scriptname
Context.event | onLogin
return value | If the return value is != 0 the login will be denied.
Available properties | login, asUser, source, instance, unit
This script exit will be called before the authorization against the system.

after login

Where to define | Property at Principal: afterLoginScript=Scriptname
Context.event | onLogin
return value | No
Available properties | login, asUser, source, instance, unit, Context.currentUser (since 5.0e HF2)
This script exit will be called after a successful login.

on login with single sign on

Where to define | Property at Principal: autoLoginScript=Scriptname
Context.event | autoLogin
return value | No
Available properties | login, source, instance, unit
This script exit will be called during a login with single sign on.

after login with single sign on

Where to define | Property at Principal: afterAutoLoginScript=Scriptname
Context.event | autoLogin
return value | No
Available properties | login, source, instance, unit, Context.currentUser (since 5.0e HF2)
This script exit will be called after a login with single sign on.

set password

Where to define | Property at Principal: setPasswordScript=Scriptname
Context.event |
return value | If the return value is != 0 the password change will be canceled.
Available properties | login, oldpassword, newpassword
This script exit will be called if an user wants to change his password. With the script you can define e.g. your own password guidelines. If the script returns a value != 0, the action will be canceled and the value of Context.errorMessage will be display in an alert window.

on logout

Where to define | Property at Principal: logutScript=Scriptname
Context.event | onLogout
return value | No
Available properties | Context.currentUser, source
This script exit will be called before the logout from the system. The source parameter contains the source of the logout e.g. "web" or "soapapi"

on EASY authentication

Where to define | Property at Principal: EasyAuthScript=Scriptname
Context.event | onEasyAuth
return value | No
Available properties | unit, instance, param.login, knownAccount, Context.currentUser (if available)
If the EASY Authentification feature is enabled, then this script exit will be called right before DOCUMENTS forwards login data to the archive. The script may overwrite the login name in param.login. The XML-Server will receive the modified login, but DOCUMENTS will internally still use the original login. knownAccount indicates, if a Systemuser for the given login already exists. In this case the property Context.currentUser will refer to this object. Otherwise the value can be the job user or simply null. // Sample: append country code to login against EASYWARE param.login += "@de"; return 0;

Access rights

allowed actions

Where to define | On register Scripting at filetype, register, folder Allowed actions
Context.event | allowedActions
return value | No
Available properties | Context.currentUser, Context.file, enumval

If you specify user defined actions at the filetype, register or folder you can handle the access rights to the actions for a user. The object enumval contains the list of all actions. Overwrite an entry with an empty string to redraw a privilege.

// Sample: Withdraw user defined action "Release_Invoice"
var docFile = context.file;
if (!docFile)
return;
for (var i=0; i<enumval.length; i++)
{
if (enumval[i] == "Release_Invoice" && docFile.price > 10000)
enumval[i] = "";
}

decrease field right in file view

Where to define | Property at filetype: decreaseFieldRightOnFileViewScript=Scriptname
Context.event | decreaseFieldRights
return value | No
Available properties | Context.currentUser, Context.file, Context.register
This script exit allows you to redraw read and write rights on fields in the file view / edit mode. var docFile = context.file; if (!docFile) return; var currentUser = context.getSystemUser(); if (!currentUser) { enumval.clear(); throw "Error: currentUser == NULL"; } // make field price: // invisible for guest // readonly for employee // default for boss var isBoss = currentUser.hasAccessProfile("Boss"); var isEmployee = currentUser.hasAccessProfile("Employee"); var guest = !isBoss && !isEmployee; for (var i=0; i<enumval.length; i++) { if (enumval[i] == "price") { if (isBoss) { // do nothing - default right } else if (isEmployee) { enumval[i] = "-w"; // redraw write right } else { // isGuest enumval[i] = "-rw"; // redraw read & write right } } }

hide register in file view

Where to define | Property at filetype: hideRegisterOnFileViewScript=Scriptname
Since | 4.0c HF2
Context.event | hideRegisters
return value | No
Available properties | Context.currentUser, Context.file

This script exit allows you to hide a register in the file view / edit mode. The object enumval contains the list of all register names. Overwrite a register name with an empty string to hide the register in the file view.

var docFile = context.file;
if (!docFile)
return;
var currentUser = context.getSystemUser();
if (!currentUser)
{
enumval.clear();
throw "Error: currentUser == NULL";
}
for (var i=0; i<enumval.length; i++)
{
// The registers 'reg1' und 'reg2' should be hidden in the file view.
if (enumval[i] == "reg1" || enumval[i] == "reg2")
enumval[i] = ""
}

decrease search archives

Where to define | Property at Documents/Settings: decreaseSearchArchivesScript=Scriptname
Context.event | decreaseSearchArchives
return value | No
Available properties | Context.currentUser, enumval
This script exit allows you to reduce the views in the extended search. var publicViews = new Array(); publicViews.push("Unit=Default/Instance=Default/View=Scanners"); publicViews.push("Unit=Default/Instance=Default/View=Invoices"); var currentUser = context.getSystemUser(); if (!currentUser) { enumval.clear(); throw "Error: currentUser == NULL"; } if (currentUser.hasAccessProfile("Boss")) { // Boss is authorized to see all view return 0; } // disable all view, that are not public for (var i=0; i<enumval.length; i++) { if (util.searchInArray(publicViews, enumval[i]) < 0) enumval[i] = ""; }

decrease search stores

Where to define | Property at Documents/Settings: decreaseSearchStoresScript=Scriptname
Context.event | decreaseSearchStores
return value | No
Available properties | Context.currentUser, enumval

This script exit allows you to reduce the EDA and EBIS stores in the extended search. The enumval contains the names of the EDA and EBIS stores.

var publicStores = new Array();
publicStores.push("Invoice2016");
publicStores.push("Invoice2017");
var currentUser = context.getSystemUser();
if (!currentUser)
{
enumval.clear();
throw "Error: currentUser == NULL";
}
if (currentUser.hasAccessProfile("Boss"))
{
// Boss is authorized to see all stores
return 0;
}
// remove all stores, that are not public
for (var i=0; i<enumval.length; i++)
{
if (publicStores.indexOf(enumval[i]) < 0)
enumval[i] = "";
}

decrease search file types

Where to define | Property at Documents/Settings: decreaseSearchFileTypesScript=Scriptname
Context.event | decreaseSearchFileTypes
return value | No
Available properties | Context.currentUser, enumval

This script exit allows you to reduce the filetypes in the extended search. The enumval contains the names of the filetypes.

var confidentialFiletypes = new Array();
confidentialFiletypes.push("SecretLetters");
confidentialFiletypes.push("Salery");
var currentUser = context.getSystemUser();
if (!currentUser)
{
enumval.clear();
throw "Error: currentUser == NULL";
}
if (currentUser.hasAccessProfile("Boss"))
{
// Boss is authorized to search in all filetypes
return 0;
}
// remove all filetypes, that are confidential
for (var i=0; i<enumval.length; i++)
{
if (confidentialFiletypes.indexOf(enumval[i]) >= 0)
enumval[i] = "";
}

access script

Where to define | Property at filetype: AccessScript=Scriptname
Context.event | accessScript
return value | No
Available properties | Context.currentUser, Context.file, enumval

Such an AccessScript is executed every time read access to a file is attempted; it can check any conceivable condition (in doing so, it is imperative that you consider careful resource procedure, because this event is one of the extremely expensive resources!). An AccessScript provides four different rights in the form of the familiar array named enumval: "DlcFile_RightRead", "DlcFile_RightWrite", "DlcFile_RightChangeWorkflow" and "DlcFile_RightReactivate".

It is important to mention here that the read right from the AccessScript is actually more of a right, whether the file can be opened in the web.

var myFile = context.file;
if(!myFile)
throw "Not in a file context";
var read = "1";
var write = "0";
var changeWorkflow = "0";
var reactivate = "0";
var loginFileOwner = myFile.getAutoText("fileOwner.login");
var loginCurrentUser = context.currentUser;
if (loginFileOwner == loginCurrentUser)
write = "1";
for (var i = 0; i < enumval.length; i++)
{
switch (enumval[i])
{
case "DlcFile_RightRead":
enumval[i] = read;
break;
case "DlcFile_RightWrite":
enumval[i] = write;
break;
case "DlcFile_RightChangeWorkflow":
enumval[i] = changeWorkflow;
break;
case "DlcFile_RightReactivate":
enumval[i] = reactivate;
break;
}
}

hide mail template in file view

Where to define | Property at filetype: allowedMailTemplatesScript=Scriptname
Context.event | allowedMailTemplates
return value | No
Available properties | Context.currentUser, Context.file, enumval

This script exit allows you to hide a E-mail template in the file view. The object enumval contains the list of all E-mail template names. Overwrite a template name with an empty string to remove the E-mail template from the action list.

var docFile = context.file;
if (!docFile)
return;
var currentUser = context.getSystemUser();
if (!currentUser)
{
enumval.clear();
throw "Error: currentUser == NULL";
}
for (var i=0; i<enumval.length; i++)
{
// The E-mail template mailComplain should be hidden in the file view.
if (enumval[i] == "mailComplain")
enumval[i] = ""
}

hide print template in file view

Where to define | Property at filetype: allowedPrintTemplatesScript=Scriptname
Context.event | allowedPrintTemplates
return value | No
Available properties | Context.currentUser, Context.file, enumval

This script exit allows you to hide a print template in the file view. The object enumval contains the list of all print template names. Overwrite a template name with an empty string to remove the print template from the action list.

var docFile = context.file;
if (!docFile)
return;
var currentUser = context.getSystemUser();
if (!currentUser)
{
enumval.clear();
throw "Error: currentUser == NULL";
}
for (var i=0; i<enumval.length; i++)
{
// The print template invoiceTemplate should be hidden in the file view.
if (enumval[i] == "invoiceTemplate")
enumval[i] = ""
}

hide document template in edit mode

Where to define | Property at filetype, register: allowedDocumentTemplatesScript=Scriptname
Context.event | allowedDocumentTemplates
return value | No
Available properties | Context.currentUser, Context.file, enumval, (Context.register)

This script exit allows you to hide a document template at the register in the file edit mode. The object enumval contains the list of all document template names. Overwrite a template name with an empty string to remove the documents template from the register action list.

var docFile = context.file;
if (!docFile)
return;
var currentUser = context.getSystemUser();
if (!currentUser)
{
enumval.clear();
throw "Error: currentUser == NULL";
}
for (var i=0; i<enumval.length; i++)
{
// The document template letterComplain should be hidden in the edit mode.
if (enumval[i] == "letterComplain")
enumval[i] = ""
}

Document retrieval

on search request

Where to define | Property at Documents/Settings: OnSearchScript=ScriptName
Since | 4.0c HF2
Context.event | onSearch
return value | The return value must be an integer code, and it is usually zero. A negative value indicates an error and the search will subsequently be canceled. A few request types also allow a positive return value to indicate a warning message, which shall be displayed without cancelling the search. To avoid possible conflicts with existing codes, custom return codes should be in the range -1000 to -100 or +100 to +1000.
Available properties | Context.currentUser, Context.file (only for dynamic register queries), Context.folderName (only for folder queries)
This script exit will be called when the DocumentsServer starts processing a search request. The exit can be used to cancel some requests with a custom error. Another possible use case is optimizing requests for a special project. See the class DocQueryParams for details and an example.

on preparation of a search formular

Where to define | Property at Documents/Settings: FillSearchMaskScript=ScriptName
Since | 4.0d
Context.event | onFillSearchMask
return value | None
Available properties | Context.currentUser
This script exit will be called when DOCUMENTS is about to present a search formular to the user. The attached script can examine the selected search resources and available search fields. Subsequently it may place some default values in the search fields. It may also declare some of these values as write-protected. The script should not perform lengthy tasks, because it will be called frequently.
A brief example: var par = context.getQueryParams(); var cnt; for(cnt = 0; cnt < par.searchFieldCount; ++cnt) { var feld = par.getSearchField(cnt, false); if(feld.name == "hrSuperior") feld.setDefault("schmidt", true); }

modify support form

Where to define | Script with defined prefix in script name: ScriptName must start with InfoDialogAddition
Since | 5.0d HF1
Context.event | supportInfo
return value | None
Available properties and parameters | Context.currentUser, param.supportInfoData
If the documents settings property HasSupportForm=1 is set, in the Client V is an info option to show and send a support form.
Before the support form is shown, the documents server searches for scripts that have the prefix InfoDialogAddition in there names. These scripts can modify the content of the form. This happens by modifying the Parameter param.supportInfoData. The Parameter contains the supportInfo as an JSON string.
JavaScript example
// Scriptname is "InfoDialogAdditionMysolution"
// Output param.supportInfoData:
var data = param.supportInfoData;
util.out(data);
// Set param.supportInfoData:
var obj = JSON.parse(data);
obj.suppFormMailTo = "support@mysolution.com";
param.supportInfoData = JSON.stringify(obj);
JSON example for param.supportInfoData
{
"suppForm": true,
"suppInfoHeader": "Systeminformationen",
"suppInfo": [
{
"Documents": "5.0d #2064 dbg x64 UTF-8 MS SQL Server\r\nAug 7 2018 - 2064.133939/J133931 branches/fixes/8.0d"
},
{
"Archive": "archiv: EAS eas-core-1.1.7-26 (develop)\r\nboost-1_59\r\nclucene-core-0.9.23\r\ncryptopp-562\r\nsqlite-3.19.2\r\nxerces-c-3.1.2\r\nOpenSSL 1.0.2k 26 Jan 2017\r\nICU-58.2\r\nmod_eas-1.1.7-26 (develop)\r\nlibapr-1.5.2\r\nlibapreq-2.8.1-dev\r\n"
},
{
"Host": "Doc5Dev11"
},
{
"OS": "Windows 7 (Service Pack 1)"
},
{
"CPU": "Intel(R) Xeon(R) CPU W3520 @ 2.67GHz - 4 Cores"
},
{
"DB": "Microsoft SQL Server 2014 - 12.0.2269.0 (X64) "
},
{
"Principal": "dopaag"
}
],
"suppFormHeader": "Support-Meldung",
"suppFormMailTo": {
"label": "E-Mail Support",
"value": "support@otris.de",
"readonly": true
},
"suppFormName": {
"label": "Kontakt",
"value": "Schreiber, Willi",
"readonly": false
},
"suppFormMailFrom": {
"label": "E-Mail",
"value": "schreiber@dopa.ag",
"readonly": false
},
"suppFormPhone": {
"label": "Telefonkontakt",
"value": "023112345-12",
"readonly": false
},
"suppFormSubject": {
"label": "Betreff der Anfrage",
"value": "",
"readonly": false
},
"suppFormMessage": {
"label": "Text der Anfrage",
"value": "",
"readonly": false
}
}


DOCUMENTS 5 - PortalScripting API: Field Access Methods

Field Access Methods

The DocFile class offers the following ways to access the field values:

  • DocFile.fieldName
    Each field of a DocFile is mapped to an according property. You can access the field value with the technical name.
  • DocFile.getFieldValue(fieldName)
    DocFile.setFieldValue(fieldName, value)
  • DocFile.getAutoText(autoText)
    whereby the autoText represents the desired field name. The output is performed in the locale of the current user.
  • DocFile.getFieldAttribute(fieldName, attrName)
    DocFile.setFieldAttribute(fieldName, attrName, value)
    These methods are not recommended because of missing validations.

It is worth to mention that DocFile.fieldName and DocFile.setFieldValue(fieldName, value) for an active file need DocFile.sync(checkHistoryFields) to synchronize the changes of the DocFile object back to the real file. For an archive file you must call DocFile.startEdit() before setting the field values and afterwards use DocFile.commit() to commit the changes.

The table below gives an overview about data types of the return values and shows how to set field values by means of examples, whereby the following settings are assumed:

  • The locale of the current user: 'en'
  • Technical date format: DD.MM.YYYY
  • Date format for locale 'en': MM/DD/YYYY
  • Technical decimal point: ,
  • Decimal point for locale 'en': .
  • Format for filing plan: {%R%}.{%D2%}
  • Example enumeration values for enumeration field and double select list field:
    No2; de:Zwei; en:Two
    No3; de:Drei; en:Three
  • Example enumeration value for reference field:
    ftEmployee:Login
    %LastName%, %FirstName%
Field type Access methods JavaScript type of return
value / input parameter
for field value 		Example of return value

Example of setting field value

String, E-Mail,
Text Fixed Font,
Text, URL, HTML 		DocFile.fieldName String "Hello" file.stringField = "Hello";
file.sync();

DocFile.getFieldValue()
DocFile.setFieldValue() 		String "Hello" file.setFieldValue("stringField", "Hello");
file.sync();

DocFile.getAutoText() String "Hello"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "Hello"

file.setFieldAttribute("stringField", "Value", "Hello");

Checkbox, Bool DocFile.fieldName Boolean true / false file.boolField = false;
file.sync();

DocFile.getFieldValue()
DocFile.setFieldValue() 		Boolean true / false file.setFieldValue("boolField", false);
file.sync();

DocFile.getAutoText() String "1" / "0"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "1" / "0"

file.setFieldAttribute("boolField", "Value", "0");

Date DocFile.fieldName Date a Date object / null if empty file.dateField = new Date(2013, 6, 22);
file.sync();

DocFile.getFieldValue()
DocFile.setFieldValue() 		Date a Date object / null if empty file.setFieldValue("dateField", new Date(2013, 6, 22));
file.sync();

DocFile.getAutoText() String "07/22/2013"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "22.07.2013"

file.setFieldAttribute("dateField", "Value", "22.07.2013");

Timestamp DocFile.fieldName Date a Date object / null if empty file.tsField = new Date(2013, 6, 22, 13, 30);
file.sync()

DocFile.getFieldValue()
DocFile.setFieldValue() 		Date a Date object / null if empty file.setFieldValue("tsField", new Date(2013, 6, 22, 13, 30));
file.sync();

DocFile.getAutoText() String "07/22/2013 13:30"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "22.07.2013 13:30"

file.setFieldAttribute("tsField", "Value", "22.07.2013 13:30");

Enumeration DocFile.fieldName String "No3"
(from the enumeration value:
No3; de:Drei; en:Three) 		file.enumField = "No3";
file.sync();

DocFile.getFieldValue()
DocFile.setFieldValue() 		String "No3" file.setFieldValue("enumField", "No3");
file.sync();

DocFile.getAutoText() String "Three"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "No3"

file.setFieldAttribute("enumField", "Value", "No3");

Numeric DocFile.fieldName Number 22.33 file.numField = 22.33;
file.sync();

DocFile.getFieldValue()
DocFile.setFieldValue() 		Number 22.33 file.setFieldValue("numField", 22.33);
file.sync();

DocFile.getAutoText() String "22.33"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "22,33"

file.setFieldAttribute("numField", "Value", "22,33");

Reference DocFile.fieldName String "schreiber\nSchreiber, Willi"
(see 'Example enumeration value
for reference field' above) 		file.refField = "schreiber\nSchreiber, Willi";
file.sync();

DocFile.getFieldValue()
DocFile.setFieldValue() 		String "schreiber\nSchreiber, Willi" file.setFieldValue("refField", "schreiber\nSchreiber, Willi");
file.sync();

DocFile.getAutoText() String "Schreiber, Willi"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "schreiber\nSchreiber, Willi"

file.setFieldAttribute("refField", "Value", "schreiber\nSchreiber, Willi");

History DocFile.fieldName String "23.07.2013 13:03 schreiber: Received" file.historyField = "Received";
file.sync(true);

DocFile.getFieldValue()
DocFile.setFieldValue() 		String "23.07.2013 13:03 schreiber: Received" file.setFieldValue("historyField", "Received");
file.sync(true);

DocFile.getAutoText() String "23.07.2013 13:03 schreiber: Received"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "23.07.2013 13:03 schreiber: Received"

file.setFieldAttribute("historyField", "Value", "Received");

Double select list DocFile.fieldName String "No2\r\nNo3"
(from the enumeration values:
No2; de:Zwei; en:Two
No3; de:Drei; en:Three) 		file.dsListField = "No2\r\nNo3";
file.sync();

DocFile.getFieldValue()
DocFile.setFieldValue() 		String "No2\r\nNo3"
// or (Array as returnType)
["No2", "No3"] 		file.setFieldValue("dsListField", "No2\r\nNo3");
// or (value passed as an Array)
file.setFieldValue("dsListField", ["No2", "No3"]);
file.sync();

DocFile.getAutoText() String "Two\r\nThree"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "No2\r\nNo3"

file.setFieldAttribute("dsListField", "Value", "No2\r\nNo3");

Filing plan DocFile.fieldName String "II.01" file.fpField = "II.01";
file.sync();

DocFile.getFieldValue()
DocFile.setFieldValue() 		String "II.01" file.setFieldValue("fpField", "II.01");
file.sync();

DocFile.getAutoText() String "II.01"

DocFile.getFieldAttribute()
DocFile.setFieldAttribute() 		String "002001" file.setFieldAttribute("fpField", "Value", "002001");


DOCUMENTS 5 - PortalScripting API: Filter Expressions

Filter Expressions

Common filter syntax and operators

The filter syntax resembles the structure of an extended search form in DOCUMENTS' web frontend. A simple filter expression consists of a field name followed by an operator and a value expression. Multiple filter expressions can be linked with "AND" (in capital letters) or with "OR". The following table lists the available operators.

Operator | Meaning | Comments
= | equal |
<> | not equal |
!= | not equal | alternative spelling
< | less than | only allowed for dates, timestamps and numeric fields; in archives only supported by EE.x
> | greater than | only allowed for dates, timestamps and numeric fields; in archives only supported by EE.x
<= | less than or equal | only allowed for dates, timestamps and numeric fields; usage with EE.i is restricted
>= | greater than or equal | only allowed for dates, timestamps and numeric fields; usage with EE.i is restricted
|~ | begins with |
~ | web retrieval operator (called "contains") | The exact behavior of this operator depends on the applied search method. Only for line-indexed fields the search method will be ignored (exact search).
>~ | has text line | New in DOCUMENTS 5.0e. Not applicable to archive requests.

The value expression of a filter represents a single constant value in most cases. If the expression contains a whitespace character or any of the characters used for comparison operators, it has to be enclosed in either 'single' or "double" quotation marks. If a script dynamically creates such an expression, it should always place these marks. If the value contains single marks by itself, double marks should be around it and vice versa. To simplify work, developers may use the function util.getQuoted() to fulfill this requirement.

Note: The behaviour of some operators in the table also depends on the type of index used. DOCUMENTS traditionally uses a primary index for fields. A fulltext option is available since Version 5.0. Starting with 5.0e a line index can be created in place of the fulltext index (with a limit of 255 Characters per line). The DOCUMENTS archive (EAS/EDA) generally uses fulltext indexing. Only certain fields (references for example) become indexed in a "keyword" style, which is like a primary index. Since DOCUMENTS 5 the default indexing of double lists in the archive is line-indexing.

EASY ENTERPRISE.i constantly uses a fulltext index. ENTERPRISE.x supports primary and fulltext indexing.

Operators within a field value expression

Exclusively in conjunction with the operators "~" and ">~" a value expression can be composed with a different set of operators.

Operator | Meaning | Comments
& | logical AND |
| | logical OR |
<space character> | logical AND/OR | configurable by "documents.ini"; AND is the default
! | logical NOT |
* | wildcard | Placeholder for any character sequence. Example: the pattern h*y retrieves words like hey or hurry in a fulltext index. In a primary index, the same pattern matches the value "Hello dolly", but not "Hey doc", because the complete text is checked instead of single words.
'<word-sequence>' or "<word-sequence>" | phrase query | Finds a sequence of words. If you use this, please do not forget to enclose the whole value expression in quotation marks of the other type.

Note: The operator "&" binds stronger than "|" does. Brackets are not allowed. Use the distributive law to eliminate them.

The preconfigured search method and how to override it

Another special feature of the web retrieval operator "~" is to place wilcards around search terms automatically. The intention of this feature is to make searching more comfortable for the user. A query for a company "peachit", for example, would not find a "peachit corporation" in a primary index. A query peachit* would find it, but end users don't like to worry about different index types and to append wildcards every time. The DOCUMENTS setting, which controls automatic wildcard placement, is called search method. Different settings exist for internal queries on one hand, and for archive queries on the other. DOCUMENTS knows three search methods. (The additional methods of the internal search engine are of minor interest for scripting)

Method number | Wildcard pattern
0 | *term*
1 | term
2 (default) | term*

By the rule DOCUMENTS places wildcards only, when a primary index is being addressed. An exception are queries sent to the DOCUMENTS archive (EAS/EDA). In these queries the actual server applies wildcards to all one-word search terms.

To make scripts independent of the software settings, [Archive]FileResultsets can be created with an override of the search method. The constructors of these classes have not got an explicit parameter "searchMethod" for compatibility reasons. The search method can be passed as a special prefix within the filter expression instead: SETMETHOD(<number>).

Date values, numeric values and range queries

DOCUMENTS' retrieval system expects numbers and date values to be formatted in the user's locale format. The following functions may help to obtain values in the local format.

  • Util.convertDateToString()
  • Context.convertNumericToString()
  • Context.getAutoText()
  • docFile.getAutoText()

Starting with Version 4.0d dates and numbers can also be passed with a fixed format. The format pattern for dates is "@yyyymmdd", where each "y" represents a digit of the year number, each "m" a digit of rhe month and each "d" a digit of the day in month. Timestamps can equivalently be formatted as "@yyyymmddHHMMSS" (HH = hours, MM = minutes, SS = seconds). The fixed format pattern for numbers is either "@sn" or "@sn.n", where "s" is the placeholder for an optional sign (+/-) and each "n" represents a sequence of one or more decimal digits.

The retrieval services of supported archive systems do not necessarily provide relational operators like ">", or "<=". ENTREPRISE.i and EDA accept only range queries with a minimum and a maximum value. To make DOCUMENTS create a proper range query, the passed filter expression needs to contain two subsequent conditions for the same field. The first one specifies the minimum value (or the earliest date) using the operator ">=". The second one is reserved for the maximum value (respectively the latest date) behind a "<=". Violations of this rule may result in unprocessible queries or inefficient queries.

Examples

See also Filter Examples

Reserved names in a filter expression

Beside those fields, which are declared in a filetype or an archive structure, some docFile attributes may also be included in a filter expression. Even a fulltext search is possible. The following table lists identifiers, which may be used instead of the name of a conventional field.

Identifier | Attribute or option | Remarks
DlcFile_Title | The docFile's title |
Search_DateFrom | Date of creation |
Search_DateUntil | Date of creation | Equivalent to Search_DateFrom. The double naming only helps to distinguish two input fields in the web-frontend.
Search_ModDateFrom | Date of last modification |
Search_ModDateUntil | Date of last modification | Equivalent to Search_ModDateFrom. The double naming only helps to distinguish two input fields in the web-frontend.
Search_Owner | The creator or the actual owner of a docFile |
Search_LastEditor | The last editor of a docFile | Non-interactive changes may set this attribute, too. An example is a script, which calls startEdit() and commit().
Search_Fulltext | Performs a fulltext search (fields and attachments). | The only allowed operator is the web-retrieval operator ("~"). Applying any other operator may produce unpredictable results. Search_Fulltext is not allowed, when a filter contains "OR"-linked conditions.
Search_FileId | "search" a docFile by its id. | Internal feature for extended permission checks. Scripts should prefer the method Context.getFileById()
Search_EEIFileNr | ENTERPRISE.i file number | DOCUMENTS uses this to obtain a version list of an EE.i docFile.


DOCUMENTS 5 - PortalScripting API: Filter Expression Examples

Filter Expression Examples

Example 1: Searching an invoice by its number.

This is a complete script.
Notice for beginners: The example constantly uses double quotation marks around JavaScript String literals. To include the double quotation mark itself in such a string, a backslash needs to be put in front. At run time the backslash will not be a character in the string. To insert one, two backslashes would be necessary.

function getInvoiceByNumber(invNumber)
{
if(invNumber.indexOf("\"") >= 0)
return null; // make the function safe against filter injection attempts
var filter = "invoiceNo=\"" + invNumber + "\"";
// alternative:
// var filter = "invoiceNo=" + util.getQuoted(invNumber);
var myFRS = new FileResultset("ftInvoice", filter, "");
var theFile = myFRS.first();
if(theFile != null)
{
if(myFRS.next())
{
// invNumber is ambiguous; do not return the docFile
return null;
}
else
return theFile;
}
return null; // invNumber not found
}
var invoiceNum = "064821";
var theInvoice = getInvoiceByNumber(invoiceNum);
if(theInvoice != null)
util.out("Company:" + theInvoice.company);
else
util.out("Invoice number " + invoiceNum + " does not uniquely exist.");

Example 2: A few hard-codes filters using the operator "begins with"

var filter1 = "company|~peach";
// In filter1 no quotation marks around "peach" are required.
var filter2 = "company|~\"peach it\"";
// In filter 2 the quotation marks inside the string literal are necessary.
// Otherwise DOCUMENTS would interpret the space character as the end of the condition.
// Subsequently it would expect nothing but an "AND" in the position of the "it".
var filter2b = "company|~'peach it'";
// Equivalent to filter2 with single quotation marks.
// Notice: Mixtures of single and double quotation marks in the script code are often difficult
// to read within the DocumentsManager, which always uses a proportional font.
var filter2c = "company|~" + util.getQuoted("peach it");
// Yet another style to create filter 2.

Example 3: Testing a field for multiple search terms

function createFindOneFilter(fieldname, values)
{
// The function creates a filter, which tests if the field value is exacly one of the values passed as an array.
// (This applies to a primary index. With a fulltext index the result would be a "contains any of" operation.)
if(typeof(fieldname) != "string") throw "Invalid call of createFindOneFilter(): the parameter \"fieldname\" must be a string";
if(typeof(values) != "object") throw "Invalid call of createFindOneFilter(): the parameter \"values\" must be an array of strings";
//
// First we create a value expression, which links all possible values
// with the "|"-Operator (logical OR). Each value may be a phrase (multiple words
// separated by space characters). So we need to put quotation marks around.
var valueExpr = util.getQuoted(values[0]);
var counter;
for(counter = 1; counter < values.length; ++counter)
{
valueExpr = valueExpr + "|" + util.getQuoted(values[counter]);
}
// Now create the filter with the web retrieval operator "~".
// For an exact search under all configurations, we prepend "SETMETHOD(1)" to the filter expression.
// Since the value expression is not trivial, we need to put quotation marks around it again.
// The previous calls of getQuoted() created double quotation marks. The next one
// will automatically use single quotation marks. So DOCUMENTS can clearly distinguish the end of the
// value expression from the beginning or the end of an embedded phrase.
return "SETMETHOD(1)" + fieldname + "~" + util.getQuoted(valueExpr);
}
// Example call
var colourfulCustomers = new Array("yellowfish", "greenhorse", "black frog", "blue panther");
var filterExpr = createFindOneFilter("company", colourfulCustomers);
var fileRS = new FileResultset("ftOrder", filterExpr, "orderDate+");
// Omitted: loop through and process the docFiles ...

Example 4: A numeric range filter

var minVal = context.convertNumericToString(3.1415, context.getClientLang(), 4);
util.out(minVal);
var maxVal = context.convertNumericToString(10, context.getClientLang());
util.out(maxVal);
var numRangeFilter = "total>=" +minVal + " AND total<=" + maxVal;

Example 5: A date range filter

function getDaysInMonth(month, year)
{
if(month < 0 || month > 11)
throw "Month is out of bounds (0..11)";
switch(month) {
case 1: // special case February
if(year % 4 == 0 && !(year % 100 == 0 && year % 400 != 0))
return 29; // leap year
else
return 28;
case 3:
case 5:
case 8:
case 10:
return 30; // any other short month
default:
return 31; // long month
}
}
var minVal = new Date(); // get the actual date
minVal.setHours(0); // drop the time components
minVal.setMinutes(0);
minVal.setSeconds(0);
minVal.setMilliseconds(0);
var maxVal = new Date(minVal.getTime()); // copy the date object, not just the reference!
// move minVal to the first day and maxVal to the last day of the month
minVal.setDate(1);
maxVal.setDate(getDaysInMonth(maxVal.getMonth(), maxVal.getFullYear()));
// The DOCUMENTS search operations for scripting and SOAP usually expect date constants
// in the current user's locale format. Starting with Version 4.0d also a fixed format
// is allowed. The indicator of this format is a prepended "@".
var fmtPattern = "@yyyymmdd";
var dateRangeFilter = "orderDate>=" + util.convertDateToString(minVal, fmtPattern)
+ " AND orderDate<=" + util.convertDateToString(maxVal, fmtPattern);


DOCUMENTS 5 - PortalScripting API: XML-DOM Example

XML-DOM Example

The following code shows in a short example how to create and parse a XML using the DOM classes.

Sample-XML

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<price>44.95</price>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<price>5.95</price>
</book>
</catalog>

Creating the sample XML and parsing of it

var xml = createXML();
parseXML(xml);
function createXML()
{
var xml = "";
try
{
var domDoc = new DOMDocument("catalog");
var rootElem = domDoc.firstChild;
// Book 1
var book = domDoc.createElement("book");
rootElem.appendChild(book);
book.setAttribute("id", "bk101");
var author = domDoc.createElement("author");
book.appendChild(author);
author.appendChild(domDoc.createTextNode("Gambardella, Matthew"));
var title = domDoc.createElement("title");
book.appendChild(title);
title.appendChild(domDoc.createTextNode("XML Developer's Guide"));
var price = domDoc.createElement("price");
book.appendChild(price);
price.appendChild(domDoc.createTextNode("44.95"));
// Book 2
book = domDoc.createElement("book");
rootElem.appendChild(book);
book.setAttribute("id", "bk102");
author = domDoc.createElement("author");
book.appendChild(author);
author.appendChild(domDoc.createTextNode("Ralls, Kim"));
title = domDoc.createElement("title");
book.appendChild(title);
title.appendChild(domDoc.createTextNode("Midnight Rain"));
price = domDoc.createElement("price");
book.appendChild(price);
price.appendChild(domDoc.createTextNode("5.95"));
// create xml
var parser = new DOMParser();
xml = parser.write(domDoc, "", "UTF-8")
}
catch (exp)
{
throw exp.message;
}
return xml;
}
function parseXML(xml)
{
try
{
var domParser = new DOMParser();
domParser.parse(xml, false);
var root = domParser.getDocument();
var catalog = root.documentElement;
util.out(catalog.tagName); // -> "catalog"
var catChildCount = catalog.childNodes.length; // -> 2 up to 5
for (var i = 0; i < catChildCount; i++)
{
var book = catalog.childNodes[i];
// Examine only DOMElements on this level! Text nodes with whitespaces and
// comment nodes may occur before, between and after the book nodes.
if (book.nodeType == DOMNode.ELEMENT_NODE)
{
util.out(book.getAttribute("id")); // -> "bk101" / "bk102"
var childs = book.childNodes;
for (var j = 0; j < childs.length; j++)
{
// Again: skip whitespaces etc.
if(childs[j].nodeType == DOMNode.ELEMENT_NODE)
{
util.out(childs[j].tagName); // -> "author" / "title" ....
util.out(childs[j].firstChild.data); // -> "Gambardella, Matthew" / "XML Developer's Guide" ....
}
}
}
}
}
catch (exp)
{
throw exp.message;
}
}


DOCUMENTS 5 - PortalScripting API: SOAP Client using DOM

SOAP Client using DOM

This JavaScript SOAP Client is based on DOM and XMLHTTPRequest supported by PortalScripting.

It works by calling the method SOAPClient.invoke(url, method, parameters, async, callback) from the SOAP Client Library as follows:

  • Get the WSDL by the given URL for the SOAP Proxy (e.g. "http://localhost:11001/") and cache it for future requests;
  • Create and send a SOAP request containing the corresponding header, the given method with the given parameters to the server;
  • Receive and process the server response using the WSDL so as to build the corresponding JavaScript objects to be returned;
  • In case the call mode is async, the given callback method is invoked to get the response, otherwise the JavaScript object is returned.

Since DOCUMENTS 4.0c

SOAP client example

#import "soapclient"
// Call mode
var async = false;
// URL for the SOAP Proxy
var url = "http://localhost:11001/";
function User(user, locale, principal, code, passwd)
{
this.user = user;
this.locale = locale;
this.principal = principal;
this.code = code;
this.passwd = passwd;
}
// *************login******************
function login(user)
{
var pl = new SOAPClientParameters();
pl.add("user", user.user);
pl.add("locale", user.locale);
pl.add("principal", user.principal);
pl.add("code", user.code);
pl.add("passwd", user.passwd);
if (!async)
{
var res = SOAPClient.invoke(url, "login", pl, async);
util.out("session: " + res["session"] + "\n");
}
else
SOAPClient.invoke(url, "login", pl, async, login_callback);
}
function login_callback(res)
{
if (res instanceof Error)
util.out("login failed with the error message: \n" + res.message + "\n");
else
util.out("session: " + res["session"] + "\n");
}
// *************logout******************
function logout()
{
var pl = new SOAPClientParameters();
if (!async)
var res = SOAPClient.invoke(url, "logout", pl, async);
else
SOAPClient.invoke(url, "logout", pl, async, logout_callback);
}
function logout_callback(res)
{
if (res instanceof Error)
util.out("logout failed with the error message: \n" + res.message + "\n");
}
// *************userInfo******************
function userInfo()
{
var pl = new SOAPClientParameters();
if (!async)
{
var res = SOAPClient.invoke(url, "userInfo", pl, async);
util.out("name: " + res["name"] + "\n");
}
else
SOAPClient.invoke(url, "userInfo", pl, async, userInfo_callback);
}
function userInfo_callback(res)
{
if (res instanceof Error)
util.out("userInfo failed with the error message: \n" + res.message + "\n");
else
util.out("name: " + res["name"] + "\n");
}
// *************testSession******************
function testSession()
{
var pl = new SOAPClientParameters();
if (!async)
{
var res = SOAPClient.invoke(url, "testSession", pl, async);
util.out("valid: " + res["valid"] + "\n");
}
else
SOAPClient.invoke(url, "testSession", pl, async, testSession_callback);
}
function testSession_callback(res)
{
if (res instanceof Error)
util.out("testSession failed with the error message: \n" + res.message + "\n");
else
util.out("valid: " + res["valid"] + "\n");
}
// *************getInbox******************
function getInbox()
{
var pl = new SOAPClientParameters();
if (!async)
{
var res = SOAPClient.invoke(url, "getInbox", pl, async);
outputInbox(res);
}
else
SOAPClient.invoke(url, "getInbox", pl, async, getInbox_callback);
}
function getInbox_callback(res)
{
if (res instanceof Error)
util.out("getInbox failed with the error message: \n" + res.message + "\n");
else
outputInbox(res);
}
// Help method for getInbox
function outputInbox(res)
{
util.out("=============return value of getInbox: =================\n");
util.out("idFolder: " + res["idFolder"] + "\n");
var fileStatuses = res["fileStatuses"];
for (var i = 0; i < fileStatuses.length; ++i)
{
var fileStatus = fileStatuses[i];
util.out("\n fileStatus of file " + i + " in inbox: \n");
util.out("fileId: " + fileStatus["fileId"] + "\n");
util.out("idWorkflowStep: " + fileStatus["idWorkflowStep"] + "\n");
util.out("status: " + fileStatus["status"] + "\n");
}
util.out("====================================================\n");
}
// *************createFile******************
function createFile()
{
var pl = new SOAPClientParameters();
// Add parameter 'fileType'
pl.add("fileType", "Filetype1");
var fields = new Array();
var field1 = new field("Feld1_String", "This is a test for SOAP.");
fields.push(field1);
// Add parameter 'fields'
pl.add("fields", fields);
var addDocs = new Array();
var dataBase64 = util.getFileContentAsString("C:\\temp\\test.png");
var document1 = new document("myTestDoc.png", "Reg1_Docs", dataBase64);
addDocs.push(document1);
// Add Parameter 'addDocs'
pl.add("addDocs", addDocs);
if (!async)
{
var res = SOAPClient.invoke(url, "createFile", pl, async);
util.out("fileId: " + res["fileId"] + "\n");
}
else
SOAPClient.invoke(url, "createFile", pl, async, createFile_callback);
}
function createFile_callback(res)
{
if (res instanceof Error)
util.out("createFile failed with the error message: \n" + res.message + "\n");
else
util.out("fileId: " + res["fileId"] + "\n");
}
function field(name, value)
{
this.name = name;
this.value = value;
}
function document(name, register, data)
{
this.name = name;
this.register = register;
this.data = data;
}
// *************report3******************
function report3()
{
var pl = new SOAPClientParameters();
pl.add("filetypes", ["Filetype1", "Filetype2"]);
pl.add("archives", ["Filetype1@eas1", "Unit=Default/Instance=Default/View=REGTEST@eex1"]);
pl.add("columns", ["Hit_Id", "DlcFile_Title", "Feld1_String", "Feld2_Aufzaehlung"]);
pl.add("filter", "SETMETHOD(2)Feld1_String ~ 'soaptest'");
pl.add("sort", "Feld2_Aufzaehlung+");
pl.add("hitlistname", "Default");
if (!async)
{
var res = SOAPClient.invoke(url, "report3", pl, async);
outputReport(res);
}
else
SOAPClient.invoke(url, "report3", pl, async, report3_callback);
}
function report3_callback(res)
{
if (res instanceof Error)
util.out("report3 failed with the error message: \n" + res.message + "\n");
else
outputReport(res);
}
function outputReport(res)
{
var hitlist = res["hitlist"];
util.out("rows: " + hitlist["rows"]);
util.out("columns: " + hitlist["columns"]);
var hit = hitlist["hit"];
if (hit)
{
var hitSize = hit.length;
var output = "";
for (var i = 0; i < hitSize; i++)
{
output = output + "----------\n"
output = output + "hit[" + i + "]\n";
var col = hit[i]["column"]
for (var j = 0; j < col.length; j++)
{
output = output + "column[" + j + "]: " + col[j] + "\n";
}
output = output + "reserved: " + hit[i]["reserved"] + "\n";
output = output + "----------\n";
}
util.out("hit:\n" + output);
}
}
var user1 = new User("schreiber", "de", "peachit", "", "willi");
login(user1);
userInfo();
testSession();
getInbox();
//createFile();
//report3();
logout();

SOAP Client Library

// *****************************************************************************
// Javascript "SOAP Client" library
// @version: 2.4 - 2007.12.21
// @author: Matteo Casati - http://www.guru4.net/
// *****************************************************************************
// Adjusted for DOCUMENTS 4 using DOM Parser by otris software AG
// The class for the definition of the parameters to be passed to the Web method
function SOAPClientParameters()
{
var _pl = new Array();
// Append a new parameter
this.add = function(name, value)
{
_pl[name] = value;
return this;
}
// Provide XML serialization for SOAP request
this.toXml = function()
{
var xml = "";
for(var p in _pl)
{
switch(typeof(_pl[p]))
{
case "string":
case "number":
case "boolean":
case "object":
xml += "<" + p + ">" + SOAPClientParameters._serialize(_pl[p]) + "</" + p + ">";
break;
default:
break;
}
}
return xml;
}
}
// XML serialization
SOAPClientParameters._serialize = function(o)
{
var s = "";
switch(typeof(o))
{
case "string":
s += o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); break;
case "number":
case "boolean":
s += o.toString(); break;
case "object":
// Date
if(o.constructor.toString().indexOf("function Date()") > -1)
{
var year = o.getFullYear().toString();
var month = (o.getMonth() + 1).toString(); month = (month.length == 1) ? "0" + month : month;
var date = o.getDate().toString(); date = (date.length == 1) ? "0" + date : date;
var hours = o.getHours().toString(); hours = (hours.length == 1) ? "0" + hours : hours;
var minutes = o.getMinutes().toString(); minutes = (minutes.length == 1) ? "0" + minutes : minutes;
var seconds = o.getSeconds().toString(); seconds = (seconds.length == 1) ? "0" + seconds : seconds;
var milliseconds = o.getMilliseconds().toString();
var tzminutes = Math.abs(o.getTimezoneOffset());
var tzhours = 0;
while(tzminutes >= 60)
{
tzhours++;
tzminutes -= 60;
}
tzminutes = (tzminutes.toString().length == 1) ? "0" + tzminutes.toString() : tzminutes.toString();
tzhours = (tzhours.toString().length == 1) ? "0" + tzhours.toString() : tzhours.toString();
var timezone = ((o.getTimezoneOffset() < 0) ? "+" : "-") + tzhours + ":" + tzminutes;
s += year + "-" + month + "-" + date + "T" + hours + ":" + minutes + ":" + seconds + "." + milliseconds + timezone;
}
// Array
else if(o.constructor.toString().indexOf("function Array()") > -1)
{
for(var p in o)
{
if(!isNaN(p)) // linear array
{
(/function\s+(\w*)\s*\(/ig).exec(o[p].constructor.toString());
var type = RegExp.$1;
switch(type)
{
case "":
type = typeof(o[p]);
case "String":
type = "string"; break;
case "Number":
type = "int"; break;
case "Boolean":
type = "bool"; break;
case "Date":
type = "DateTime"; break;
}
s += "<" + type + ">" + SOAPClientParameters._serialize(o[p]) + "</" + type + ">"
}
else // associative array
s += "<" + p + ">" + SOAPClientParameters._serialize(o[p]) + "</" + p + ">"
}
}
// Object or custom function
else
for(var p in o)
s += "<" + p + ">" + SOAPClientParameters._serialize(o[p]) + "</" + p + ">";
break;
default:
break; // throw new Error(500, "SOAPClientParameters: type '" + typeof(o) + "' is not supported");
}
return s;
}
// The SOAPClient class
function SOAPClient() {}
// Session id of SOAP client
SOAPClient.sessionId = "0";
// Timeout in milliseconds for asynchronous calls, the value 0 implies infinite timeout.
SOAPClient.timeout = 30000;
// Idle time in milliseconds for asynchronous calls
SOAPClient.idle = 50;
// This method is invoked by the SOAP client using a JavaScript function with following parameters.
// url: The Web Service URL
// method: Web methode name
// parameters: Web methode parameter values
// async: Call mode (true = async, false = sync)
// callback: Callback method invoked to receive the server response (optional for sync calls)
SOAPClient.invoke = function(url, method, parameters, async, callback)
{
if(async)
SOAPClient._loadWsdl(url, method, parameters, async, callback);
else
return SOAPClient._loadWsdl(url, method, parameters, async, callback);
}
// private: wsdl cache
SOAPClient_cacheWsdl = new Array();
// private: invoke async
SOAPClient._loadWsdl = function(url, method, parameters, async, callback)
{
// load from cache?
var wsdl = SOAPClient_cacheWsdl[url];
if(wsdl + "" != "" && wsdl + "" != "undefined")
return SOAPClient._sendSoapRequest(url, method, parameters, async, callback, wsdl);
// get wsdl
var xmlHttp = SOAPClient._getXmlHttp();
xmlHttp.open("GET", url + "?wsdl", async);
xmlHttp.send(null);
if(async)
{
var timeoutTS = (new Date()).getTime() + SOAPClient.timeout;
while (true)
{
if(xmlHttp.readyState == xmlHttp.COMPLETED)
{
SOAPClient._onLoadWsdl(url, method, parameters, async, callback, xmlHttp);
break;
}
if (SOAPClient.timeout > 0)
{
if ((new Date()).getTime() > timeoutTS)
{
if(callback)
{
callback(new Error("Timeout!"), null);
break;
}
else
throw new Error("Timeout for the method '" + method + "'!");
}
}
PDTools.sleep(SOAPClient.idle);
}
}
if (!async)return SOAPClient._onLoadWsdl(url, method, parameters, async, callback, xmlHttp);
}
SOAPClient._onLoadWsdl = function(url, method, parameters, async, callback, req)
{
var wsdl = req.response;
SOAPClient_cacheWsdl[url] = wsdl; // save a copy in cache
return SOAPClient._sendSoapRequest(url, method, parameters, async, callback, wsdl);
}
SOAPClient._sendSoapRequest = function(url, method, parameters, async, callback, wsdl)
{
// get namespace
var ns = "http://xml.otris.de/ws/DOCUMENTS.xsd";
// build SOAP request
var headerSessionId = "";
if (method != "login")
headerSessionId = "<DOCUMENTS:sessionID soap:mustUnderstand=\"1\" >" + SOAPClient.sessionId + "</DOCUMENTS:sessionID>"
var sr =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope " +
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
"xmlns:DOCUMENTS=\"" + ns + "\">" +
"<soap:Header>" +
headerSessionId +
"</soap:Header>" +
"<soap:Body>" +
"<" + method + " xmlns=\"" + ns + "\">" +
parameters.toXml() +
"</" + method + "></soap:Body></soap:Envelope>";
// send request
var xmlHttp = SOAPClient._getXmlHttp();
xmlHttp.open("POST", url, async);
var soapaction = ((ns.lastIndexOf("#") != ns.length - 1) ? ns + "#" : ns) + method;
xmlHttp.addRequestHeader("SOAPAction", soapaction);
xmlHttp.addRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttp.send(sr);
if(async)
{
var timeoutTS = (new Date()).getTime() + SOAPClient.timeout;
while (true)
{
if(xmlHttp.readyState == 4)
{
SOAPClient._onSendSoapRequest(method, async, callback, wsdl, xmlHttp);
break;
}
if (SOAPClient.timeout > 0)
{
if ((new Date()).getTime() > timeoutTS)
{
if(callback)
{
callback(new Error("Timeout!"), null);
break;
}
else
throw new Error("Timeout for the method '" + method + "'!");
}
}
PDTools.sleep(SOAPClient.idle);
}
}
if (!async)
return SOAPClient._onSendSoapRequest(method, async, callback, wsdl, xmlHttp);
}
// Receive and process the server response
SOAPClient._onSendSoapRequest = function(method, async, callback, wsdl, req)
{
var o = null;
if (req.response)
{
var tagName;
if (method == "report2" || method == "report3")
tagName = "DOCUMENTS:" + method + "Respose"; // Typing error in the wsdl
else
tagName = "DOCUMENTS:" + method + "Response";
var nd = SOAPClient._getElementsByTagName(req.response, tagName);
if(nd.length == 0)
{
nd = SOAPClient._getElementsByTagName(req.response, "faultcode");
if(nd.length > 0)
{
var faultstring = SOAPClient._getElementsByTagName(req.response, "faultstring")[0].childNodes[0].nodeValue;
if(async || callback)
o = new Error(faultstring);
else
throw new Error(faultstring);
}
}
else
{
SOAPClient.sessionId = SOAPClient._getElementsByTagName(req.response, "DOCUMENTS:sessionID")[0].childNodes[0].nodeValue;
var wsdlArrTypes = SOAPClient._getArrayTypesFromWsdl(wsdl);
// Special handling for the methods report2/report3, getFilesInfo and getFileTypes,
// because these methods are specified in the wsdl different than usual.
if (method == "report3" || method == "report2")
o = SOAPClient._reportResponse2object(nd[0]);
else if (method == "getFilesInfo")
o = SOAPClient._getFilesInfoResonse2object(nd[0], wsdlArrTypes);
else if (method == "getFileTypes")
o = SOAPClient._getFileTypesResonse2object(nd[0], wsdlArrTypes);
else
o = SOAPClient._node2object(nd[0], wsdlArrTypes);
}
}
else
{
var faultstring = "Error occurred during invoking '" + method + "'.";
if(async || callback)
o = new Error(faultstring);
else
throw new Error(faultstring);
}
if(callback)
callback(o, req.response);
if(!async)
return o;
}
SOAPClient._reportResponse2object = function(resNode)
{
if(resNode.hasChildNodes())
o = new Object();
else
return null;
// hitlist
var hitlist = null;
if (resNode.firstChild.hasChildNodes())
{
hitlist = new Object();
var hitlistNode = resNode.firstChild;
hitlist["rows"] = hitlistNode.childNodes[0].childNodes[0].nodeValue;
hitlist["columns"] = hitlistNode.childNodes[1].childNodes[0].nodeValue;
var len = hitlistNode.childNodes.length;
if (hitlistNode.childNodes.length > 2)
{
var hits = new Array();
var colCount = hitlistNode.childNodes[2].childNodes.length - 1;
for (var i = 2; i < len; i++)
{
var hitData = new Object();
var columns = new Array();
for (var j = 0; j < colCount; j++)
{
if (hitlistNode.childNodes[i].childNodes[j].hasChildNodes())
columns[j] = hitlistNode.childNodes[i].childNodes[j].childNodes[0].nodeValue;
else
columns[j] = "";
}
hitData["column"] = columns;
hitData["reserved"] = hitlistNode.childNodes[i].childNodes[colCount].childNodes[0].nodeValue;
hits[i-2] = hitData;
}
hitlist["hit"] = hits;
}
}
o["hitlist"] = hitlist;
return o;
}
SOAPClient._getFilesInfoResonse2object = function(resNode, wsdlArrTypes)
{
if(resNode.hasChildNodes())
o = new Object();
else
return null;
var files = new Array();
var len = resNode.childNodes.length;
for (var i = 0; i < len; i++)
{
files[i] = SOAPClient._node2object(resNode.childNodes[i], wsdlArrTypes);
}
o["file"] = files;
return o;
}
SOAPClient._getFileTypesResonse2object = function(resNode, wsdlArrTypes)
{
if(resNode.hasChildNodes())
o = new Object();
else
return null;
var filetypes = new Array();
var len = resNode.childNodes.length;
for (var i = 0; i < len; i++)
{
filetypes[i] = SOAPClient._node2object(resNode.childNodes[i], wsdlArrTypes);
}
o["filetype"] = filetypes;
return o;
}
SOAPClient._node2object = function(node, wsdlArrTypes)
{
// null node
if(node == null)
return null;
// text node
if(node.nodeType == 3 || node.nodeType == 4)
return node.nodeValue;
// leaf node
if (node.childNodes.length == 1 && (node.childNodes[0].nodeType == 3 || node.childNodes[0].nodeType == 4))
return SOAPClient._node2object(node.childNodes[0], wsdlArrTypes);
var type = wsdlArrTypes[node.nodeName] + "";
var isarray = type != "undefined";
// object node
if(!isarray)
{
var obj = null;
if(node.hasChildNodes())
obj = new Object();
for(var i = 0; i < node.childNodes.length; i++)
{
var p = SOAPClient._node2object(node.childNodes[i], wsdlArrTypes);
obj[node.childNodes[i].nodeName] = p;
}
return obj;
}
// list node
else
{
// create node ref
var l = new Array();
for(var i = 0; i < node.childNodes.length; i++)
l[l.length] = SOAPClient._node2object(node.childNodes[i], wsdlArrTypes);
return l;
}
return null;
}
SOAPClient._getArrayTypesFromWsdl = function(wsdl)
{
var wsdlArrTypes = new Array();
var ell = SOAPClient._getElementsByTagName(wsdl, "element");
for(var i = 0; i < ell.length; i++)
{
if( ell[i].attributes.getNamedItem("name") != null
&& ell[i].attributes.getNamedItem("type") != null
&& ell[i].attributes["type"].nodeValue.toLowerCase().indexOf("list") != -1
&& ell[i].attributes["type"].nodeValue.toLowerCase().indexOf("hitlist") == -1)
{
wsdlArrTypes[ell[i].attributes["name"].nodeValue] = ell[i].attributes["type"].nodeValue;
}
}
return wsdlArrTypes;
}
// private: utils
SOAPClient._getElementsByTagName = function(document, tagName)
{
var parser = new DOMParser;
var errCode = parser.parse(document);
var doc;
if (errCode == DOMParser.ErrCatNone)
{
doc = parser.getDocument();
if (doc != null)
{
var nodeList = doc.getElementsByTagName(tagName);
return nodeList;
}
}
return null;
}
// private: xmlhttp factory
SOAPClient._getXmlHttp = function()
{
return new XMLHTTPRequest();
}


DOCUMENTS 5 - PortalScripting API: The Property Cache and enumval

The Property Cache and enumval

Since DOCUMENTS 5.0 HF1 (Caching at the FIELD)

At fields of the datatype enumeration, it is possible to define the enum values by execution of an enumeration script (runscript:scriptName).

This enumeration script has to be executed every time if the field is displayed. You can decrease the amount of executions by using a caching mechanism at the field. You can define the property ScriptEnumCache={Principal|SystemUser}[.propname] at an enumeration field to activate the cache.

Example:

Filetype-Name: Order
Field-Name: Country
Type: Enumeration
Enumeration values: runscript:getcountries
Property: ScriptEnumCache=Principal
getcountries:
enumval.push("de; de:Deutschland; en:Germany");
enumval.push("de; de:Frankreich; en:France");
enumval.push("us; USA");
return;

At the first access on the field Country the DocumentsServer checks if at propCache the property enumcache.Order.Country is defined. If not, then the Script getcountries will be executed and the enumval will automatically be stored in propCache. At the next access on a field Country the enumval will be taken from the cache instead of executing the script. To invalidate the cache you have to remove the property enumcache.Order.Country from propCache.

  • ScriptEnumCache=Principal: Usage of propCache for a principal-wide cache (for all users)
  • ScriptEnumCache=SystemUser: Usage of SystemUser.propCache for a user specific cache
  • ScriptEnumCache=Principal.myPropName: Usage of propCache.myPropName instead of propCache.enumcache.FileType.Field as property name

Since DOCUMENTS 5.0c HF2 (Caching at the PORTALSCRIPT itself)

Until DOCUMENTS 5.0c HF2 it was only possible to cache the enum values at the single field. If you use the same enumeration script at several fields, the enum values will be cached multiple times. Now it is also possible to cache the enum values at the PortalScript itself. You have to define one of the following properties at the PortalScript to activate the cache:

  • 1. ScriptEnumCache=PortalScript: Enum values will be directly stored at the script. You can clear the cache with Context.clearEnumvalCache(String scriptName)
  • 2. ScriptEnumCache=Principal: Enum values will be stored in global propCache object as property enumcache.{scriptName}
  • 3. ScriptEnumCache=SystemUser: Enum values will be stored in SystemUser.propCache object as property enumcache.{scriptName}
  • 4. ScriptEnumCache=Principal.fieldName: Enum values will be stored in global propCache object as property enumcache.{scriptName}.{fieldName} with the fieldName = context.fieldName
  • 5. ScriptEnumCache=SystemUser.fieldName: Enum values will be stored in SystemUser.propCache object as property enumcache.{scriptName}.{fieldName} with the fieldName = context.fieldName
  • 2.-4. To invalidate the cache you have to remove the property (PropertyCache.removeProperty(String name) from the global propCache or SystemUser.propCache


DOCUMENTS 5 - PortalScripting API: User DLLs

User DLLs

Die Funktionalitaet von PortalScripting kann mit Hilfe von externen DLLs (oder shared libraries unter Unix/Linux) erweitert werden.

Die DLLs koennen in JavaScript verwendet werden und lassen sich einem laufenden Server hinzufuegen, weil sie dynamisch geladen werden. Damit die DLL im PortalScripting verwendet werden kann, muss sie folgende Funktionen exportieren:

  • int J_Constructor(void **context)
    Die Funktion dient zur Vorbereitung einer DLL-Instanz. Sie wird pro Skript, in dem die DLL verwendet wird, aufgrufen. In der Implementierung dieser Funktion muss Speicher reserviert werden, der den Kontext fuer einen DLL-Aufruf enthaelt. Zum Kontext gehoeren z.B. die gesetzten Properties. Der Zeiger auf den angeforderten Speicherbereich wird in *context gespeichert. Falls die DLL keinen Kontext benoetigt, muss hier NULL hineingeschrieben werden. Falls die Initialisierung fehlschlaegt, gibt die Funktion einen Wert ungleich 0 zurueck. Da dann kein Kontext zur Verfuegung steht, muss J_Error() mit dem Wert NULL fuer den Parameter context aufgerufen werden, um aus diesem Fehlercode eine Meldung zu ermitteln.
  • const char **J_GetProperties(void *context)
    Die in dieser DLL in diesem Kontext moeglichen Properties ermitteln. Pro Property muss die zurueckgegebene Liste drei Eintraege enthalten:
    1. Name des Properties. Der Name muss ein gueltiger JavaScript-Bezeichner sein, d.h. er muss mit einem Buchstaben beginnen und darf nur Ziffern und Buchstaben enthalten. Gross- und Kleinbuchstaben werden unterschieden.
    2. Typ des Properties. Es sind folgende Typen erlaubt:
      • int: Der Wert muss eine vorzeichenbehaftete 32Bit-Zahl sein. Die Konvertierung erfolgt mit strtol, d.h. Zahlen mit fuehrender 0 werden als Oktalwerte interpretiert, Zahlen mit 0x als Hexadezimalzahlen. Wird das Property veraendert, so werden immer Dezimalwerte geschrieben.
      • float: Fliesskommazahl doppelter Genauigkeit.
      • string: 0-terminierte Zeichenkette.
      • bool: Nur die Werte true und false sind erlaubt.
      • date: Datum im Format JJJJMMTT.
      • time: Uhrzeit im Format HHMMSS.
      • timestamp: Zeitstempel im Format JJJJMMTTHHMMSS.
      Wird vor den Datentyp ein Minuszeichen - gesetzt, ist das Property nur zum Lesen freigegeben. Wird vor den Datentyp ein Pluszeichen + gesetzt, ist nur Schreiben erlaubt. Werden beide Zeichen oder keins angegeben, ist Lesen und Schreiben des Properties moeglich.
    3. Default-Wert des Properties. Wenn kein Default-Wert vergeben ist, muss hier ein leerer String angegeben werden.
    Am Ende der Liste ist ein NULL-Zeiger anzugeben. Wenn fuer die DLL keine Properties definiert werden, ist nur der NULL-Zeiger zurueckzugeben.
  • int J_GetProperty(void *context, const char *what, char *val, int *pLen)
    Diese Funktion dient zum Lesen eines Properties. Als erster Parameter ist der durch J_Constructor() bestimmte Kontext anzugeben. Zweiter Parameter ist der Name des Properties. Dritter Paramter ist ein Zeiger auf einen Speicherbereich, in den der in eine Zeichenkette konvertierte Wert geschrieben wird. Ein Zeiger auf die Laenge des Speicherbereichs wird in dem Parameter pLen uebergeben. Falls die Laenge nicht ausreicht, wird in pLen die benoetigte Laenge (inklusive 0-Bytes) geschrieben und die Funktion gibt -1 zurueck (die Funktion fordert keinen Speicher an, sondern muss dann nochmals aufgerufen werden). Der Speicher, auf den val zeigt, wird in diesem Fall nicht veraendert. Ein Rueckgabewert von 0 zeigt an, dass das Property gelesen werden konnte. Ein Rueckgabewert > 0 deutet auf einen Fehler hin, der mit J_Error() in eine Fehlermeldung gewandelt werden kann.
  • int J_SetProperty(void *context, const char *what, const char *val)
    Setzen eines Property fuer die DLL. Der Name der zu setzenden Eigenschaft ist als Zeichenkette nach dem Parameter context zu uebergeben. Der dritte Parameter ist der ebenfalls in eine Zeichenkette konvertierte Wert. Im Erfolgsfall muss diese Funktion 0 zurueckgeben. Ein Wert groesser 0 deutet auf einen Fehler hin. Werte kleiner als 0 duerfen nicht zurueckgegeben werden.
  • int J_Run(void *context, const char *param)
    Durchfuehren einer Aktion. Es muss der Kontext und ein Funktionsname/freier Parameter uebergeben werden. Im Normalfall wurde zuvor mit J_SetProperty() mindestens ein Parameter gesetzt. Die Funktion gibt 0 zurueck, wenn die Aktion erfolgreich durchgefuehrt wurde. Ein Rueckgabewert groesser 0 zeigt einen Fehler an. Durch Aufrufen von J_Error mit diesem Rueckgabewert kann ein Fehlertext ermittelt werden. Die Funktion darf keine Werte < 0 zurueckgeben.
  • const char * J_Error(void *context, const int code)
    Rueckgabe eines Fehlertextes zu code. Falls zu dem angegebenen Code keine Fehlermeldung existiert, gibt die Funktion NULL zurueck. Der zurueckgegebene Zeiger muss nicht freigegeben werden. Die Funktion wird unter Umstaenden mit NULL fuer context aufgerufen (z.B., wenn J_Constructor() fehlschlaegt). Diese Funktion ist optional, d.h. die Implementierung ist nicht erforderlich. Um eine Fehlerbehandlung zu ermoeglichen, sollte sie aber implementiert werden.
  • int J_Destructor(void *context)
    Den durch J_Constructor() erzeugten Kontext wieder freigeben. Ein Rueckgabewert groesser 0 zeigt auch hier einen Fehler an. Die Funktion wird von der JavaScript-Laufzeitumgebung (Garbage Collector) aufgerufen.

Ein Beispielprojekt (Visual Studio 2012) in C++ fuer eine solche DLL kann unter der folgenden URL heruntergeladen werden: http://ftp.otris.de/doc5/js_dll_test_VS2012.zip

Verwendung der DLL in JavaScript

In einem Skript wird einfach ein Objekt der Klasse PDExternal erzeugt. Auf die definierten Properties kann dann direkt zugegriffen werden. Zusaetzlich steht noch die Methode run(String param) zur Verfuegung.

Beispiel fuer die Anwendung:

var ext = new PDExternal("jstest"); // keine Dateiendung angeben!
ext.IntProp = 20;
ext.DateProp = new Date();
if (!ext.run("doIncrement"))
{
// Fehlerbehandlung
}
util.out(ext.IntProp); // 21
util.out(ext.DateProp); // Date of tomorrow

Im Beispiel (jstest.dll) stellt die DLL die Properties IntProp (ganze Zahl) und DateProp (Datum) zur Verfuegung. Die Methode doIncrement erhoeht die beiden Properties, die danach wieder ausgelesen werden.


DOCUMENTS 5 - PortalScripting API: Change log for the Scripting API

Change log for the Scripting API

Changes in version DOCUMENTS 5.0e HF2:

  • New method Document.reindexBlob()
  • New method Document.setDocumentName(String nameWithExt)
  • New parameter updateXML in XMLExport.addFolder(Folder folder, boolean exportStructure, var exportCondition, boolean updateXML)
  • New script-exit hide receivers for indirect forwarding
  • New script-exit hide options for indirect forwarding
  • New parameter returnType in DocFile.getFieldValue(String fieldName, String returnType)
  • New method DocFile.getDoubleSelectListValues(String fieldName, boolean resolved)
  • For a double select list field the parameter value in DocFile.setFieldValue(String fieldName, var value) may be passed as an Array of strings
  • Script-Exit after login has new property Context.currentUser
  • Script-Exit after login with single sign on has new property Context.currentUser
  • ScriptCall.setRunAsEnumScript(boolean runAsEnumScript)
  • ScriptCall.isFinished()

Changes in version DOCUMENTS 5.0e:

  • New method XMLExport.addFileTypesFromCategory(String categoryName)
  • New method XMLExport.addFileTypesFromFolder(String folderName)
  • New method Util.hash(String filePath, String hashfunction)
  • New method Document.hash(String hashfunction, String version)
  • New classes for creating Excel files:
    • XLSXWriter
    • XLSXWorksheet
    • XLSXChartsheet
    • XLSXFormat
    • XLSXChart
    • XLSXChartSeries
    • XLSXChartAxis
  • New method Context.reloadPrincipal(String principalName, boolean pemReload)
  • New method Context.reloadCurrentPrincipal(boolean pemReload)
  • New method Context.getDocumentById(String idFile, String idDocument)
  • XMLHTTPRequest supports PATCH request.
  • New method DocFile.setReferenceFile(String fieldName, DocFile referenceFile)
  • New method Context.writeLogBook(int actionCode, String detail1, String detail2, String detail3)
  • New search operator ">~" (has line) in FileResultset filter expressions.
  • New method Util.convertDateToExcelDate(Date timeStamp)
  • New parameter easDeleteMode in DocFile.deleteFile(boolean moveTrash, boolean movePool, boolean allVersions, integer easDeleteMode)
  • New script-exit available blobs in email
  • New property Document.id

Changes in version DOCUMENTS 5.0d:

  • New method Register.removeFileLink(DocFile file)
  • New method Register.addFileLink(DocFile file)
  • New method XMLExport.addCustomProperty(String propName)
  • New method AccessProfile.setParentProfile(AccessProfile parentProfile)
  • New method HitResultset.getHitIds(boolean withServer)
  • New method Context.enableModules(Object root)
  • New script-exit on connecting file to inbox
  • New directive #import cached - experimental
  • New directive require()- experimental
  • New property Context.folder
  • New property Folder.systemUser
  • New method ScriptCall.setFolder(Folder folder)
  • FileResultset is now a iterable object and supports for..of loops
  • ArchiveFileResultset is now a iterable object and supports for..of loops
  • HitResultset is now a iterable object and supports for..of loops

Changes in version DOCUMENTS 5.0c HF2:

  • New parameters includeLockedUsers and includeInvisibleUsers for the method AccessProfile.getSystemUsers(boolean includeLockedUsers, boolean includeInvisibleUsers)
  • New method Util.makeGACLValue(var val1, var val2, ...)
  • New method SystemUser.setAccessProfiles(var apNames1, var apNames2, ...)
  • New method Context.hasPEMModule(Integer moduleConst)
  • New method DocFile.asJSON(string[] fieldList) and DocFile.fromJSON(String jsonstring)

Changes in version DOCUMENTS 5.0c HF1:

  • Context.createFile() now supports direct creation of a file for EDA/EAS and EBIS stores
  • DBResultSet.getString() now supports SQL_GUID data type
  • New method Context.doMaintenance(String operationName)
  • New method Register.getLocaleLabel(String locale)
  • New method Context.getLocaleValue(String value, String locale)
  • New method Document.getRegister()
  • New method Register.getFile()

Changes in version DOCUMENTS 5.0c:

  • XMLHTTPRequest extension for binary content and file transfers
  • XMLHTTPRequest supports system proxy configuration on windows
  • XMLHTTPRequest supports additional to Basic now Digest & NTLM authentification
  • New method SystemUser.getAllFolders()
  • New method DocFile.getTitle(String locale)
  • New method DocFile.getid()
  • New method DocFile.getCreator(bool asObject)
  • New method DocFile.getLastModifier()
  • New method DocFile.getCreationDate()
  • New method DocFile.getLastModificationDate()
  • New Script-Exit on DOCUMENTS settings decrease search stores
  • New parameter withBlobInfo for the method HitResultset.HitResultset(Var searchResources, String filter, String sortOrder, Var hitlist, Integer pageSize, Boolean unlimitedHits, Boolean withBlobInfo)
  • New method DocHit.getBlobInfo()
  • New method FileResultset.getIds()
  • New parameter checkAccessRight for the method DocFile.getRegisters(String type, boolean checkAccessRight)
  • New parameter checkAccessRight for the method DocFile.getRegisterByName(String registerName, boolean checkAccessRight)
  • New method DocFile.getFieldAutoText(String fieldName, String autoText)
  • New Script-Exit on DOCUMENTS settings decrease search file types

Changes in version DOCUMENTS 5.0b:

  • New method Folder.getFilterFileTypes()
  • New method Util.hmac(String hashfunction, String key, String message, Boolean rawOutput)
  • New method Util.sha256(String message)
  • New method SystemUser.getAccess(DocFile docFile)
  • New parameter updateModifiedDate for the method DocFile.sync(Boolean checkHistoryFields, bool notifyHitlistChange, bool updateRefFields, bool updateModifiedDate)
  • New method Util.encryptString(String input)
  • New method Util.decryptString(String input)
  • New method DocFile.getAllWorkflowSteps()

Changes in version DOCUMENTS 5.0a:

  • New method SystemUser.addFileTypeAgent(var fileTypes, Array loginNames)
  • New method SystemUser.addFileTypeAgentScript(var fileTypes, String scriptName)
  • New method SystemUser.removeFileTypeAgent(var fileTypes)
  • New method SystemUser.listFileTypeAgents(String fileType)
  • New method SystemUser.listAgentFileTypes()
  • New parameters (from and until) for the method SystemUser.setAbsent(Boolean absent, Boolean filesDueAbsenceToInfo, Array agents, Boolean removeFromAgentInbox, Date from, Date until)
  • New method SystemUser.notifyNewFileInInbox(Boolean notifying)
  • New method SystemUser.notifyFileReturnedFromSending(Boolean notifying)
  • New Script-Exit allowedMailTemplatesScript on filetype
  • New Script-Exit allowedPrintTemplatesScript on filetype
  • New Script-Exit allowedDocumentTemplatesScript on register and filetype
  • New property SystemUser.email
  • New formats for Util.convertDateToString(Date dateOrTimeStamp, String format)
  • New formats for Util.convertStringToDate(String dateOrTimeStamp, String format)
  • New parameter (updateRefFields) for the method DocFile.sync(Boolean checkHistoryFields, bool notifyHitlistChange, bool updateRefFields)
  • New method Util.sleep(Integer duration)
  • New method Util.encodeUrlCompatible(String param)
  • New method Util.decodeUrlCompatible(String encodedParam)
  • Class XMLServer was renamed to ArchiveConnection, because the class provides also access to EAS and EBIS archive interface
  • New method ArchiveConnection.sendEbisRequest(String resourceIdentifier, String postData, Array() extraHeaders)
  • Class XMLServerBlob was renamed to ArchiveConnectionBlob
  • Class XMLServerBlobIterator was renamed to ArchiveConnectionBlobIterator
  • Method Context.getXMLServer(String archiveServerName) declared as deprecated
  • New method Context.getArchiveConnection(String archiveServerName)
  • New Method Context.getArchiveServer(String name)
  • New Method Context.getArchiveServers()
  • New class ArchiveServer
  • New method ArchiveServer.getArchiveConnection()
  • New Method Context.getFolderPosition(Folder folder)
  • New Method Context.setFolderPosition(Folder folder, int position)

Changes in version DOCUMENTS 5.0 HF2:

  • New method XMLExport.addSystemUser(var systemUser, bool includePrivateFolders)
  • New method XMLExport.addPartnerAccount(var userAccount, bool includePrivateFolders)
  • Fields in a DocHit are now accessible as properties, just like in DocFiles.

Changes in version DOCUMENTS 5.0 HF1:

  • Changed method XMLExport.addPortalScript(String scriptName, String format) for format 4.0 / 5.0
  • Changed method XMLExport.addPortalScriptsFromCategory(String nameCategory, String format) for format 4.0 / 5.0

Changes in version DOCUMENTS 5.0:

  • E4X was removed
  • New property SystemUser.propCache
  • New property AccessProfile.propCache
  • New method Context.findCustomProperties(String filter)
  • New method Context.getCustomProperties(String nameFilter, String typeFilter)
  • New method Context.setOrAddCustomProperty(String name, String type, String value)
  • New method Context.addCustomProperty(String name, String type, String value)
  • New method AccessProfile.getCustomProperties(String nameFilter, String typeFilter)
  • New method AccessProfile.setOrAddCustomProperty(String name, String type, String value)
  • New method AccessProfile.addCustomProperty(String name, String type, String value)
  • New method CustomProperty.getSubProperties(String nameFilter, String typeFilter)
  • New method CustomProperty.setOrAddSubProperty(String name, String type, String value)
  • New method CustomProperty.addSubProperty(String name, String type, String value)
  • New method CustomProperty.setFiletype(String nameFiletype)
  • New method CustomProperty.setSystemUser(String login)
  • New method CustomProperty.setAccessProfile(String nameAccessProfile)
  • New method DocFile.sendFileAdHoc(Array receivers, String sendMode, String task, Boolean backWhenFinished)
  • New method ScriptCall.addParameter(String name, String value)
  • New method ScriptCall.getReturnValue()
  • New method Context.getFileTypeOID(String nameFiletype, Boolean oidLow)
  • New method Context.getClientType()
  • New method DBResultSet.getNumCols()
  • New method DBResultSet.getColName(int colNo)
  • New method DocFile.changeFiletype(String nameFiletype)
  • New method XMLExport.addDocumentsSettings()
  • Script-Exit decreaseFieldRightOnFileViewScript: New property Context.register
  • New method XMLExport.addSystemUser(var systemUser, bool includePrivateFolders)
  • New method XMLExport.addPartnerAccount(var userAccount, bool includePrivateFolders)

Changes in version DOCUMENTS 4.0d (HF1):

  • New option for hitlist parameter of the method HitResultset.HitResultset(Var searchResources, String filter, String sortOrder, Var hitlist, Integer pageSize, Boolean unlimitedHits):
    An array of field names instead of a hitlist name to specify the available columns in the resultset
  • New method ScriptCall.addParameter(String name, String value)
  • New method ScriptCall.getReturnValue()
  • New method Context.getFileTypeOID(String nameFiletype, Boolean oidLow)
  • New method Context.getCustomProperties(String nameFilter, String typeFilter)
  • New method Context.findCustomProperties(String filter)
  • New method Context.setOrAddCustomProperty(String name, String type, String value)
  • New method Context.addCustomProperty(String name, String type, String value)
  • New method AccessProfile.getCustomProperties(String nameFilter, String typeFilter)
  • New method AccessProfile.setOrAddCustomProperty(String name, String type, String value)
  • New method AccessProfile.addCustomProperty(String name, String type, String value)
  • New method CustomProperty.getSubProperties(String nameFilter, String typeFilter)
  • New method CustomProperty.setOrAddSubProperty(String name, String type, String value)
  • New method CustomProperty.addSubProperty(String name, String type, String value)
  • New method CustomProperty.setSystemUser(String login)
  • New method CustomProperty.setAccessProfile(String nameAccessProfile)
  • New method CustomProperty.setFiletype(String nameFiletype)
  • New method DocFile.sendFileAdHoc(Array receivers, String sendMode, String task, Boolean backWhenFinished)
  • New property SystemUser.propCache and AccessProfile.propCache for user dependent or access profile dependent property caches
  • New parameter oidLow for the method SystemUser.getOID(Boolean oidLow)
  • New parameter oidLow for the method AccessProfile.getOID(Boolean oidLow)
  • New parameter oidLow for the method DocFile.getOID(Boolean oidLow)
  • New parameter oidLow for the method Register.getOID(Boolean oidLow)
  • New parameter oidLow for the method Document.getOID(Boolean oidLow)
  • New parameter oidLow for the method WorkflowStep.getOID(Boolean oidLow)
  • New parameter oidLow for the method Folder.getOID(Boolean oidLow)
  • New parameter oidLow for the method UserAction.getOID(Boolean oidLow)

Changes in version DOCUMENTS 4.0d:

  • New method SystemUser.getUserdefinedInboxFolders()
  • New method SystemUser.getIndividualFolders()
  • New method DocFile.disconnectArchivedFile()
  • New parameter bcc for the method DocFile.sendMail(String from, String templateName, String to, String cc, Boolean addDocs, String bcc)
  • New method DocFile.hasField(String fieldName)
  • New method Folder.getActionByName(String actionName)
  • New class UserAction
  • New parameter version for the method Document.downloadDocument(String filePath, String version)
  • New method Document.uploadDocument(String sourceFilePath, Boolean versioning)
  • New method XMLExport.addOutbar(String outbarName)
  • New class Email
  • New method SystemUser.getBackDelegatedFiles(Boolean removeFromAgentInbox)
  • New class ScriptCall
  • New variant of the Script-Exit "onDelete" for archived files ("onDeleteAll").
  • Added fixed formats for dates and numbers in filter expressions
  • New property DOMDocument.documentElement
  • New script exits "OnSearch" and "FillSearchMask"
  • New script exits "OnSearch" and "FillSearchMask"
  • New classes DocQueryParams, RetrievalSource and RetrievalField
  • New Script-Exit "afterSetReferenceFieldScript" for reference fields.

Changes in version DOCUMENTS 4.0c (HF2):

  • New documentation for the class XMLHTTPRequest
  • Changed method DocFile.setFieldValue(String fieldName, var value) for multi-instance fields of an EE.i/EE.x archive file
  • Changed method DocFile.getFieldValue(String fieldName) for multi-instance fields of an EE.i/EE.x archive file
  • New method DocFile.countFields(String fieldName)
  • New parameter in XMLExport.addFellow(var editor, bool includePrivateFolders)

Changes in version DOCUMENTS 4.0c (HF1):

  • New method DocFile.getUserStatus(String login)
  • New method Context.convertDateToString(Date dateOrTimeStamp, String locale)
  • New method Util.base64Decode(String value, bool returnArray)
  • New method Util.base64Encode(var value, bool returnArray)

Changes in version DOCUMENTS 4.0c:

  • New XML-parser DOMParser
    See also
    XML-DOM Example
  • XML-parser E4X is now deprecated and will be removed in future versions!

  • New example SOAP Client using DOM

  • New script-exit hide register in file view
  • New method Util.getFileContentAsString(String filePath)
  • New method Util.concatPDF(Array pdfFilePaths, Boolean deleteSinglePdfs)
  • New method Util.generateChecksum(String input)
  • New method WorkflowStep.setNewExecutiveGroup(String accessProfileName)
  • New property WorkflowStep.executiveGroup
  • New method Document.getAsPDF()

  • New method Document.moveToRegister(Register regObj)

  • Overview about Field Access Methods
  • New method DocFile.getFieldValue(String fieldName)

  • New method DocFile.setFieldValue(String fieldName, var value)

  • Extensions to XMLExport

    • New class XMLExportDescription
    • New method XMLExport.addPortalScript(String scriptName, String format)
    • New method XMLExport.addFileType(String fileTypeName)
    • New method XMLExport.addFolder(Folder folder, Boolean exportStructure, var exportCondition)
    • New method XMLExport.addWorkflow(String workflowName)
    • New method XMLExport.addDistributionList(String distributionListName)
    • New method XMLExport.addFellow(var editor)
    • New method XMLExport.addFilingPlan(String filingPlanName)
    • New method XMLExport.addAccessProfile(var accessProfile)
    • New method XMLExport.addAlias(String aliasName)

  • Extensions to Folder
    • New method Context.createFolder(String name, String type)
    • New method Folder.addAccessProfile(String accessProfileName, Boolean allowInsertFiles, Boolean allowRemoveFiles)
    • New method Folder.removeAccessProfile(String accessProfileName)
    • New method Folder.addFilterEDAServer(String serverName)
    • New method Folder.removeFilterEDAServer(String serverName)
    • New method Folder.addFilterEEiArchive(String archiveKey)
    • New method Folder.removeFilterEEiArchive(String archiveKey)
    • New method Folder.addFilterEExView(String viewKey)
    • New method Folder.removeFilterEExView(String viewKey)
    • New method Folder.addFilterFileType(String fileType)
    • New method Folder.removeFilterFileType(String fileType)
    • New method Folder.addSystemUser(String loginName, Boolean allowInsertFiles, Boolean allowRemoveFiles)
    • New method Folder.removeSystemUser(String loginName)
    • New method Folder.createSubFolder(String name, String type)
    • New method Folder.deleteFolder()
    • New method Folder.getPosition(Folder subFolder)
    • New method Folder.setPosition(Folder subFolder, int position)
    • New method Folder.setAllowedActionScript(String scriptName)
    • New method Folder.setParentFolder(Folder parentFolder)
    • New property Folder.allowArchive
    • New property Folder.allowCopyTo
    • New property Folder.allowCreatePDF
    • New property Folder.allowDelete
    • New property Folder.allowExport
    • New property Folder.allowForward
    • New property Folder.allowMoveTo
    • New property Folder.filterExpression
    • New property Folder.filterStyle
    • New property Folder.icon
    • New property Folder.invisible
    • New property Folder.released
    • New property Folder.sortColumn
    • New property Folder.sortDescending
    • New property Folder.sortFieldName

Changes in version DOCUMENTS 4.0b (HF2):

  • New method Folder.getLocaleLabel(String locale)
  • New example SOAP Client with E4X (removed since 5.0)

Changes in version DOCUMENTS 4.0b (HF1):

  • Changed method SystemUser.addToAccessProfile(AccessProfile ap)
  • Changed method SystemUser.removeFromAccessProfile(AccessProfile ap)
  • New property Context.selectedDocuments

Changes in version DOCUMENTS 4.0b:

  • New classes HitResultset and DocHit
  • New method Util.getQuoted(String input)
  • New method DocFile.getAsPDF(String nameCoverTemplate, Boolean createCover, Array sourceRegisterNames)
  • New method Register.getFiles()

Changes in version DOCUMENTS 4.0a (HF2):

  • New method DocFile.createMonitorFile(Boolean asPdf, String locale)
  • New method DocFile.createStatusFile(Boolean asPdf, String locale)

Changes in version DOCUMENTS 4.0a (HF1):

  • New method Util.length_u(String value)
  • New method Util.substr_u(String value, int startIndex, int length)

Changes in version DOCUMENTS 4.0a:

  • New class CustomProperty
  • New class CustomPropertyIterator
  • New method SystemUser.getCustomProperties()
  • New method SystemUser.setOrAddCustomProperty()
  • New method SystemUser.addCustomProperty()

Changes in version DOCUMENTS 4.0 (HF1):

  • New method SystemUser.invalidateAccessProfileCache()

Changes in version DOCUMENTS 4.0:

  • Changed method Context.getXMLServer(String archiveServerName)
  • Changed method DocFile.archive()
  • Changed method DocFile.archive(String archiveKey)
  • Changed method DocFile.getOriginal()
  • New method DBConnection.executeQueryUC(String sqlStatement)
  • New method DBResultSet.getUCString(int colNo)
  • New class PropertyCache

Changes in version 3.60j / otrisPORTAL 6.0j:

  • New property Context.selectedArchiveFiles
  • New property Context.selectedArchiveKeys
  • New method WorkflowStep.retry(String comment)
  • New method FileResultset.last()
  • New method ArchiveFileResultset.last()

Changes in version 3.60i / otrisPORTAL 6.0i:

  • New method Context.createAccessProfile(String profileName)
  • Method AccessProfile.new(String profileName) is now deprecated
  • New method DocFile.reactivate()
  • Introduction of PortalScripting for archive files (DocFile, Register, Document)
  • New class ArchiveFileResultset
  • New method DocFile.isArchiveFile()
  • New method Context.getXMLServer()
  • New class XMLServer
  • New class XMLServerBlob
  • New class XMLServerBlobIterator

Changes in version 3.60g / otrisPORTAL 6.0g:

  • New method Context.extProcess(String cmd)
  • New method SystemUser.setAbsent(Boolean absent, Boolean filesDueAbsenceToInfo, Array agents)
  • New method SystemUser.setAbsentMail(Boolean sendMail, String message)
  • New method SystemUser.delegateFilesOfAbsentUser()
  • New method SystemUser.getAgents()

Changes in version 3.60f / otrisPORTAL 6.0f:

  • New method Context.createFellow(String loginName, Boolean isDlcUser, String licenseType)

Changes in version 3.60e / otrisPORTAL 6.0e:

  • New method Util.makeFullDir(String dirPath)
  • New method Util.getDir(String dirname, Array files, Array subDirs)
  • New method Util.fileSize(String filePath)
  • New method Util.fileCopy(String sourceFilePath, String targetFilePath)
  • New method Util.fileMove(String sourceFilePath, String targetFilePath)
  • New method Util.deleteFile(String filePath)
  • New method Util.beep(int frequency, int duration)
  • New method Util.getEnvironment(String variableName)
  • New method Util.makeHTML(String val, Boolean isUTF8)
  • New method DocFile.isDeletedFile()
  • New method DocFile.undeleteFile()

Changes in version 3.60d / otrisPORTAL 6.0d:

  • New method Util.transcode(String nameSourceEncoding, String text, String nameTargetEncoding)
  • New method WorkflowStep.getWorkflowName()
  • New method WorkflowStep.getWorkflowVersion()
  • New method SystemUser.checkPassword(String passwd)
  • New method Register.deleteDocument(Document doc)


DOCUMENTS 5 - PortalScripting API: Generating header/footer in Excel

Generating header/footer in Excel

Page headers/footers in Excel are generated using a string which is a combination of plain text and control characters.

The available control characters are:

Control | Category | Description
&L | Justification | Left
&C |  | Center
&R |  | Right
&P | Information | Page number
&N |  | Total number of pages
&D |  | Date
&T |  | Time
&F |  | File name
&A |  | Worksheet name
&Z |  | Workbook path
&fontsize | Font | Font size
&"font,style" |  | Font name and style
&U |  | Single underline
&E |  | Double underline
&S |  | Strikethrough
&X |  | Superscript
&Y |  | Subscript

Text in headers and footers can be justified (aligned) to the left, center and right by prefixing the text with the control characters &L, &C and &R.

For example (with ASCII art representation of the results):

worksheet1.setHeader("&LHello");
// ---------------------------------------------------------------
// | |
// | Hello |
// | |

For simple text, if you do not specify any justification the text will be centered. However, you must prefix the text with &C if you specify a font name or any other formatting:

You can have text in each of the justification regions:

worksheet1.setHeader("&LCiao&CBello&RCielo");
// ---------------------------------------------------------------
// | |
// | Ciao Bello Cielo |
// | |

The information control characters act as variables that Excel will update as the Excel file or worksheet changes. Times and dates are in the users default format:

worksheet1.setHeader("&CPage &P of &N");
// ---------------------------------------------------------------
// | |
// | Page 1 of 6 |
// | |
worksheet1.setHeader("&CUpdated at &T");
// ---------------------------------------------------------------
// | |
// | Updated at 12:30 PM |
// | |

You can specify the font size of a section of the text by prefixing it with the control character &n where n is the font size:

worksheet1.setHeader("&C&30Hello Big");
worksheet2.setHeader("&C&10Hello Small");

You can specify the font of a section of the text by prefixing it with the control sequence &"font,style" where font is a font name such as "Courier New" or "Times New Roman" and style is one of the standard Windows font styles: "Regular", "Italic", "Bold" or "Bold Italic".

worksheet1.setHeader("&C&\"Courier New,Italic\"Hello");
worksheet2.setHeader("&C&\"Courier New,Bold Italic\"Hello");
worksheet3.setHeader("&C&\"Times New Roman,Regular\"Hello");

To include a single literal ampersand & in a header or footer you should use a double ampersand &&:

worksheet1.setHeader("&CCuriouser && Curiouser - Attorneys at Law");

Note:

The header or footer string must be less than 255 characters. Strings longer than this will not be written.


DOCUMENTS 5 - PortalScripting API: Deprecated List

Deprecated List
Member AccessProfile::AccessProfile (String nameAccessProfile)
since ELC 3.60i / otrisPORTAL 6.0i use Context.createAccessProfile() instead
Member Context::getXMLServer (String archiveServerName="")
since DOCUMENTS 5.0a - Use Context.getArchiveConnection(String archiveServerName) instead
Member Context::setClientSystemLang (int langIndex)
since DOCUMENTS 4.0c use setClientLang(String locale) instead
Member DBConnection::executeQueryUC (String sqlStatement)
since DOCUMENTS 4.0a HF2, use DBConnection.executeQuery() instead
Member DBConnection::executeStatementUC (String sqlStatement)
since DOCUMENTS 4.0a HF2, use DBConnection.executeStatement() instead
Member DBResultSet::getUCString (int colNo)
since DOCUMENTS 4.0a HF2 use DBResultSet.getString() instead
Class E4X
XMLParser E4X is deprecated since DOCUMENTS 4.0c and was removed in DOCUMENTS 5.0.


DOCUMENTS 5 - PortalScripting API: Class List

Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
C AccessProfile | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means
C AccessProfileIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means
C ArchiveConnection | Allows low level access to the EAS Interface, EBIS and the EASY ENTERPRISE XML-Server
C ArchiveConnectionBlob | Access to each single attachment of files in the archive
C ArchiveConnectionBlobIterator | Iterator that holds a list of objects of the class ArchiveConnectionBlob
C ArchiveFileResultset | Supports basic functions to loop through a list of ArchiveFile objects
C ArchiveServer | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS ArchiveServer by scripting means
C ArchiveServerIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS ArchiveSerevrby scripting means
C ArchivingDescription | Has been added to the DOCUMENTS PortalScripting API to improve the archiving process of DOCUMENTS files by scripting means
C Context | Basic anchor for the most important attributes and methods to customize DOCUMENTS through PortalScripting
C ControlFlow | Has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means
C ControlFlowIterator | Has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means
C CustomProperty | Access to the user properties
C CustomPropertyIterator | Iterator that holds a list of objects of the class CustomProperty
C DBConnection | This class enables you to connect to a database and execute SQL statements
C DBResultSet | List of resultset rows
C DocFile | Implements the file object of DOCUMENTS
C DocFileDataField | The JS_DocFileDataField class represents the special comment field at the DocFile
C DocHit | Presents the hit object collected by a HitResultset
C DocQueryParams | This class encapsulates the basic parameters of a Documents search request
C Document | Has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means
C DocumentIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means
C DOMAttr | This class models a single attribute of a DOMElement
C DOMCharacterData | DOMCharacterData represents text-like nodes in the DOM tree
C DOMDocument | The DOMDocument is the root of a DOM tree
C DOMElement | An object of this class represents a HTML or XML element in the DOM
C DOMException | Many of the DOM API functions throw a DOMException, when an error has occurred
C DOMNamedNodeMap | A DOMNamedNodeMap is a kind of index for a set of DOMNodes, in which each node has got a unique name
C DOMNode | DOMNode is the base class of all tree elements in a DOMDocument
C DOMNodeList | A dynamic, ordered list of DOMNodes
C DOMParser | This class provides basic methods to parse or synthesize XML documents using the Document Object Model (DOM)
C E4X |
C Email | Allows to create and send an email
C File | Allows full access to files stored on the Portal Server's filesystem
C FileResultset | Supports basic functions to loop through a list of DocFile objects
C Folder | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS folders by scripting means
C FolderIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS folders by scripting means
C HitResultset | Allows comprehensive search operations in Documents and in connected archives
C PropertyCache | Util class that allows it to store / cache data over the end of the run time of a script
C Register | Has been added to the DOCUMENTS PortalScripting API to gain full access to the registers of a DOCUMENTS file by scripting means
C RegisterIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the registers of a DOCUMENTS file by scripting means
C RetrievalField | This class represents one search field or one conditon within a DOCUMENTS search request
C RetrievalSource | This class describes a searchable resource in the DOCUMENTS retrieval system
C ScriptCall | This class allows asynchronous calling a script from another script
C SystemUser | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS users by scripting means
C SystemUserIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS users by scripting means
C UserAction | User-defined action of DOCUMENTS
C Util | Supports some functions that do not need any user or file context
C WorkflowStep | Allows access to the according object type of DOCUMENTS
C WorkflowStepIterator | Has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means
C XLSXChart | Allows creating an Excel chart
C XLSXChartAxis | Excel chart axis
C XLSXChartSeries | Excel chart data series
C XLSXChartsheet | Excel chartsheet
C XLSXFormat | Allows formatting cells in Excel
C XLSXWorksheet | Excel worksheet
C XLSXWriter | Allows creating files in the Excel 2007+ XLSX file format by use of the library Libxlsxwriter
C XMLExport | Allows to export DOCUMENTS elements as an XML file by scripting means
C XMLExportDescription | Has been added to the DOCUMENTS PortalScripting API to improve the XML Export process of DOCUMENTS files by scripting means
C XMLHTTPRequest | HTTP request


DOCUMENTS 5 - PortalScripting API: AccessProfile Class Reference

Public Member Functions | Public Attributes | List of all members
AccessProfile Class Reference

The AccessProfile class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means. More...

Public Member Functions

AccessProfile | AccessProfile (String nameAccessProfile)
With the new method is it possible to create a new AccessProfile. More...
CustomProperty | addCustomProperty (String name, String type, String value)
Creates a new CustomProperty for the AccessProfile. More...
String | getAttribute (String attribute)
Get the String value of an attribute of the AccessProfile. More...
CustomPropertyIterator | getCustomProperties (String nameFilter="", String typeFilter="")
Get a CustomPropertyIterator with custom properties of the current AccessProfile. More...
String | getLastError ()
If you call a method at an AccessProfile object and an error occurred, you can get the error description with this function. More...
String | getOID (boolean oidLow=false)
Returns the object-id. More...
SystemUserIterator | getSystemUsers (boolean includeLockedUsers=true, boolean includeInvisibleUsers=true)
Retrieve a list of desired SystemUser which are assigned to the current AccessProfile. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the AccessProfile to the desired value. More...
CustomProperty | setOrAddCustomProperty (String name, String type, String value)
Creates a new CustomProperty or modifies a CustomProperty according the name and type for the AccessProfile. More...
boolean | setParentProfile (AccessProfile parentProfile)
Set the parent profile of the current profile. More...

Public Attributes

String name
The technical name of the AccessProfile. More...
PropertyCache propCache
Access to the property cache of the AccessProfile. More...

Detailed Description

The AccessProfile class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means.

A SystemUser can be assigned to an AccessProfile. At the filetype it is possible to define several rights depending on the AccessProfile. You can get an AccessProfile object by different methods like Context.findAccessProfile(String ProfileName) or from the AccessProfileIterator.

Since
ELC 3.50b / otrisPORTAL 5.0b

Constructor & Destructor Documentation

◆ AccessProfile()

AccessProfile AccessProfile::AccessProfile ( String nameAccessProfile )

With the new method is it possible to create a new AccessProfile.

If an access profile with the profile name already exist, the method return the existing access profile.

Returns
The new created AccessProfile object. If the creation fails, the method returns NULL.
Example:
var newAP = new AccessProfile("supportteam");
if (!newAP)
util.out("Creation of AccessProfile failed.");
Since
ELC 3.50b / otrisPORTAL 5.0b
Deprecated:
since ELC 3.60i / otrisPORTAL 6.0i use Context.createAccessProfile() instead

Member Function Documentation

◆ addCustomProperty()

CustomProperty AccessProfile::addCustomProperty | ( | String | name,
 |  | String | type,
 |  | String | value
 | ) |  |

Creates a new CustomProperty for the AccessProfile.

Parameters
name | String value defining the name
type | String value defining the type
value | String value defining the value
Returns
CustomProperty
Since
DOCUMENTS 5.0
Example:
var office = context.findAccessProfile("office");
if (!office) throw "office is null";
var custProp = office.addCustomProperty("favorites", "string", "peachit");
if (!custProp)
util.out(office.getLastError());
See also
AccessProfile.setOrAddCustomProperty(String name, String type, String value)
AccessProfile.getCustomProperties(String nameFilter, String typeFilter)

◆ getAttribute()

String AccessProfile::getAttribute ( String attribute )

Get the String value of an attribute of the AccessProfile.

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Note
This function is only for experts. Knowledge about the ELC-database schema is necessary!
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ getCustomProperties()

CustomPropertyIterator AccessProfile::getCustomProperties | ( | String | nameFilter = "",
 |  | String | typeFilter = ""
 | ) |  |

Get a CustomPropertyIterator with custom properties of the current AccessProfile.

Parameters
nameFilter | String value defining an optional filter depending on the name
typeFilter | String value defining an optional filter depending on the type
Returns
CustomPropertyIterator
Since
DOCUMENTS 5.0
Example:
var office = context.findAccessProfile("office");
if (!office) throw "office is null";
var itProp = office.getCustomProperties();
for (var prop = itProp.first(); prop; prop = itProp.next())
{
util.out(prop.name + ": " + prop.value);
}
See also
Context.findCustomProperties(String filter)
AccessProfile.setOrAddCustomProperty(String name, String type, String value)
AccessProfile.addCustomProperty(String name, String type, String value)

◆ getLastError()

String AccessProfile::getLastError ( )

If you call a method at an AccessProfile object and an error occurred, you can get the error description with this function.

Returns
Text of the last error as String
Since
ELC 3.50b / otrisPORTAL 5.0b
See also
DocFile.getLastError()

◆ getOID()

String AccessProfile::getOID ( boolean oidLow = false )

Returns the object-id.

Parameters
oidLow Optional flag:
If true only the id of the AccessProfile object (m_oid) will be returned.
If false the id of the AccessProfile 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
Since
ELC 3.60c / otrisPORTAL 6.0c
DOCUMENTS 5.0 (new parameter oidLow)

◆ getSystemUsers()

SystemUserIterator AccessProfile::getSystemUsers | ( | boolean | includeLockedUsers = true,
 |  | boolean | includeInvisibleUsers = true
 | ) |  |

Retrieve a list of desired SystemUser which are assigned to the current AccessProfile.

Parameters
includeLockedUsers | Optional flag indicating whether locked users also should be returned. The default value is true.
includeInvisibleUsers | Optional flag indicating whether the method also should return users for which the option "Display user in DOCUMENTS lists" in the Documents Manager is not checkmarked. The default value is true.
Returns
SystemUserIterator containing a list of SystemUser
Example:
var ap = context.findAccessProfile("supportteam");
if (ap)
{
var itSU = ap.getSystemUsers();
for (var su = itSU.first(); su; su = itSU.next())
util.out(su.login);
}
else
util.out("AccessProfile does not exist.");
Since
ELC 3.51e / otrisPORTAL 5.1e
DOCUMENTS 5.0c HF2 (new parameters includeLockedUsers and includeInvisibleUsers)

◆ setAttribute()

boolean AccessProfile::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the AccessProfile to the desired value.

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Note
This function is only for experts. Knowledge about the ELC-database schema is necessary!
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ setOrAddCustomProperty()

CustomProperty AccessProfile::setOrAddCustomProperty | ( | String | name,
 |  | String | type,
 |  | String | value
 | ) |  |

Creates a new CustomProperty or modifies a CustomProperty according the name and type for the AccessProfile.

This method creates or modifies a unique CustomProperty for the AccessProfile. The combination of the name and the type make the CustomProperty unique for the AccessProfile.

Parameters
name | String value defining the name
type | String value defining the type
value | String value defining the value
Returns
CustomProperty
Since
DOCUMENTS 5.0
Example:
var office = context.findAccessProfile("office");
if (!office) throw "office is null";
var custProp = office.setOrAddCustomProperty("favorites", "string", "peachit");
if (!custProp)
util.out(office.getLastError());
See also
AccessProfile.getCustomProperties(String nameFilter, String typeFilter)
AccessProfile.addCustomProperty(String name, String type, String value)

◆ setParentProfile()

boolean AccessProfile::setParentProfile ( AccessProfile parentProfile )

Set the parent profile of the current profile.

Parameters
parentProfile optional AccessProfile object being the parent profile of the current profile. If no parent profile is defined, the current profile will be moved to the top level.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0d
Example:
var parentProfile = context.createAccessProfile("parentProfile");
if (parentProfile)
{
var subProfile = context.createAccessProfile("subProfile");
if (subProfile)
{
var success = subProfile.setParentProfile(parentProfile);
if (!success)
util.out(subProfile.getLastError());
// We can move subProfile to the top level as follows:
success = subProfile.setParentProfile();
}
}

Member Data Documentation

◆ name

String AccessProfile::name

The technical name of the AccessProfile.

Returns
String containing the technical name of the AccessProfile.
Since
ELC 3.50b / otrisPORTAL 5.0b
Example:
var su = context.getSystemUser(); // current user
if (su)
{
var apIter = su.getAccessProfiles();
for (var ap = apIter.first(); ap; ap = apIter.next())
{
util.out(ap.name);
}
}

◆ propCache

PropertyCache AccessProfile::propCache

Access to the property cache of the AccessProfile.

Returns
PropertyCache object of the AccessProfile.
Example:
var ap = context.findAccessProfile("Everybody");
if (!ap.propCache.hasProperty("Contacts"))
{
util.out("Creating cache");
ap.propCache.Contacts = ["Peter", "Paul", "Marry"];
}
Since
DOCUMENTS 5.0
See also
PropertyCache, SystemUser.propCache


DOCUMENTS 5 - PortalScripting API: Member List

AccessProfile Member List

This is the complete list of members for AccessProfile, including all inherited members.

AccessProfile(String nameAccessProfile) | AccessProfile
addCustomProperty(String name, String type, String value) | AccessProfile
getAttribute(String attribute) | AccessProfile
getCustomProperties(String nameFilter="", String typeFilter="") | AccessProfile
getLastError() | AccessProfile
getOID(boolean oidLow=false) | AccessProfile
getSystemUsers(boolean includeLockedUsers=true, boolean includeInvisibleUsers=true) | AccessProfile
name | AccessProfile
propCache | AccessProfile
setAttribute(String attribute, String value) | AccessProfile
setOrAddCustomProperty(String name, String type, String value) | AccessProfile
setParentProfile(AccessProfile parentProfile) | AccessProfile


DOCUMENTS 5 - PortalScripting API: AccessProfileIterator Class Reference

Public Member Functions | List of all members
AccessProfileIterator Class Reference

The AccessProfileIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means. More...

Public Member Functions

AccessProfile first ()
Retrieve the first AccessProfile object in the AccessProfileIterator. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
AccessProfile next ()
Retrieve the next AccessProfile object in the AccessProfileIterator. More...
int | size ()
Get the amount of AccessProfile objects in the AccessProfileIterator. More...

Detailed Description

The AccessProfileIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means.

The objects of this class represent lists of AccessProfile objects and allow to loop through such a list of profiles. The following methods return an AccessProfileIterator: Context.getAccessProfiles(), SystemUser.getAccessProfiles().

Since
ELC 3.50b / otrisPORTAL 5.0b
Example:
// take a certain Systemuser object (stored in user) and assign all availabe
// accessprofiles to this user
var itRoles = context.getAccessProfiles();
if (itRoles && itRoles.size() > 0)
{
for (var ap = itRoles.first(); ap; ap = itRoles.next())
{
user.addToAccessProfile(ap); // add user to profile
}
}

Member Function Documentation

◆ first()

AccessProfile AccessProfileIterator::first ( )

Retrieve the first AccessProfile object in the AccessProfileIterator.

Returns
AccessProfile or null in case of an empty AccessProfileIterator
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ getLastError()

String AccessProfileIterator::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.50b / otrisPORTAL 5.0b
See also
DocFile.getLastError()

◆ next()

AccessProfile AccessProfileIterator::next ( )

Retrieve the next AccessProfile object in the AccessProfileIterator.

Returns
AccessProfile or null if end of AccessProfileIterator is reached.
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ size()

int AccessProfileIterator::size ( )

Get the amount of AccessProfile objects in the AccessProfileIterator.

Returns
integer value with the amount of AccessProfile objects in the AccessProfileIterator
Since
ELC 3.50b / otrisPORTAL 5.0b


DOCUMENTS 5 - PortalScripting API: Member List

AccessProfileIterator Member List

This is the complete list of members for AccessProfileIterator, including all inherited members.

first() | AccessProfileIterator
getLastError() | AccessProfileIterator
next() | AccessProfileIterator
size() | AccessProfileIterator


DOCUMENTS 5 - PortalScripting API: ArchiveConnection Class Reference

Public Member Functions | Public Attributes | List of all members
ArchiveConnection Class Reference

The ArchiveConnection class allows low level access to the EAS Interface, EBIS and the EASY ENTERPRISE XML-Server. More...

Public Member Functions

ArchiveConnectionBlob | downloadBlob (String fileKey, String docKey)
Download an attachment from the XML-Server. More...
ArchiveConnectionBlobIterator | downloadBlobs (String fileKey[], String docKey[])
Download multiple attachments from the XML-Server. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
boolean | putBlob (Document doc, String blobreference)
Upload an attachment to the XML-Server. More...
String | queryRawEEx (String eql, int wantedHits=-1, int maxHits=-1)
Sends a query EQL to the EE.x XML-Server and returns the response XML. More...
String | sendEbisRequest (string resourceIdentifier, string postData="", string[] extraHeaders=[])
Sends a request to the EBIS interface and returns the response. More...
String | sendRequest (String request)
Sends a request to the ArchiveConnection and returns the response XML. More...

Public Attributes

String id
String value containing the version of the archive interface. More...

Detailed Description

The ArchiveConnection class allows low level access to the EAS Interface, EBIS and the EASY ENTERPRISE XML-Server.

Member Function Documentation

◆ downloadBlob()

ArchiveConnectionBlob ArchiveConnection::downloadBlob | ( | String | fileKey,
 |  | String | docKey
 | ) |  |

Download an attachment from the XML-Server.

With this method you can download an attachment from the EASYWARE ENTERPRISE archive using the XML-Server. The method returns an object of the class ArchiveConnectionBlob. This object allows you to access the attachment. If the method fails the return value is NULL. You can retrieve the error message by executing ArchiveConnection.getLastError().

Parameters
fileKey | String containing the key of the file
docKey | String containing the key of the attachment
Returns
ArchiveConnectionBlob or NULL, if failed
Note
Method is only available for EE.x using XML-Server
Since
ELC 3.60h / otrisPORTAL 6.0h
Example:
var xmlserver = context.getArchiveConnection();
if (xmlserver)
{
var fileKey = "Unit=Default/Instance=Default/Pool=DEMO/Pool=RECHNUNGEN/Document=RECHNUNGEN.41D3694E2B1E11DD8A9A000C29FACDC2"
var docKey = "41D3695F2B1E11DD8A9A000C29FACDC2"
var path = xmlserver.downloadBlob(fileKey, docKey);
if (!res)
util.out(xmlserver.getLastError());
else
util.out(res.localPath)
}

◆ downloadBlobs()

ArchiveConnectionBlobIterator ArchiveConnection::downloadBlobs | ( | String | fileKey[],
 |  | String | docKey[]
 | ) |  |

Download multiple attachments from the XML-Server.

This method allows downloading multiple attachments from the EASYWARE ENTERPRISE archive using the XML-Server. The method returns an object of the class ArchiveConnectionBlobIterator. This object allows you to access the attachments. If the method fails the return value is NULL. You can retrieve the error message by executing ArchiveConnection.getLastError().

Parameters
fileKey | String Array containing the keys of the files
docKey | String Array containing the keys of the attachments
Returns
ArchiveConnectionBlobIterator or NULL, if failed
Note
Method is only available for EE.x using XML-Server
Since
ELC 3.60h / otrisPORTAL 6.0h
Example:
var fileKeys = new Array();
var docKeys = new Array();
var fileKey1 = "Unit=Default/Instance=Defaul...";
var docKey1 = "41D3695F2B1E11DD8A9A000C29FACDC2";
var fileKey2 = "Unit=Default/Instance=Defaul...";
var docKey2 = "28CDB49ECE1B11DB9FC3000C29FACDC2";
fileKeys[0] = fileKey1;
docKeys[0] = docKey1;
fileKeys[1] = fileKey2;
docKeys[1] = docKey2;
var itArchDoc = xmlserver.downloadBlobs(fileKeys, docKeys);
if (!itArchDoc)
{
util.out(xmlserver.getLastError())
return -1;
}
for (var archDoc=itArchDoc.first(); archDoc; archDoc=itArchDoc.next())
{
util.out(archDoc.name);
util.out(archDoc.localPath);
}

◆ getLastError()

String ArchiveConnection::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.60h / otrisPORTAL 6.0h

◆ putBlob()

boolean ArchiveConnection::putBlob | ( | Document | doc,
 |  | String | blobreference
 | ) |  |

Upload an attachment to the XML-Server.

This method performs a "putblob" request to an installed EASY XML-Server.

Parameters
doc | The Document object, whose binary content is to be uploaded
blobreference | A unique string, which will identify the content in the XML-Server's blobcache.
Returns
A boolean value indicates, if the attachment has succeessfully been uploaded.
Note
You may use util.getUniqueId() to create a blobreference. However this may be not unique enough, if several portal servers are connected to the same XML-server in this way.
Method is only available for EE.x using XML-Server
Since
ELC 3.60h / otrisPORTAL 6.0h
Example:
var xmlserver = context.getArchiveConnection();
if (!xmlserver)
throw "Error: no ArchiveConnection"
// Create a unique id as BlobReference for the upload
var blobRef = util.getUniqueId();
// take a Document object and upload it to the ArchiveConnection
if (!xmlserver.putBlob(doc, blobRef))
throw "Upload failed";
// Now the blobRef can be used e.g. for an IMPORT request

◆ queryRawEEx()

String ArchiveConnection::queryRawEEx | ( | String | eql,
 |  | int | wantedHits = -1,
 |  | int | maxHits = -1
 | ) |  |

Sends a query EQL to the EE.x XML-Server and returns the response XML.

With this method you can send a query EQL to the XML-Server of EASY ENTERPRISE.x If the method succeed the return value is the response-xml, otherwise it returns NULL. If the value is NULL you can retrieve the error message by executing ArchiveConnection.getLastError()

Parameters
eql | String containing the EQL
wantedHits | Int with the number of currently wanted hits (optional)
maxHits | Int with the max. number of hits, that the ArchiveConnection should respond (optional)
Returns
String with the response (xml) or NULL in case of any error
Note
Method is only available for EE.x using XML-Server
Since
ELC 3.60h / otrisPORTAL 6.0h
Example:
var xmlserver = context.getArchiveConnection();
if (xmlserver)
{
var eql = "SELECT @Finance.Type FROM @Finance WHERE isnewestversion(FIBU) ORDER BY FIBU.BUCHUNGSTYP ASC";
var res = xmlserver.queryRawEEx(eql);
if (!res)
util.out(xmlserver.getLastError());
else
util.out(res);
}

◆ sendEbisRequest()

String ArchiveConnection::sendEbisRequest | ( | string | resourceIdentifier,
 |  | string | postData = "",
 |  | string [] | extraHeaders = []
 | ) |  |

Sends a request to the EBIS interface and returns the response.

With this method you can send a GET or a POST request to an EBIS interface. If the request succeeds, the return value is the HTTP-content of the response. Otherwise the function returns an empty String. Call ArchiveConnection.getLastError() subsequently to test for eventual errors. If the interface reports an error, it will be prefixed with "[EBIS] ".

Parameters
resourceIdentifier | String containing the REST resource identifier (in other words: the back part of the URL).
postData | A optional String with content data of a HTTP-POST request. If the parameter is missing or empty, the function generates a GET request.
extraHeaders | A optional Array of Strings with an even number of elements. The first element of each pair must contain the name, the second one the value of an additional HTTP header element.
Returns
A String with the response. This may be an XML or plain text. It depends on the request.
Remarks
The function is unable to handle a response with binary data. The function does not check the parameters for illegal characters, such as linefeeds in the extraHeaders, for example.
Note
Method is only available for EBIS
Since
DOCUMENTS 5.0a
Example:
//
// Example for GET
//
var ebisConn = context.getArchiveConnection("ebisStore1");
if (ebisConn)
{
var factoryInfo = ebisConn.sendEbisRequest("/factory");
var eText = ebisConn.getLastError();
if(eText == "")
util.out(factoryInfo);
else
util.out(eText);
}
//
// Example for POST (do a query on EBIS with JSON)
//
var req = {};
req.maxHits = 250;
req.pageSize = 20;
req.unformattedResult = true;
req.includeTextmarkers = true;
// search sources
req.sources = ["Unit=Default/Instance=Default/View=Store01"];
// hitlist fields
req.fields = [];
req.fields.push({field: "TITLE", sort: "NONE"})
req.fields.push({field: "MODIFIED_DATE", sort: "NONE"})
req.fields.push({field: "_type", sort: "NONE"})
// search condition: all files of filetype "Simple"
req.conditions = {};
req.conditions.type = "set";
req.conditions.conditions = [{type : "compare", field : "_type", value : "Simple", or : true, not : false}];
var json = JSON.stringify(req);
var archiveServer = context.getArchiveServer("ebisStore1");
var ebisConn = archiveServer.getArchiveConnection();
var headers = ["Content-Type", "application/json"];
var res = ebisConn.sendEbisRequest("/search", json, headers);
util.out(res);
=> EBIS returns query id { id : "8c31d9352240a1c507d8d5f163e49085", columns : [ ], infos : [ ], executed : false }

◆ sendRequest()

String ArchiveConnection::sendRequest ( String request )

Sends a request to the ArchiveConnection and returns the response XML.

With this method you can send a request to the XML-Server of EASY ENTERPRISE. If the method succeeds the return value is the response-xml, otherwise it returns NULL. If the value is NULL you can retrieve the error message by executing ArchiveConnection.getLastError()

Parameters
request String containing the request
Returns
an String with the response (xml) or NULL in case of any error
Note
Method is only available for EE.x using XML-Server
Since
ELC 3.60h / otrisPORTAL 6.0h
Example:
var xmlserver = context.getArchiveConnection();
if (xmlserver)
{
var req = "<INFO REQUESTID=\"1\"/>";
var res = xmlserver.sendRequest(req);
if (!res)
util.out(xmlserver.getLastError());
else
util.out(res);
}

Member Data Documentation

◆ id

String ArchiveConnection::id

String value containing the version of the archive interface.

Returns
String value containing the version of the archive interface
Since
ELC 3.60h / otrisPORTAL 6.0h


DOCUMENTS 5 - PortalScripting API: Member List

ArchiveConnection Member List

This is the complete list of members for ArchiveConnection, including all inherited members.

downloadBlob(String fileKey, String docKey) | ArchiveConnection
downloadBlobs(String fileKey[], String docKey[]) | ArchiveConnection
getLastError() | ArchiveConnection
id | ArchiveConnection
putBlob(Document doc, String blobreference) | ArchiveConnection
queryRawEEx(String eql, int wantedHits=-1, int maxHits=-1) | ArchiveConnection
sendEbisRequest(string resourceIdentifier, string postData="", string[] extraHeaders=[]) | ArchiveConnection
sendRequest(String request) | ArchiveConnection


DOCUMENTS 5 - PortalScripting API: ArchiveConnectionBlob Class Reference

Public Member Functions | Public Attributes | List of all members
ArchiveConnectionBlob Class Reference

The ArchiveConnectionBlob class provides access to each single attachment of files in the archive. More...

Public Member Functions

boolean | download ()
Download the attachment to the PortalServer's machine (localPath) More...
String | getLastError ()
Function to get the description of the last error that occurred. More...

Public Attributes

number | bytes
Integer containing the filesize of an attachment in the archive. More...
String | docKey
String containing the key of the attachment in the archive. More...
boolean | downloaded
boolean that indicates whether an attachment of the archive is locally available at the PortalServer. More...
String | fileKey
String containing the key of the file the attachment belongs to in the archive. More...
String | localPath
String with the local path to the attachment (blob). More...
String | mimeType
String containing the mime-type of an attachment in the archive. More...
String | name
String containing the name of the attachment in the archive. More...
String | size
String containing the filesize of an attachment in the archive. More...

Detailed Description

The ArchiveConnectionBlob class provides access to each single attachment of files in the archive.

This class holds data like name, extension, size etc. of attachments in the archive. The existance of an object means, that an attachment exists in the archive. If you want to access the attachment (blob) itself in the PortalServer, you have to download the attachment from the archive with the ArchiveConnectionBlob.download() method. Then the attachment will be transferred to the PortalServer machine (localPath).

Note
You can not create objects of this class. Objects of this class are available only as return value of other functions, e.g. ArchiveConnection.downloadBlob(String fileKey, String docKey).
Class is only available for an ArchiceConnection to a XML-Server
Since
ELC 3.60i / otrisPORTAL 6.0i available for archive files

Member Function Documentation

◆ download()

boolean ArchiveConnectionBlob::download ( )

Download the attachment to the PortalServer's machine (localPath)

Returns
true if successful, false in case of any error
Since
ELC 3.60h / otrisPORTAL 6.0h
Example:
var archFile = .....
if (!archFile.downloaded)
{
var res = archFile.download();
if (!res)
util.out(archFile.getLastError());
else
util.out(archFile.localPath);
}

◆ getLastError()

String ArchiveConnectionBlob::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.60h / otrisPORTAL 6.0h

Member Data Documentation

◆ bytes

number ArchiveConnectionBlob::bytes

Integer containing the filesize of an attachment in the archive.

This property contains the filesize of the attachment in bytes (83605).

Example:
....
var archDoc = xmlserver.downloadBlob(....);
util.out(archDoc.bytes);

◆ docKey

String ArchiveConnectionBlob::docKey

String containing the key of the attachment in the archive.

Example:
....
var archDoc = xmlserver.downloadBlob(....);
util.out(archDoc.docKey);

◆ downloaded

boolean ArchiveConnectionBlob::downloaded

boolean that indicates whether an attachment of the archive is locally available at the PortalServer.

If the attachment in the archive is locally available at the PortalServer's file system, this value is true.

Example:
....
var archDoc = ...
if (archDoc.downloaded)
util.out(archDoc.localPath);

◆ fileKey

String ArchiveConnectionBlob::fileKey

String containing the key of the file the attachment belongs to in the archive.

Example:
....
var archDoc = xmlserver.downloadBlob(....);
util.out(archDoc.fileKey);

◆ localPath

String ArchiveConnectionBlob::localPath

String with the local path to the attachment (blob).

This path is only available if the attribute ArchiveConnectionBlob.downloaded is true

Example:
....
var archDoc = ...
if (archDoc.downloaded)
util.out(archDoc.localPath);

◆ mimeType

String ArchiveConnectionBlob::mimeType

String containing the mime-type of an attachment in the archive.

This property contains the mime-type of the attachment, e.g image/jpeg.

Example:
....
var archDoc = xmlserver.downloadBlob(....);
util.out(archDoc.mimeType);

◆ name

String ArchiveConnectionBlob::name

String containing the name of the attachment in the archive.

Example:
....
var archDoc = xmlserver.downloadBlob(....);
util.out(archDoc.name);

◆ size

String ArchiveConnectionBlob::size

String containing the filesize of an attachment in the archive.

This property contains the filesize of the attachment in as readable way (81.6 KB).

Example:
....
var archDoc = xmlserver.downloadBlob(....);
util.out(archDoc.size);


DOCUMENTS 5 - PortalScripting API: Member List

ArchiveConnectionBlob Member List

This is the complete list of members for ArchiveConnectionBlob, including all inherited members.

bytes | ArchiveConnectionBlob
docKey | ArchiveConnectionBlob
download() | ArchiveConnectionBlob
downloaded | ArchiveConnectionBlob
fileKey | ArchiveConnectionBlob
getLastError() | ArchiveConnectionBlob
localPath | ArchiveConnectionBlob
mimeType | ArchiveConnectionBlob
name | ArchiveConnectionBlob
size | ArchiveConnectionBlob


DOCUMENTS 5 - PortalScripting API: ArchiveConnectionBlobIterator Class Reference

Public Member Functions | List of all members
ArchiveConnectionBlobIterator Class Reference

The ArchiveConnectionBlobIterator class is an iterator that holds a list of objects of the class ArchiveConnectionBlob. More...

Public Member Functions

ArchiveConnectionBlob first ()
Retrieve the first ArchiveConnectionBlob object in the ArchiveConnectionBlobIterator. More...
ArchiveConnectionBlob next ()
Retrieve the next ArchiveConnectionBlob object in the ArchiveConnectionBlobIterator. More...
int size ()
Get the amount of ArchiveConnectionBlob objects in the ArchiveConnectionBlobIterator. More...

Detailed Description

The ArchiveConnectionBlobIterator class is an iterator that holds a list of objects of the class ArchiveConnectionBlob.

You may access ArchiveConnectionBlobIterator objects by the ArchiveConnection.downloadBlobs() method described in the ArchiceConnection chapter.

Note
Class is only available for an ArchiceConnection to a XML-Server
Since
ELC 3.60h / otrisPORTAL 6.0h

Member Function Documentation

◆ first()

ArchiveConnectionBlob ArchiveConnectionBlobIterator::first ( )

Retrieve the first ArchiveConnectionBlob object in the ArchiveConnectionBlobIterator.

Returns
ArchiveConnectionBlob or null in case of an empty ArchiveConnectionBlobIterator
Since
ELC 3.60h / otrisPORTAL 6.0h

◆ next()

ArchiveConnectionBlob ArchiveConnectionBlobIterator::next ( )

Retrieve the next ArchiveConnectionBlob object in the ArchiveConnectionBlobIterator.

Returns
ArchiveConnectionBlob or NULL if end of ArchiveConnectionBlobIterator is reached
Since
ELC 3.60h / otrisPORTAL 6.0h

◆ size()

int ArchiveConnectionBlobIterator::size ( )

Get the amount of ArchiveConnectionBlob objects in the ArchiveConnectionBlobIterator.

Returns
integer value with the amount of ArchiveConnectionBlob objects in the ArchiveConnectionBlobIterator
Since
ELC 3.60h / otrisPORTAL 6.0h


DOCUMENTS 5 - PortalScripting API: Member List

ArchiveConnectionBlobIterator Member List

This is the complete list of members for ArchiveConnectionBlobIterator, including all inherited members.

first() | ArchiveConnectionBlobIterator
next() | ArchiveConnectionBlobIterator
size() | ArchiveConnectionBlobIterator


DOCUMENTS 5 - PortalScripting API: ArchiveFileResultset Class Reference

Public Member Functions | List of all members
ArchiveFileResultset Class Reference

The ArchiveFileResultset class supports basic functions to loop through a list of ArchiveFile objects. More...

Public Member Functions

ArchiveFileResultset | ArchiveFileResultset (String archiveKey, String filter, String sortOrder, String hitlist, boolean unlimitedHits=false)
Create a new ArchiveFileResultset object. More...
DocFile first ()
Retrieve the first DocFile object in the ArchiveFileResultset. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
DocFile last ()
Retrieve the last DocFile object in the ArchiveFileResultset. More...
DocFile next ()
Retrieve the next DocFile object in the ArchiveFileResultset. More...
int | size ()
Get the amount of DocFile objects in the ArchiveFileResultset. More...

Detailed Description

The ArchiveFileResultset class supports basic functions to loop through a list of ArchiveFile objects.

Constructor & Destructor Documentation

◆ ArchiveFileResultset()

ArchiveFileResultset ArchiveFileResultset::ArchiveFileResultset | ( | String | archiveKey,
 |  | String | filter,
 |  | String | sortOrder,
 |  | String | hitlist,
 |  | boolean | unlimitedHits = false
 | ) |  |

Create a new ArchiveFileResultset object.

Like in other programming languages you create a new object with the new operator (refer to example below).

Parameters
archiveKey | String containing the key of the desired view or archive
filter | String containing an filter criterium; use empty String ('') if you don't want to filter at all
sortOrder | String containing an sort order; use empty String ('') if you don't want to sort at all
hitlist | String containing the hitlist that you want to use (optional für EE.i / mandatory for EE.x
unlimitedHits | boolean that indicates if the archive hit limit must be ignored
Note
Important: The resultset may contain less hits than really exist. For EE.i and EE.x the limit of returned hits is the value of the DOCUMENTS property "MaxArchiveHitsFolder". If the property is not set, the limit is the XML-Server's default hit count. For EAS, The limit is either the "MaxArchiveHitsFolder" value or the limit of free research hitlists. The method is the same for dynamic folders and link-registers.
Since
ELC 3.60i / otrisPORTAL 6.0i
Example:
// Example for EE.i:
var archiveKey = "$(#STANDARD)\\EINRECH";
archiveKey += "@myeei"; // since Documents 4.0 using multi archive server
var filter = "Kreditor='ALFKI'";
var sortOrder = "BelegNr+";
var hitlist = "STANDARD";
var myAFRS = new ArchiveFileResultset(archiveKey, filter, sortOrder, hitlist);
var archFile = null;
while (true)
{
try
{
archFile = archFile ? myAFRS.next() : myAFRS.first();
if (!archFile) // end of ArchiveFileResultset
break;
util.out(archFile.getArchiveKey());
}
catch (err)
{
util.out("Unable to load archFile: " + err);
}
}
Example:
// Example for EE.x:
var archiveKey = "Unit=Default/Instance=Default/View=Scanners";
archiveKey += "@myeex"; // since Documents 4.0 using multi archive server
var filter = "Speed=10";
var sortOrder = "";
var hitlist = "Default";
var myAFRS = new ArchiveFileResultset(archiveKey, filter, sortOrder, hitlist);
Example:
// Example for EAS:
var archiveKey = "Order";
archiveKey += "@myeas"; // since Documents 4.0 using multi archive server
var filter = "company=A*";
var sortOrder = "company+";
var myAFRS = new ArchiveFileResultset(archiveKey, filter, sortOrder);

Member Function Documentation

◆ first()

DocFile ArchiveFileResultset::first ( )

Retrieve the first DocFile object in the ArchiveFileResultset.

Returns
DocFile, null in case of an empty ArchiveFileResultset, throws an exception on error loading archive file.
Since
ELC 3.60i / otrisPORTAL 6.0i

◆ getLastError()

String ArchiveFileResultset::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.60i / otrisPORTAL 6.0i
See also
DocFile.getLastError()

◆ last()

DocFile ArchiveFileResultset::last ( )

Retrieve the last DocFile object in the ArchiveFileResultset.

Returns
DocFile or null if end of ArchiveFileResultset is reached.
Since
ELC 3.60j / otrisPORTAL 6.0j

◆ next()

DocFile ArchiveFileResultset::next ( )

Retrieve the next DocFile object in the ArchiveFileResultset.

Returns
DocFile, null if end of ArchiveFileResultset is reached, throws an exception on error loading archive file.
Since
ELC 3.60i / otrisPORTAL 6.0i

◆ size()

int ArchiveFileResultset::size ( )

Get the amount of DocFile objects in the ArchiveFileResultset.

Returns
integer value with the amount of DocFile objects in the ArchiveFileResultset
Since
ELC 3.60i / otrisPORTAL 6.0i


DOCUMENTS 5 - PortalScripting API: Member List

ArchiveFileResultset Member List

This is the complete list of members for ArchiveFileResultset, including all inherited members.

ArchiveFileResultset(String archiveKey, String filter, String sortOrder, String hitlist, boolean unlimitedHits=false) | ArchiveFileResultset
first() | ArchiveFileResultset
getLastError() | ArchiveFileResultset
last() | ArchiveFileResultset
next() | ArchiveFileResultset
size() | ArchiveFileResultset


DOCUMENTS 5 - PortalScripting API: ArchiveServer Class Reference

Public Member Functions | Public Attributes | List of all members
ArchiveServer Class Reference

The ArchiveServer class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS ArchiveServer by scripting means. More...

Public Member Functions

ArchiveConnection getArchiveConnection ()
Retrieve the archive connection object for EAS, EBIS or EASY Enterprise XML-Server. More...
String | getAttribute (String attribute)
Get the String value of an attribute of the ArchiveServer. More...
String | getLastError ()
If you call a method at an ArchiveServer object and an error occurred, you can get the error description with this function. More...
String | getOID (boolean oidLow=false)
Returns the object-id. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the ArchiveServer to the desired value. More...
void | submitChanges ()
After changes on the ArchiveServer with scripting methods, it is necessary to submit them to make them immediately valid. More...

Public Attributes

String name
The technical name of the ArchiveServer. More...

Detailed Description

The ArchiveServer class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS ArchiveServer by scripting means.

Since
DOCUMENTS 5.0a

Member Function Documentation

◆ getArchiveConnection()

ArchiveConnection ArchiveServer::getArchiveConnection ( )

Retrieve the archive connection object for EAS, EBIS or EASY Enterprise XML-Server.

The ArchiveConnection object can be used for low level call directly on the archive interface.

Returns
ArchiveConnection object if successful, NULL in case of any error
Since
DOCUMENTS 5.0a

◆ getAttribute()

String ArchiveServer::getAttribute ( String attribute )

Get the String value of an attribute of the ArchiveServer.

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Note
This function is only for experts. Knowledge about the DOCUMENTS-database schema is necessary!
Since
DOCUMENTS 5.0a

◆ getLastError()

String ArchiveServer::getLastError ( )

If you call a method at an ArchiveServer object and an error occurred, you can get the error description with this function.

Returns
Text of the last error as String
Since
DOCUMENTS 5.0a

◆ getOID()

String ArchiveServer::getOID ( boolean oidLow = false )

Returns the object-id.

Parameters
oidLow Optional flag:
If true only the id of the ArchiveServer object (m_oid) will be returned.
If false the id of the ArchiveServer 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
Since
DOCUMENTS 5.0a

◆ setAttribute()

boolean ArchiveServer::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the ArchiveServer to the desired value.

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Note
This function is only for experts. Knowledge about the DOCUMENTS-database schema is necessary!
Since
DOCUMENTS 5.0a

◆ submitChanges()

void ArchiveServer::submitChanges ( )

After changes on the ArchiveServer with scripting methods, it is necessary to submit them to make them immediately valid.

The settings of the ArchiveServer will be cached in a connection pool to the archive system. The pool does not recognize changes in the ArchiveServer object automatically, therefore it is necessary to call this method after all.

Example:
var as = context.getArchiveServerByName("EDA_2017");
if (as)
{
as.setAttribute("Host", "127.0.0.1");
as.submitChanges();
}
Since
DOCUMENTS 5.0c

Member Data Documentation

◆ name

String ArchiveServer::name

The technical name of the ArchiveServer.

Returns
String containing the technical name of the ArchiveServer.
Since
DOCUMENTS 5.0a


DOCUMENTS 5 - PortalScripting API: Member List

ArchiveServer Member List

This is the complete list of members for ArchiveServer, including all inherited members.

getArchiveConnection() | ArchiveServer
getAttribute(String attribute) | ArchiveServer
getLastError() | ArchiveServer
getOID(boolean oidLow=false) | ArchiveServer
name | ArchiveServer
setAttribute(String attribute, String value) | ArchiveServer
submitChanges() | ArchiveServer


DOCUMENTS 5 - PortalScripting API: ArchiveServerIterator Class Reference

Public Member Functions | List of all members
ArchiveServerIterator Class Reference

The ArchiveServerIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS ArchiveSerevrby scripting means. More...

Public Member Functions

AccessProfile first ()
Retrieve the first ArchiveServer object in the ArchiveServerIterator. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
AccessProfile next ()
Retrieve the next ArchiveServer object in the ArchiveServerIterator. More...
int | size ()
Get the amount of ArchiveServer objects in the ArchiveServerIterator. More...

Detailed Description

The ArchiveServerIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS ArchiveSerevrby scripting means.

Since
DOCUMENTS 5.0a

Member Function Documentation

◆ first()

AccessProfile ArchiveServerIterator::first ( )

Retrieve the first ArchiveServer object in the ArchiveServerIterator.

Returns
ArchiveServer or null in case of an empty ArchiveServerIterator
Since
DOCUMENTS 5.0a

◆ getLastError()

String ArchiveServerIterator::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 5.0a

◆ next()

AccessProfile ArchiveServerIterator::next ( )

Retrieve the next ArchiveServer object in the ArchiveServerIterator.

Returns
ArchiveServer or null if end of ArchiveServerIterator is reached.
Since
DOCUMENTS 5.0a

◆ size()

int ArchiveServerIterator::size ( )

Get the amount of ArchiveServer objects in the ArchiveServerIterator.

Returns
integer value with the amount of ArchiveServer objects in the ArchiveServerIterator
Since
DOCUMENTS 5.0a


DOCUMENTS 5 - PortalScripting API: Member List

ArchiveServerIterator Member List

This is the complete list of members for ArchiveServerIterator, including all inherited members.

first() | ArchiveServerIterator
getLastError() | ArchiveServerIterator
next() | ArchiveServerIterator
size() | ArchiveServerIterator


DOCUMENTS 5 - PortalScripting API: ArchivingDescription Class Reference

Public Member Functions | Public Attributes | List of all members
ArchivingDescription Class Reference

The ArchivingDescription class has been added to the DOCUMENTS PortalScripting API to improve the archiving process of DOCUMENTS files by scripting means. More...

Public Member Functions

void addRegister (String registerName)
flag an additional (document) register to be archived with the file. More...
ArchivingDescription ArchivingDescription ()
Create a new ArchivingDescription object. More...

Public Attributes

boolean | archiveMonitor
boolean value whether to archive the monitor of the file. More...
String | archiveServer
String containing the name of the archive server in a multi archive server environment. More...
boolean | archiveStatus
boolean value whether to archive the status of the file. More...
String | targetArchive
String containing the complete address of the target archive for archiving to EE.i. More...
String | targetSchema
String containing the complete address of the target schema used for archiving to EE.x. More...
String | targetView
String containing the complete address of the target view used for archiving to EE.x. More...
boolean | versioning
boolean value whether to use the versioning technique in the archive. More...

Detailed Description

The ArchivingDescription class has been added to the DOCUMENTS PortalScripting API to improve the archiving process of DOCUMENTS files by scripting means.

For instance this allows to use different target archives for each file as well as to influence the archiving process by the file's contents itself. The ArchivingDescription object can only be used as parameter for the method DocFile.archive(ArchivingDescription)

Note
By default, archiving with an ArchivingDescription does not include any attachments. To archive some attachments, the script needs to call addRegister() on this object.
Since
EE.i: ELC 3.51c / otrisPORTAL 5.1c
EE.x: ELC 3.60a / otrisPORTAL 6.0a
EAS: ELC 4.0 / otrisPORTAL 7

Constructor & Destructor Documentation

◆ ArchivingDescription()

ArchivingDescription ArchivingDescription::ArchivingDescription ( )

Create a new ArchivingDescription object.

Like in other programming languages you create a new object with the new operator (refer to example below).

Returns
ArchivingDescription which allows to define several conditions for the archiving process of a certain DocFile object
Since
EE.i: ELC 3.51c / otrisPORTAL 5.1c
EE.x: ELC 3.60a / otrisPORTAL 6.0a
EAS: ELC 4.0 / otrisPORTAL 7
Example:
// Example for EE.i:
var docFile = context.file;
if (!docFile)
{
// error handling
}
var ad = new ArchivingDescription();
ad.targetArchive = "$(#DEMO)\\BELEGE";
ad.archiveServer = "myeei"; // since Documents 4.0 using multi archive server
// Note: This example does not archive any attachments
var success = docFile.archive(ad);
if (!success)
{
util.out(docFile.getLastError());
}
Example:
// Example for EE.x:
var docFile = context.file;
if (!docFile)
{
// error handling
}
var ad = new ArchivingDescription();
ad.targetView = "Unit=Default/Instance=Default/View=DeliveryNotes";
ad.targetSchema = "Unit=Default/Instance=Default/DocumentSchema=LIEFERSCHEINE";
ad.archiveServer = "myeex"; // since Documents 4.0 using multi archive server
ad.archiveMonitor = true;
// Note: This example does not archive any attachments
var success = docFile.archive(ad);
if (!success)
{
util.out(docFile.getLastError());
}
Example:
// Example for EAS:
var docFile = context.file;
if (!docFile)
{
// error handling
}
var ad = new ArchivingDescription();
ad.archiveServer = "myeas";
ad.archiveMonitor = true;
// Note: This example does not archive any attachments
var success = docFile.archive(ad);
if (success)
util.out(docFile.getArchiveKey());
else
util.out(docFile.getLastError());
See also
DocFile.archive(ArchivingDescription)

Member Function Documentation

◆ addRegister()

void ArchivingDescription::addRegister ( String registerName )

flag an additional (document) register to be archived with the file.

You may add the technical names of different document registers to an internal list of your ArchivingDescription object. This allows for example to archive only part of your documents of your DocFile.

Parameters
registerName String containing the technical name of the register to be archived. Pass "all_docs" to archive all attachments of your DocFile.
Since
EE.i: ELC 3.51c / otrisPORTAL 5.1c
EE.x: ELC 3.60a / otrisPORTAL 6.0a
EAS: ELC 4.0 / otrisPORTAL 7
Example:
var docFile = context.file;
var ad = new ArchivingDescription();
ad.targetArchive = "$(#DEMO)\\BELEGE";
ad.addRegister("Documents");
ad.addRegister("InternalDocuments");
docFile.archive(ad);

Member Data Documentation

◆ archiveMonitor

boolean ArchivingDescription::archiveMonitor

boolean value whether to archive the monitor of the file.

Like on the filetype in the Portal Client you may decide whether you want to archive the monitor of the file along with the file. If so, the file's monitor will be transformed to a HTML file named monitor.html, and it will be part of the archived file in the desired target archive.

Since
EE.i: ELC 3.51c / otrisPORTAL 5.1c
EE.x: ELC 3.60a / otrisPORTAL 6.0a
EAS: ELC 4.0 / otrisPORTAL 7.0
Example:
var ad = new ArchivingDescription();
ad.archiveMonitor = true; // archive monitor of file as HTML page as well

◆ archiveServer

String ArchivingDescription::archiveServer

String containing the name of the archive server in a multi archive server environment.

You need to define the archive server if you want to archive in an archive server that is different from the main archives server. If you want to archive into the main archive you can leave this value empty.

Note
This value has only to be set if you habe multiple archive servers
Since
ELC 4.0 / otrisPORTAL 7.0 (EE.i, EE.x, EAS)
Example:
var ad = new ArchivingDescription();
ad.archiveServer = "myeei"";

◆ archiveStatus

boolean ArchivingDescription::archiveStatus

boolean value whether to archive the status of the file.

Like on the filetype in the Portal Client you may decide whether you want to archive the status of the file along with the file. If so, the file's status will be transformed to a HTML file named status.html, and it will be part of the archived file in the desired target archive.

Since
EE.i: ELC 3.51c / otrisPORTAL 5.1c
EE.x: ELC 3.60a / otrisPORTAL 6.0a
EAS: ELC 4.0 / otrisPORTAL 7
Example:
var ad = new ArchivingDescription();
ad.archiveStatus = true; // archive status of file as HTML page as well

◆ targetArchive

String ArchivingDescription::targetArchive

String containing the complete address of the target archive for archiving to EE.i.

You need to define the target archive including the "Storageplace".

Note
This value has only to be set if you want to archive to EE.i. If you want to archive to EE.x, you have to set targetView and targetSchema. It is important to know that the target archive String must use the socalled XML-Server syntax. It is as well neccessary to use a double backslash (\\) if you define your target archive as an PortalScript String value, because a single backslash is a special character.
Since
EE.i: ELC 3.51c / otrisPORTAL 5.1c
Example:
var ad = new ArchivingDescription();
ad.targetArchive = "$(#DEMO)\\BELEGE"; // archiving to "DEMO\BELEGE"

◆ targetSchema

String ArchivingDescription::targetSchema

String containing the complete address of the target schema used for archiving to EE.x.

You need to define the target schema you want to archive into.

Note
This value has only to be set if you want to archive to EE.x.
Since
ELC 3.60a / otrisPORTAL 6.0a
Example:
var ad = new ArchivingDescription();
ad.targetView = "Unit=Default/Instance=Default/DocumentSchema=LIEFERSCHEINE";

◆ targetView

String ArchivingDescription::targetView

String containing the complete address of the target view used for archiving to EE.x.

You need to define the target view (write pool) you want to archive into.

Note
This value has only to be set if you want to archive to EE.x.
Since
ELC 3.60a / otrisPORTAL 6.0a
Example:
var ad = new ArchivingDescription();
ad.targetView = "Unit=Default/Instance=Default/View=DeliveryNotes";

◆ versioning

boolean ArchivingDescription::versioning

boolean value whether to use the versioning technique in the archive.

If the DocFile has already been archived and if you define this attribute to be true, a new version of the archive file will be created otherwise a independent new file in the archive will be created.

Since
EE.i: ELC 3.51c / otrisPORTAL 5.1c
EE.x: ELC 3.60a / otrisPORTAL 6.0a
EAS: ELC 4.0 / otrisPORTAL 7
Example:
var ad = new ArchivingDescription();
ad.versioning = true; // use versioning for archived file


DOCUMENTS 5 - PortalScripting API: Member List

ArchivingDescription Member List

This is the complete list of members for ArchivingDescription, including all inherited members.

addRegister(String registerName) | ArchivingDescription
archiveMonitor | ArchivingDescription
archiveServer | ArchivingDescription
archiveStatus | ArchivingDescription
ArchivingDescription() | ArchivingDescription
targetArchive | ArchivingDescription
targetSchema | ArchivingDescription
targetView | ArchivingDescription
versioning | ArchivingDescription


DOCUMENTS 5 - PortalScripting API: Context Class Reference

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
name | String value defining the name
type | String value defining the type
value | String 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
ts | Date object to which the period of time should be added
amount | integer value of the period of time to be added
unit String value representing the time unit of the period of time. You may use one of the following unit values:
  • "minutes"
  • "hours"
  • "days"
  • "weeks"
useWorkCalendar | true 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
login String 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
scriptName String 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
dateOrTimeStamp | Date/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
value | Numeric object representing the number
decimalSep | Decimal-Separator as String
thousandSep | Thousend-Separator 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, ",", ".", 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
value | Numeric object representing the number
locale | Locale 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
dateOrTimeStamp | String representing a date has to be formatted as the definition in the specified locale, e.g. "TT.MM.JJJJ" for the locale "de".
locale | Optional 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
numericValue | Formatted numeric String
decimalSep | Decimal-Separator as String
thousandSep | Thousend-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
numericValue | Formatted numeric String
locale | Locale 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
fileType the 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
profileName technical 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
name | The technical name of the ArchiveServer to be created.
type | The 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
loginName | login of the fellow
isDlcUser | automatically grant DOCUMENTS access (true/false)
licenseType | optional 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
fileType Name 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
name | The technical name of the folder to be created.
type | The 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
fileType the 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
loginName | login of the user
isDlcUser | automatically grant DOCUMENTS access (true/false)
licenseType | optional 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
profileName technical 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
folderObj an 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
loginName login 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
operationName String 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
root An 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
workDir | String containing a complete directory path which should be used as the working directory
cmd | String containing the full path and filename to the batch file which shall be executed
synced | boolean 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
cmd String 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
profileName technical 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
filter Optional 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
login name 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
alias technical 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
includeInvisibleProfiles optional 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
archiveServerName Optional 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
name The 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
autoText the 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
attributeName the 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
nameFilter | String value defining an optional filter depending on the name
typeFilter | String 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
earlierDate | Date object representing the earlier date
laterDate | Date object representing the later date
unit | optional String value defining the unit, allowed values are "minutes", "hours" and "days" (default)
useWorkCalendar | optional 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
idFile | Unique id of the file
idDocument | Unique 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
autoText to 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
fileType | String value containing the technical name of the desired filetype
field | String value containing the technical name of the desired enumeration field
techEnumValue | String value containing the desired technical value of the enumeration entry
locale | optional 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
fileType | String value containing the technical name of the desired filetype
field | String 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
fileType | String value containing the technical name of the desired filetype
field | String value containing the technical name of the desired field
locale | optional 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
idFile Unique 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
fileType | String value containing the technical name of the desired filetype
locale | optional 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
nameFiletype String value containing the technical name of the filetype.
oidLow Optional 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
folder Folder 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
folderPattern | the name pattern of the desired folder(s)
type | optional 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
identifier String 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
oid String 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
value | String with the complete value string
locale | Optional 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
attributeName the 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
fileTypeName | String value containing the technical name of the desired filetype
registerName | String value containing the technical name of the desired register
locale | optional 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
includeLockedUsers optional 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
accessToken | String value with the token
dropToken | Optional 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
archiveServerName Optional 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
moduleConst from 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
pemReload Optional 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
principalName | String containing the name of the principal to be reloaded.
pemReload | Optional 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
server | String containing the IP address or server host
port | int containing the port on which the server is listening
request | String with the request that should be sent to the server
responseTimeout | int 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
locale String 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
langIndex integer 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
folder | Folder object whose position to be set.
position | new 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
name | String value defining the name
type | String value defining the type
value | String 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
attributeName | the technical name of the desired attribute
value | the 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
value Float 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
text String 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
actionCode The 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
detail1 | Optional String with length <= 255 containing additional information of the action. if the string length > 255, only the first 255 characters will be displayed.
detail2 | Optional String with length <= 60 containing additional information of the action. if the string length > 60, only the first 60 characters will be displayed.
detail3 | Optional 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.


DOCUMENTS 5 - PortalScripting API: Member List

Context Member List

This is the complete list of members for Context, including all inherited members.

addCustomProperty(String name, String type, String value) | Context
addTimeInterval(Date ts, number amount, String unit='minutes', boolean useWorkCalendar=true) | Context
changeScriptUser(String login) | Context
clearEnumvalCache(String scriptName) | Context
clientId | Context
convertDateToString(Date dateOrTimeStamp, String locale=user locale) | Context
convertNumericToString(number value, String decimalSep, String thousandSep, number precision=2) | Context
convertNumericToString(number value, String locale=user locale, number precision=2) | Context
convertStringToDate(String dateOrTimeStamp, String locale) | Context
convertStringToNumeric(String numericValue, String decimalSep, String thousandSep) | Context
convertStringToNumeric(String numericValue, String locale=userlocale) | Context
countPoolFiles(String fileType) | Context
createAccessProfile(String profileName) | Context
createArchiveServer(String name, String type) | Context
createFellow(String loginName, boolean isDlcUser, String licenseType='named') | Context
createFile(String fileType) | Context
createFolder(String name, String type) | Context
createPoolFile(String fileType) | Context
createSystemUser(String loginName, boolean isDlcUser, String licenseType='named') | Context
currentUser | Context
deleteAccessProfile(String profileName) | Context
deleteFolder(Folder folderObj) | Context
deleteSystemUser(String loginName) | Context
document | Context
doMaintenance(String operationName) | Context
enableModules(Object root=undefined) | Context
errorMessage | Context
event | Context
extCall(String workDir, String cmd, boolean synced) | Context
extProcess(String cmd) | Context
fieldName | Context
file | Context
fileType | Context
findAccessProfile(String profileName) | Context
findCustomProperties(String filter) | Context
findSystemUser(String login) | Context
findSystemUserByAlias(String alias) | Context
folder | Context
folderFiles | Context
folderName | Context
getAccessProfiles(boolean includeInvisibleProfiles=false) | Context
getArchiveConnection(String archiveServerName) | Context
getArchiveFile(String key) | Context
getArchiveServer(String name) | Context
getArchiveServers() | Context
getAutoText(String autoText) | Context
getClientLang() | Context
getClientSystemLang() | Context
getClientType() | Context
getCurrentUserAttribute(String attributeName) | Context
getCustomProperties(String nameFilter="", String typeFilter="") | Context
getDatesDiff(Date earlierDate, Date laterDate, String unit='days', boolean useWorkCalendar=true) | Context
getDocumentById(String idFile, String idDocument) | Context
getEnumAutoText(String autoText) | Context
getEnumErgValue(String fileType, String field, String techEnumValue, String locale="") | Context
getEnumValues(String fileType, String field) | Context
getFieldErgName(String fileType, String field, String locale="") | Context
getFileById(String idFile) | Context
getFileTypeErgName(String fileType, String locale="") | Context
getFileTypeOID(String nameFiletype, boolean oidLow=false) | Context
getFolderPosition(Folder folder) | Context
getFoldersByName(String folderPattern, String type="") | Context
getFromSystemTable(String identifier) | Context
getJSObject(String oid) | Context
getLastError() | Context
getLocaleValue(String value, String locale="") | Context
getPrincipalAttribute(String attributeName) | Context
getProgressBar() | Context
getQueryParams() | Context
getRegisterErgName(String fileTypeName, String registerName, String locale="") | Context
getServerInstallPath() | Context
getSystemUser() | Context
getSystemUsers(boolean includeLockedUsers=false) | Context
getTempPathByToken(String accessToken, boolean dropToken=true) | Context
getTmpFilePath() | Context
getXMLServer(String archiveServerName="") | Context
hasPEMModule(Integer moduleConst) | Context
qsession | Context
register | Context
reloadCurrentPrincipal(boolean pemReload=false) | Context
reloadPrincipal(String principalName, boolean pemReload=false) | Context
returnType | Context
scriptName | Context
selectedArchiveFiles | Context
selectedArchiveKeys | Context
selectedDocuments | Context
selectedFiles | Context
sendTCPStringRequest(String server, int port, String request, int responseTimeout=3000) | Context
setClientLang(String locale) | Context
setClientSystemLang(int langIndex) | Context
setFolderPosition(Folder folder, int position) | Context
setOrAddCustomProperty(String name, String type, String value) | Context
setPrincipalAttribute(String attributeName, String value) | Context
setProgressBar(float value) | Context
setProgressBarText(String text) | Context
sourceCode | Context
workflowActionId | Context
workflowActionName | Context
workflowControlFlowId | Context
workflowControlFlowName | Context
workflowStep | Context
writeLogBook(int actionCode, String detail1, String detail2, String detail3) | Context


DOCUMENTS 5 - PortalScripting API: ControlFlow Class Reference

Public Member Functions | Public Attributes | List of all members
ControlFlow Class Reference

The ControlFlow class has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means. More...

Public Member Functions

String | getAttribute (String attribute)
Get the String value of an attribute of the ControlFlow. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the ControlFlow to the desired value. More...

Public Attributes

String | id
String value containing the unique internal ID of the ControlFlow. More...
String | label
String value containing the ergonomic label of the ControlFlow. More...
String | name
String value containing the technical name of the ControlFlow. More...

Detailed Description

The ControlFlow class has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means.

You may access ControlFlow objects of a certain WorkflowStep by the different methods described in the WorkflowStep chapter. The objects of this class reflect only outgoing control flows of a WorkflowStep object.

Note
This class and all of its methods and attributes require a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

Member Function Documentation

◆ getAttribute()

String ControlFlow::getAttribute ( String attribute )

Get the String value of an attribute of the ControlFlow.

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ getLastError()

String ControlFlow::getLastError ( )

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

Returns
Text of the last error as String
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e
See also
DocFile.getLastError()

◆ setAttribute()

boolean ControlFlow::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the ControlFlow to the desired value.

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

Member Data Documentation

◆ id

String ControlFlow::id

String value containing the unique internal ID of the ControlFlow.

Returns
String value containing the unique ControlFlow ID.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ label

String ControlFlow::label

String value containing the ergonomic label of the ControlFlow.

This is usually the label of the according button in the web surface.

Returns
String value containing the ControlFlow's ergonomic label.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ name

String ControlFlow::name

String value containing the technical name of the ControlFlow.

Returns
String value containing the ControlFlow's technical name.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.51e / otrisPORTAL 5.1e


DOCUMENTS 5 - PortalScripting API: Member List

ControlFlow Member List

This is the complete list of members for ControlFlow, including all inherited members.

getAttribute(String attribute) | ControlFlow
getLastError() | ControlFlow
id | ControlFlow
label | ControlFlow
name | ControlFlow
setAttribute(String attribute, String value) | ControlFlow


DOCUMENTS 5 - PortalScripting API: ControlFlowIterator Class Reference

Public Member Functions | List of all members
ControlFlowIterator Class Reference

The ControlFlowIterator class has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means. More...

Public Member Functions

ControlFlow first ()
Retrieve the first ControlFlow object in the ControlFlowIterator. More...
ControlFlow next ()
Retrieve the next ControlFlow object in the ControlFlowIterator. More...
int size ()
Get the amount of ControlFlow objects in the ControlFlowIterator. More...

Detailed Description

The ControlFlowIterator class has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means.

You may access ControlFlowIterator objects of a certain WorkflowStep by the different methods described in the WorkflowStep chapter. The objects of this class reflect a list of outgoing control flows of a WorkflowStep object.

Note
This class and all of its methods and attributes require a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

Member Function Documentation

◆ first()

ControlFlow ControlFlowIterator::first ( )

Retrieve the first ControlFlow object in the ControlFlowIterator.

Returns
ControlFlow or null in case of an empty ControlFlowIterator
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ next()

ControlFlow ControlFlowIterator::next ( )

Retrieve the next ControlFlow object in the ControlFlowIterator.

Returns
ControlFlow or null if end of ControlFlowIterator is reached.
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ size()

int ControlFlowIterator::size ( )

Get the amount of ControlFlow objects in the ControlFlowIterator.

Returns
integer value with the amount of ControlFlow objects in the ControlFlowIterator
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e


DOCUMENTS 5 - PortalScripting API: Member List

ControlFlowIterator Member List

This is the complete list of members for ControlFlowIterator, including all inherited members.

first() | ControlFlowIterator
next() | ControlFlowIterator
size() | ControlFlowIterator


DOCUMENTS 5 - PortalScripting API: CustomProperty Class Reference

Public Member Functions | Public Attributes | List of all members
CustomProperty Class Reference

The CustomProperty class provides access to the user properties. More...

Public Member Functions

CustomProperty | addSubProperty (String name, String type, String value)
Creates a new subproperty for the custom property. More...
boolean | deleteCustomProperty ()
Deletes the CustomProperty. More...
String | getAttribute (String attribute)
Get the String value of an attribute of the CustomProperty. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
CustomPropertyIterator | getSubProperties (String nameFilter="", String typeFilter="")
Get a CustomPropertyIterator with subproperties of the custom property. More...
boolean | setAccessProfile (String nameAccessProfile="")
Connects a custom property to an AccessProfile. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the CustomProperty to the desired value. More...
boolean | setFiletype (String nameFiletype="")
Connects a custom property to a filetype. More...
CustomProperty | setOrAddSubProperty (String name, String type, String value)
Creates a new subproperty or modifies a subproperty according the name and type for the custom property. More...
boolean | setSystemUser (String login="")
Connects a custom property to a SystemUser. More...

Public Attributes

String | name
String containing the name of the CustomProperty.
String | type
String containing the type of the CustomProperty.
String | value
String containing the value of the CustomProperty.

Detailed Description

The CustomProperty class provides access to the user properties.

The class CustomProperty provides a container where used specific data can be stored. E.g it will be used to store the last search masks. You can save project specific data using this class. The scripting classes SystemUser, AccessProfile and Context have the following access methods available:

  • getCustomProperties()
  • addCustomProperty()
  • setOrAddCustomProperty()

In the DOCUMENTS-Manager you can find the CustomProperty on the relation-tab properties at the fellow and user account, access profiles and file types. The global custom properties are listed in Documents > Global properties. A global custom property must not belong to a SystemUser, an AccessProfile, a file type and another custom property. All custom properties are located in Documents > All properties.

Since
DOCUMENTS 4.0a
DOCUMENTS 5.0 available for AccessProfile and Context
Example:
var user = context.findSystemUser("schreiber");
if (!user)
throw "invalid user";
// Creation of an unique (name, type) CustomProperty
var custProp = user.setOrAddCustomProperty("superior", "person", "oppen");
if (!custProp)
throw "unable to create CustomProperty " + user.getLastError();
util.out("New CustomProperty: " + custProp.name);
custProp.deleteCustomProperty();
// Creation of multiple equal (name, type) CustomProperty
for (var i=0; i<5; i++)
{
var custProp = user.addCustomProperty("favorites", "something", "value_" + i);
}
var name = "favorites";
var type = "";
var it = user.getCustomProperties(name, type);
for (var prop = it.first(); prop; prop = it.next())
{
if (prop.type == "something")
prop.deleteCustomProperty();
}
See also
SystemUser.getCustomProperties(String nameFilter, String typeFilter)
SystemUser.setOrAddCustomProperty(String name, String type, String value)
SystemUser.addCustomProperty(String name, String type, String value)

Member Function Documentation

◆ addSubProperty()

CustomProperty CustomProperty::addSubProperty | ( | String | name,
 |  | String | type,
 |  | String | value
 | ) |  |

Creates a new subproperty for the custom property.

Parameters
name | String value defining the name
type | String value defining the type
value | String value defining the value
Returns
CustomProperty
Since
DOCUMENTS 5.0
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var custProp = currentUser.setOrAddCustomProperty("superior", "string", "oppen");
if (!custProp)
util.out(currentUser.getLastError());
else
custProp.addSubProperty("Address", "string", "Dortmund");
See also
CustomProperty.setOrAddSubProperty(String name, String type, String value)
CustomProperty.getSubProperties(String nameFilter, String typeFilter)

◆ deleteCustomProperty()

boolean CustomProperty::deleteCustomProperty ( )

Deletes the CustomProperty.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0a

◆ getAttribute()

String CustomProperty::getAttribute ( String attribute )

Get the String value of an attribute of the CustomProperty.

Valid attribute names are name, type and value

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Since
DOCUMENTS 4.0a

◆ getLastError()

String CustomProperty::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 4.0a

◆ getSubProperties()

CustomPropertyIterator CustomProperty::getSubProperties | ( | String | nameFilter = "",
 |  | String | typeFilter = ""
 | ) |  |

Get a CustomPropertyIterator with subproperties of the custom property.

Parameters
nameFilter | String value defining an optional filter depending on the name
typeFilter | String value defining an optional filter depending on the type
Returns
CustomPropertyIterator
Since
DOCUMENTS 5.0
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var itProp = currentUser.getCustomProperties();
for (var prop = itProp.first(); prop; prop = itProp.next())
{
util.out(prop.name + ": " + prop.value);
var itSubprop = prop.getSubProperties();
for (var subprop = itSubprop.first(); subprop; subprop = itSubprop.next())
{
util.out("Subproperty name: " + subprop.name + " Value: " + subprop.value);
}
}
See also
CustomProperty.setOrAddSubProperty(String name, String type, String value)
CustomProperty.addSubProperty(String name, String type, String value)

◆ setAccessProfile()

boolean CustomProperty::setAccessProfile ( String nameAccessProfile = "" )

Connects a custom property to an AccessProfile.

An empty profile name disconnects the AccessProfile

Parameters
nameAccessProfile Optional String value containing the name of the AccessProfile
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0
Example:
if (!custProp.setAccessProfile("Service"))
throw custProp.getLastError();
custProp.setAccessProfile(""); // disconnects AccessProfile
See also
CustomProperty.setSystemUser(String login)
CustomProperty.setFiletype(String nameFiletype)

◆ setAttribute()

boolean CustomProperty::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the CustomProperty to the desired value.

Valid attribute names are name, type and value

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0a

◆ setFiletype()

boolean CustomProperty::setFiletype ( String nameFiletype = "" )

Connects a custom property to a filetype.

An empty filetype name disconnects the filetype

Parameters
nameFiletype Optional String value containing the technical name of the filetype
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0
Example:
if (!custProp.setFiletype("ftInvoice"))
throw custProp.getLastError();
custProp.setFiletype(""); // disconnects filetype
See also
CustomProperty.setSystemUser(String login)
CustomProperty.setAccessProfile(String nameAccessProfile)

◆ setOrAddSubProperty()

CustomProperty CustomProperty::setOrAddSubProperty | ( | String | name,
 |  | String | type,
 |  | String | value
 | ) |  |

Creates a new subproperty or modifies a subproperty according the name and type for the custom property.

This method creates or modifies a unique subproperty for the custom property. The combination of the name and the type make the subproperty unique for the custom property.

Parameters
name | String value defining the name
type | String value defining the type
value | String value defining the value
Returns
CustomProperty
Since
DOCUMENTS 5.0
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var custProp = currentUser.setOrAddCustomProperty("superior", "string", "oppen");
if (!custProp)
util.out(currentUser.getLastError());
else
custProp.setOrAddSubProperty("Address", "string", "Dortmund");
See also
CustomProperty.getSubProperties(String nameFilter, String typeFilter)
CustomProperty.addSubProperty(String name, String type, String value)

◆ setSystemUser()

boolean CustomProperty::setSystemUser ( String login = "" )

Connects a custom property to a SystemUser.

An empty login disconnects the SystemUser

Parameters
login Optional String value containing the login name of the SystemUser.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0
Example:
if (!custProp.setSystemUser("schreiber"))
throw custProp.getLastError();
custProp.setSystemUser(""); // disconnects SystemUser
See also
CustomProperty.setFiletype(String nameFiletype)
CustomProperty.setAccessProfile(String nameAccessProfile)


DOCUMENTS 5 - PortalScripting API: Member List

CustomProperty Member List

This is the complete list of members for CustomProperty, including all inherited members.

addSubProperty(String name, String type, String value) | CustomProperty
deleteCustomProperty() | CustomProperty
getAttribute(String attribute) | CustomProperty
getLastError() | CustomProperty
getSubProperties(String nameFilter="", String typeFilter="") | CustomProperty
name | CustomProperty
setAccessProfile(String nameAccessProfile="") | CustomProperty
setAttribute(String attribute, String value) | CustomProperty
setFiletype(String nameFiletype="") | CustomProperty
setOrAddSubProperty(String name, String type, String value) | CustomProperty
setSystemUser(String login="") | CustomProperty
type | CustomProperty
value | CustomProperty


DOCUMENTS 5 - PortalScripting API: CustomPropertyIterator Class Reference

Public Member Functions | List of all members
CustomPropertyIterator Class Reference

The CustomPropertyIterator class is an iterator that holds a list of objects of the class CustomProperty. More...

Public Member Functions

CustomProperty first ()
Retrieve the first CustomProperty object in the CustomPropertyIterator. More...
CustomProperty next ()
Retrieve the next CustomProperty object in the CustomPropertyIterator. More...
int size ()
Get the amount of CustomProperty objects in the CustomPropertyIterator. More...

Detailed Description

The CustomPropertyIterator class is an iterator that holds a list of objects of the class CustomProperty.

Since
DOCUMENTS 4.0a

Member Function Documentation

◆ first()

CustomProperty CustomPropertyIterator::first ( )

Retrieve the first CustomProperty object in the CustomPropertyIterator.

Returns
CustomProperty or null in case of an empty CustomPropertyIterator
Since
DOCUMENTS 4.0a

◆ next()

CustomProperty CustomPropertyIterator::next ( )

Retrieve the next CustomProperty object in the CustomPropertyIterator.

Returns
CustomProperty or NULL if end of CustomPropertyIterator is reached
Since
DOCUMENTS 4.0a

◆ size()

int CustomPropertyIterator::size ( )

Get the amount of CustomProperty objects in the CustomPropertyIterator.

Returns
integer value with the amount of CustomProperty objects in the CustomPropertyIterator
Since
DOCUMENTS 4.0a


DOCUMENTS 5 - PortalScripting API: Member List

CustomPropertyIterator Member List

This is the complete list of members for CustomPropertyIterator, including all inherited members.

first() | CustomPropertyIterator
next() | CustomPropertyIterator
size() | CustomPropertyIterator


DOCUMENTS 5 - PortalScripting API: DBConnection Class Reference

Public Member Functions | List of all members
DBConnection Class Reference

This class enables you to connect to a database and execute SQL statements. More...

Public Member Functions

boolean | close ()
Close the database connection and free the server ressources. More...
DBConnection DBConnection ()
Connection to DOCUMENTS Database. More...
DBConnection | DBConnection (String connType, String connString, String user="", String password="")
Connection to External Database. More...
DBResultSet | executeQuery (String sqlStatement)
Execute a SELECT statement and retrieve a DBResultSet containing the result rows. More...
DBResultSet | executeQueryUC (String sqlStatement)
Execute a SELECT statement using a x64/UTF-8 DOCUMENTS and retrieve a DBResultSet containing the result rows. More...
boolean | executeStatement (String sqlStatement)
Execute any SQL statement on the external database. More...
boolean | executeStatementUC (String sqlStatement)
Execute any SQL statement using a x64/UTF-8 DOCUMENTS on the external database. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...

Detailed Description

This class enables you to connect to a database and execute SQL statements.

You can connect to the DOCUMENTS database (see constructor without parameters) or to any external database (see constructor with parameters). For reading the result of a SELECT statement, the class DBResultSet is used. A DBConnection object can only be used for one DBResultSet object. Meaning, if you want to create another DBResultSet object you must also create an additional DBConnection object. Please consider the example in the constructor description.

Constructor & Destructor Documentation

◆ DBConnection() [1/2]

DBConnection DBConnection::DBConnection ( )

Connection to DOCUMENTS Database.

The constructor without parameters can be used to create a connection to the database currently used in DOCUMENTS. For connecting an external database, see the documentation of the constructor with parameters.

Since
DOCUMENTS 4.0
See also
DBResultSet

◆ DBConnection() [2/2]

DBConnection DBConnection::DBConnection | ( | String | connType,
 |  | String | connString,
 |  | String | user = "",
 |  | String | password = ""
 | ) |  |

Connection to External Database.

The constructor with parameters can be used to create a connection to an external database. Meaning to a database, that is not connected to DOCUMENTS. For connecting the DOCUMENTS database, we recommend to use the constructor without parameters.

You can connect to any database system of arbitrary type. But depending on your DOCUMENTS database, you can use different values for parameter connType. The difference is described in the following two cases.

Case 1: Parameter connType = "sqlserver" | "oracle" | "mysql"

This connection types allow you to connect to an external database of the given type. But the type must be identical to the database system that is connected to the DOCUMENTS server. DOCUMENTS supports the following types (also see system requirements).

  • Windows: SQL Server, Oracle Database, MySQL, MariaDB
  • Linux: MySQL, MariaDB

So this parameter values can be used with the following database systems:

  • "mysql": MySQL and MariaDB
  • "sqlserver": SQL Server
  • "oracle": Oracle Database

Case 2: Parameter connType = "odbc"

This connection type allows the connection to an external database of almost every type. In this case the database will be accessed using the standard API for databases, called Open Database Connectivity (ODBC). The only restriction is, that an ODBC driver for the database must be available and this driver must be installed on the DOCUMENTS host. Additional, an ODBC Driver Manager can or sometimes must be used to specify a Data Source Name (DSN). The DSN allows you to define the required connection attributes all in one place. Sometimes, the credentials can also be specified at the DSN. If not, they can be set as parameters in the DBConnection constructor.

On DOCUMENTS 5.0e and lower the DSN must be used, if the DOCUMENTS database is not SQL Server.

ODBC

A short and good description about the common ODBC concept is available in the documentation of turbodbc (the ODBC documentation is independent of turbodbc). Additional there is a Microsoft documentation about ODBC.

ODBC on Windows

If your DOCUMENTS is running on Windows with SQL Server, you will probably have an ODBC Driver for SQL Server. Additional you should have the ODBC Data Source Administrator App for configuring Data Sources. To connect to a remote SQL Server, you may have to enable the TCP/IP protocol in SQL Server Configuration Manager and to open the port in the firewall on the remote SQL Server host.

ODBC on Linux

You can find installation instructions for the ODBC Driver for SQL Server in the Microsoft Documentation. The ODBC Driver Manager package unixODBC is available in the package archives of Ubuntu (e.g. 16.04 and 18.04) and can be installed using the package manager APT. For testing your database connection independent of PortalScripting, you can use isql.

Note
ODBC is not JDBC, JDBC is not supported!
Parameters
connType | The type of the database connection ("odbc" | "sqlserver" | "oracle" | "mysql"), see two cases in constructor description.
connString | The complete connection string or the data source name (DSN).
user | The login name used to authenticate against the external database.
password | The (plaintext) password of the user utilized to connect to the database.
Returns
DBConnection object representing the active database connection or null in case of any error.
Since
ELC 3.50 / otrisPORTAL 5.0
See also
DBResultSet
Example:
// Create DB-Connection to an external database (DOCUMENTS is connected to SQL Server)
var connectionString = "driver={ODBC Driver 11 for SQL Server};server=localhost;database=myDB;trusted_connection=yes;";
var myDB = new DBConnection("sqlserver", connectionString);
// Create DB-Connection to any DB using the DSN
var dataSourceName = "myDSN";
var user = "test";
var password = "test";
var myDB = new DBConnection("odbc", dataSourceName, user, password);
Example:
var myDB = null;
var myRS = null;
try {
// create DB-Connection using the Data Source Name "Nordwind"
myDB = new DBConnection("odbc", "Nordwind");
if (myDB.getLastError() != null)
throw "Error connection the database: " + myDB.getLastError();
// executeQuery returns a DBResultSet
myRS = myDB.executeQuery("SELECT Nachname, Vorname FROM Personal");
if (!myRS)
throw "Error in SELECT statement: " + myDB.getLastError();
// read all persons from the result set
while (myRS.next()) {
var fullName = myRS.getString(0) + ", " + myRS.getString(1);
// Fails, because you must read the columns in the correct order!
//var fullName = myRS.getString(1) + ", " + myRS.getString(0);
// Fails, because it is not allowed to read a value twice!
//var fullName = myRS.getString(0) + ", " + myRS.getString(0);
util.out(fullName);
}
} catch (err) {
util.out(err);
} finally {
// Important: free resources!
if (myRS)
myRS.close();
if (myDB)
myDB.close();
}

Member Function Documentation

◆ close()

boolean DBConnection::close ( )

Close the database connection and free the server ressources.

Note
It is strongly recommanded to close each DBConnection object you have created, since database connections are so-called expensive ressources and should be used carefully.
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
See also
DBResultSet.close()

◆ executeQuery()

DBResultSet DBConnection::executeQuery ( String sqlStatement )

Execute a SELECT statement and retrieve a DBResultSet containing the result rows.

Note
This instruction should only be used to SELECT on the external database, since the method always tries to create a DBResultSet. If you need to execute different SQL statements, refer to the DBConnection.executeStatement() method.
Parameters
sqlStatement String containing the SELECT statement you want to execute in the database
Returns
DBResultSet containing the result rows generated by the SELECT instruction
Since
ELC 3.50 / otrisPORTAL 5.0
See also
DBConnection.executeStatement(String sqlStatement)
Note
x64/UTF-8 DOCUMENTS version: since DOCUMENTS 4.0a HF2 the method handles the statement as UTF-8-String

◆ executeQueryUC()

DBResultSet DBConnection::executeQueryUC ( String sqlStatement )

Execute a SELECT statement using a x64/UTF-8 DOCUMENTS and retrieve a DBResultSet containing the result rows.

Note
This instruction should only be used to SELECT on the external database, since the method always tries to create a DBResultSet. If you need to execute different SQL statements, refer to the DBConnection.executeStatement() method.
Parameters
sqlStatement String containing the SELECT statement you want to execute in the database
Returns
DBResultSet containing the result rows generated by the SELECT instruction
Since
DOCUMENTS 4.0
See also
DBConnection.executeStatementUC()
Deprecated:
since DOCUMENTS 4.0a HF2, use DBConnection.executeQuery() instead

◆ executeStatement()

boolean DBConnection::executeStatement ( String sqlStatement )

Execute any SQL statement on the external database.

You can execute any SQL statement, as long as the database driver used for the connection supports the type of instruction. Use this method especially if you want to INSERT or UPDATE or DELETE data rows in tables of the external database. If you need to SELECT table rows, refer to the DBConnection.executeQuery() method.

Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
See also
DBConnection.executeQuery(String sqlStatement)
Note
x64/UTF-8 DOCUMENTS version: since DOCUMENTS 4.0a HF2 the method handles the statement as UTF-8-String

◆ executeStatementUC()

boolean DBConnection::executeStatementUC ( String sqlStatement )

Execute any SQL statement using a x64/UTF-8 DOCUMENTS on the external database.

You can execute any SQL statement, as long as the database driver used for the connection supports the type of instruction. Use this method especially if you want to INSERT or UPDATE or DELETE data rows in tables of the external database. If you need to SELECT table rows, refer to the DBConnection.executeQueryUC() method.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0
See also
DBConnection.executeQueryUC()
Deprecated:
since DOCUMENTS 4.0a HF2, use DBConnection.executeStatement() instead

◆ getLastError()

String DBConnection::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
See also
DocFile.getLastError()


DOCUMENTS 5 - PortalScripting API: Member List

DBConnection Member List

This is the complete list of members for DBConnection, including all inherited members.

close() | DBConnection
DBConnection() | DBConnection
DBConnection(String connType, String connString, String user="", String password="") | DBConnection
executeQuery(String sqlStatement) | DBConnection
executeQueryUC(String sqlStatement) | DBConnection
executeStatement(String sqlStatement) | DBConnection
executeStatementUC(String sqlStatement) | DBConnection
getLastError() | DBConnection


DOCUMENTS 5 - PortalScripting API: DBResultSet Class Reference

Public Member Functions | List of all members
DBResultSet Class Reference

The DBResultSet class contains a list of resultset rows. More...

Public Member Functions

boolean | close ()
Close the DBResultSet and free the server ressources. More...
boolean | getBool (int colNo)
Read the indicated column of the current row of the DBResultSet as a boolean value. More...
String | getColName (int colNo)
Function returns the name of a column. More...
Date | getDate (int colNo)
Read the indicated column of the current row of the DBResultSet as a Date object. More...
float | getFloat (int colNo)
Read the indicated column of the current row of the DBResultSet as a float value. More...
int | getInt (int colNo)
Read the indicated column of the current row of the DBResultSet as an integer value. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
int | getNumCols ()
Function returns the amount of columns of the DBResultSet. More...
String | getString (int colNo)
Read the indicated column of the current row of the DBResultSet as a String. More...
Date | getTimestamp (int colNo)
Read the indicated column of the current row of the DBResultSet as a Date object including the time. More...
String | getUCString (int colNo)
Read the indicated column of the current row of the DBResultSet on a x64/UTF-8 DOCUMENTS as a String. More...
boolean | next ()
Move the resultset pointer to the next row of the DBResultSet. More...

Detailed Description

The DBResultSet class contains a list of resultset rows.

You need an active DBConnection object to execute an SQL query which is used to create a DBResultSet.

Note
Important: Please consider the restrictions according the order of reading of the columns of the DBResultSet. Read the example!

The following data types for database columns will be supported:

SQL data type | access method
SQL_INTEGER | getInt(), getString()
SQL_SMALLINT | getInt(), getString()
SQL_BIGINT | getInt(), getString()
SQL_FLOAT | getFloat(), getInt(), getString()
SQL_DECIMAL | getFloat(), getInt(), getString()
SQL_NUMERIC | getFloat(), getInt(), getString()
SQL_BIT | getBool(), getString()
SQL_TIMESTAMP | getTimestamp(), getString()
SQL_DATE | getDate(), getString()
SQL_GUID | getString()
SQL_VARCHAR | getString()
SQL_CHAR | getString()
all other types | getString()
Example:
// create DB-Connection to ODBC-64 Datasource "Nordwind"
var myDB = new DBConnection("odbc", "Nordwind");
if (myDB && myDB.getLastError() == null)
{
var myRS = myDB.executeQuery("SELECT Nachname, Vorname FROM Personal");
if (myRS)
{
// read all persons from the result set
while (myRS.next())
{
var fullName = myRS.getString(0) + ", " + myRS.getString(1);
// var fullName = myRS.getString(1) + ", " + myRS.getString(0); // Fails, because you must read the columns in the correct order!
// var fullName = myRS.getString(0) + ", " + myRS.getString(0); // Fails, because it is not allowed to read a value twice!
util.out(fullName);
}
// Important: free resource!
myRS.close()
}
else
util.out("Error in SELECT statement: " + myDB.getLastError());
// Important: free resource!
myDB.close();
}
else
util.out("Error connection the database: " + myDB.getLastError())
Since
ELC 3.50 / otrisPORTAL 5.0
DOCUMENTS 5.0c HF1 (support for SQL_GUID)
See also
DBConnection

Member Function Documentation

◆ close()

boolean DBResultSet::close ( )

Close the DBResultSet and free the server ressources.

Note
It is strongly recommanded to close each DBResultSet object you have created, since database connections and resultsets are so-called expensive ressources and should be used carefully.
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
See also
DBConnection.close()

◆ getBool()

boolean DBResultSet::getBool ( int colNo )

Read the indicated column of the current row of the DBResultSet as a boolean value.

Parameters
colNo integer value (zero based) indicating the desired column of the current row of the DBResultSet
Returns
boolean value representing the indicated column of the current row
Since
ELC 3.50 / otrisPORTAL 5.0

◆ getColName()

String DBResultSet::getColName ( int colNo )

Function returns the name of a column.

Parameters
colNo integer value (zero based) indicating the desired column
Returns
Column name as String
Since
DOCUMENTS 5.0

◆ getDate()

Date DBResultSet::getDate ( int colNo )

Read the indicated column of the current row of the DBResultSet as a Date object.

Note
The return value will be null if the content of the indicated column cannot be converted to a Date object.
Parameters
colNo integer value (zero based) indicating the desired column of the current row of the DBResultSet
Returns
Date object representing the indicated column of the current row or NULL if is null-value
Since
ELC 3.50 / otrisPORTAL 5.0
Note
every value of a DBResultSet can only be read one time and in the correct order!

◆ getFloat()

float DBResultSet::getFloat ( int colNo )

Read the indicated column of the current row of the DBResultSet as a float value.

Note
The return value will be NaN if the content of the indicated column cannot be converted to a float value.
Parameters
colNo integer value (zero based) indicating the desired column of the current row of the DBResultSet
Returns
float value representing the indicated column of the current row or NULL if is null-value
Since
ELC 3.50 / otrisPORTAL 5.0
Note
every value of a DBResultSet can only be read one time and in the correct order!

◆ getInt()

int DBResultSet::getInt ( int colNo )

Read the indicated column of the current row of the DBResultSet as an integer value.

Note
The return value will be NaN if the content of the indicated column cannot be converted to an integer value.
Parameters
colNo integer value (zero based) indicating the desired column of the current row of the DBResultSet
Returns
integer value representing the indicated column of the current row or NULL if is null-value
Since
ELC 3.50 / otrisPORTAL 5.0
Note
every value of a DBResultSet can only be read one time and in the correct order!

◆ getLastError()

String DBResultSet::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
See also
DocFile.getLastError()

◆ getNumCols()

int DBResultSet::getNumCols ( )

Function returns the amount of columns of the DBResultSet.

Returns
Column count as int
Since
DOCUMENTS 5.0

◆ getString()

String DBResultSet::getString ( int colNo )

Read the indicated column of the current row of the DBResultSet as a String.

Parameters
colNo integer value (zero based) indicating the desired column of the current row of the DBResultSet
Returns
String representing the indicated column of the current row or NULL if is null-value
Since
ELC 3.50 / otrisPORTAL 5.0
Note
x64/UTF-8 DOCUMENTS version: since DOCUMENTS 4.0a HF2 the method transcode the fetched data to UTF-8
every value of a DBResultSet can only be read one time and in the correct order!

◆ getTimestamp()

Date DBResultSet::getTimestamp ( int colNo )

Read the indicated column of the current row of the DBResultSet as a Date object including the time.

Note
The return value will be null if the content of the indicated column cannot be converted to a Date object.
Parameters
colNo integer value (zero based) indicating the desired column of the current row of the DBResultSet
Returns
Date object (including time) representing the indicated column of the current row or NULL if is null-value
Since
ELC 3.50 / otrisPORTAL 5.0
Note
every value of a DBResultSet can only be read one time and in the correct order!

◆ getUCString()

String DBResultSet::getUCString ( int colNo )

Read the indicated column of the current row of the DBResultSet on a x64/UTF-8 DOCUMENTS as a String.

Parameters
colNo integer value (zero based) indicating the desired column of the current row of the DBResultSet
Returns
String representing the indicated column of the current row or NULL if is null-value
Since
DOCUMENTS 4.0
Deprecated:
since DOCUMENTS 4.0a HF2 use DBResultSet.getString() instead
Note
every value of a DBResultSet can only be read one time and in the correct order!

◆ next()

boolean DBResultSet::next ( )

Move the resultset pointer to the next row of the DBResultSet.

The method must be called at least once after retrieving a DBResultSet, because the newly created object does not point to the first result row but to BOF (beginning of file).

Returns
true if the DBResultSet now points to the next row, false if there is no further result row
Since
ELC 3.50 / otrisPORTAL 5.0
Note
every value of a DBResultSet can only be read one time and in the correct order!


DOCUMENTS 5 - PortalScripting API: Member List

DBResultSet Member List

This is the complete list of members for DBResultSet, including all inherited members.

close() | DBResultSet
getBool(int colNo) | DBResultSet
getColName(int colNo) | DBResultSet
getDate(int colNo) | DBResultSet
getFloat(int colNo) | DBResultSet
getInt(int colNo) | DBResultSet
getLastError() | DBResultSet
getNumCols() | DBResultSet
getString(int colNo) | DBResultSet
getTimestamp(int colNo) | DBResultSet
getUCString(int colNo) | DBResultSet
next() | DBResultSet


DOCUMENTS 5 - PortalScripting API: DocFile Class Reference

Public Member Functions | Public Attributes | List of all members
DocFile Class Reference

The DocFile class implements the file object of DOCUMENTS. More...

Public Member Functions

boolean | abort ()
Cancel edit mode for a file. More...
Document | addDocumentFromFileSystem (String pathDocument, String targetRegister, String targetFileName, boolean deleteDocumentAtFileSystem=false, boolean parseAutoText=false, DocFile referencFileToParse=this)
Add a file as a new Document from the server's filesystem to a given Register. More...
boolean | addPDF (String pathCoverXML, boolean createCover, String pdfFileName, String targetRegister, Array sourceRegisterNames)
Create a PDF file containing the current DocFile's contents and store it on a given document register. More...
boolean | archive ()
Archive the DocFile object. More...
boolean | archive (String archiveKey)
Archive the DocFile object to the desired archive. More...
boolean | archive (ArchivingDescription desc)
Archive the DocFile object according to the given ArchivingDescription object. More...
boolean | archiveAndDelete ()
Archive the DocFile object and remove the DOCUMENTS file. More...
String | asJSON (string[] fieldList=[])
Creates a JSON-String of this file. More...
boolean | cancelWorkflow ()
Cancel the current workflow for the file. More...
boolean | changeFiletype (String nameFiletype)
Change the filetype of this file. More...
boolean | checkWorkflowReceiveSignal ()
Checks the receive signals of the workflow for the DocFile object. More...
boolean | clearFollowUpDate (SystemUser pUser)
Clear a followup date for a desired user. More...
boolean | commit ()
Commit any changes to the DocFile object. More...
boolean | connectFolder (Folder fObj)
Store a reference to the current file in the desired target folder. More...
int | countFields (String fieldName)
Count fields with a desired name in the file. More...
String | createMonitorFile (boolean asPDF=false, String locale="")
Creates a workflow monitor file in the server's file system. More...
String | createStatusFile (boolean asPDF=false, String locale="")
Creates a status file in the server's file system. More...
boolean | deleteFile (boolean moveTrash=false, boolean movePool=true, boolean allVersions=false, integer easDeleteMode=0)
Delete the DocFile object. More...
boolean | disconnectArchivedFile ()
Uncouple an active file from the archived version. More...
boolean | disconnectFolder (Folder fObj)
Remove a reference to the current file out of the desired target folder. More...
boolean | exportXML (String pathXML, boolean withDocuments, boolean withStatus=false, boolean withMonitor=false)
Export the file as an XML file. More...
boolean | forwardFile (String controlFlowId, String comment="")
Forward file in its workflow via the given control flow. More...
boolean | fromJSON (String jsonstring)
Updates a file from a JSON-String. More...
WorkflowStepIterator getAllLockingWorkflowSteps ()
Get a list of all locking workflow step that currently lock the file. More...
WorkflowStepIterator getAllWorkflowSteps ()
Get a list of all workflow step of the file. More...
String | getArchiveKey (boolean withServer=true)
After archiving of a file this method returns the key of the file in the archive. More...
String | getAsPDF (String nameCoverTemplate, boolean createCover, Array sourceRegisterNames)
Create a PDF file containing the current DocFile's contents and returns the path in the file system. More...
String | getAttribute (String attribute)
Get the String value of an attribute of the file. More...
String | getAutoText (String autoText)
Get the String value of a DOCUMENTS autotext. More...
DocFile | getCopy ("NoDocs"|"ActualVersion"|"AllVersions" copyMode)
Duplicate a file. More...
Date | getCreationDate ()
Returns the creation date (timestamp) of a DocFile. More...
var | getCreator (boolean asObject=false)
Returns the SystemUser object or fullname as String of the creator of the DocFile. More...
WorkflowStep getCurrentWorkflowStep ()
Get the current workflow step of the current user locking the file. More...
DocFileDataField getDocFileComment ()
Returns the comment value for a DocFile. More...
string [] | getDoubleSelectListValues (String fieldName, boolean resolved=false)
Get the enumeration values of the desired double select list field. More...
Array | getEnumAutoText (String autoText)
Get an array with the values of an enumeration autotext. More...
String | getFieldAttribute (String fieldName, String attrName)
Get the String value of an attribute of the desired file field. More...
String | getFieldAutoText (String fieldName, String autoText="")
Returns an AutoText value of a specified field of the DocFile. More...
String | getFieldName (int index)
Get the technical name of the n-th field of the file. More...
var | getFieldValue (String fieldName, String returnType)
Get the value of the desired file field. More...
SystemUser getFileOwner ()
Get the file owner of the file. More...
WorkflowStep getFirstLockingWorkflowStep ()
Get the first locking workflow step that currently locks the file. More...
String | getid ()
Returns the file id of the DocFile. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
Date | getLastModificationDate ()
Returns the last modification date (timestamp) of a DocFile. More...
String | getLastModifier ()
Returns the fullname as String of the last editor of the DocFile. More...
String | getOID (boolean oidLow=false)
Returns the object-id. More...
DocFile getOriginal ()
Get the orginal file for a scratch copy. More...
DocFile | getReferenceFile (String referenceFileField)
Get the file referred by a reference field in the current file. More...
Register | getRegisterByName (String registerName, boolean checkAccessRight=false)
RegisterIterator | getRegisters (String type="documents", boolean checkAccessRight=false)
Get an iterator with the registers of the file for the specified type. More...
String | getTitle (String locale=user locale)
Returns the title of the DocFile. More...
String | getUserStatus (String login)
Get the status of the file for a desired user. More...
boolean | hasField (String fieldName)
Gather information whether the current file has the field with the desired name. More...
boolean | insertStatusEntry (String action, String comment)
Add an entry to the status tab of the file. More...
boolean | isArchiveFile ()
Gather information whether the current file is an archive file. More...
boolean | isDeletedFile ()
Gather information whether the current file is a deleted file of a trash folder. More...
boolean | isNewFile ()
Gather information whether the current file is a new file. More...
boolean | reactivate ()
Reactivate an archive file to a file of the corresponding filetype. More...
boolean | sendFileAdHoc (Array receivers, String sendMode, String task, boolean backWhenFinished)
Send the DocFile directly. More...
boolean | sendMail (String from, String templateName, String to, String cc, boolean addDocs, String bcc)
Send the file as email to somebody. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the file to the desired value. More...
boolean | setFieldAttribute (String fieldName, String attrName, String value)
Set the value of an attribute of the desired file field. More...
boolean | setFieldValue (String fieldName, var value)
Set the value of the desired file field. More...
boolean | setFileOwner (SystemUser owner)
Set the file owner of the file to the desired user. More...
boolean | setFollowUpDate (SystemUser pUser, Date followUpDate, String comment)
Set a followup date for a desired user. More...
DocFile | setReferenceFile (String fieldName, DocFile referenceFile)
set the referred file of the desired reference field in the current file. More...
boolean | setUserRead (String login, boolean fileRead)
Mark the file as read or unread for the desired user. More...
boolean | setUserStatus (String login, String status)
Set the status of the file for a desired user to a desired value. More...
boolean | startEdit ()
Switch a DocFile to edit mode. More...
boolean | startWorkflow (String workflowName)
Start a workflow for the DocFile object. More...
boolean | sync (boolean checkHistoryFields=false, boolean notifyHitlistChange=true, boolean updateRefFields=true, boolean updateModifiedDate=false)
Synchronize any changes to the DocFile object back to the real file. More...
boolean | undeleteFile ()
Relive a deleted file. More...

Public Attributes

var fieldName
The technical name of a field. More...

Detailed Description

The DocFile class implements the file object of DOCUMENTS.

You may access a single DocFile with the help of the attribute context.file or by creating a FileResultset. There are no special properties available, but each field of a file is mapped to an according property. You can access the different field values with their technical names.
For this reason it is mandatory to use programming language friendly technical names, meaning

  • only letters, digits and the underscore "_" are allowed.
  • no whitespaces or any special characters are allowed.
  • the technical name must not start with a digit.
  • only the first 32 characters of the technical name are significant to identify the field.
Example:
var myFile = context.file;
var priority = myFile.Priority; // read a field value
myFile.Remark = "Just a remark"; // assign a value to a field
myFile.sync(); // apply changes in field values to the file

Member Function Documentation

◆ abort()

boolean DocFile::abort ( )

Cancel edit mode for a file.

If you switched a file to edit mode with the startEdit() method and if you want to cancel this (e.g. due to some error that has occurred in the mean time) this function should be used to destroy the scratch copy which has been created by the startEdit() instruction.

Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFile = context.file;
myFile.startEdit();
myFile.Field = "value";
myFile.abort(); // effect: "value" is not applied!
See also
DocFile.startEdit()
DocFile.commit()

◆ addDocumentFromFileSystem()

Document DocFile::addDocumentFromFileSystem | ( | String | pathDocument,
 |  | String | targetRegister,
 |  | String | targetFileName,
 |  | boolean | deleteDocumentAtFileSystem = false,
 |  | boolean | parseAutoText = false,
 |  | DocFile | referencFileToParse = this
 | ) |  |

Add a file as a new Document from the server's filesystem to a given Register.

It is possible to parse Autotexts inside the source file to fill the Document with the contents of index fields of a DocFile object. The max. file size for the source file is 512 KB.

Parameters
pathDocument | String value containing the complete filepath to the source file on the server
targetRegister | String value containing the technical name of the desired Register
targetFileName | String value containing the desired filename of the uploaded Document
deleteDocumentAtFileSystem | optional boolean value to decide whether to delete the source file on the server's filesystem
parseAutoText | optional boolean value to decide whether to parse the AutoText values inside the source file. Note: if you want to make use of AutoTexts in this kind of template files, you need to use double percentage signs instead of single ones, e.g. %%Field1%% instead of %Field1%!
referencFileToParse | optional DocFile object to be used to parse the AutoTexts inside the template. If you omit this parameter, the current DocFile object is used as the data source.
Returns
Document if successful, null in case of any error
Since
ELC 3.51f / otrisPORTAL 5.1f
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var f = context.file;
var success = f.addDocumentFromFileSystem("c:\\temp\\test.rtf", "Documents", "parsedRTFFile.rtf", false, true);

◆ addPDF()

boolean DocFile::addPDF | ( | String | pathCoverXML,
 |  | boolean | createCover,
 |  | String | pdfFileName,
 |  | String | targetRegister,
 |  | Array | sourceRegisterNames
 | ) |  |

Create a PDF file containing the current DocFile's contents and store it on a given document register.

The different document types of your documents on your different tabs require the appropriate PDF filter programs to be installed and configured in DOCUMENTS. To successfully add the created PDF file to a register the DocFile needs to be in edit mode (via startEdit() method), and the changes have to be applied via commit().

Parameters
pathCoverXML | String containing full path and filename of the template xml file to parse
createCover | boolean whether to create a field list or to only take the documents
pdfFileName | String value for the desired file name of the created PDF
targetRegister | String value containing the technical name of the target document register
sourceRegisterNames | Array with the technical names of the document registers you want to include
Returns
true if successful, false in case of any error
Since
ELC 3.50a / otrisPORTAL 5.0a
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var source = new Array();
source.push("FirstRegister");
source.push("SecondRegister");
var docFile = context.file;
docFile.startEdit();
docFile.addPDF("c:\\tmp\\cover.xml",
true,
"GeneratedPDF.pdf",
"MyTargetRegister",
source
);
docFile.commit();

◆ archive() [1/3]

boolean DocFile::archive ( )

Archive the DocFile object.

The target archive has to be configured in the filetype definition (in the Windows Portal Client) as the default archive. If no default archive is defined, the execution of this operation will fail.

Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFile = context.file;
myFile.archive();

◆ archive() [2/3]

boolean DocFile::archive ( String archiveKey )

Archive the DocFile object to the desired archive.

If the target archive key is misspelled or if the target archive does not exist, the operation will fall back to the default archive, as long as it is configured in the filetype definition. So the function will only fail if both the target archive and the default archive are missing.

Parameters
archiveKey String value containing the complete archive key for EE.i or schema|view for EE.x of the desired target archive
Returns
true if successful, false in case of any error
Note
For EE.i: It is important to know that the target archive String must use the socalled XML-Server syntax. The old EAG syntax is not supported. It is as well neccessary to use a double backslash (\\) if you define your target archive as an ECMAScript String value, because a single backslash is a special character.
Since
EE.i: ELC 3.51c / otrisPORTAL 5.1c
EE.x: ELC 3.60a / otrisPORTAL 6.0a
EAS: Documents 4.0
Example:
// Example for EE.i:
var myFile = context.file;
var targetArchive = "$(#TOASTUP)\\STANDARD";
targetArchive += "@myeei"; // since Documents 4.0 using multi archive server
myFile.archive(targetArchive);
Example:
// Example for EE.x:
var myFile = context.file;
var view = "Unit=Default/Instance=Default/View=DeliveryNotes";
var schema = "Unit=Default/Instance=Default/DocumentSchema=LIEFERSCHEINE";
var target = schema + "|" + view;
target += "@myeex"; // since Documents 4.0 using multi archive server
myFile.archive(target);
Example:
// Example for EAS:
var myFile = context.file;
myFile.archive("@myeas"); // using multi archive server

◆ archive() [3/3]

boolean DocFile::archive ( ArchivingDescription desc )

Archive the DocFile object according to the given ArchivingDescription object.

This is the most powerful way to archive a file through scripting, since the ArchivingDescription object supports a convenient way to influence which parts of the DocFile should be archived.

Parameters
desc ArchivingDescription object that configures several archiving options
Returns
true if successful, false in case of any error
Since
EE.i: ELC 3.51c / otrisPORTAL 5.1c
EE.x: ELC 3.60a / otrisPORTAL 6.0a
EAS: Documents 4.0
Example:
// Example for EE.i:
var myFile = context.file;
var ad = new ArchivingDescription();
ad.targetArchive = "$(#TOASTUP)\\STANDARD";
ad.archiveServer = "myeei"; // since Documents 4.0 using multi archive server
ad.archiveStatus = true;
ad.archiveMonitor = true;
ad.addRegister("all_docs"); // archive all attachments
var success = myFile.archive(ad);
if (success)
{
context.returnType = "html";
return ("<p>ArchiveFileID: " + myFile.getAttribute("Key") + "<p>");
}
Example:
// Example for EE.x:
var myFile = context.file;
var ad = new ArchivingDescription();
ad.targetView = "Unit=Default/Instance=Default/View=DeliveryNotes";
ad.targetSchema = "Unit=Default/Instance=Default/DocumentSchema=LIEFERSCHEINE";
ad.archiveServer = "myeex"; // since Documents 4.0 using multi archive server
ad.archiveStatus = true;
ad.archiveMonitor = true;
ad.addRegister("all_docs"); // archive all attachments
var success = myFile.archive(ad);
if (success)
{
context.returnType = "html";
return ("<p>ArchiveFileID: " + myFile.getArchiveKey() + "</p>");
}
Example:
// Example for EAS:
var myFile = context.file;
var ad = new ArchivingDescription();
ad.archiveServer = "myeas"; // using multi archive server
ad.archiveStatus = true;
ad.archiveMonitor = true;
ad.addRegister("all_docs"); // archive all attachments
var success = myFile.archive(ad);
if (success)
{
context.returnType = "html";
return ("<p>ArchiveFileID: " + myFile.getArchiveKey() + "</p>");
}
See also
ArchivingDescription

◆ archiveAndDelete()

boolean DocFile::archiveAndDelete ( )

Archive the DocFile object and remove the DOCUMENTS file.

The target archive has to be configured in the filetype definition (in the Windows Portal Client) as the default archive. It depends on the filetype settings as well, whether Status and Monitor will be archived as well. If no default archive is defined, the execution of this operation will fail.

Note
It is strictly forbidden to access the DocFile object after this function has been executed successfully; if you try to access it, your script will fail, because the DocFile does not exist any longer in DOCUMENTS. For the same reason it is strictly forbidden to execute this function in a signal exit PortalScript.
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFile = context.file;
myFile.archiveAndDelete();

◆ asJSON()

String DocFile::asJSON ( string [] fieldList = [] )

Creates a JSON-String of this file.

Parameters
fieldList optional String array, that specifies the DocFile attributes and field names, that will be part of JSON export

Available DocFile attributes:

  • "DlcFile_Title"
  • "DlcFile_Owner"
  • "DlcFile_Created"
  • "DlcFile_LastEditor"
  • "DlcFile_LastModified"
    Returns
    String with JSON content.
    Since
    DOCUMENTS 5.0 HF1
    DOCUMENTS 5.0c HF2 (new parameter fieldList)
    Example:
    var file = context.file;
    util.out(file.asJSON());
    // {
    // "DlcFile_Title": "Filetype1_Test 11.03.2011 11:23",
    // "DlcFile_Owner": "user1",
    // "DlcFile_Created": "2011-03-11T10:23:00.000Z",
    // "DlcFile_LastEditor": "user2",
    // "DlcFile_LastModified": "2011-03-12T18:08:08.000Z",
    // "str":"Hallo",
    // "ts":"2015-11-20T13:21:22.389Z", Zulu Time
    // "bool":true,
    // "num":1,
    // "float":3.14,
    // "arr":["abc",1,true]
    // }
    var file = context.file;
    var fields = ["DlcFile_Title", "str"];
    util.out(file.asJSON(fields));
    // {
    // "DlcFile_Title": "Filetype1_Test 11.03.2011 11:23",
    // "str":"Hallo"
    // }
    See also
    DocFile.fromJSON(String jsonstring)

◆ cancelWorkflow()

boolean DocFile::cancelWorkflow ( )

Cancel the current workflow for the file.

Returns
true if successful, false in case of any error
Since
ELC 3.51e / otrisPORTAL 5.1e
Example:
var f = context.file;
f.cancelWorkflow();

◆ changeFiletype()

boolean DocFile::changeFiletype ( String nameFiletype )

Change the filetype of this file.

Parameters
nameFiletype String containing the technical name of the filetype.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0e
Example:
var file = context.file;
if (!file.changeFiletype("newFiletype"))
util.out(file.getLastError());

◆ checkWorkflowReceiveSignal()

boolean DocFile::checkWorkflowReceiveSignal ( )

Checks the receive signals of the workflow for the DocFile object.

This method can only be used for a DocFile, that runs in a workflow and the workflow has receive signals. Usually the receive signals of the workflow step will be checked by a periodic job. Use this method to trigger the check of the receive signals for the DocFile.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0a
Example:
var myFile = context.file;
var succ = myFile.checkWorkflowReceiveSignal();
if (!succ)
util.out(myFile.getLastError());

◆ clearFollowUpDate()

boolean DocFile::clearFollowUpDate ( SystemUser pUser )

Clear a followup date for a desired user.

Parameters
pUser SystemUser object of the desired user
Returns
true if successful, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
var docFile = context.file;
var su = context.getSystemUser();
docFile.clearFollowUpDate(su);
See also
DocFile.setFollowUpDate(SystemUser pUser, Date followUpDate, String comment)

◆ commit()

boolean DocFile::commit ( )

Commit any changes to the DocFile object.

This method is mandatory to apply changes to a file that has been switched to edit mode with the startEdit() method. It is strictly prohibited to execute the commit() method in a script which is attached to the onSave scripting hook.

Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFile = context.file;
myFile.startEdit();
myFile.Field = "value";
myFile.commit();
See also
DocFile.startEdit()
DocFile.sync()
DocFile.abort()

◆ connectFolder()

boolean DocFile::connectFolder ( Folder fObj )

Store a reference to the current file in the desired target folder.

The (public) folder must be a real folder, it must not be a dynamic filter, nor a "only subfolder" object.

Parameters
fObj Folder object representing the desired target public folder
Returns
true if successful, false in case of any error.
Since
ELC 3.51h / otrisPORTAL 5.1h
Example:
var f = context.file;
var fObj = context.getFoldersByName("Invoices").first();
var success = f.connectFolder(fObj);
See also
DocFile.disconnectFolder(Folder fObj)

◆ countFields()

int DocFile::countFields ( String fieldName )

Count fields with a desired name in the file.

Parameters
fieldName String containing the technical name of the fields to be counted.
Returns
The number of fields als an Integer.
Note
When this function is called on an EE.x DocFile with an empty field name, the return value may be greater than expected. The DOCUMENTS image of such a file can include EE.x system fields and symbolic fields for other imported scheme attributes (blob content, notice content).
Since
DOCUMENTS 4.0c HF2
Example:
var key = "Unit=Default/Instance=Default/Pool=DEMO/Pool=RECHNUNGEN/Document=RECHNUNGEN.41D3694E2B1E11DD8A9A000C29FACDC2@eex1"
var docFile = context.getArchiveFile(key);
if (!docFile)
throw "archive file does not exist: " + key;
else
util.out(docFile.countFields("fieldName"));

◆ createMonitorFile()

String DocFile::createMonitorFile | ( | boolean | asPDF = false,
 |  | String | locale = ""
 | ) |  |

Creates a workflow monitor file in the server's file system.

This method creates a monitor file in the server's file system with the workflow monitor content of the DocFile. The file will be created as a html-file.

Parameters
asPDF | boolean parameter that indicates that a pdf-file must be created instead of a html-file
locale | String (de, en,..) in which locale the file must be created (empty locale = log-in locale)
Returns
String containing the path of the created file
Note
This generated file will no be automatically added to the DocFile
Since
DOCUMENTS 4.0a HF2

◆ createStatusFile()

String DocFile::createStatusFile | ( | boolean | asPDF = false,
 |  | String | locale = ""
 | ) |  |

Creates a status file in the server's file system.

This method creates a status file in the server's file system with the status content of the DocFile. The file will be created as a html-file.

Parameters
asPDF | boolean parameter that indicates that a pdf-file must ge created instead of a html-file
locale | String (de, en,..) in which locale the file must be created (empty locale = log-in locale)
Returns
String containing the path of the created file
Note
This generated file will no be automatically added to the DocFile
Since
DOCUMENTS 4.0a HF2

◆ deleteFile()

boolean DocFile::deleteFile | ( | boolean | moveTrash = false,
 |  | boolean | movePool = true,
 |  | boolean | allVersions = false,
 |  | integer | easDeleteMode = 0
 | ) |  |

Delete the DocFile object.

If there's another PortalScript attached to the onDelete scripting hook, it will be executed right before the deletion takes place.

Note
It is strictly forbidden to access the DocFile object after this function has been executed successfully; if you try to access it, your script will fail, because the DocFile does not exist any longer in DOCUMENTS. For the same reason it is strictly forbidden to execute this function in a signal exit PortalScript.
Parameters
moveTrash | optional boolean parameter to decide whether to move the deleted file to the trash folder
movePool | optional boolean parameter to decide whether to move the deleted file's object to the file pool
allVersions | optional boolean parameter to delete all versions of an EAS archive file at once.
easDeleteMode | opional integer specifying the delete mode for an EAS archive file. See remarks.
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
ELC 3.50n / otrisPORTAL 5.0n (moveTrash parameter)
ELC 3.51f / otrisPORTAL 5.1f (movePool parameter)
DOCUMENTS 4.0a HF1 (available for archive files)
DOCUMENTS 4.0e (all versions)
DOCUMENTS 5.0e (easDeleteMode)
Note
The parameters moveTrash, movePool are ignored for archive files. The parameters allVersions and easDeleteMode require an EAS/EDA file and are ignored otherwise.
Remarks
The parameter easDeleteMode is interpreted in the following way. 0 = Use default setting (property "EASDeleteMode" of the archive store or factory setting); 1 = quick delete (restorable from WORM directory with archive administration tools); 2 = full delete (requires archive maintenance login "eas_keeper"). The last option ist occasionally needed to make a solution compliant with EU-GDPR. If a script tries to delete the actual "context.file", the server usually enforces "movePool = true". This is controlled by the common DOCUMENTS property "ContextFileDeleteProtection".
Example:
var myFile = context.file;
myFile.deleteFile(false, true);

◆ disconnectArchivedFile()

boolean DocFile::disconnectArchivedFile ( )

Uncouple an active file from the archived version.

Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0d
Example:
var f = context.file;
var f.archive();
var success = f.disconnectArchivedFile();
See also
DocFile.archive(), DocFile.getArchiveKey(boolean withServer)

◆ disconnectFolder()

boolean DocFile::disconnectFolder ( Folder fObj )

Remove a reference to the current file out of the desired target folder.

The (public) folder must be a real folder, it must not be a dynamic filter, nor a "only subfolder" object.

Parameters
fObj Folder object representing the desired target public folder
Returns
true if successful, false in case of any error.
Since
ELC 3.51h / otrisPORTAL 5.1h
Example:
var f = context.file;
var fObj = context.getFoldersByName("Invoices").first();
var success = f.disconnectFolder(fObj);
See also
DocFile.connectFolder(String folderName)

◆ exportXML()

boolean DocFile::exportXML | ( | String | pathXML,
 |  | boolean | withDocuments,
 |  | boolean | withStatus = false,
 |  | boolean | withMonitor = false
 | ) |  |

Export the file as an XML file.

Parameters
pathXML | String containing full path and filename of the desired target xml file
withDocuments | boolean value to include the documents. The value must be set to true in case status or monitor information are to be inserted.
withStatus | boolean value to include status information. The value must be set to true in order to add the status. Status Information will then be generated into a file which will be added to the documents. Please note that therefore withDocuments must be set to true in order to get Status information.
withMonitor | boolean value to include Monitor information. The value must be set to true in order to add the monitor. Monitor Information will then be generated into a file which will be added to the documents. Please note that therefore withDocuments must be set to true in order to get Monitor information.
Returns
true if successful, false in case of any error
Since
ELC 3.50a / otrisPORTAL 5.0a
ELC 3.60e / otrisPORTAL 6.0e (Option: export of status & monitor)
Example:
var docFile = context.file;
docFile.exportXML("c:\\tmp\\myXmlExport.xml", true, false, true);

◆ forwardFile()

boolean DocFile::forwardFile | ( | String | controlFlowId,
 |  | String | comment = ""
 | ) |  |

Forward file in its workflow via the given control flow.

This method only works if the file is inside a workflow and inside a workflow action that is accessible by a user of the web interface. Based on that current workflowstep you need to gather the ID of one of the outgoing control flows of that step. The access privileges of the current user who tries to execute the script are taken into account. Forwarding the file will only work if that control flow is designed to forward without query.

Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Parameters
controlFlowId | String containing the technical ID of the outgoing control flow that should be passed
comment | optional String value containing a comment to be automatically added to the file's monitor
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var docFile = context.file;
var step = docFile.getCurrentWorkflowStep();
var flowId = step.firstControlFlow;
docFile.forwardFile(flowId);

◆ fromJSON()

boolean DocFile::fromJSON ( String jsonstring )

Updates a file from a JSON-String.

Must be followed by sync()

Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0 HF1
See also
DocFile.asJSON()

◆ getAllLockingWorkflowSteps()

WorkflowStepIterator DocFile::getAllLockingWorkflowSteps ( )

Get a list of all locking workflow step that currently lock the file.

The locking workflow steps do not need to be locked by the current user executing the script, this function as well returns all locking steps which refer to different users.

Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Returns
WorkflowStepIterator object which represents a list of all locking workflow steps for the file
Since
ELC 3.51e / otrisPORTAL 5.1e
Example:
var f = context.file;
var stepIter = f.getAllLockingWorkflowSteps();
if (stepIter.size() > 0)
util.out("File is locked by " + stepIter.size() + " workflow steps");
See also
DocFile.getCurrentWorkflowStep()
DocFile.getFirstLockingWorkflowStep()

◆ getAllWorkflowSteps()

WorkflowStepIterator DocFile::getAllWorkflowSteps ( )

Get a list of all workflow step of the file.

The methd will return all workflow steps, the currently locking and the previous ones.

Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Returns
WorkflowStepIterator object which represents a list of all workflow steps for the file
Since
DOCUMENTS 5.0b
Example:
var f = context.file;
var stepIter = f.getAllWorkflowSteps();
See also
DocFile.getCurrentWorkflowStep()
DocFile.getFirstLockingWorkflowStep()

◆ getArchiveKey()

String DocFile::getArchiveKey ( boolean withServer = true )

After archiving of a file this method returns the key of the file in the archive.

Parameters
withServer optional boolean value to indicate, if the key should include an "@archiveServerName" appendix
Returns
String containing the key.
Note
If the file is not archived or archived without versioning or uncoupled from the achived file the key is empty.
Since
ELC 3.60a / otrisPORTAL 6.0a
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var f = context.file;
if (f.archive())
util.out(f.getArchiveKey());
else
util.out(f.getLastError());
See also
DocFile.archive(), DocFile.disconnectArchivedFile()

◆ getAsPDF()

String DocFile::getAsPDF | ( | String | nameCoverTemplate,
 |  | boolean | createCover,
 |  | Array | sourceRegisterNames
 | ) |  |

Create a PDF file containing the current DocFile's contents and returns the path in the file system.

The different document types of your documents on your different tabs require the appropriate PDF filter programs to be installed and configured in DOCUMENTS.

Parameters
nameCoverTemplate | String containing the name of the pdf cover template defined at the filetype
createCover | boolean whether to create a field list or to only take the documents
sourceRegisterNames | Array with the technical names of the document registers you want to include
Returns
String with file path of the pdf, an empty string in case of any error
Since
DOCUMENTS 4.0b
Example:
var source = new Array();
source.push("FirstRegister");
source.push("SecondRegister");
var docFile = context.file;
var pathPdfFile = docFile.getAsPDF("pdfcover", true, source);
if (pathPdfFile == "")
throw docFile.getLastError();
util.out("Size: " + util.fileSize(pathPdfFile))

◆ getAttribute()

String DocFile::getAttribute ( String attribute )

Get the String value of an attribute of the file.

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Since
ELC 3.50 / otrisPORTAL 5.0
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var myFile = context.file;
util.out(myFile.getAttribute("hasInvoicePlugin"));

◆ getAutoText()

String DocFile::getAutoText ( String autoText )

Get the String value of a DOCUMENTS autotext.

Parameters
autoText the rule to be parsed
Returns
String containing the parsed value of the autotext
Since
ELC 3.50 / otrisPORTAL 5.0
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var myFile = context.file;
util.out(myFile.getAutoText("fileOwner"));

◆ getCopy()

DocFile DocFile::getCopy ( "NoDocs"|"ActualVersion"|"AllVersions" copyMode )

Duplicate a file.

This function creates a real 1:1 copy of the current file which may be submitted to its own workflow. The function returns the copied file. If an error occurrs, the function returns null and getLastError() can be called on the calling object.

Parameters
copyMode defines how to handle the documents of the originating file.
There are three different parameter values allowed:
  • "NoDocs" copied DocFile does not contain any documents
  • "ActualVersion" copied DocFile contains only the latest (published) version of each document
  • "AllVersions" copied DocFile contains all versions (both published and locked) of each document
Returns
DocFile object representing the copied file, null in case of error
Since
ELC 3.51c / otrisPORTAL 5.1c
Example:
var docFile = context.file;
var newFile = docFile.getCopy("AllVersions");
if (!newFile)
util.out(docFile.getLastError());

◆ getCreationDate()

Date DocFile::getCreationDate ( )

Returns the creation date (timestamp) of a DocFile.

Returns
Date object, if the date is valid, null for an invalid data.
Since
DOCUMENTS 5.0c
Example:
var file = context.file;
var c_ts = file.getCreationDate();
if (c_ts)
util.out(c_ts);
See also
DocFile.getCreator(boolean asObject)
DocFile.getLastModificationDate()

◆ getCreator()

var DocFile::getCreator ( boolean asObject = false )

Returns the SystemUser object or fullname as String of the creator of the DocFile.

Parameters
asObject optional boolean value, that specifies, if the SystemUser object or the fullname should be returned.
Returns
asObject=true: SystemUser object or null (if user does not exist anymore)
asObject=false: String with the fullname.
Since
DOCUMENTS 5.0c
Example:
var file = context.file;
var su = file.getCreator(true);
if (su)
util.out(su.login);
else
util.out(file.getCreator());
See also
DocFile.getLastModifier()
DocFile.getCreationDate()

◆ getCurrentWorkflowStep()

WorkflowStep DocFile::getCurrentWorkflowStep ( )

Get the current workflow step of the current user locking the file.

The function returns a valid WorkflowStep object if there exists one for the current user. If the current user does not lock the file, the function returns null instead.

Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Returns
WorkflowStep object
Since
ELC 3.51e / otrisPORTAL 5.1e
Example:
var f = context.file;
var step = f.getCurrentWorkflowStep();
if (!step)
step = f.getFirstLockingWorkflowStep();
// still no workflow steps found? File not in workflow
if (!step)
util.out("File is not in a workflow");
See also
DocFile.getFirstLockingWorkflowStep()

◆ getDocFileComment()

DocFileDataField DocFile::getDocFileComment ( )

Returns the comment value for a DocFile.

Returns
DocFileDataField object or null.
Since
DOCUMENTS 5.0d

◆ getDoubleSelectListValues()

string [] DocFile::getDoubleSelectListValues | ( | String | fieldName,
 |  | boolean | resolved = false
 | ) |  |

Get the enumeration values of the desired double select list field.

Parameters
fieldName String containing the technical field name can be followed by the desired instance number in form techFieldName[i] for multi-instance fields of an EE.i/EE.x archive file.
Note: The index i is zero-based. The specification of field instance is olny available for an EE.i/EE.x archive file, it will be ignored for other files. If the parameter contains no instance information, the first field instance is used. The field instance order is determined by the field order in the file.
resolved Optional boolean value indicating whether to return the full multi language enumeration values (e.g. "key;de:Wert;en:Value") instead of only the keys (e.g. "key"). The default value is false.
Returns
Array of strings containing the multi language enumeration values or only the keys.
Since
DOCUMENTS 5.0e HF2
Example:
var myFile = context.file;
var values = myFile.getDoubleSelectListValues("DoubleListfield", true);
if (values)
{
for (var i = 0; i < values.length; i++)
{
util.out(values[i]);
}
}

◆ getEnumAutoText()

Array DocFile::getEnumAutoText ( String autoText )

Get an array with the values of an enumeration autotext.

Parameters
autoText to 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]);
}
}

◆ getFieldAttribute()

String DocFile::getFieldAttribute | ( | String | fieldName,
 |  | String | attrName
 | ) |  |

Get the String value of an attribute of the desired file field.

Parameters
fieldName | String containing the technical name of the desired field
attrName | String containing the name of the desired attribute
Returns
String containing the value of the desired field attribute
Since
ELC 3.50 / otrisPORTAL 5.0
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var myFile = context.file;
util.out(myFile.getFieldAttribute("Samplefield", "Value"));

◆ getFieldAutoText()

String DocFile::getFieldAutoText | ( | String | fieldName,
 |  | String | autoText = ""
 | ) |  |

Returns an AutoText value of a specified field of the DocFile.

The following AutoTexts are available

  • "[locale]" - field value in the user locale or specified locale.
  • "key" - key value (e.g. at refence fields, enumeration fields, etc.).
  • "fix" - fix format value (e.g. at numeric fields, date fields, etc.).
  • "pos" - order position of the field value at enumeration fields.
  • "raw" - database field value.
  • "label[.locale]" - label of the field in user locale or specified locale.
Parameters
fieldName | Name of the field as String
[autoText] | WantedAutoText as String (default = "" returns field value in the user locale)
Returns
String with the AutoText.
Since
DOCUMENTS 5.0c
Example:
var file = context.file;
util.out(file.getFieldAutoText("erpInvoiceDate")); // => 31.12.2017
util.out(file.getFieldAutoText("erpInvoiceDate", "en")); // => 12/31/2017
util.out(file.getFieldAutoText("erpInvoiceDate", "fix")); // => 20171231
util.out(file.getFieldAutoText("erpInvoiceDate", "label")); // => Rechnungsdatum
util.out(file.getFieldAutoText("erpInvoiceDate", "label.en")); // => Invoice date

◆ getFieldName()

String DocFile::getFieldName ( int index )

Get the technical name of the n-th field of the file.

This allows generic scripts to be capable of different versions of the same filetype, e.g. if you changed details of the filetype, but there are still older files of the filetype in the system.

Parameters
index integer index of the desired field
Returns
String containing the technical name of the file field, false if index is out of range
Since
ELC 3.50e / otrisPORTAL 5.0e
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var myFile = context.file;
var fieldName = "Samplefield";
var fields = new Array();
var i = 0;
// get all field names
while (myFile.getFieldName(i))
{
fields[i] = myFile.getFieldName(i)
i++;
}
// check for field existance
var found = false;
for (var j = 0; j < fields.length; j++)
{
if (fields[j] == fieldName)
{
found = true;
break;
}
}

◆ getFieldValue()

var DocFile::getFieldValue | ( | String | fieldName,
 |  | String | returnType
 | ) |  |

Get the value of the desired file field.

Parameters
fieldName String containing the technical field name can be followed by the desired instance number in form techFieldName[i] for multi-instance fields of an EE.i/EE.x archive file.
Note: The index i is zero-based. The specification of field instance is olny available for an EE.i/EE.x archive file, it will be ignored for other files. If the parameter contains no instance information, the first field instance is used. The field instance order is determined by the field order in the file.
returnType Optional string specified the type of the return value. Currently only the type "Array" is available for a double select list field.
Returns
The field value, its type depends on the field type (such as a Date object returned for a field of type 'Timestamp') or the specified return type if applicable.
See also
Field Access Methods
Since
DOCUMENTS 4.0c
DOCUMENTS 4.0c HF2 available for multi-instance fields of an EE.i/EE.x archive file
DOCUMENTS 5.0e HF2 (optional parameter returnType)
Example:
var myFile = context.file;
util.out(myFile.getFieldValue("Samplefield"));
// Since DOCUMENTS 4.0c HF2
var key = "Unit=Default/Instance=Default/Pool=FeldZ/Document=Feldzahlen.86C94C30438011E2B925080027B22D11@eex1";
var eexFile = context.getArchiveFile(key);
util.out(eexFile.getFieldValue("multiInstanceField[2]"));
// Since DOCUMENTS 5.0e HF2
var myFile = context.file;
var values = myFile.getFieldValue("doubleListfield", "Array");
if (values)
{
for (var i = 0; i < values.length; i++)
{
util.out(values[i]);
}
}

◆ getFileOwner()

SystemUser DocFile::getFileOwner ( )

Get the file owner of the file.

Returns
SystemUser object representing the user who owns the file
Since
ELC 3.51d / otrisPORTAL 5.1d
Example:
var docFile = context.file;
var su = docFile.getFileOwner();
util.out(su.login);

◆ getFirstLockingWorkflowStep()

WorkflowStep DocFile::getFirstLockingWorkflowStep ( )

Get the first locking workflow step that currently locks the file.

The first locking workflow step does not need to be locked by the current user executing the script, this function as well returns the first locking step if it is locked by a different user. If no locking step is found at all, the function returns null instead.

Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Returns
WorkflowStep object
Since
ELC 3.50e / otrisPORTAL 5.0e
Example:
var f = context.file;
var step = f.getCurrentWorkflowStep();
if (!step)
{
step = f.getFirstLockingWorkflowStep();
}
// still no workflow steps found? File not in workflow
if (!step)
{
util.out("File is not in a workflow");
}
See also
DocFile.getCurrentWorkflowStep()

◆ getid()

String DocFile::getid ( )

Returns the file id of the DocFile.

Returns
String with the file id.
Since
DOCUMENTS 5.0c
Example:
var file = context.file;
util.out(file.getid());

◆ getLastError()

String DocFile::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
Example:
var myFile = context.file;
// do something which may go wrong
if (hasError)
{
util.out(myFile.getLastError());
}

◆ getLastModificationDate()

Date DocFile::getLastModificationDate ( )

Returns the last modification date (timestamp) of a DocFile.

Returns
Date object, if the date is valid, null for an invalid data.
Since
DOCUMENTS 5.0c
Example:
var file = context.file;
var c_ts = file.getLastModificationDate();
if (c_ts)
util.out(c_ts);
See also
DocFile.getLastModifier()
DocFile.getCreationDate()

◆ getLastModifier()

String DocFile::getLastModifier ( )

Returns the fullname as String of the last editor of the DocFile.

Returns
String with the fullname.
Since
DOCUMENTS 5.0c
Example:
var file = context.file;
util.out(file.getLastModifier());
See also
DocFile.getCreator(boolean asObject)
DocFile.getLastModificationDate()

◆ getOID()

String DocFile::getOID ( boolean oidLow = false )

Returns the object-id.

Parameters
oidLow Optional flag:
If true only the id of the DocFile object (m_oid) will be returned.
If false the id of the DocFile 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
Since
ELC 3.60c / otrisPORTAL 6.0c
ELC 3.60i / otrisPORTAL 6.0i available for archive files
DOCUMENTS 5.0 (new parameter oidLow)

◆ getOriginal()

DocFile DocFile::getOriginal ( )

Get the orginal file for a scratch copy.

If you run a scipt on a scratch copy (e.g. a onSave script), you can get the orginal file with this function.

Returns
DocFile
Since
DOCUMENTS 4.0 (EAS)
Example:
var scratchCopy = context.file;
var origFile = scratchCopy.getOriginal();
if (!origFile)
util.out(scratchFile.getLastError();
else
{
if (scratchCopy.FieldA != origFile.FieldA)
util.out("Field A changed");
else
util.out("Field A not changed");
}

◆ getReferenceFile()

DocFile DocFile::getReferenceFile ( String referenceFileField )

Get the file referred by a reference field in the current file.

If the current file's filetype is connected to a superior filetype by a reference field, this function allows to easily access the referred file, e.g. if you are in an invoice file and you want to access data of the referring company.

Parameters
referenceFileField String value containing the technical name of the file field contianing the definition to the referred filetype
Returns
DocFile object representing the referred file if successful, null in case of any error
Since
ELC 3.51c / otrisPORTAL 5.1c
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var docFile = context.file;
var company = docFile.getReferenceFile("crmCompany");
util.out(company.crmCompanyName);

◆ getRegisterByName()

Register DocFile::getRegisterByName | ( | String | registerName,
 |  | boolean | checkAccessRight = false
 | ) |  |
Parameters
registerName | String value containing the technical name of the desired register
checkAccessRight | optional boolean value, that indicates if the access rights should be considered.
Returns
Register object representing the desired register
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files
DOCUMENTS 5.0c (new optional parameter checkAccessRight)
Note
Until version 5.0c this method ignored the access rights of the user to the register. With the optional parameter checkAccessRight this can now be done. For backward compatibility the default value is set to false.
Example:
var docFile = context.file;
var reg = docFile.getRegisterByName("Documents");
See also
DocFile.getRegisters(String type, boolean checkAccessRight)

◆ getRegisters()

RegisterIterator DocFile::getRegisters | ( | String | type = "documents",
 |  | boolean | checkAccessRight = false
 | ) |  |

Get an iterator with the registers of the file for the specified type.

Parameters
type optional String value to filter for a desired register type. Default type is documents
Allowed values:
  • documents
  • fields
  • links
  • archiveddocuments
  • externalcall
  • all (returns all registers independent of the type)
checkAccessRight optional boolean value, that indicates if the access rights should be considered.
Returns
RegisterIterator with all registers (matching the filter)
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files
DOCUMENTS 5.0c (new optional parameter checkAccessRight)
Note
Until version 5.0c this method ignored the access rights of the user to the register. With the optional parameter checkAccessRight this can now be done. For backward compatibility the default value is set to false.
Example:
var docFile = context.file;
var regIter = docFile.getRegisters("documents");
See also
RegisterIterator
DocFile.getRegisterByName(String registerName, boolean checkAccessRight)

◆ getTitle()

String DocFile::getTitle ( String locale = user locale )

Returns the title of the DocFile.

Parameters
[locale] Locale as String (default = user locale)
Returns
String with the title.
Since
DOCUMENTS 5.0c
Note
the special locale raw returns the title in all locales
Example:
var file = context.file;
util.out(file.getTitle("en"));

◆ getUserStatus()

String DocFile::getUserStatus ( String login )

Get the status of the file for a desired user.

Parameters
login String containing the login name of the desired user
Returns
String with the status. Possible values:
  • standard
  • new
  • fromFollowup
  • toForward
  • forInfo
  • task
  • workflowCanceled
  • backFromDistribution
  • consultation
Since
DOCUMENTS 4.0c HF1
Example:
var docFile = context.file;
util.out(docFile.getUserStatus("schreiber"));
See also
DocFile.setUserStatus(String login, String status)

◆ hasField()

boolean DocFile::hasField ( String fieldName )

Gather information whether the current file has the field with the desired name.

Parameters
fieldName String containing the technical name of the field.
Returns
true if the file has the field, false if not
Since
DOCUMENTS 4.0d
Example:
var file = context.file;
if (file.hasField("address"))
util.out(file.address);

◆ insertStatusEntry()

boolean DocFile::insertStatusEntry | ( | String | action,
 |  | String | comment
 | ) |  |

Add an entry to the status tab of the file.

This function is especially useful in connection with PortalScripts being used as decision guards in workflows, because this allows to comment and describe the decisions taken by the scripts. This increases transparency concerning the life cycle of a file in DOCUMENTS.

Parameters
action | String containing a brief description
comment | optional String containing a descriptive comment to be added to the status entry
Returns
true if successful, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
var docFile = context.file;
docFile.insertStatusEntry("Executed Guard Script","all conditions met");

◆ isArchiveFile()

boolean DocFile::isArchiveFile ( )

Gather information whether the current file is an archive file.

Returns
true if is an archive file, false if not
Since
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var key = "Unit=Default/Instance=Default/Pool=DEMO/Pool=RECHNUNGEN/Document=RECHNUNGEN.41D3694E2B1E11DD8A9A000C29FACDC2"
var docFile = context.getArchiveFile(key);
if (docFile)
util.out(docFile.isArchiveFile());

◆ isDeletedFile()

boolean DocFile::isDeletedFile ( )

Gather information whether the current file is a deleted file of a trash folder.

Returns
true if is a deleted file, false if not
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
...
var trashFolder = user.getPrivateFolder("trash");
if (trashFolder)
{
var it = trashFolder.getFiles();
for (var file = it.first(); file; file = it.next())
{
if (file.isDeletedFile())
util.out("ok");
else
util.out("Error: Found undeleted file in trash folder!");
}
}

◆ isNewFile()

boolean DocFile::isNewFile ( )

Gather information whether the current file is a new file.

Returns
true if new file, false if not
Since
ELC 3.50l01 / otrisPORTAL 5.0l01
Example:
var docFile = context.file;
util.out(docFile.isNewFile());

◆ reactivate()

boolean DocFile::reactivate ( )

Reactivate an archive file to a file of the corresponding filetype.

Returns
true if successful, false if not - get error message with getLastError()
Since
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var key = "Unit=Default/Instance=Default/Pool=DEMO/Pool=RECHNUNGEN/Document=RECHNUNGEN.41D3694E2B1E11DD8A9A000C29FACDC2@eex1"
var docFile = context.getArchiveFile(key);
if (!docFile)
throw "archive file does not exist: " + key;
if (!docFile.reactivate())
throw "Reactivation failed: " + docFile.getLastError();
docFile.startWorkflow....

◆ sendFileAdHoc()

boolean DocFile::sendFileAdHoc | ( | Array | receivers,
 |  | String | sendMode,
 |  | String | task,
 |  | boolean | backWhenFinished
 | ) |  |

Send the DocFile directly.

Parameters
receivers | Array with the names of the users or groups to which to send the DocFile. You need to specify at least one recipient.
sendMode String containing the send type. The following values are available:
  • sequential - one after the other
  • parallel_info - concurrently for information
task | String specifying the task for the recipients of the DocFile
backWhenFinished | boolean indicating whether the DocFile should be returned to the own user account after the cycle.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0
Example:
var docFile = context.createFile("Filetype1");
var success = docFile.sendFileAdHoc(["user2", "user3"], "parallel_info", "test task", true);
if (!success)
util.out(docFile.getLastError());

◆ sendMail()

boolean DocFile::sendMail | ( | String | from,
 |  | String | templateName,
 |  | String | to,
 |  | String | cc,
 |  | boolean | addDocs,
 |  | String | bcc
 | ) |  |

Send the file as email to somebody.

You must define an email template in the Windows Portal Client at the filetype of your DocFile object. This template may contain autotexts that can be parsed and replaced with their appropriate field values.

Parameters
from | String value containing the sender's email address
templateName | String value containing the technical name of the email template. This must be defined on the email templates tab of the filetype.
to | String value containing the email address of the recipient
cc | Optional String value for an additional recipient ("cc" means "carbon copy")
addDocs | optional boolean value whether to include the documents of the file
bcc | Optional String value for the email addresses of blind carbon-copy recipients (remaining invisible to other recipients).
Returns
true if successful, false in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b
ELC 3.60i / otrisPORTAL 6.0i available for archive files
DOCUMENTS 4.0d new parameter bcc
Example:
var docFile = context.file;
docFile.sendMail("schreiber@toastup.de", "MyMailTemplate",
"oppen@toastup.de", "", true
);

◆ setAttribute()

boolean DocFile::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the file to the desired value.

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var myFile = context.file;
myFile.setAttribute("hasInvoicePlugin", "true");

◆ setFieldAttribute()

boolean DocFile::setFieldAttribute | ( | String | fieldName,
 |  | String | attrName,
 |  | String | value
 | ) |  |

Set the value of an attribute of the desired file field.

Parameters
fieldName | String containing the technical name of the desired field
attrName | String containing the name of the desired attribute
value | String value containing the desired field attribute value
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var myFile = context.file;
myFile.setFieldAttribute("Samplefield", "Value", "1");

◆ setFieldValue()

boolean DocFile::setFieldValue | ( | String | fieldName,
 |  | var | value
 | ) |  |

Set the value of the desired file field.

Parameters
fieldName String containing the technical field name can be followed by the desired instance number in form techFieldName[i] for multi-instance fields of an EE.i/EE.x archive file.
Note: The index i is zero-based. The specification of field instance is only available for an EE.i/EE.x archive file, it will be ignored for other files. If the parameter contains no instance information, the first field instance is used. The field instance order is determined by the field order in the file.
value The desired field value of the proper type according to the field type, e.g. a Date object as value of a field of type 'Timestamp'.
Note: The keys of the enumeration values for a double select list field may be passed either as an Array of strings or as an ordinary string with one key per line of text (see Field Access Methods).
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
DOCUMENTS 4.0c HF2 available for multi-instance fields of an EE.i/EE.x archive file
DOCUMENTS 5.0c HF2 String array as value for a double select list field
Example:
var myFile = context.file;
myFile.setFieldValue("NumericField", 3.14);
myFile.setFieldValue("TimestampField", new Date());
myFile.setFieldValue("BoolField", true);
myFile.setFieldValue("StringField", "Hello");
myFile.setFieldValue("DoubleListField1", "key1\nkey2";
myFile.setFieldValue("DoubleListField2", ["key1", "key2"]; // Since DOCUMENTS 5.0e HF2
myFile.sync();
// Since DOCUMENTS 4.0c HF2
var key = "Unit=Default/Instance=Default/Pool=FeldZ/Document=Feldzahlen.86C94C30438011E2B925080027B22D11@eex1";
var eexFile = context.getArchiveFile(key);
eexFile.startEdit();
eexFile.setFieldValue("multiInstanceField[2]", "Hello");
eexFile.commit();

◆ setFileOwner()

boolean DocFile::setFileOwner ( SystemUser owner )

Set the file owner of the file to the desired user.

Parameters
owner SystemUser object representing the desired new file owner
Returns
true if successful, false in case of any error
Since
ELC 3.51d / otrisPORTAL 5.1d
Example:
var docFile = context.file;
var su = context.getSystemUser();
docFile.setFileOwner(su);

◆ setFollowUpDate()

boolean DocFile::setFollowUpDate | ( | SystemUser | pUser,
 |  | Date | followUpDate,
 |  | String | comment
 | ) |  |

Set a followup date for a desired user.

Parameters
pUser | SystemUser object of the desired user
followUpDate | Date object representing the desired followup date
comment | optional String value containing a comment that is displayed as a task as soon as the followup is triggered
Returns
true if successful, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
var docFile = context.file;
var su = context.getSystemUser();
var followup = util.convertStringToDate("31.12.2008", "dd.mm.yyyy");
docFile.setFollowUpDate(su, followup, "Silvester");
See also
DocFile.clearFollowUpDate(SystemUser pUser)

◆ setReferenceFile()

DocFile DocFile::setReferenceFile | ( | String | fieldName,
 |  | DocFile | referenceFile
 | ) |  |

set the referred file of the desired reference field in the current file.

Parameters
fieldName | String value containing the technical name of the reference field
referenceFile | DocFile object representing the referred file
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var docFile = context.file;
var refFile = context.createFile("refFileType");
if (!docFile.setReferenceFile("crmCompany", refFile))
util.out(docFile.getLastError());

◆ setUserRead()

boolean DocFile::setUserRead | ( | String | login,
 |  | boolean | fileRead
 | ) |  |

Mark the file as read or unread for the desired user.

Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Parameters
login | String containing the login name of the desired user
fileRead | boolean whether the file should be markes as read (true) or unread (false)
Returns
true if successful, false in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b
Example:
var docFile = context.file;
docFile.setUserRead("schreiber", true);

◆ setUserStatus()

boolean DocFile::setUserStatus | ( | String | login,
 |  | String | status
 | ) |  |

Set the status of the file for a desired user to a desired value.

The file icon in the list view and file view depends on this status.

Parameters
login String containing the login name of the desired user
status String value containing the desired status
Allowed values:
  • standard
  • new
  • fromFollowup
  • toForward
  • forInfo
  • task
  • workflowCanceled
  • backFromDistribution
  • consultation
Returns
true if successful, false in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b
DOCUMENTS 4.0c (status values extended)
Example:
var docFile = context.file;
docFile.setUserStatus("schreiber", "new");
See also
DocFile.getUserStatus(String login)

◆ startEdit()

boolean DocFile::startEdit ( )

Switch a DocFile to edit mode.

Switching a file to edit mode with this function has the same effect as the "Edit" button in the web surface of DOCUMENTS. This means, a scratch copy of the file is created, and any changes you apply to the file are temporarily stored in the scratch copy - until you commit() your changes back to the original file. There are a few scripting event hooks which disallow the use of this function at all costs:

  • onEdit hook - the system has already created the scratch copy.
  • onCreate hook - a newly created file is always automatically in edit mode.

You should avoid using this function in scripts that are executed inside a workflow (signal exits, decisions etc.).

Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFile = context.file;
myFile.startEdit();
myFile.Field = "value";
myFile.commit(); // apply changes
See also
DocFile.abort(), DocFile.commit()

◆ startWorkflow()

boolean DocFile::startWorkflow ( String workflowName )

Start a workflow for the DocFile object.

Parameters
workflowName String containing the technical name and optional the version number of the workflow. The format of the workflowName is technicalName[-version]. If you don't specify the version of the workflow, the workflow with the highest workflow version number will be used. If you want to start a specific version you have to use technicalName-version e.g. (Invoice-2) as workflowName.
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFile = context.file;
myFile.startWorkflow("Invoice"); // starts the latest version of the workflow "Invoice"
myFile.startWorkflow("Invoice-2"); // starts the version 2 of the workflow "Invoice"

◆ sync()

boolean DocFile::sync | ( | boolean | checkHistoryFields = false,
 |  | boolean | notifyHitlistChange = true,
 |  | boolean | updateRefFields = true,
 |  | boolean | updateModifiedDate = false
 | ) |  |

Synchronize any changes to the DocFile object back to the real file.

If you want to apply changes to file fields through a script that is executed as a signal exit inside a workflow, you should rather prefer sync() than the startEdit() / commit() instruction pair.

Note
If there's a scratch copy of the file in the system (e.g. by some user through the web surface), committing the changes in the scratch copy results in the effect that your synced changes are lost. So be careful with the usage of this operation.
In case of an error, the function stops immediately, regardless of how many values were already written to the database. So if sync() finishes due to an error, the file will probably contain some but not all new values. If you change field values using setFieldValue(), you can get the errors before you call sync().
Parameters
checkHistoryFields | optional boolean parameter has to be set to true, if the file contains history fields, that are modified
notifyHitlistChange | optional boolean parameter indicates the web client to refresh the current hitlist
updateRefFields | optional boolean parameter indicates to update reference fields if using the property AutoUpdateByRefFields
updateModifiedDate | optional boolean parameter indicates to update the modification date of the file
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0 (checkHistoryFields parameter since ELC 3.60i / otrisPORTAL 6.0i)
DOCUMENTS 5.0a (new parameter updateRefFields)
DOCUMENTS 5.0a HF2 (new parameter updateModifiedDate)
Example:
var myFile = context.file;
myFile.Field = "value";
myFile.sync();
See also
DocFile.startEdit()
DocFile.commit()
DocFile.setFieldValue()

◆ undeleteFile()

boolean DocFile::undeleteFile ( )

Relive a deleted file.

Sets the status active to a file and redraws it from the trash folder. Deleted files are not searchable by a FileResultSet. You can only retrieve deleted files by iterating throw the trash-folder of the users

Returns
true if successful, false if not
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
...
var trashFolder = user.getPrivateFolder("trash");
if (trashFolder)
{
var it = trashFolder.getFiles();
for (var file = it.first(); file; file = it.next())
{
if (file.isDeletedFile())
{
file.undeleteFile();
// now e.g. search a private folder and add the file...
}
}
}

Member Data Documentation

◆ fieldName

var DocFile::fieldName

The technical name of a field.

Each field of a DocFile is mapped to an according property. You can access the field value with the technical name.

Returns
The field value, its type depends on the field type, such as a Date object returned for a field of type 'Timestamp'.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFile = context.file;
var strValue = myFile.stringField;
myFile.dateField = new Date();
myFile.sync();


DOCUMENTS 5 - PortalScripting API: Member List

DocFile Member List

This is the complete list of members for DocFile, including all inherited members.

abort() | DocFile
addDocumentFromFileSystem(String pathDocument, String targetRegister, String targetFileName, boolean deleteDocumentAtFileSystem=false, boolean parseAutoText=false, DocFile referencFileToParse=this) | DocFile
addPDF(String pathCoverXML, boolean createCover, String pdfFileName, String targetRegister, Array sourceRegisterNames) | DocFile
archive() | DocFile
archive(String archiveKey) | DocFile
archive(ArchivingDescription desc) | DocFile
archiveAndDelete() | DocFile
asJSON(string[] fieldList=[]) | DocFile
cancelWorkflow() | DocFile
changeFiletype(String nameFiletype) | DocFile
checkWorkflowReceiveSignal() | DocFile
clearFollowUpDate(SystemUser pUser) | DocFile
commit() | DocFile
connectFolder(Folder fObj) | DocFile
countFields(String fieldName) | DocFile
createMonitorFile(boolean asPDF=false, String locale="") | DocFile
createStatusFile(boolean asPDF=false, String locale="") | DocFile
deleteFile(boolean moveTrash=false, boolean movePool=true, boolean allVersions=false, integer easDeleteMode=0) | DocFile
disconnectArchivedFile() | DocFile
disconnectFolder(Folder fObj) | DocFile
exportXML(String pathXML, boolean withDocuments, boolean withStatus=false, boolean withMonitor=false) | DocFile
fieldName | DocFile
forwardFile(String controlFlowId, String comment="") | DocFile
fromJSON(String jsonstring) | DocFile
getAllLockingWorkflowSteps() | DocFile
getAllWorkflowSteps() | DocFile
getArchiveKey(boolean withServer=true) | DocFile
getAsPDF(String nameCoverTemplate, boolean createCover, Array sourceRegisterNames) | DocFile
getAttribute(String attribute) | DocFile
getAutoText(String autoText) | DocFile
getCopy("NoDocs"|"ActualVersion"|"AllVersions" copyMode) | DocFile
getCreationDate() | DocFile
getCreator(boolean asObject=false) | DocFile
getCurrentWorkflowStep() | DocFile
getDocFileComment() | DocFile
getDoubleSelectListValues(String fieldName, boolean resolved=false) | DocFile
getEnumAutoText(String autoText) | DocFile
getFieldAttribute(String fieldName, String attrName) | DocFile
getFieldAutoText(String fieldName, String autoText="") | DocFile
getFieldName(int index) | DocFile
getFieldValue(String fieldName, String returnType) | DocFile
getFileOwner() | DocFile
getFirstLockingWorkflowStep() | DocFile
getid() | DocFile
getLastError() | DocFile
getLastModificationDate() | DocFile
getLastModifier() | DocFile
getOID(boolean oidLow=false) | DocFile
getOriginal() | DocFile
getReferenceFile(String referenceFileField) | DocFile
getRegisterByName(String registerName, boolean checkAccessRight=false) | DocFile
getRegisters(String type="documents", boolean checkAccessRight=false) | DocFile
getTitle(String locale=user locale) | DocFile
getUserStatus(String login) | DocFile
hasField(String fieldName) | DocFile
insertStatusEntry(String action, String comment) | DocFile
isArchiveFile() | DocFile
isDeletedFile() | DocFile
isNewFile() | DocFile
reactivate() | DocFile
sendFileAdHoc(Array receivers, String sendMode, String task, boolean backWhenFinished) | DocFile
sendMail(String from, String templateName, String to, String cc, boolean addDocs, String bcc) | DocFile
setAttribute(String attribute, String value) | DocFile
setFieldAttribute(String fieldName, String attrName, String value) | DocFile
setFieldValue(String fieldName, var value) | DocFile
setFileOwner(SystemUser owner) | DocFile
setFollowUpDate(SystemUser pUser, Date followUpDate, String comment) | DocFile
setReferenceFile(String fieldName, DocFile referenceFile) | DocFile
setUserRead(String login, boolean fileRead) | DocFile
setUserStatus(String login, String status) | DocFile
startEdit() | DocFile
startWorkflow(String workflowName) | DocFile
sync(boolean checkHistoryFields=false, boolean notifyHitlistChange=true, boolean updateRefFields=true, boolean updateModifiedDate=false) | DocFile
undeleteFile() | DocFile


DOCUMENTS 5 - PortalScripting API: DocFileDataField Class Reference

Public Member Functions | Public Attributes | List of all members
DocFileDataField Class Reference

The JS_DocFileDataField class represents the special comment field at the DocFile. More...

Public Member Functions

String | getLastError ()
If you call a method at a DocFileDataField object and an error occurred, you can get the error description with this function. More...
String | getValue ()
Get the comment as String. More...
boolean | setValue (String value)
Set the comment as String. More...

Public Attributes

String | hash
Hash value of the last field value. More...
String | name
Name of the field. More...
String | readAccess
Access-right to read the field. More...
String | writeAccess
Access-right to write the field. More...

Detailed Description

The JS_DocFileDataField class represents the special comment field at the DocFile.

Since
DOCUMENTS 5.0d

Member Function Documentation

◆ getLastError()

String DocFileDataField::getLastError ( )

If you call a method at a DocFileDataField object and an error occurred, you can get the error description with this function.

Returns
Text of the last error as String
Since
DOCUMENTS 5.0d

◆ getValue()

String DocFileDataField::getValue ( )

Get the comment as String.

Returns
String containing the comment
Since
DOCUMENTS 5.0d

◆ setValue()

boolean DocFileDataField::setValue ( String value )

Set the comment as String.

Parameters
value String containing the new comment
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0d

Member Data Documentation

◆ hash

String DocFileDataField::hash

Hash value of the last field value.

Returns
String with sha256 hash.
Since
DOCUMENTS 5.0d

◆ name

String DocFileDataField::name

Name of the field.

Returns
String with name.
Since
DOCUMENTS 5.0d

◆ readAccess

String DocFileDataField::readAccess

Access-right to read the field.

Returns
true or false.
Since
DOCUMENTS 5.0d

◆ writeAccess

String DocFileDataField::writeAccess

Access-right to write the field.

Returns
true or false.
Since
DOCUMENTS 5.0d


DOCUMENTS 5 - PortalScripting API: Member List

DocFileDataField Member List

This is the complete list of members for DocFileDataField, including all inherited members.

getLastError() | DocFileDataField
getValue() | DocFileDataField
hash | DocFileDataField
name | DocFileDataField
readAccess | DocFileDataField
setValue(String value) | DocFileDataField
writeAccess | DocFileDataField


DOCUMENTS 5 - PortalScripting API: DocHit Class Reference

Public Member Functions | Public Attributes | List of all members
DocHit Class Reference

The DocHit class presents the hit object collected by a HitResultset. More...

Public Member Functions

DocFile getArchiveFile ()
Get a file from the archive associated to the archive hit. More...
String | getArchiveKey (boolean withServer=true)
Retrieve the key of the associated archive file object. More...
String | getBlobInfo ()
Function to get the blob info of the hit as xml. More...
DocFile getFile ()
Get the file associated to the hit. More...
String | getFileId ()
Get the file id of the associated file object. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
String | getLocalValue (int colIndex)
Get the local value of an available column. More...
String | getLocalValueByName (String colName)
Get the local value of an available column. More...
String | getSchema ()
Get a schema identifier of the archive hit. More...
String | getTechValue (int colIndex)
Get the technical value of an available column. More...
String | getTechValueByName (String colName)
Get the technical value of an available column. More...
boolean | isArchiveHit ()
Function to test whether the associated file is an archive file. More...

Public Attributes

var columnName
Field value, addressed by a known column name. More...

Detailed Description

The DocHit class presents the hit object collected by a HitResultset.

Objects of this class cannot be created directly. You may access a single DocHit by creating a HitResultset, which provides functions to retrieve its hit entries.

Since
DOCUMENTS 4.0b
Example:
var searchResource = "Standard";
var filter = "";
var sortOrder = "";
var myFile;
var myHRS = new HitResultset(searchResource, filter, sortOrder);
for (var myHit = myHRS.first(); myHit; myHit = myHRS.next())
{
if (myHit.isArchiveHit())
myFile = myHit.getArchiveFile();
else
myFile = myHit.getFile();
if (myFile)
util.out(myFile.getAutoText("title"));
else
util.out(myHit.getLastError());
}
See also
HitResultset.first(), HitResultset.next()
HitResultset.getAt(number pos), HitResultset.fetchNextPage()

Member Function Documentation

◆ getArchiveFile()

DocFile DocHit::getArchiveFile ( )

Get a file from the archive associated to the archive hit.

You need the necessary access rights on the archive side.

Returns
DocFile or NULL, if failed.
Remarks
This function creates a complete DOCUMENTS image of the archived file, except for the content of attachments. This is a time-consuming workstep. If a script calls this function for each hit in the set, it will not run any faster than a script, which uses a conventional ArchiveFileResultset instead of this class.
Since
DOCUMENTS 4.0b
See also
getFile()

◆ getArchiveKey()

String DocHit::getArchiveKey ( boolean withServer = true )

Retrieve the key of the associated archive file object.

Parameters
withServer optional boolean value to indicate, if the key should include an "@archiveServerName" appendix
Returns
The archive file's key as a String, but an empty String, if the hit does not refer to an archive file.
Since
DOCUMENTS 4.0b
See also
getFileId()

◆ getBlobInfo()

String DocHit::getBlobInfo ( )

Function to get the blob info of the hit as xml.

Returns
String with xml content
Since
DOCUMENTS 5.0c

◆ getFile()

DocFile DocHit::getFile ( )

Get the file associated to the hit.

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.

Returns
DocFile or NULL, if failed.
Since
DOCUMENTS 4.0b
See also
getArchiveFile()

◆ getFileId()

String DocHit::getFileId ( )

Get the file id of the associated file object.

Returns
The file id as String, if the associated file is an active file, but an empty String otherwise.
Since
DOCUMENTS 4.0b
See also
getArchiveKey(boolean withServer)

◆ getLastError()

String DocHit::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 4.0b

◆ getLocalValue()

String DocHit::getLocalValue ( int colIndex )

Get the local value of an available column.

Parameters
colIndex The zero-based index of the column.
Returns
The local value of the given column as String.
Since
DOCUMENTS 4.0b
See also
getLocalValueByName(String colName)

◆ getLocalValueByName()

String DocHit::getLocalValueByName ( String colName )

Get the local value of an available column.

Parameters
colName The name of the column.
Returns
The local value of the given column as String.
Note
Accesing a column by its index is a bit faster than by its name.
Since
DOCUMENTS 4.0b
See also
getLocalValue(int colIndex)

◆ getSchema()

String DocHit::getSchema ( )

Get a schema identifier of the archive hit.

Returns
The schema identifier as a String.
Remarks
For EE.i, the value is an archive identifier in the XML-Server's notation. For EDA it is just the name of a filetype. All values come with an "@Servername" appendix.
Since
DOCUMENTS 4.0b

◆ getTechValue()

String DocHit::getTechValue ( int colIndex )

Get the technical value of an available column.

Parameters
colIndex The zero-based index of the column.
Returns
The technical value of the given column as a String.
Remarks
The function returns dates, timestamps and numbers in DOCUMENTS' storage format. (In the DOCUMENTS Manager see menu 'Documents/Settings', dialog page 'Locale/format', group 'Format settings'.) If you prefer JavaScript numbers and dates, simply use the object like an array: myDocHit[colIndex].
Since
DOCUMENTS 4.0b
See also
getTechValueByName(String colName)

◆ getTechValueByName()

String DocHit::getTechValueByName ( String colName )

Get the technical value of an available column.

Parameters
colName The name of the column.
Returns
The technical value of the given column as String.
Note
Accessing a column by its index is a bit faster than by its name.
Remarks
The function returns dates, timestamps and numbers in DOCUMENTS' storage format. (In the DOCUMENTS Manager see menu 'Documents/Settings', dialog page 'Locale/format', group 'Format settings'.) If you prefer JavaScript numbers and dates, you can simply read the columns as a property DocHit.columnName.
Since
DOCUMENTS 4.0b
See also
getTechValue(int colIndex), DocHit.columnName

◆ isArchiveHit()

boolean DocHit::isArchiveHit ( )

Function to test whether the associated file is an archive file.

Returns
true, if the associated file is an archive file, false otherwise.
Since
DOCUMENTS 4.0b

Member Data Documentation

◆ columnName

var DocHit::columnName

Field value, addressed by a known column name.

Each field in a DocHit is mapped to an according property. You can read the value on the basis of the column name.

Returns
The field value; its type depends on the field type, such as a Date object returned for a column of type 'Timestamp'.
Remarks
Overwriting values in a DocHit is not allowed. Each attempt will raise an exception. To read dates and numbers in DOCUMENTS' storage format, see getTechValueByName().
Since
DOCUMENTS 5.0HF2
Example:
function logValue(label, value)
{
util.out(label +" [" + typeof(value) + "] " + value);
}
var HRS = new HitResultset("ftOrder", "", "", "HL2");
var hitline = HRS.first();
if(hitline)
{
// We assume, "ftOrder" has got a string field "company", a
// date field "orderDate" and a numeric field "netPrice".
var checkVal = hitline.company;
logValue("company: ", checkVal);
checkVal = hitline.orderDate;
logValue("orderDate: ", checkVal);
// The next example shows a different way to read "hitline.netPrice".
// This style is necessary, if the name of a column contains
// critical characters, or if the name equals a reserved JavaScript keyword.
checkVal = hitline["netPrice"];
logValue("orderDate: ", checkVal);
// Columns can also be addressed by number (0..n-1)
checkVal = hitline[0];
logValue("first column: ", checkVal);
}


DOCUMENTS 5 - PortalScripting API: Member List

DocHit Member List

This is the complete list of members for DocHit, including all inherited members.

columnName | DocHit
getArchiveFile() | DocHit
getArchiveKey(boolean withServer=true) | DocHit
getBlobInfo() | DocHit
getFile() | DocHit
getFileId() | DocHit
getLastError() | DocHit
getLocalValue(int colIndex) | DocHit
getLocalValueByName(String colName) | DocHit
getSchema() | DocHit
getTechValue(int colIndex) | DocHit
getTechValueByName(String colName) | DocHit
isArchiveHit() | DocHit


DOCUMENTS 5 - PortalScripting API: DocQueryParams Class Reference

Public Member Functions | Public Attributes | List of all members
DocQueryParams Class Reference

This class encapsulates the basic parameters of a Documents search request. More...

Public Member Functions

String | getLastError ()
Function to get the description of the last error that occurred. More...
RetrievalField | getSearchField (number index, boolean skipEmpty)

Get a descriptive object of one of the search fields (conditions), which are declared in the query. More...
RetrievalSource | getSource (number index)

Get a descriptive object of one selected search resource. More...
boolean | removeSource (Var refSource)

Remove a search resource from the query. More...

Public Attributes

number | filledSearchFieldCount
The number of filled in search fields in the query (read-only). More...
Integer | requestType
The type (or trigger) of the search request (read-only). More...
Integer | searchFieldCount
The number of declared search fields in the query (read-only). More...
String | searchMaskName
The (technical) name of the selected search mask, if available (read only). More...
Integer | sourceCount
The number of searchable resources involved in the query (read-only). More...
Request Type Constants

These constants are equally available in each instance of DocQueryParams and in the constructor object.

Integer | DIRECT
Integer code for the requestType "direct fultext search".
Integer | EXTENDED
Integer code for the requestType "extended search".
Integer | FOLDER_S
Integer code for the requestType "static folder". More...
Integer | FOLDER_D
Integer code for the requestType "dynamic folder". More...
Integer | REGISTER
Integer code for the requestType "link register".
Integer | REFERENCE
Integer code for the request type "reference field destination selection". More...
Integer | API
Integer code for the requestType "API search". More...
Integer | FILING_PLAN
Integer code for the requestType "filing plan node".
Integer | QUICK_VIEW
Integer code for the requestType "quick view". More...
Integer | SCRIPT_TREE
Integer code for the request type "script controlled hit tree generation". More...

Detailed Description

This class encapsulates the basic parameters of a Documents search request.

Only the script-exits "OnSearch" and "FillSearchMask" provide access to such an object. See also Context.getQueryParams().

Scripts can modify the parameters only in the following ways.

  1. A project-related "OnSearch" script may detect in advance, if an individual query won't find any hits in a specified searchable resource. In this case, the script can call removeSource() for each zero-hits resource to reduce the workload on the database and/or archive systems. However the very first listed resource cannot be removed, because it regularly owns the selected hit list. As a result, removeSource() is not suitable for implementing extraordinary permission restrictions.
  2. A "OnSearch" script can substitute the relational operator or the value in a search field. This practice is not recommended, because it may make the user find something competely different than he sought for.
  3. A "OnSearch" script may cancel some special search requests and submit a custom message. The type (or origin) of the search request determines, if and where this message will be displayed.
  4. A "FillSearchMask" script can place default values in the search fields.
Since
DOCUMENTS 4.0d
Example:
util.out("*********** onSearch start *************");
var params = context.getQueryParams();
if(params)
{
// First write the contents of the object to the server window
util.out("got retrieval parameter object");
var requestType = params.requestType;
util.out("queryType = " + requestType);
// Print the list of searchable resources.
var count = params.sourceCount;
util.out("sourceCount = " + count);
var cnt;
for(cnt = 0; cnt < count; ++cnt)
{
var source = params.getSource(cnt);
if(source)
{
util.out("<Source " + (cnt+1) + ">");
util.out("resId = " + source.resId);
util.out("type = " + source.type);
util.out("server = " + source.server);
}
else
util.out("got a NULL source");
}
// Print the list of all search fields.
// This dump may include many empty fields.
count = params.searchFieldCount;
util.out("\r\nsearch fields = " + count);
for(cnt = 0; cnt < count; ++cnt)
{
var sfield = params.getSearchField(cnt);
if(sfield)
{
util.out("<Searchfield " + (cnt+1) + ">");
var filter = sfield.name + sfield.compOp + sfield.valueExpr;
util.out("Condition: " + filter);
util.out("fieldType = " + sfield.type);
util.out("label = " + sfield.label);
}
else
util.out("got a NULL field");
}
// Print the search fields again, but this time ignore all empty
// fields.
count = params.filledSearchFieldCount;
util.out("\r\nfilled search fields = " + count);
for(cnt = 0; cnt < count; ++cnt)
{
sfield = params.getSearchField(cnt, true);
if(sfield)
{
util.out("<Searchfield " + (cnt+1) + ">");
var filter = sfield.name + sfield.compOp + sfield.valueExpr;
util.out("Condition: " + filter);
util.out("fieldType = " + sfield.type);
util.out("label = " + sfield.label);
}
else
util.out("got a NULL field");
}
// The subsequent test code requires at least one filled in search field
if(count > 0)
{
sfield = params.getSearchField(0, true);
var testExpr = sfield.valueExpr;
// Test 1:
// Let's assume we have got a bunch of EDA stores. We know,
// that the value "rarely" is frequently searched across many
// stores, but it never can appear in a store named "Playground".
// We can try to exclude this store from the search request to
// reduce the workload.
if(testExpr == "rarely")
{
// Note: Source #0 cannot not be removed.
for(cnt = 1; cnt < params.sourceCount; ++cnt)
{
source = params.getSource(cnt);
if(source.server == "Playground")
{
params.removeSource(cnt--);
// About the "--": removeSource() has implicitly
// decreased the index number of all subsequent
// sources and also the "sourceCount" property.
// To skip nothing, the loop needs to run with
// the same index once again.
}
}
}
// Test 2:
// If the OnSearchScript triggers a search request itself, it
// ends up in a recursive call! This section does nothing serious.
// It just demonstrates the effect with a few log messages.
if(testExpr == "recurse")
{
if(requestType == DocQueryParams.API)
util.out("OnSearchScript avoiding another recursion");
else
{
util.out("OnSearchScript before recursion");
var iter = new FileResultset("ftEmployee", "hrRemarks=recurse", "");
var o = iter.first();
util.out("OnSearchScript after recursion");
}
}
// Test 3:
// Generate an error for a specific search expression.
if((requestType == DocQueryParams.DIRECT
|| requestType == DocQueryParams.EXTENDED)
&& testExpr == "want an error")
{
context.errorMessage = "Here is the error message you desired!";
return -142;
}
// Test 4:
// Substitute a search expression (not recommended; just a demo)
if(requestType == DocQueryParams.EXTENDED && (testExpr == "U" ||testExpr == "u"))
sfield.valueExpr = "X";
}
}
else
util.out("No retrieval parameters available.");
util.out("********* onSearch end **************");

Member Function Documentation

◆ getLastError()

String DocQueryParams::getLastError ( )

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

Returns
Text of the last error
Since
DOCUMENTS 4.0c

◆ getSearchField()

RetrievalField DocQueryParams::getSearchField | ( | number | index,
 |  | boolean | skipEmpty
 | ) |  |

Get a descriptive object of one of the search fields (conditions), which are declared in the query.

Parameters
index | The index of the desired search field. The valid range is 0 to (filledSearchFieldCount - 1), if the flag skipEmpty is set. Otherwise the range is 0 to (searchFieldCount - 1).
skipEmpty | An optional boolean to treat all empty search fields as non-existing. By default all fields can be examined.
Returns
A RetrievalField object, which contains a search field name, an operator and (sometimes) a value expression.
Remarks
If the request has been prepared with any kind of searck mask in the background, all available fields of that mask appear in the internal list, not only those, which the user has filled in. The skipEmpty flag provides a simple opportunity to examine only effective search conditions.
Internally generated conditions (for example ACL-filters) cannot be returned by this function.
Attaching a default value to a field does not modify its "empty" state in terms of this function.
Since
DOCUMENTS 4.0c

◆ getSource()

RetrievalSource DocQueryParams::getSource ( number index )

Get a descriptive object of one selected search resource.

Parameters
index The integer index of the resource in the internal list. Range: 0 to (sourceCount - 1)
Returns
A RetrievalSource object on success, otherwise null.
Since
DOCUMENTS 4.0c

◆ removeSource()

boolean DocQueryParams::removeSource ( Var refSource )

Remove a search resource from the query.

Parameters
refSource Either the current integer index or the id of the resource.
Returns
A boolean value, which indicates a succesful call.
Note
The access to this function is restricted. Only the "OnSearchScript" can effectively use it.
Remarks
The id can be read from the property RetrievalSource.resId. Valid index values range from 1 to (sourceCount - 1). The resource at index 0 cannot be removed (see the class details). After a succesful call, the sourceCount and the index of each subsequent resource in the list are decreased by one.
The method does not perform type-checking on the refSource parameter. It interprets a value like "12345" always as an index, even when this value has been passed as a string.
Since
DOCUMENTS 4.0c

Member Data Documentation

◆ API

Integer DocQueryParams::API

Integer code for the requestType "API search".

(Archive-)FileResultsets, HitResultsets and the SOAP report functions belong to this category.

◆ filledSearchFieldCount

number DocQueryParams::filledSearchFieldCount

The number of filled in search fields in the query (read-only).

This is in other words the number of conditions in the query.

Note
Attaching a default value to a search field does not fill it in this context. Default values are being stored separately from concrete search values, for technical reasons.
Since
DOCUMENTS 4.0c

◆ FOLDER_D

Integer DocQueryParams::FOLDER_D

Integer code for the requestType "dynamic folder".

Listing the contents of such a folder already triggers a search request.

◆ FOLDER_S

Integer DocQueryParams::FOLDER_S

Integer code for the requestType "static folder".

In the current release, this type can occur only, if the Documents setting "search field in folder" is enabled.

◆ QUICK_VIEW

Integer DocQueryParams::QUICK_VIEW

Integer code for the requestType "quick view".

Remarks
Quick view URLs with just an id-Parameter do not trigger a search.

◆ REFERENCE

Integer DocQueryParams::REFERENCE

Integer code for the request type "reference field destination selection".

This request type originates from the web dialog, which opens, when a user is editing a file and presses a reference fields select button.

◆ requestType

Integer DocQueryParams::requestType

The type (or trigger) of the search request (read-only).

See the enumeration constants in this class. If Documents encounters a request, which it cannot categorize exactly, it will return the nearest match with respect to the server's internal interfaces.

Since
DOCUMENTS 4.0c

◆ SCRIPT_TREE

Integer DocQueryParams::SCRIPT_TREE

Integer code for the request type "script controlled hit tree generation".

This is a special feature, where a script in the web server process sends a seach request and immediately generates a hit tree from the results. The tabular list is not displayed in this case.

◆ searchFieldCount

Integer DocQueryParams::searchFieldCount

The number of declared search fields in the query (read-only).

This count may include fields from a search mask, which have not been filled in.

Since
DOCUMENTS 4.0c

◆ searchMaskName

String DocQueryParams::searchMaskName

The (technical) name of the selected search mask, if available (read only).

Remarks
The value is an empty string, if the query has been prepared without a search mask or with an anonymous mask (controlled by "show in search mask" checkboxes).
Search mask names are unique with regard to a single searchable resource. As soon as multiple resources are involved, the names are often ambiguous, because each resource may supply a search mask with the same name.
To obtain a better identifier, the script may combine the mask's name and the resId of the first selected resource.
However, even this identifier is not always unique. If a user has selected multiple EE.x views and the DOCUMENTS property "UseMainArchives" is undefined or zero, the query does not specify a main resource. DOCUMENTS then passes the RetrievalSource objects with random order. In this case the script cannot distinguish search masks with equal names.
See also
getSource(), sourceCount
Since
DOCUMENTS 4.0e

◆ sourceCount

Integer DocQueryParams::sourceCount

The number of searchable resources involved in the query (read-only).

Since
DOCUMENTS 4.0c


DOCUMENTS 5 - PortalScripting API: Member List

DocQueryParams Member List

This is the complete list of members for DocQueryParams, including all inherited members.

API | DocQueryParams
DIRECT | DocQueryParams
EXTENDED | DocQueryParams
FILING_PLAN | DocQueryParams
filledSearchFieldCount | DocQueryParams
FOLDER_D | DocQueryParams
FOLDER_S | DocQueryParams
getLastError() | DocQueryParams
getSearchField(number index, boolean skipEmpty) | DocQueryParams
getSource(number index) | DocQueryParams
QUICK_VIEW | DocQueryParams
REFERENCE | DocQueryParams
REGISTER | DocQueryParams
removeSource(Var refSource) | DocQueryParams
requestType | DocQueryParams
SCRIPT_TREE | DocQueryParams
searchFieldCount | DocQueryParams
searchMaskName | DocQueryParams
sourceCount | DocQueryParams


DOCUMENTS 5 - PortalScripting API: Document Class Reference

Public Member Functions | Public Attributes | List of all members
Document Class Reference

The Document class has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means. More...

Public Member Functions

boolean | deleteDocument ()
Delete the Document object. More...
boolean | doOCR ()
Execute OCR for the current document. More...
String | downloadDocument (String filePath="", String version="")
Download the Document to the server's filesystem for further use. More...
String | getAsPDF ()
Create a PDF file containing the current Document's contents and return the path in the file system. More...
String | getAttribute (String attribute)
Get the String value of an attribute of the Document. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
String | getOID (boolean oidLow=false)
Returns the object-id. More...
Register getRegister ()
Returns the Register the Document belongs to. More...
String | hash (String hashfunction, String version="")
Generate the hash value for the Document using the given hash function. More...
boolean | moveToRegister (Register regObj)
Move the Document to another document Register of the file. More...
boolean | reindexBlob ()
Reindex the blob located in an active file. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the Document to the desired value. More...
boolean | setDocumentName (String nameWithExt)

Set the name of the current document. More...
boolean | uploadDocument (String sourceFilePath, boolean versioning=true)
Upload a file stored on the server's filesystem for replacing or versioning this Document. More...

Public Attributes

String | bytes
The file size of the Document object. More...
String | comment
The comment of the Document object. More...
boolean | encrypted
Info, if the blob is encrypted in the repository. More...
String | extension
The extension of the Document object. More...
String | fullname
The complete filename (name plus extension) of the Document object. More...
String | id
The id of the Document object. More...
String | name
The name (without extension) of the Document object. More...
String | size
The file size of the Document object. More...

Detailed Description

The Document class has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means.

Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

Member Function Documentation

◆ deleteDocument()

boolean Document::deleteDocument ( )

Delete the Document object.

With the necessary rights you can delete a document of the file. Do this only on scratch copies (startEdit, commit)

Note
It is strictly forbidden to access the Document object after this function has been executed successfully; if you try to access it, your script will fail, because the Document does not exist any longer in DOCUMENTS.
Returns
true if successful, false in case of any error
Since
ELC 3.60b / otrisPORTAL 6.0b
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
// Deletion of the first document of the register "docs"
var myFile = context.file;
if (!myFile)
{
util.out("missing file");
return -1;
}
if (!myFile.startEdit())
{
util.out("Unable to create scratch copy: " + myFile.getLastError());
return -1;
}
var myReg = myFile.getRegisterByName("docs");
if (!myReg)
{
util.out("missing >docs< register");
return -1;
}
var firstDoc = myReg.getDocuments().first();
if (!firstDoc)
{
return 0; // Nothing to do
}
if (!firstDoc.deleteDocument())
{
util.out(firstDoc.getLastError());
myFile.abort();
return -1;
}
if (!myFile.commit())
{
util.out("commit failed: " + myFile.getLastError());
myFile.abort();
return -1;
}
return 0;

◆ doOCR()

boolean Document::doOCR ( )

Execute OCR for the current document.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ downloadDocument()

String Document::downloadDocument | ( | String | filePath = "",
 |  | String | version = ""
 | ) |  |

Download the Document to the server's filesystem for further use.

Parameters
filePath Optional string specifying where the downloaded Document to be stored.
Note: A file path containing special characters can be modified due to the encoding problem. The modified file path will be returned.
version Optional string value specifying which version of this Document to be downloaded (e.g. "2.0"). The default value is the active version.
Note: This parameter is ignored for an archive document.
Returns
String containing full path and file name of the downloaded Document, an empty string in case of any error.
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files
DOCUMENTS 4.0 (new parameter filePath)
DOCUMENTS 4.0d (new parameter version)
Example:
// Example 1
var docFile = context.file;
var reg = docFile.getRegisterByName("Documents");
var docIter = reg.getDocuments();
if (docIter && docIter.size() > 0)
{
var doc = docIter.first();
var docPath = doc.downloadDocument();
var txtFile = new File(docPath, "r+t");
if (txtFile.ok())
{
var stringVar = txtFile.readLine(); // read the first line
txtFile.close();
}
}
Example:
// Example 2
var docFile = context.file;
var reg = docFile.getRegisterByName("Documents");
var docIter = reg.getDocuments();
if (docIter && docIter.size() > 0)
{
var doc = docIter.first();
var docPath = "C:\\tmp\\test.txt";
docPath = doc.downloadDocument(docPath, "2.0"); // since DOCUMENTS 4.0d
if (docPath == "")
util.out(doc.getLastError());
}

◆ getAsPDF()

String Document::getAsPDF ( )

Create a PDF file containing the current Document's contents and return the path in the file system.

The different document types of your documents require the appropriate PDF filter programs to be installed and configured in DOCUMENTS.

Returns
String with file path of the PDF, an empty string in case of any error.
Since
DOCUMENTS 4.0c
Example:
var docFile = context.file;
var reg = docFile.getRegisterByName("Doc1");
var docIt = reg.getDocuments();
for (doc = docIt.first(); doc; doc = docIt.next())
{
var pathPdfFile = doc.getAsPDF();
if (pathPdfFile == "")
util.out(doc.getLastError());
else
util.out("File path: " + pathPdfFile);
}

◆ getAttribute()

String Document::getAttribute ( String attribute )

Get the String value of an attribute of the Document.

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ getLastError()

String Document::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files
See also
DocFile.getLastError()

◆ getOID()

String Document::getOID ( boolean oidLow = false )

Returns the object-id.

Parameters
oidLow Optional flag:
If true only the id of the Document object (m_oid) will be returned.
If false the id of the Document 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
Since
ELC 3.60c / otrisPORTAL 6.0c
ELC 3.60i / otrisPORTAL 6.0i available for archive files
DOCUMENTS 5.0 (new parameter oidLow)

◆ getRegister()

Register Document::getRegister ( )

Returns the Register the Document belongs to.

Returns
Register object or null if missing
Since
DOCUMENTS 5.0c HF1
Example:
var file = context.file;
var reg1 = file.getRegisterByName("RegisterA");
var firstDoc = reg1.getDocuments().first();
if (firstDoc)
{
var reg = firstDoc.getRegister();
if (reg)
util.out(reg.name); // "RegisterA"
}

◆ hash()

String Document::hash | ( | String | hashfunction,
 |  | String | version = ""
 | ) |  |

Generate the hash value for the Document using the given hash function.

These hash functions are supported:

  • sha1
  • sha224
  • sha256
  • sha384
  • sha512
  • md4
  • md5
  • whirlpool
  • ripemd160
Parameters
hashfunction String containing the name of the hash function.
version Optional string value specifying which version of this Document to be hashed (e.g. "2.0"). The default value is the active version.
Note: This parameter is ignored for an archive document.
Returns
String with the hash value of the Document, an empty string in case of any error.
Since
DOCUMENTS 5.0e
Example:
var file = context.file;
var reg1 = file.getRegisterByName("RegisterA");
var firstDoc = reg1.getDocuments().first();
if (firstDoc)
{
try
{
var hashValue = firstDoc.hash("sha256", "2.0");
if (hashValue == "")
util.out(firstDoc.getLastError());
}
catch (ex)
{
util.out(ex);
}
}
See also
Util.hash(String filePath, String hashfunction)

◆ moveToRegister()

boolean Document::moveToRegister ( Register regObj )

Move the Document to another document Register of the file.

With the necessary rights you can move the Document to another document Register of the file.

Note
This operation is not available for a Document located in an archive file.
Parameters
regObj The Register this Document will be moved to.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
Example:
var file = context.file;
if (!file.isArchiveFile())
{
var regDoc1 = file.getRegisterByName("Doc1");
var regDoc2 = file.getRegisterByName("Doc2");
var docIt = regDoc2.getDocuments();
for (var doc = docIt.first(); doc; doc = docIt.next())
{
if (!doc.moveToRegister(regDoc1))
util.out(doc.getLastError());
}
}

◆ reindexBlob()

boolean Document::reindexBlob ( )

Reindex the blob located in an active file.

This method is only allowed if at the filetype the option 'automatic document indexing' is enabled.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e HF2

◆ setAttribute()

boolean Document::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the Document to the desired value.

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ setDocumentName()

boolean Document::setDocumentName ( String nameWithExt )

Set the name of the current document.

This method is only allowed for documents at a scratch copy (startEdit, commit).

Parameters
nameWithExt String containing the document name with extension.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e HF2
Example:
// Rename the first document of the register "docs"
var myFile = context.file;
if (!myFile)
{
util.out("missing file");
return -1;
}
if (!myFile.startEdit())
{
util.out("Unable to create scratch copy: " + myFile.getLastError());
return -1;
}
var myReg = myFile.getRegisterByName("docs");
if (!myReg)
{
util.out("missing >docs< register");
return -1;
}
var firstDoc = myReg.getDocuments().first();
if (!firstDoc)
{
return 0; // Nothing to do
}
if (!firstDoc.setDocumentName("newName.txt"))
{
util.out(firstDoc.getLastError());
myFile.abort();
return -1;
}
if (!myFile.commit())
{
util.out("commit failed: " + myFile.getLastError());
myFile.abort();
return -1;
}
return 0;

◆ uploadDocument()

boolean Document::uploadDocument | ( | String | sourceFilePath,
 |  | boolean | versioning = true
 | ) |  |

Upload a file stored on the server's filesystem for replacing or versioning this Document.

Note
After successful upload of the Document the source file on the server's directory structure is removed!
Parameters
sourceFilePath String containing the path of the desired file to be uploaded.
Note: Backslashes contained in the filepath must be quoted with a leading backslash, since the backslash is a special char in ECMAScript!
versioning Optional flag: true for versioning the Document and false for replacing it.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var docFile = context.file;
var reg = docFile.getRegisterByName("Documents");
var docIter = reg.getDocuments();
if (docIter && docIter.size() > 0)
{
var doc = docIter.first();
if (!doc.uploadDocument("c:\\tmp\\test.txt", true))
util.out(doc.getLastError());
}

Member Data Documentation

◆ bytes

String Document::bytes

The file size of the Document object.

Returns
Integer containing the file size of the Document in Byte
Note
This property is readonly.
Since
DOCUMENTS 4.0e

◆ comment

String Document::comment

The comment of the Document object.

Returns
String containing the comment of the Document
Note
This property is readonly.
Since
DOCUMENTS 5.0d HF1

◆ encrypted

boolean Document::encrypted

Info, if the blob is encrypted in the repository.

Returns
boolean value indicating whether the blob is encyrpted or not
Note
This property is readonly.
Since
DOCUMENTS 4.0d HF3

◆ extension

String Document::extension

The extension of the Document object.

Returns
String containing the filename's extension of the Document
Note
This property is readonly.
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ fullname

String Document::fullname

The complete filename (name plus extension) of the Document object.

Returns
String containing the complete filename of the Document
Note
This property is readonly.
Since
ELC 3.60i / otrisPORTAL 6.0i available for archive files
ELC 3.50n / otrisPORTAL 5.0n

◆ id

String Document::id

The id of the Document object.

Returns
String containing the unique id of the Document
Note
This property is readonly.
Since
DOCUMENTS 5.0e

◆ name

String Document::name

The name (without extension) of the Document object.

Returns
String containing the filename of the Document without extension
Note
This property is readonly.
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ size

String Document::size

The file size of the Document object.

Returns
String containing the formatted file size of the Document
Note
This property is readonly.
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files


DOCUMENTS 5 - PortalScripting API: Member List

Document Member List

This is the complete list of members for Document, including all inherited members.

bytes | Document
comment | Document
deleteDocument() | Document
doOCR() | Document
downloadDocument(String filePath="", String version="") | Document
encrypted | Document
extension | Document
fullname | Document
getAsPDF() | Document
getAttribute(String attribute) | Document
getLastError() | Document
getOID(boolean oidLow=false) | Document
getRegister() | Document
hash(String hashfunction, String version="") | Document
id | Document
moveToRegister(Register regObj) | Document
name | Document
reindexBlob() | Document
setAttribute(String attribute, String value) | Document
setDocumentName(String nameWithExt) | Document
size | Document
uploadDocument(String sourceFilePath, boolean versioning=true) | Document


DOCUMENTS 5 - PortalScripting API: DocumentIterator Class Reference

Public Member Functions | List of all members
DocumentIterator Class Reference

The DocumentIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means. More...

Public Member Functions

Document first ()
Retrieve the first Document object in the DocumentIterator. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
Document next ()
Retrieve the next Document object in the DocumentIterator. More...
int | size ()
Get the amount of Document objects in the DocumentIterator. More...

Detailed Description

The DocumentIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means.

Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var docFile = context.file;
if (docFile)
{
var docreg = docFile.getRegisterByName("Documents");
if (docreg)
{
var docs = docreg.getDocuments();
if (docs && docs.size() > 0)
{
for (var d = docs.first(); d; d = docs.next())
{
util.out(d.Fullname);
}
}
}
}

Member Function Documentation

◆ first()

Document DocumentIterator::first ( )

Retrieve the first Document object in the DocumentIterator.

Returns
Document or null in case of an empty DocumentIterator
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ getLastError()

String DocumentIterator::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.50n / otrisPORTAL 5.0n
See also
DocFile.getLastError()

◆ next()

Document DocumentIterator::next ( )

Retrieve the next Document object in the DocumentIterator.

Returns
Document or null if end of DocumentIterator is reached.
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ size()

int DocumentIterator::size ( )

Get the amount of Document objects in the DocumentIterator.

Returns
integer value with the amount of Document objects in the DocumentIterator
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files


DOCUMENTS 5 - PortalScripting API: Member List

DocumentIterator Member List

This is the complete list of members for DocumentIterator, including all inherited members.

first() | DocumentIterator
getLastError() | DocumentIterator
next() | DocumentIterator
size() | DocumentIterator


DOCUMENTS 5 - PortalScripting API: DOMAttr Class Reference

Public Attributes | List of all members
DOMAttr Class Reference

This class models a single attribute of a DOMElement. More...

Inheritance diagram for DOMAttr:
DOMNode

Public Attributes

String | name
The name of the attribute. More...
boolean | specified
A flag to test, whether the attribute's value has been explicitly specified. More...
String | value
The value of the attribute as a string. More...
- Public Attributes inherited from DOMNode
DOMNamedNodeMap attributes
A map of DOM attributes. If this node is not a DOMElement, the value is null. The property is readonly.
DOMNodeList childNodes
A list of all children of this node. The property is readonly.
DOMNode firstChild
The first child node, otherwise null. The property is readonly.
DOMNode lastChild
The last child node, otherwise null. The property is readonly.
DOMNode nextSibling
The next sibling node, otherwise null. The property is readonly.
String | nodeName
The name of this node. The property is readonly.
Integer | nodeType
The type or subclass of a this node, encoded as an integer. The property is readonly.
String | nodeValue
The value of the node, which depends on the type. More...
DOMDocument ownerDocument
The document, which owns this node. The property is readonly.
DOMNode parentNode
The parent node or null. The property is readonly.
DOMNode previousSibling
The previous sibling node, otherwise null. The property is readonly.
Integer | ELEMENT_NODE
Constant for the nodeType "Element". The actual subclass is DOMElement.
Integer | ATTRIBUTE_NODE
Constant for the nodeType "Attr". The actual subclass is DOMAttr.
Integer | TEXT_NODE
Constant for the nodeType "Text". The actual subclass is DOMCharacterData, differing from the standard.
Integer | CDATA_SECTION_NODE
Constant for the nodeType "CDATASection". The actual subclass is DOMCharacterData, differing from the standard.
Integer | ENTITY_REFERENCE_NODE
Constant for the nodeType "EntityReference". The actual implementation does not provide a subclass for this type.
Integer | ENTITY_NODE
Constant for the nodeType "Entity". The actual implementation does not provide a subclass for this type.
Integer | PROCESSING_INSTRUCTION_NODE
Constant for the nodeType "ProcessingInstruction". The actual implementation does not provide a subclass for this type.
Integer | COMMENT_NODE
Constant for the nodeType "Comment". The actual subclass is DOMCharacterData, differing from the standard.
Integer | DOCUMENT_NODE
Constant for the nodeType "Document". The actual subclass is DOMDocument.
Integer | DOCUMENT_TYPE_NODE
Constant for the nodeType "DocumentType". The actual implementation does not provide a subclass for this type.
Integer | DOCUMENT_FRAGMENT_NODE
Constant for the nodeType "DocumentFragment". The actual implementation does not provide a subclass for this type.
Integer | NOTATION_NODE
Constant for the nodeType "Notation". The actual implementation does not provide a subclass for this type.

Additional Inherited Members

- Public Member Functions inherited from DOMNode
DOMNode | appendChild (DOMNode newChild)
Append a new node to the list of child nodes. More...
DOMNode | cloneNode (boolean deep)
Create a duplicate of this node. More...
boolean | hasAttributes ()
Test, whether a node has got any associated attributes. More...
boolean | hasChildNodes ()
Test, whether a node has got any associated child nodes. More...
DOMNode | insertBefore (DOMNode newChild, DOMNode refChild)
Insert a new node into the list of child nodes. More...
void | normalize ()
Normalize the node ans its subtree. More...
DOMNode | removeChild (DOMNode oldChild)
Remove a node from the list of child nodes. More...
DOMNode | replaceChild (DOMNode newChild, DOMNode oldChild)
Replace a node in the list of child nodes. More...

Detailed Description

This class models a single attribute of a DOMElement.

DOMAttrs cannot be created directly. This applies to all kinds of DOMNodes.

Remarks about W3C conformity
The class covers the Attribute interface of DOM level 1. The underlying native library already supports at least level 2.

Since
DOCUMENTS 4.0c

Member Data Documentation

◆ name

String DOMAttr::name

The name of the attribute.

This property is readonly.

Since
DOCUMENTS 4.0c

◆ specified

boolean DOMAttr::specified

A flag to test, whether the attribute's value has been explicitly specified.

The flag is true, if the value was explicitly contained in a parsed document. The flag is also true, if the script has set the property "value" of this DOMAttr object. The flag is false, if the value came from a default value declared in a DTD. The flag is readonly.

Since
DOCUMENTS 4.0c

◆ value

String DOMAttr::value

The value of the attribute as a string.

Character and general entity references are replaced with their values.

Exceptions
DOMException (only on setting)
Since
DOCUMENTS 4.0c


DOCUMENTS 5 - PortalScripting API: Member List

DOMAttr Member List

This is the complete list of members for DOMAttr, including all inherited members.

appendChild(DOMNode newChild) | DOMNode
ATTRIBUTE_NODE | DOMNode
attributes | DOMNode
CDATA_SECTION_NODE | DOMNode
childNodes | DOMNode
cloneNode(boolean deep) | DOMNode
COMMENT_NODE | DOMNode
DOCUMENT_FRAGMENT_NODE | DOMNode
DOCUMENT_NODE | DOMNode
DOCUMENT_TYPE_NODE | DOMNode
ELEMENT_NODE | DOMNode
ENTITY_NODE | DOMNode
ENTITY_REFERENCE_NODE | DOMNode
firstChild | DOMNode
hasAttributes() | DOMNode
hasChildNodes() | DOMNode
insertBefore(DOMNode newChild, DOMNode refChild) | DOMNode
lastChild | DOMNode
name | DOMAttr
nextSibling | DOMNode
nodeName | DOMNode
nodeType | DOMNode
nodeValue | DOMNode
normalize() | DOMNode
NOTATION_NODE | DOMNode
ownerDocument | DOMNode
parentNode | DOMNode
previousSibling | DOMNode
PROCESSING_INSTRUCTION_NODE | DOMNode
removeChild(DOMNode oldChild) | DOMNode
replaceChild(DOMNode newChild, DOMNode oldChild) | DOMNode
specified | DOMAttr
TEXT_NODE | DOMNode
value | DOMAttr


DOCUMENTS 5 - PortalScripting API: DOMCharacterData Class Reference

Public Member Functions | Public Attributes | List of all members
DOMCharacterData Class Reference

DOMCharacterData represents text-like nodes in the DOM tree. More...

Inheritance diagram for DOMCharacterData:
DOMNode

Public Member Functions

void | appendData (String arg)
Append some string to the text. More...
void | deleteData (Integer offset, Integer count)
Delete a section of the text. More...
void | insertData (Integer offset, String arg)
Insert some string into the text. More...
void | replaceData (Integer offset, Integer count, String arg)
Replace a section of the text with a new string. More...
DOMCharacterData | splitText (Integer offset)
Split a text node into two. More...
String | substringData (Integer offset, Integer count)
Extract a substring of the node's text. More...
- Public Member Functions inherited from DOMNode
DOMNode | appendChild (DOMNode newChild)
Append a new node to the list of child nodes. More...
DOMNode | cloneNode (boolean deep)
Create a duplicate of this node. More...
boolean | hasAttributes ()
Test, whether a node has got any associated attributes. More...
boolean | hasChildNodes ()
Test, whether a node has got any associated child nodes. More...
DOMNode | insertBefore (DOMNode newChild, DOMNode refChild)
Insert a new node into the list of child nodes. More...
void | normalize ()
Normalize the node ans its subtree. More...
DOMNode | removeChild (DOMNode oldChild)
Remove a node from the list of child nodes. More...
DOMNode | replaceChild (DOMNode newChild, DOMNode oldChild)
Replace a node in the list of child nodes. More...

Public Attributes

String | data
The text data in the node. More...
Integer | length
The text length in the node. More...
- Public Attributes inherited from DOMNode
DOMNamedNodeMap attributes
A map of DOM attributes. If this node is not a DOMElement, the value is null. The property is readonly.
DOMNodeList childNodes
A list of all children of this node. The property is readonly.
DOMNode firstChild
The first child node, otherwise null. The property is readonly.
DOMNode lastChild
The last child node, otherwise null. The property is readonly.
DOMNode nextSibling
The next sibling node, otherwise null. The property is readonly.
String | nodeName
The name of this node. The property is readonly.
Integer | nodeType
The type or subclass of a this node, encoded as an integer. The property is readonly.
String | nodeValue
The value of the node, which depends on the type. More...
DOMDocument ownerDocument
The document, which owns this node. The property is readonly.
DOMNode parentNode
The parent node or null. The property is readonly.
DOMNode previousSibling
The previous sibling node, otherwise null. The property is readonly.
Integer | ELEMENT_NODE
Constant for the nodeType "Element". The actual subclass is DOMElement.
Integer | ATTRIBUTE_NODE
Constant for the nodeType "Attr". The actual subclass is DOMAttr.
Integer | TEXT_NODE
Constant for the nodeType "Text". The actual subclass is DOMCharacterData, differing from the standard.
Integer | CDATA_SECTION_NODE
Constant for the nodeType "CDATASection". The actual subclass is DOMCharacterData, differing from the standard.
Integer | ENTITY_REFERENCE_NODE
Constant for the nodeType "EntityReference". The actual implementation does not provide a subclass for this type.
Integer | ENTITY_NODE
Constant for the nodeType "Entity". The actual implementation does not provide a subclass for this type.
Integer | PROCESSING_INSTRUCTION_NODE
Constant for the nodeType "ProcessingInstruction". The actual implementation does not provide a subclass for this type.
Integer | COMMENT_NODE
Constant for the nodeType "Comment". The actual subclass is DOMCharacterData, differing from the standard.
Integer | DOCUMENT_NODE
Constant for the nodeType "Document". The actual subclass is DOMDocument.
Integer | DOCUMENT_TYPE_NODE
Constant for the nodeType "DocumentType". The actual implementation does not provide a subclass for this type.
Integer | DOCUMENT_FRAGMENT_NODE
Constant for the nodeType "DocumentFragment". The actual implementation does not provide a subclass for this type.
Integer | NOTATION_NODE
Constant for the nodeType "Notation". The actual implementation does not provide a subclass for this type.

Detailed Description

DOMCharacterData represents text-like nodes in the DOM tree.

An object of this class can represent either a text node, a comment node or a CDATA section. Scripts should use the inherited nodeType attribute to distinguish these node types.

Remarks about W3C conformity
The class covers the CharacterData interface of DOM level 1. The underlying native library already supports at least level 2. The W3C has defined several derived interfaces, namely "Text", "Comment" and "CDATASection". With respect to code size (and work) this API omits the corresponding subclasses "DOMText", "DOMComment" and "DOMCDATASection". The only additional method "DOMText.splitText()" has been moved into this class.
This simplification has got only one little disadvantage. Scripts cannot distinguish the three node types using the JavaScript instanceof operator. They must use the nodeType attribute instead.

Since
DOCUMENTS 4.0c

Member Function Documentation

◆ appendData()

void DOMCharacterData::appendData ( String arg )

Append some string to the text.

Parameters
arg The string to append.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ deleteData()

void DOMCharacterData::deleteData | ( | Integer | offset,
 |  | Integer | count
 | ) |  |

Delete a section of the text.

Parameters
offset | The zero-based position of the first character to delete.
count | The number of characters to delete.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ insertData()

void DOMCharacterData::insertData | ( | Integer | offset,
 |  | String | arg
 | ) |  |

Insert some string into the text.

Parameters
offset | A zero-based position. On return, the inserted string will begin here.
arg | The string to insert.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ replaceData()

void DOMCharacterData::replaceData | ( | Integer | offset,
 |  | Integer | count,
 |  | String | arg
 | ) |  |

Replace a section of the text with a new string.

Parameters
offset | The zero-based position of the first character to be replaced.
count | The number of characters to replace.
arg | The string replacing the old one.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ splitText()

DOMCharacterData DOMCharacterData::splitText ( Integer offset )

Split a text node into two.

The new node becomes the next sibling of this node in the tree, and it has got the same nodeType.

Parameters
offset The zero-based index of the character, which will become the first character of the new node.
Returns
The new text node.
Exceptions
DOMException
Note
Future releases of the API may expose this method only in a new subclass DOMText. See also the W3C conformity remarks in the class description. If a script calls this method on a "Comment" node. it will trigger a JavaScript error, because "Comment" is not derived from "Text" in the standard API.
Since
DOCUMENTS 4.0c

◆ substringData()

String DOMCharacterData::substringData | ( | Integer | offset,
 |  | Integer | count
 | ) |  |

Extract a substring of the node's text.

Parameters
offset | The zero-based index of the first character to extract.
count | The number of characters to extract.
Returns
The requested substring.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

Member Data Documentation

◆ data

String DOMCharacterData::data

The text data in the node.

Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ length

Integer DOMCharacterData::length

The text length in the node.

This property is readonly.

Since
DOCUMENTS 4.0c


DOCUMENTS 5 - PortalScripting API: Member List

DOMCharacterData Member List

This is the complete list of members for DOMCharacterData, including all inherited members.

appendChild(DOMNode newChild) | DOMNode
appendData(String arg) | DOMCharacterData
ATTRIBUTE_NODE | DOMNode
attributes | DOMNode
CDATA_SECTION_NODE | DOMNode
childNodes | DOMNode
cloneNode(boolean deep) | DOMNode
COMMENT_NODE | DOMNode
data | DOMCharacterData
deleteData(Integer offset, Integer count) | DOMCharacterData
DOCUMENT_FRAGMENT_NODE | DOMNode
DOCUMENT_NODE | DOMNode
DOCUMENT_TYPE_NODE | DOMNode
ELEMENT_NODE | DOMNode
ENTITY_NODE | DOMNode
ENTITY_REFERENCE_NODE | DOMNode
firstChild | DOMNode
hasAttributes() | DOMNode
hasChildNodes() | DOMNode
insertBefore(DOMNode newChild, DOMNode refChild) | DOMNode
insertData(Integer offset, String arg) | DOMCharacterData
lastChild | DOMNode
length | DOMCharacterData
nextSibling | DOMNode
nodeName | DOMNode
nodeType | DOMNode
nodeValue | DOMNode
normalize() | DOMNode
NOTATION_NODE | DOMNode
ownerDocument | DOMNode
parentNode | DOMNode
previousSibling | DOMNode
PROCESSING_INSTRUCTION_NODE | DOMNode
removeChild(DOMNode oldChild) | DOMNode
replaceChild(DOMNode newChild, DOMNode oldChild) | DOMNode
replaceData(Integer offset, Integer count, String arg) | DOMCharacterData
splitText(Integer offset) | DOMCharacterData
substringData(Integer offset, Integer count) | DOMCharacterData
TEXT_NODE | DOMNode


DOCUMENTS 5 - PortalScripting API: DOMDocument Class Reference

Public Member Functions | Public Attributes | List of all members
DOMDocument Class Reference

The DOMDocument is the root of a DOM tree. More...

Inheritance diagram for DOMDocument:
DOMNode

Public Member Functions

DOMAttr | createAttribute (String name)
Create a new atttribute within this document. More...
DOMCharacterData | createCDATASection (String data)
Create a new CDATA section within this document. More...
DOMCharacterData | createComment (String data)
Create a new comment node within this document. More...
DOMElement | createElement (String tagName)
Create a new DOMElement within this document. More...
DOMCharacterData | createTextNode (String data)
Create a new text node within this document. More...
DOMDocument (String rootElementName)
Create a new empty XML document structure. More...
DOMNodeList | getElementsByTagName (String tagName)
List all DOMElements in the document with a certain tag name. More...
- Public Member Functions inherited from DOMNode
DOMNode | appendChild (DOMNode newChild)
Append a new node to the list of child nodes. More...
DOMNode | cloneNode (boolean deep)
Create a duplicate of this node. More...
boolean | hasAttributes ()
Test, whether a node has got any associated attributes. More...
boolean | hasChildNodes ()
Test, whether a node has got any associated child nodes. More...
DOMNode | insertBefore (DOMNode newChild, DOMNode refChild)
Insert a new node into the list of child nodes. More...
void | normalize ()
Normalize the node ans its subtree. More...
DOMNode | removeChild (DOMNode oldChild)
Remove a node from the list of child nodes. More...
DOMNode | replaceChild (DOMNode newChild, DOMNode oldChild)
Replace a node in the list of child nodes. More...

Public Attributes

DOMElement documentElement
The node, which represents the outermost structure element of the document. More...
- Public Attributes inherited from DOMNode
DOMNamedNodeMap attributes
A map of DOM attributes. If this node is not a DOMElement, the value is null. The property is readonly.
DOMNodeList childNodes
A list of all children of this node. The property is readonly.
DOMNode firstChild
The first child node, otherwise null. The property is readonly.
DOMNode lastChild
The last child node, otherwise null. The property is readonly.
DOMNode nextSibling
The next sibling node, otherwise null. The property is readonly.
String | nodeName
The name of this node. The property is readonly.
Integer | nodeType
The type or subclass of a this node, encoded as an integer. The property is readonly.
String | nodeValue
The value of the node, which depends on the type. More...
DOMDocument ownerDocument
The document, which owns this node. The property is readonly.
DOMNode parentNode
The parent node or null. The property is readonly.
DOMNode previousSibling
The previous sibling node, otherwise null. The property is readonly.
Integer | ELEMENT_NODE
Constant for the nodeType "Element". The actual subclass is DOMElement.
Integer | ATTRIBUTE_NODE
Constant for the nodeType "Attr". The actual subclass is DOMAttr.
Integer | TEXT_NODE
Constant for the nodeType "Text". The actual subclass is DOMCharacterData, differing from the standard.
Integer | CDATA_SECTION_NODE
Constant for the nodeType "CDATASection". The actual subclass is DOMCharacterData, differing from the standard.
Integer | ENTITY_REFERENCE_NODE
Constant for the nodeType "EntityReference". The actual implementation does not provide a subclass for this type.
Integer | ENTITY_NODE
Constant for the nodeType "Entity". The actual implementation does not provide a subclass for this type.
Integer | PROCESSING_INSTRUCTION_NODE
Constant for the nodeType "ProcessingInstruction". The actual implementation does not provide a subclass for this type.
Integer | COMMENT_NODE
Constant for the nodeType "Comment". The actual subclass is DOMCharacterData, differing from the standard.
Integer | DOCUMENT_NODE
Constant for the nodeType "Document". The actual subclass is DOMDocument.
Integer | DOCUMENT_TYPE_NODE
Constant for the nodeType "DocumentType". The actual implementation does not provide a subclass for this type.
Integer | DOCUMENT_FRAGMENT_NODE
Constant for the nodeType "DocumentFragment". The actual implementation does not provide a subclass for this type.
Integer | NOTATION_NODE
Constant for the nodeType "Notation". The actual implementation does not provide a subclass for this type.

Detailed Description

The DOMDocument is the root of a DOM tree.

The constructor of this class always creates an empty document structure. Use the class DOMParser to obtain the structure of an existing XML. To create any new child nodes, a script must call the appropriate create method of the DOMDocument. It is not possible to create child nodes standalone.

After a DOMDocument has been deleted by the scripting engine's garbage collector, accessing any nodes and lists of that document may issue an error. You should avoid code like the following.

function buildSomeElement()
{
var domDoc = new DOMDocument("root");
var someElement = domDoc.createElement("Test");
// This is an error: Some operations on the DOMElement may no
// longer work, when the owning DOMDocument has already died.
return someElement;
}

Remarks about W3C conformity
The class covers much of the Document interface of DOM level 1, but the following properties and functions have not been implemented until now.

  • DocumentType doctype
  • DOMImplementation implementation
  • DocumentFragment createDocumentFragment()
  • ProcessingInstruction createProcessingInstruction(String target, String data)
  • EntityReference createEntityReference(in String name)

The native DOM library behind the scripting API already supports at least DOM level 2. This is worth knowing, because the behaviour of a few operations might have changed with level 2.

Since
DOCUMENTS 4.0c

Constructor & Destructor Documentation

◆ DOMDocument()

DOMDocument::DOMDocument ( String rootElementName )

Create a new empty XML document structure.

Parameters
rootElementName A qualified name for the document element.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

Member Function Documentation

◆ createAttribute()

DOMAttr DOMDocument::createAttribute ( String name )

Create a new atttribute within this document.

Parameters
name The name of the attribute.
Returns
A new DOMAttr object, which may initially appear anywhere or nowhere in the DOM tree.
Exceptions
DOMException
See also
DOMElement.setAttributeNode() to place the node within the tree.
Since
DOCUMENTS 4.0c

◆ createCDATASection()

DOMCharacterData DOMDocument::createCDATASection ( String data )

Create a new CDATA section within this document.

Parameters
data The data for the node
Returns
A new DOMCharacterData object, which may initially appear anywhere or nowhere in the DOM tree.
Exceptions
DOMException
See also
DOMNode.appendChild() and DOMNode.insertBefore() to place the node within the tree.

Remarks about W3C conformity
The W3C specifies the return type as "CDATASection". Considering code size (and work) the actual implementation omits a class CDATASection and presents the only additional member (splitText(), inherited from "Text") directly in the second level base class. Scripts can examine DOMNode.nodeType to distinguish different types of character data, if necessary.

Since
DOCUMENTS 4.0c

◆ createComment()

DOMCharacterData DOMDocument::createComment ( String data )

Create a new comment node within this document.

Parameters
data The data for the node
Returns
A new DOMCharacterData object, which may initially appear anywhere or nowhere in the DOM tree.
See also
DOMNode.appendChild( and DOMNode.insertBefore() to place the node within the tree.

Remarks about W3C conformity
The W3C specifies the return type as "Comment". Considering code size (and work) the actual implementation omits a class DOMComment, which would not get any more members apart from the inherited ones. Scripts can examine DOMNode.nodeType to distinguish different types of character data, if necessary.

Since
DOCUMENTS 4.0c

◆ createElement()

DOMElement DOMDocument::createElement ( String tagName )

Create a new DOMElement within this document.

Parameters
tagName The name of the element.
Returns
A new DOMElement, which may initially appear anywhere or nowhere in the DOM tree.
Exceptions
DOMException
See also
DOMNode.appendChild() and DOMNode.insertBefore() to place the element within the tree.
Since
DOCUMENTS 4.0c

◆ createTextNode()

DOMCharacterData DOMDocument::createTextNode ( String data )

Create a new text node within this document.

Parameters
data The data for the node
Returns
A new DOMCharacterData object, which may initially appear anywhere or nowhere in the DOM tree.
See also
DOMNode.appendChild( and DOMNode.insertBefore() to place the node within the tree.

Remarks about W3C conformity
The W3C specifies the return type as "Text". Considering code size (and work) the actual implementation omits a class DOMText and presents the only additional member (splitText()) directly in the base class. Scripts can examine DOMNode.nodeType to distinguish different types of character data, if necessary.

Since
DOCUMENTS 4.0c

◆ getElementsByTagName()

DOMNodeList DOMDocument::getElementsByTagName ( String tagName )

List all DOMElements in the document with a certain tag name.

The order of the elements in the returned list corresponds to a preorder traversal of the DOM tree.

Parameters
tagName The name to match on. The special value "*" matches all tags.
Returns
A dynamic list of the found elements.
See also
DOMNodeList.
Since
DOCUMENTS 4.0c

Member Data Documentation

◆ documentElement

DOMElement DOMDocument::documentElement

The node, which represents the outermost structure element of the document.

This property is readonly.

Remarks
Unlike written in older versions of this document, the documentElement is not necessarily the first child of the DOMDocument. A DocumentType node, for example, may precede it in the list of direct children.
Since
DOCUMENTS 4.0d


DOCUMENTS 5 - PortalScripting API: Member List

DOMDocument Member List

This is the complete list of members for DOMDocument, including all inherited members.

appendChild(DOMNode newChild) | DOMNode
ATTRIBUTE_NODE | DOMNode
attributes | DOMNode
CDATA_SECTION_NODE | DOMNode
childNodes | DOMNode
cloneNode(boolean deep) | DOMNode
COMMENT_NODE | DOMNode
createAttribute(String name) | DOMDocument
createCDATASection(String data) | DOMDocument
createComment(String data) | DOMDocument
createElement(String tagName) | DOMDocument
createTextNode(String data) | DOMDocument
DOCUMENT_FRAGMENT_NODE | DOMNode
DOCUMENT_NODE | DOMNode
DOCUMENT_TYPE_NODE | DOMNode
documentElement | DOMDocument
DOMDocument(String rootElementName) | DOMDocument
ELEMENT_NODE | DOMNode
ENTITY_NODE | DOMNode
ENTITY_REFERENCE_NODE | DOMNode
firstChild | DOMNode
getElementsByTagName(String tagName) | DOMDocument
hasAttributes() | DOMNode
hasChildNodes() | DOMNode
insertBefore(DOMNode newChild, DOMNode refChild) | DOMNode
lastChild | DOMNode
nextSibling | DOMNode
nodeName | DOMNode
nodeType | DOMNode
nodeValue | DOMNode
normalize() | DOMNode
NOTATION_NODE | DOMNode
ownerDocument | DOMNode
parentNode | DOMNode
previousSibling | DOMNode
PROCESSING_INSTRUCTION_NODE | DOMNode
removeChild(DOMNode oldChild) | DOMNode
replaceChild(DOMNode newChild, DOMNode oldChild) | DOMNode
TEXT_NODE | DOMNode


DOCUMENTS 5 - PortalScripting API: DOMElement Class Reference

Public Member Functions | Public Attributes | List of all members
DOMElement Class Reference

An object of this class represents a HTML or XML element in the DOM. More...

Inheritance diagram for DOMElement:
DOMNode

Public Member Functions

String | getAttribute (String name)
Get the string value of an attribute of this element. More...
DOMAttr | getAttributeNode (String name)
Get an attribute of this element. More...
DOMNodeList | getElementsByTagName (String tagName)
List all DOMElements in the subtree with a certain tag name. More...
void | removeAttribute (String name)
Remove an attribute from this element by name. More...
DOMAttr | removeAttributeNode (DOMAttr oldAttr)
Remove an attribute node from this element. More...
void | setAttribute (String name, String value)
Set an attribute of this element by string. More...
DOMAttr | setAttributeNode (DOMAttr newAttr)
Attach an attribute node to this element. More...
- Public Member Functions inherited from DOMNode
DOMNode | appendChild (DOMNode newChild)
Append a new node to the list of child nodes. More...
DOMNode | cloneNode (boolean deep)
Create a duplicate of this node. More...
boolean | hasAttributes ()
Test, whether a node has got any associated attributes. More...
boolean | hasChildNodes ()
Test, whether a node has got any associated child nodes. More...
DOMNode | insertBefore (DOMNode newChild, DOMNode refChild)
Insert a new node into the list of child nodes. More...
void | normalize ()
Normalize the node ans its subtree. More...
DOMNode | removeChild (DOMNode oldChild)
Remove a node from the list of child nodes. More...
DOMNode | replaceChild (DOMNode newChild, DOMNode oldChild)
Replace a node in the list of child nodes. More...

Public Attributes

String | tagName
The name of the element. More...
- Public Attributes inherited from DOMNode
DOMNamedNodeMap attributes
A map of DOM attributes. If this node is not a DOMElement, the value is null. The property is readonly.
DOMNodeList childNodes
A list of all children of this node. The property is readonly.
DOMNode firstChild
The first child node, otherwise null. The property is readonly.
DOMNode lastChild
The last child node, otherwise null. The property is readonly.
DOMNode nextSibling
The next sibling node, otherwise null. The property is readonly.
String | nodeName
The name of this node. The property is readonly.
Integer | nodeType
The type or subclass of a this node, encoded as an integer. The property is readonly.
String | nodeValue
The value of the node, which depends on the type. More...
DOMDocument ownerDocument
The document, which owns this node. The property is readonly.
DOMNode parentNode
The parent node or null. The property is readonly.
DOMNode previousSibling
The previous sibling node, otherwise null. The property is readonly.
Integer | ELEMENT_NODE
Constant for the nodeType "Element". The actual subclass is DOMElement.
Integer | ATTRIBUTE_NODE
Constant for the nodeType "Attr". The actual subclass is DOMAttr.
Integer | TEXT_NODE
Constant for the nodeType "Text". The actual subclass is DOMCharacterData, differing from the standard.
Integer | CDATA_SECTION_NODE
Constant for the nodeType "CDATASection". The actual subclass is DOMCharacterData, differing from the standard.
Integer | ENTITY_REFERENCE_NODE
Constant for the nodeType "EntityReference". The actual implementation does not provide a subclass for this type.
Integer | ENTITY_NODE
Constant for the nodeType "Entity". The actual implementation does not provide a subclass for this type.
Integer | PROCESSING_INSTRUCTION_NODE
Constant for the nodeType "ProcessingInstruction". The actual implementation does not provide a subclass for this type.
Integer | COMMENT_NODE
Constant for the nodeType "Comment". The actual subclass is DOMCharacterData, differing from the standard.
Integer | DOCUMENT_NODE
Constant for the nodeType "Document". The actual subclass is DOMDocument.
Integer | DOCUMENT_TYPE_NODE
Constant for the nodeType "DocumentType". The actual implementation does not provide a subclass for this type.
Integer | DOCUMENT_FRAGMENT_NODE
Constant for the nodeType "DocumentFragment". The actual implementation does not provide a subclass for this type.
Integer | NOTATION_NODE
Constant for the nodeType "Notation". The actual implementation does not provide a subclass for this type.

Detailed Description

An object of this class represents a HTML or XML element in the DOM.

DOMElements cannot be created directly. This applies to all kinds of DOMNodes.

Remarks about W3C conformity
The class covers the Element interface of DOM level 1. The underlying native library already supports at least level 2.

Since
DOCUMENTS 4.0c

Member Function Documentation

◆ getAttribute()

String DOMElement::getAttribute ( String name )

Get the string value of an attribute of this element.

Parameters
name The name of the attribute
Returns
The atrribute's value or the empty string, if the attribute is not specified and has not got a default value.
Since
DOCUMENTS 4.0c

◆ getAttributeNode()

DOMAttr DOMElement::getAttributeNode ( String name )

Get an attribute of this element.

Parameters
name The attribute's name
Returns
The object, which represents the attribute in the DOM. If no attribute of the given name exists, the value is null.

◆ getElementsByTagName()

DOMNodeList DOMElement::getElementsByTagName ( String tagName )

List all DOMElements in the subtree with a certain tag name.

The order of the elements in the returned list corresponds to a preorder traversal of the DOM tree.

Parameters
tagName The name to match on. The special value "*" matches all tags.
Returns
A dynamic list of the found elements.
See also
DOMNodeList.
Since
DOCUMENTS 4.0c

◆ removeAttribute()

void DOMElement::removeAttribute ( String name )

Remove an attribute from this element by name.

Parameters
name The attribute's name
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ removeAttributeNode()

DOMAttr DOMElement::removeAttributeNode ( DOMAttr oldAttr )

Remove an attribute node from this element.

Parameters
oldAttr The attribute object to remove
Returns
The removed attribute node.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ setAttribute()

void DOMElement::setAttribute | ( | String | name,
 |  | String | value
 | ) |  |

Set an attribute of this element by string.

If an attribute of the given name exists, the method only updates its value. Otherwise it creates the attribute.

Parameters
name | The attribute's name
value | The new value of the attribute
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ setAttributeNode()

DOMAttr DOMElement::setAttributeNode ( DOMAttr newAttr )

Attach an attribute node to this element.

Parameters
newAttr The DOMAttr object, which defines the attribute to add or replace.
Returns
The formerly attached DOMAttr, if the call has replaced an attribute with the same name. Otherwise the method returns null.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

Member Data Documentation

◆ tagName

String DOMElement::tagName

The name of the element.

This property is readonly.

Since
DOCUMENTS 4.0c


DOCUMENTS 5 - PortalScripting API: Member List

DOMElement Member List

This is the complete list of members for DOMElement, including all inherited members.

appendChild(DOMNode newChild) | DOMNode
ATTRIBUTE_NODE | DOMNode
attributes | DOMNode
CDATA_SECTION_NODE | DOMNode
childNodes | DOMNode
cloneNode(boolean deep) | DOMNode
COMMENT_NODE | DOMNode
DOCUMENT_FRAGMENT_NODE | DOMNode
DOCUMENT_NODE | DOMNode
DOCUMENT_TYPE_NODE | DOMNode
ELEMENT_NODE | DOMNode
ENTITY_NODE | DOMNode
ENTITY_REFERENCE_NODE | DOMNode
firstChild | DOMNode
getAttribute(String name) | DOMElement
getAttributeNode(String name) | DOMElement
getElementsByTagName(String tagName) | DOMElement
hasAttributes() | DOMNode
hasChildNodes() | DOMNode
insertBefore(DOMNode newChild, DOMNode refChild) | DOMNode
lastChild | DOMNode
nextSibling | DOMNode
nodeName | DOMNode
nodeType | DOMNode
nodeValue | DOMNode
normalize() | DOMNode
NOTATION_NODE | DOMNode
ownerDocument | DOMNode
parentNode | DOMNode
previousSibling | DOMNode
PROCESSING_INSTRUCTION_NODE | DOMNode
removeAttribute(String name) | DOMElement
removeAttributeNode(DOMAttr oldAttr) | DOMElement
removeChild(DOMNode oldChild) | DOMNode
replaceChild(DOMNode newChild, DOMNode oldChild) | DOMNode
setAttribute(String name, String value) | DOMElement
setAttributeNode(DOMAttr newAttr) | DOMElement
tagName | DOMElement
TEXT_NODE | DOMNode


DOCUMENTS 5 - PortalScripting API: DOMException Class Reference

Public Attributes | List of all members
DOMException Class Reference

Many of the DOM API functions throw a DOMException, when an error has occurred. More...

Public Attributes

Integer | code
An error code. More...
String | message
An error message. More...
Error Code Constants

All these constants are also available as properties of the constructor.

Since
DOCUMENTS 4.0c
Integer | INDEX_SIZE_ERR
The index or size is negative, or greater than the allowed value.
Integer | DOMSTRING_SIZE_ERR
The specified range of text does not fit into a DOMString.
Integer | HIERARCHY_REQUEST_ERR
Any node is inserted somewhere it doesn't belong.
Integer | WRONG_DOCUMENT_ERR
A node is used in a different document than the one that created it.
Integer | INVALID_CHARACTER_ERR
An invalid or illegal character is specified, such as in a name.
Integer | NO_DATA_ALLOWED_ERR
Data is specified for a node which does not support data.
Integer | NO_MODIFICATION_ALLOWED_ERR
An attempt is made to modify an object where modifications are not allowed.
Integer | NOT_FOUND_ERR
An attempt is made to reference a node in a context where it does not exist.
Integer | NOT_SUPPORTED_ERR
The implementation does not support the requested type of object or operation.
Integer | INUSE_ATTRIBUTE_ERR
An attempt is made to add an attribute that is already in use elsewhere.
Integer | INVALID_STATE_ERR
An attempt is made to use an object that is not, or is no longer, usable.
Integer | SYNTAX_ERR
An invalid or illegal string is specified.
Integer | INVALID_MODIFICATION_ERR
An attempt is made to modify the type of the underlying object.
Integer | NAMESPACE_ERR
An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
Integer | INVALID_ACCESS_ERR
A parameter or an operation is not supported by the underlying object.
Integer | VALIDATION_ERR
A call to a method such as insertBefore or removeChild would make the Node invalid with respect to "partial validity", this exception would be raised and the operation would not be done.

Detailed Description

Many of the DOM API functions throw a DOMException, when an error has occurred.

Remarks about W3C conformity
The class implements the DOMException exception type with the error codes specified in DOM level 2.

Since
DOCUMENTS 4.0c

Member Data Documentation

◆ code

Integer DOMException::code

An error code.

See the error constants in this class.

Since
DOCUMENTS 4.0c

◆ message

String DOMException::message

An error message.

Since
DOCUMENTS 4.0c


DOCUMENTS 5 - PortalScripting API: Member List

DOMException Member List

This is the complete list of members for DOMException, including all inherited members.

code | DOMException
DOMSTRING_SIZE_ERR | DOMException
HIERARCHY_REQUEST_ERR | DOMException
INDEX_SIZE_ERR | DOMException
INUSE_ATTRIBUTE_ERR | DOMException
INVALID_ACCESS_ERR | DOMException
INVALID_CHARACTER_ERR | DOMException
INVALID_MODIFICATION_ERR | DOMException
INVALID_STATE_ERR | DOMException
message | DOMException
NAMESPACE_ERR | DOMException
NO_DATA_ALLOWED_ERR | DOMException
NO_MODIFICATION_ALLOWED_ERR | DOMException
NOT_FOUND_ERR | DOMException
NOT_SUPPORTED_ERR | DOMException
SYNTAX_ERR | DOMException
VALIDATION_ERR | DOMException
WRONG_DOCUMENT_ERR | DOMException


DOCUMENTS 5 - PortalScripting API: DOMNamedNodeMap Class Reference

Public Member Functions | Public Attributes | List of all members
DOMNamedNodeMap Class Reference

A DOMNamedNodeMap is a kind of index for a set of DOMNodes, in which each node has got a unique name. More...

Public Member Functions

DOMNode | getNamedItem (String name)
Get a node from the map by its unique name. More...
DOMNode | item (Integer index)
Get the a node from the map at a certain position. More...
DOMNode | removeNamedItem (String name)
Remove a node from the map. More...
DOMNode | setNamedItem (DOMNode arg)
Add a node to the map or replace an existing one. More...

Public Attributes

Integer length
The number of nodes in the map. More...

Detailed Description

A DOMNamedNodeMap is a kind of index for a set of DOMNodes, in which each node has got a unique name.

The attributes of a DOMElement are organized in a DOMNamedNodeMap. See DOMElement.attributes. The attached nodes can be accessed either by the name or by an integer index. When using an index, the output order of the nodes is not determined. Objects of this class cannot be created directly.

Remarks about W3C conformity
The class covers the NamedNodeMap interface of DOM level 1. The underlying native library already supports at least level 2.

Since
DOCUMENTS 4.0c

Member Function Documentation

◆ getNamedItem()

DOMNode DOMNamedNodeMap::getNamedItem ( String name )

Get a node from the map by its unique name.

Parameters
name The name.
Returns
The node, respectively null, if no node with the name is in the map.
Since
DOCUMENTS 4.0c

◆ item()

DOMNode DOMNamedNodeMap::item ( Integer index )

Get the a node from the map at a certain position.

This is useful only to iterate over all nodes in the map.

Parameters
index the zero based index of the element.
Returns
The requested DOMNode Object. If the index is invalid, the method returns null.
Remarks
It is also possible to access the nodes using square brackets, as if the object would be an array.
Since
DOCUMENTS 4.0c

◆ removeNamedItem()

DOMNode DOMNamedNodeMap::removeNamedItem ( String name )

Remove a node from the map.

Parameters
name The unique node name.
Returns
The removed node.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ setNamedItem()

DOMNode DOMNamedNodeMap::setNamedItem ( DOMNode arg )

Add a node to the map or replace an existing one.

Parameters
arg The node to add. The name for indexing is the value of the attribute DOMNode.nodeName,
Returns
If a node with the same name has already been added, the method removes that node and returns it. Otherwise it returns null.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

Member Data Documentation

◆ length

Integer DOMNamedNodeMap::length

The number of nodes in the map.

This property is readonly.

Since
DOCUMENTS 4.0c


DOCUMENTS 5 - PortalScripting API: Member List

DOMNamedNodeMap Member List

This is the complete list of members for DOMNamedNodeMap, including all inherited members.

getNamedItem(String name) | DOMNamedNodeMap
item(Integer index) | DOMNamedNodeMap
length | DOMNamedNodeMap
removeNamedItem(String name) | DOMNamedNodeMap
setNamedItem(DOMNode arg) | DOMNamedNodeMap


DOCUMENTS 5 - PortalScripting API: DOMNode Class Reference

Public Member Functions | Public Attributes | List of all members
DOMNode Class Reference

DOMNode is the base class of all tree elements in a DOMDocument. More...

Inheritance diagram for DOMNode:
DOMAttr DOMCharacterData DOMDocument DOMElement

Public Member Functions

DOMNode | appendChild (DOMNode newChild)
Append a new node to the list of child nodes. More...
DOMNode | cloneNode (boolean deep)
Create a duplicate of this node. More...
boolean | hasAttributes ()
Test, whether a node has got any associated attributes. More...
boolean | hasChildNodes ()
Test, whether a node has got any associated child nodes. More...
DOMNode | insertBefore (DOMNode newChild, DOMNode refChild)
Insert a new node into the list of child nodes. More...
void | normalize ()
Normalize the node ans its subtree. More...
DOMNode | removeChild (DOMNode oldChild)
Remove a node from the list of child nodes. More...
DOMNode | replaceChild (DOMNode newChild, DOMNode oldChild)
Replace a node in the list of child nodes. More...

Public Attributes

DOMNamedNodeMap attributes
A map of DOM attributes. If this node is not a DOMElement, the value is null. The property is readonly.
DOMNodeList childNodes
A list of all children of this node. The property is readonly.
DOMNode firstChild
The first child node, otherwise null. The property is readonly.
DOMNode lastChild
The last child node, otherwise null. The property is readonly.
DOMNode nextSibling
The next sibling node, otherwise null. The property is readonly.
String | nodeName
The name of this node. The property is readonly.
Integer | nodeType
The type or subclass of a this node, encoded as an integer. The property is readonly.
String | nodeValue
The value of the node, which depends on the type. More...
DOMDocument ownerDocument
The document, which owns this node. The property is readonly.
DOMNode parentNode
The parent node or null. The property is readonly.
DOMNode previousSibling
The previous sibling node, otherwise null. The property is readonly.
Node Type Constants

These constants build an enumeration of the possible values of the property nodeType. The constants are also properties of the constructor, so it is possible to read them in the style DOMNode.ELEMENT_NODE.

Integer | ELEMENT_NODE
Constant for the nodeType "Element". The actual subclass is DOMElement.
Integer | ATTRIBUTE_NODE
Constant for the nodeType "Attr". The actual subclass is DOMAttr.
Integer | TEXT_NODE
Constant for the nodeType "Text". The actual subclass is DOMCharacterData, differing from the standard.
Integer | CDATA_SECTION_NODE
Constant for the nodeType "CDATASection". The actual subclass is DOMCharacterData, differing from the standard.
Integer | ENTITY_REFERENCE_NODE
Constant for the nodeType "EntityReference". The actual implementation does not provide a subclass for this type.
Integer | ENTITY_NODE
Constant for the nodeType "Entity". The actual implementation does not provide a subclass for this type.
Integer | PROCESSING_INSTRUCTION_NODE
Constant for the nodeType "ProcessingInstruction". The actual implementation does not provide a subclass for this type.
Integer | COMMENT_NODE
Constant for the nodeType "Comment". The actual subclass is DOMCharacterData, differing from the standard.
Integer | DOCUMENT_NODE
Constant for the nodeType "Document". The actual subclass is DOMDocument.
Integer | DOCUMENT_TYPE_NODE
Constant for the nodeType "DocumentType". The actual implementation does not provide a subclass for this type.
Integer | DOCUMENT_FRAGMENT_NODE
Constant for the nodeType "DocumentFragment". The actual implementation does not provide a subclass for this type.
Integer | NOTATION_NODE
Constant for the nodeType "Notation". The actual implementation does not provide a subclass for this type.

Detailed Description

DOMNode is the base class of all tree elements in a DOMDocument.

DOMNodes cannot be created with new. Different create methods of DOMDocument can be used to create different types of nodes.

Note
Accessing any node may generate a JavaScript error, when the owning document has been deleted or "garbage collected". See the negative example at class DOMDocument.

Remarks about W3C conformity
The class covers the Node interface of DOM level 1. The underlying native library already supports at least level 2.

Since
DOCUMENTS 4.0c

Member Function Documentation

◆ appendChild()

DOMNode DOMNode::appendChild ( DOMNode newChild )

Append a new node to the list of child nodes.

Parameters
newChild The DOMNode to append.
Returns
The node added.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ cloneNode()

DOMNode DOMNode::cloneNode ( boolean deep )

Create a duplicate of this node.

Parameters
deep true to clone also the whole subtree, false to clone only the node (including the attributes, if it is a DOMElement).
Returns
The copy. The actual type equals the type of this.
Remarks
The returned node initially has not got a parent.
Since
DOCUMENTS 4.0c

◆ hasAttributes()

boolean DOMNode::hasAttributes ( )

Test, whether a node has got any associated attributes.

Since
DOCUMENTS 4.0c

◆ hasChildNodes()

boolean DOMNode::hasChildNodes ( )

Test, whether a node has got any associated child nodes.

Since
DOCUMENTS 4.0c

◆ insertBefore()

DOMNode DOMNode::insertBefore | ( | DOMNode | newChild,
 |  | DOMNode | refChild
 | ) |  |

Insert a new node into the list of child nodes.

Parameters
newChild | The DOMNode to insert.
refChild | An existing DOMNode, which already is a child of this, and which shall become the next sibling of newChild.
Returns
The node inserted.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ normalize()

void DOMNode::normalize ( )

Normalize the node ans its subtree.

This method restructures a DOMDocument (or a subtree of it) as if the document was written to a string and reparsed from it. Subsequent "Text" nodes without any interjacent markup are combined into one node, for example.

Since
DOCUMENTS 4.0c

◆ removeChild()

DOMNode DOMNode::removeChild ( DOMNode oldChild )

Remove a node from the list of child nodes.

Parameters
oldChild The child DOMNode being removed.
Returns
The node removed.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ replaceChild()

DOMNode DOMNode::replaceChild | ( | DOMNode | newChild,
 |  | DOMNode | oldChild
 | ) |  |

Replace a node in the list of child nodes.

Parameters
newChild | The DOMNode to insert.
oldChild | The child DOMNode being replaced.
Returns
The node replaced.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

Member Data Documentation

◆ nodeValue

String DOMNode::nodeValue

The value of the node, which depends on the type.

For several node types, the value is constantly an empty string. See also the W3C documentation in the internet.

Exceptions
DOMException


DOCUMENTS 5 - PortalScripting API: Member List

DOMNode Member List

This is the complete list of members for DOMNode, including all inherited members.

appendChild(DOMNode newChild) | DOMNode
ATTRIBUTE_NODE | DOMNode
attributes | DOMNode
CDATA_SECTION_NODE | DOMNode
childNodes | DOMNode
cloneNode(boolean deep) | DOMNode
COMMENT_NODE | DOMNode
DOCUMENT_FRAGMENT_NODE | DOMNode
DOCUMENT_NODE | DOMNode
DOCUMENT_TYPE_NODE | DOMNode
ELEMENT_NODE | DOMNode
ENTITY_NODE | DOMNode
ENTITY_REFERENCE_NODE | DOMNode
firstChild | DOMNode
hasAttributes() | DOMNode
hasChildNodes() | DOMNode
insertBefore(DOMNode newChild, DOMNode refChild) | DOMNode
lastChild | DOMNode
nextSibling | DOMNode
nodeName | DOMNode
nodeType | DOMNode
nodeValue | DOMNode
normalize() | DOMNode
NOTATION_NODE | DOMNode
ownerDocument | DOMNode
parentNode | DOMNode
previousSibling | DOMNode
PROCESSING_INSTRUCTION_NODE | DOMNode
removeChild(DOMNode oldChild) | DOMNode
replaceChild(DOMNode newChild, DOMNode oldChild) | DOMNode
TEXT_NODE | DOMNode


DOCUMENTS 5 - PortalScripting API: DOMNodeList Class Reference

Public Member Functions | Public Attributes | List of all members
DOMNodeList Class Reference

A dynamic, ordered list of DOMNodes. More...

Public Member Functions

DOMNode item (Integer index)
Returns the element at a certain position. More...

Public Attributes

Integer length
The actual number of nodes in the list. More...

Detailed Description

A dynamic, ordered list of DOMNodes.

These lists always reflect the actual state of the DOM tree, which can differ from that state, when the list has been created. Getting the nodes from the list works with an integer index in square brackets, as if the list object would be an Array. DOMNodeLists cannot be created directly. Some methods or properties of DOMNode and its subclasses can create them.

Remarks about W3C conformity
The class covers the NodeList interface of DOM level 1. The underlying native library already supports at least level 2.

Since
DOCUMENTS 4.0c

Member Function Documentation

◆ item()

DOMNode DOMNodeList::item ( Integer index )

Returns the element at a certain position.

This is just the same as using the square brackets on the object.

Parameters
index The zero-based position of the requested element
Returns
The DOMNode at the requested index. In the case of an invalid index the return value is null.
Since
DOCUMENTS 4.0c

Member Data Documentation

◆ length

Integer DOMNodeList::length

The actual number of nodes in the list.

Since
DOCUMENTS 4.0c


DOCUMENTS 5 - PortalScripting API: Member List

DOMNodeList Member List

This is the complete list of members for DOMNodeList, including all inherited members.

item(Integer index) | DOMNodeList
length | DOMNodeList


DOCUMENTS 5 - PortalScripting API: DOMParser Class Reference

Public Member Functions | List of all members
DOMParser Class Reference

This class provides basic methods to parse or synthesize XML documents using the Document Object Model (DOM). More...

Public Member Functions

DOMParser ()
The constructor actually takes no arguments. More...
DOMDocument getDocument ()
This returns the root of the DOM tree after a successful call of parse(), otherwise null.
String | getLastError ()
This returns the text of the last occurred error.
Integer | parse (String xml, boolean fromFile)
Parse an XML document, either from a String or from a local file. More...
Var | write (DOMNode node, String path, String encoding, boolean prettyPrint)
Build an XML document from a DOM tree. More...

Public Attributes

Error Constants

In contrast to many other methods of the DOM API, the parse() method does not forward exceptions of the native parser to the calling script. It rather stores the error text in a buffer, which the script can read with getLastError(). The return value signals the type of the exception, which equals one of these constants. The constants are also properties of the constructor, so it is possible to read them in the style DOMParser.ErrCatDOM .

Integer | ErrCatNone
This constant with the value zero indicates "no error".
Integer | ErrCatEnv
This constant represents errors detected by interface code outside the native parser.
Integer | ErrCatXML
This constant represents a caught exception of the type "XMLException".
Integer | ErrCatSAX
This constant represents a caught exception of the type "SAXException".
Integer | ErrCatDOM
This constant represents a caught exception of the type "DOMException".

Detailed Description

This class provides basic methods to parse or synthesize XML documents using the Document Object Model (DOM).

See also
XML-DOM Example
Since
DOCUMENTS 4.0c

Constructor & Destructor Documentation

◆ DOMParser()

DOMParser::DOMParser ( )

The constructor actually takes no arguments.

Member Function Documentation

◆ parse()

Integer DOMParser::parse | ( | String | xml,
 |  | boolean | fromFile
 | ) |  |

Parse an XML document, either from a String or from a local file.

Parameters
xml | Either the XML itself or the path and file name of a local file
fromFile | true to parse a local file, otherwise false.
Returns
An integer, which describes an error category. See ErrCatNone and further constants.
Remarks
On success, call getDocument() to access the DOM tree. On error use getLastError() to obtain an error text.
The encapsulated native DOM library supports the following character encodings: ASCII, UTF-8, UTF-16, UCS4, EBCDIC code pages IBM037, IBM1047 and IBM1140, ISO-8859-1 (aka Latin1) and Windows-1252. (no guarantee)
Since
DOCUMENTS 4.0c

◆ write()

Var DOMParser::write | ( | DOMNode | node,
 |  | String | path,
 |  | String | encoding,
 |  | boolean | prettyPrint
 | ) |  |

Build an XML document from a DOM tree.

Parameters
node | The root node to build the document from. Though the interface accepts any DOMNode, only a DOMDocument should be passed. Otherwise the output may be a fragment which is not a valid XML.
path | Optional path and filename to save the XML in the local file system.
encoding | Optional encoding specification for the file. Only used when path is also specified.
prettyPrint | Optional boolean value.
Returns
The return type depends on the parameters. After saving to a local file, the method returns a boolean value, which indicates the success of the operation. Otherwise the return value is a String with the XML itself, or an empty string after an error.
Note
Saving to a local file is not supported on all platforms. If a script tries it while the version of the native DOM library is too old, the method just throws a JavaScript error.
Remarks
To obtain an error message use getLastError(). When the message is just "NULL pointer", the native DOM library may have failed to open the output file for writing. When the method writes to a string, the encoding is always the server application's internal encoding.
The encapsulated native DOM library supports the following character encodings: ASCII, UTF-8, UTF-16, UCS4, EBCDIC code pages IBM037, IBM1047 and IBM1140, ISO-8859-1 (aka Latin1) and Windows-1252. (no guarantee)
Since
DOCUMENTS 4.0c
Parameter prettyPrint since DOCUMENTS 5.0b HF3


DOCUMENTS 5 - PortalScripting API: Member List

DOMParser Member List

This is the complete list of members for DOMParser, including all inherited members.

DOMParser() | DOMParser
ErrCatDOM | DOMParser
ErrCatEnv | DOMParser
ErrCatNone | DOMParser
ErrCatSAX | DOMParser
ErrCatXML | DOMParser
getDocument() | DOMParser
getLastError() | DOMParser
parse(String xml, boolean fromFile) | DOMParser
write(DOMNode node, String path, String encoding, boolean prettyPrint) | DOMParser


DOCUMENTS 5 - PortalScripting API: E4X Class Reference

E4X Class Reference

Detailed Description

Deprecated:
XMLParser E4X is deprecated since DOCUMENTS 4.0c and was removed in DOCUMENTS 5.0.

Use DOMParser instead.


DOCUMENTS 5 - PortalScripting API: Email Class Reference

Public Member Functions | List of all members
Email Class Reference

The Email class allows to create and send an email. More...

Public Member Functions

boolean | addAttachment (Var attachment, String sourceFilePath)
Add an attachment to the email. More...
Email | Email (String to, String from, String subject, String body, String cc, String bcc, Date sendingTime, boolean deleteAfterSending)
Create a new instance of the Email class. More...
String | getLastError ()
Get the description of the last error that occurred. More...
boolean | send ()
Send the email to recipients. More...
boolean | setBCC (String bcc)
Set blind carbon-copy recipients of the email. More...
boolean | setBody (String body)
Set the content of the email. More...
boolean | setCC (String cc)
Set carbon-copy recipients of the email. More...
boolean | setDeleteAfterSending (boolean deleteAfterSending)
Decide on whether the email is to be deleted after successful sending. More...
boolean | setFrom (String from)
Set the sender's email address. More...
boolean | setSendingTime (Date sendingTime)
Set sending time of the email. More...
boolean | setSubject (String subject)
Set the subject of the email. More...
boolean | setTo (String to)
Set the primary recipients of the email. More...

Detailed Description

The Email class allows to create and send an email.

All the email settings for the principal (such as SMTP server and authentication) are used when sending an email.

Since
DOCUMENTS 4.0d
Example:
var mail = new Email("receiver@domain.de", "sender@domain.de", "Test", "This is a test email.");
mail.addAttachment("log.txt", "C:\\tmp\\changelog.txt");
mail.setBCC("somebody1@domain.de,somebody2@domain.com");
mail.setDeleteAfterSending(true);
if (!mail.send())
util.out(mail.getLastError());

Constructor & Destructor Documentation

◆ Email()

Email Email::Email | ( | String | to,
 |  | String | from,
 |  | String | subject,
 |  | String | body,
 |  | String | cc,
 |  | String | bcc,
 |  | Date | sendingTime,
 |  | boolean | deleteAfterSending
 | ) |  |

Create a new instance of the Email class.

In case of multiple recipients for the parameters to, cc or bcc, the individual email addresses are to be separated by a comma (,). It is not allowed to send an email without any primary recipients specified by the parameter to. To send a HTML email the body must begin with the <HTML> tag. Emails in following cases are stored in the folder Administration > Sent eMails in the DOCUMENTS Manager:

  • They are to be sent in the future (specified by sendingTime);
  • Sending them failed;
  • The parameter deleteAfterSending is set to false.
Parameters
to | String value containing the email addresses of primary recipients.
from | Optional string value containing the sender's email address. If no sender is specified, the default sender for the principal is used.
subject | Optional string value containing the subject of the email.
body | Optional string value containing the content of the email.
cc | Optional string value containing the email addresses of carbon-copy recipients (appearing in the header of the email).
bcc | Optional string value containing the email addresses of blind carbon-copy recipients (remaining invisible to other recipients).
sendingTime | Optional Date object specifying when the email is to be sent. If sending time is not specified, the email will be sent immediately by calling send().
deleteAfterSending | Optional flag indicating whether the email is to be deleted after successful sending. The default value is true.
Since
DOCUMENTS 4.0d

Member Function Documentation

◆ addAttachment()

boolean Email::addAttachment | ( | Var | attachment,
 |  | String | sourceFilePath
 | ) |  |

Add an attachment to the email.

Parameters
attachment Document object or string value containing the attachment name of the Email.
sourceFilePath Optional string value containing the path of the file to be attached and stored on the server's filesystem in case the first parameter is a string specifying the attachment name. You may only delete this file after calling the function send().
Note: This Parameter is ignored in case the first parameter is a Document object.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var mail = new Email("receiver@domain.de", "sender@domain.de", "Test", "This is a test.");
if (!mail.addAttachment("log.txt", "C:\\tmp\\changelog.txt"))
util.out(mail.getLastError());

◆ getLastError()

String Email::getLastError ( )

Get the description of the last error that occurred.

Returns
Text of the last error as String
Since
DOCUMENTS 4.0d

◆ send()

boolean Email::send ( )

Send the email to recipients.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var mail = new Email("receiver@domain.de");
mail.setSubject("Test");
mail.setBody("This is a test mail.");
if (!mail.send())
util.out(mail.getLastError());

◆ setBCC()

boolean Email::setBCC ( String bcc )

Set blind carbon-copy recipients of the email.

Parameters
bcc String containing the email addresses of blind carbon-copy recipients.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d

◆ setBody()

boolean Email::setBody ( String body )

Set the content of the email.

Parameters
body String containing the content of the email.
Note: To send a HTML email the body must begin with the <HTML> tag.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var mail = new Email("receiver@domain.de");
mail.setSubject("Test");
mail.setBody("<HTML>This is a &#x3c;HTML&#x3e; mail.");
if (!mail.send())
util.out(mail.getLastError());

◆ setCC()

boolean Email::setCC ( String cc )

Set carbon-copy recipients of the email.

Parameters
cc String containing the email addresses of carbon-copy recipients.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d

◆ setDeleteAfterSending()

boolean Email::setDeleteAfterSending ( boolean deleteAfterSending )

Decide on whether the email is to be deleted after successful sending.

Parameters
deleteAfterSending boolean value indicating whether the email is to be deleted after successful sending.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d

◆ setFrom()

boolean Email::setFrom ( String from )

Set the sender's email address.

Parameters
from String containing the sender's email address.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d

◆ setSendingTime()

boolean Email::setSendingTime ( Date sendingTime )

Set sending time of the email.

Parameters
sendingTime Date object representing the sending time.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var mail = new Email("receiver@domain.de", "sender@domain.de", "Test", "This is a test.");
var actDate = new Date();
var newDate = context.addTimeInterval(actDate, 2, "days", false);
mail.setSendingTime(newDate);

◆ setSubject()

boolean Email::setSubject ( String subject )

Set the subject of the email.

Parameters
subject String containing the desired subject of the email.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d

◆ setTo()

boolean Email::setTo ( String to )

Set the primary recipients of the email.

Parameters
to String containing the email addresses of primary recipients.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d


DOCUMENTS 5 - PortalScripting API: Member List

Email Member List

This is the complete list of members for Email, including all inherited members.

addAttachment(Var attachment, String sourceFilePath) | Email
Email(String to, String from, String subject, String body, String cc, String bcc, Date sendingTime, boolean deleteAfterSending) | Email
getLastError() | Email
send() | Email
setBCC(String bcc) | Email
setBody(String body) | Email
setCC(String cc) | Email
setDeleteAfterSending(boolean deleteAfterSending) | Email
setFrom(String from) | Email
setSendingTime(Date sendingTime) | Email
setSubject(String subject) | Email
setTo(String to) | Email


DOCUMENTS 5 - PortalScripting API: File Class Reference

Public Member Functions | List of all members
File Class Reference

The File class allows full access to files stored on the Portal Server's filesystem. More...

Public Member Functions

boolean | close ()
Close the file handle. More...
boolean | eof ()
Report whether the file pointer points to EOF (end of file). More...
String | error ()
Retrieve the error message of the last file access error as String. More...
File | File (String pathFileName, String mode)
The constructor has the purpose to open a file handle to the desired file. More...
boolean | ok ()
Report whether an error occurred while accessing the file handle. More...
String | read (int charsNo)
Retrieve a block of data from the file, containing a maximum of charsNo byte. More...
String | readLine ()
Retrieve one line of data from the file. More...
boolean | write (number[] byteArray)
Write binary data to the file. More...
boolean | write (string a, string b,...)
Write data to the file. More...
boolean | writeBuffer (String data, int charsNo)
Write data to the file. More...

Detailed Description

The File class allows full access to files stored on the Portal Server's filesystem.

Since
ELC 3.50 / otrisPORTAL 5.0

Constructor & Destructor Documentation

◆ File()

File File::File | ( | String | pathFileName,
 |  | String | mode
 | ) |  |

The constructor has the purpose to open a file handle to the desired file.

Once created, you cannot change the access mode of the file handle. If you need to change the access mode, you would have to close the file and reopen it.

Note
File handles are so-called expensive ressources, thus it is strongly recommanded to close them as soon as possible. Refer to File.close() for further information.
Parameters
pathFileName String value containing the complete path and filename of the desired file
mode String representing the access mode for the file handle. Allowed values are:
  • r read mode
  • r+ read mode plus write access; if the file does not yet exist, an error is raised
  • w write mode; if the file already exists, it will be completely overwritten
  • w+ write mode plus read access; if the file already exists, it will be completely overwritten
  • a write mode with append; if the file does not yet exist, it is created, otherwise the data you write to the file will be appended
  • a+ write mode with append plus read access; if the file does not yet exist, it is created, otherwise the data you write to the file will be appended
  • t open the file in text mode (ASCII 127)
  • b open the file in binary mode
Returns
File object representing a handle to a file on the server's filesystem
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
// Text-Sample
var fso = new File("c:\\tmp\\test.txt", "w+t");
if (!fso.ok())
throw fso.error();
var int_val = 65;
fso.write("Hello world: ", int_val);
fso.close();
// result: test.txt: Hello world: 65
// Binary-Sample
var fso = new File("c:\\tmp\\test.txt", "w+b");
if (!fso.ok())
throw fso.error();
var int_val = 65;
fso.write("Hello world: ", int_val);
fso.close();
// result: test.txt: Hello world: A
// Binary-Sample with Byte-Array
var fso = new File("c:\\tmp\\test.txt", "w+b");
if (!fso.ok())
throw fso.error();
var byteArr = [];
byteArr.push(72);
byteArr.push(101);
byteArr.push(108);
byteArr.push(108);
byteArr.push(111);
byteArr.push(0); // 0-Byte
byteArr.push(87);
byteArr.push(111);
byteArr.push(114);
byteArr.push(108);
byteArr.push(100);
fso.write(byteArr);
fso.close();
// result: test.txt: Hello{0-Byte}World
See also
File.close()

Member Function Documentation

◆ close()

boolean File::close ( )

Close the file handle.

Note
Since file handles are so-called expensive ressources it is strongly recommanded to close each file handle you prior created in your scripts as soon as possible.
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0
See also
File.File(String pathFileName, String mode)

◆ eof()

boolean File::eof ( )

Report whether the file pointer points to EOF (end of file).

Returns
true if EOF, false if not
Since
ELC 3.50 / otrisPORTAL 5.0

◆ error()

String File::error ( )

Retrieve the error message of the last file access error as String.

The error message (as long there is one) and its language depend on the operating system used on the Portal Server's machine. If there is no error, the method returns null.

Returns
String with the content of the last file access error message, null in case of no error
Since
ELC 3.50 / otrisPORTAL 5.0

◆ ok()

boolean File::ok ( )

Report whether an error occurred while accessing the file handle.

Returns
true if no error occurred, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0

◆ read()

String File::read ( int charsNo )

Retrieve a block of data from the file, containing a maximum of charsNo byte.

After the method has been performed, the data pointer of the file handle is moved right after the block which has been read. This might as well trigger the EOF flag, if the end of file has been reached.

Parameters
charsNo integer value indicating how many characters (resp. byte in binary mode) should be read
Returns
String containing up to charsNo characters/byte of data of the file.
Since
ELC 3.50 / otrisPORTAL 5.0

◆ readLine()

String File::readLine ( )

Retrieve one line of data from the file.

This method requires to have the file opened in text mode to work flawlessly, because the end of line is recognized by the linefeed character. After the readLine() method has been performed, the data pointer of the file handle is moved to the beginning of the next line of data.

Returns
String containing one line of data of the file.
Since
ELC 3.50 / otrisPORTAL 5.0

◆ write() [1/2]

boolean File::write ( number [] byteArray )

Write binary data to the file.

This requires to have the file handle opened with write access (meaning modes r+, w/w+, a/a+) and binary mode b.

Parameters
byteArray Array of integers containing any data you want to write to the file
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0
Example:
// Binary-Sample with Byte-Array
var fso = new File("c:\\tmp\\test.txt", "w+b");
if (!fso.ok())
throw fso.error();
var byteArr = [];
byteArr.push(72);
byteArr.push(101);
byteArr.push(108);
byteArr.push(108);
byteArr.push(111);
byteArr.push(0); // 0-Byte
byteArr.push(87);
byteArr.push(111);
byteArr.push(114);
byteArr.push(108);
byteArr.push(100);
fso.write(byteArr);
fso.close();
// result: test.txt: Hello{0-Byte}World
See also
File.close()

◆ write() [2/2]

boolean File::write | ( | string | a,
 |  | string | b,
 |  |  | ...
 | ) |  |

Write data to the file.

This requires to have the file handle opened with write access (meaning modes r+, w/w+, a/a+). You may concatenate as many strings as you want.

Parameters
a | String containing any data you want to write to the file
b | String containing any data you want to write to the file
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0

◆ writeBuffer()

boolean File::writeBuffer | ( | String | data,
 |  | int | charsNo
 | ) |  |

Write data to the file.

This requires to have the file handle opened with write access (meaning modes r+, w/w+, a/a+).

Parameters
data | String containing any data you want to write to the file.
charsNo | integer value indicating how many characters should be written.
Returns
true if successful, false in case of any error
Since
ELC 3.50 / otrisPORTAL 5.0


DOCUMENTS 5 - PortalScripting API: Member List

File Member List

This is the complete list of members for File, including all inherited members.

close() | File
eof() | File
error() | File
File(String pathFileName, String mode) | File
ok() | File
read(int charsNo) | File
readLine() | File
write(number[] byteArray) | File
write(string a, string b,...) | File
writeBuffer(String data, int charsNo) | File


DOCUMENTS 5 - PortalScripting API: FileResultset Class Reference

Public Member Functions | List of all members
FileResultset Class Reference

The FileResultset class supports basic functions to loop through a list of DocFile objects. More...

Public Member Functions

FileResultset | FileResultset (String fileType, String filter="", String sortOrder="")
Create a new FileResultset object. More...
DocFile first ()
Retrieve the first DocFile object in the FileResultset. More...
string [] | getIds ()
Returns an array with all file ids in the FileResultset. More...
DocFile last ()
Retrieve the last DocFile object in the FileResultset. More...
DocFile next ()
Retrieve the next DocFile object in the FileResultset. More...
int | size ()
Get the amount of DocFile objects in the FileResultset. More...

Detailed Description

The FileResultset class supports basic functions to loop through a list of DocFile objects.

You can manually create a FileResultset as well as access the (selected) files of a (public) Folder.

Constructor & Destructor Documentation

◆ FileResultset()

FileResultset FileResultset::FileResultset | ( | String | fileType,
 |  | String | filter = "",
 |  | String | sortOrder = ""
 | ) |  |

Create a new FileResultset object.

Like in other programming languages you create a new object with the new operator (refer to example below).

Parameters
fileType | String containing the technical name of the desired filetype
filter | String containing an optional filter criterium; use empty String ('') if you don't want to filter at all
sortOrder | String containing an optional sort order; use empty String ('') if you don't want to sort at all
Returns
FileResultset representing a list of all matching DocFile objects in the system
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var fileType = "Standard";
var filter = "";
var sortOrder = "";
var myFRS = new FileResultset(fileType, filter, sortOrder);
Note
Details for the filter expression you find in section Filter Expressions
Further samples are in Filter Expression Examples

Member Function Documentation

◆ first()

DocFile FileResultset::first ( )

Retrieve the first DocFile object in the FileResultset.

Returns
DocFile or null in case of an empty FileResultset
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFRS = new FileResultset("Standard", "", "");
var myFile = myFRS.first();

◆ getIds()

string [] FileResultset::getIds ( )

Returns an array with all file ids in the FileResultset.

Returns
Array of String with file ids of the FileResultset
Since
DOCUMENTS 5.0c
Example:
var myFRS = new FileResultset("Standard", "", "");
util.out(myFRS.getIds());

◆ last()

DocFile FileResultset::last ( )

Retrieve the last DocFile object in the FileResultset.

Returns
DocFile or null if end of FileResultset is reached.
Since
ELC 3.60j / otrisPORTAL 6.0j

◆ next()

DocFile FileResultset::next ( )

Retrieve the next DocFile object in the FileResultset.

Returns
DocFile or null if end of FileResultset is reached.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFRS = new FileResultset("Standard", "", "");
for (var myFile = myFRS.first(); myFile; myFile = myFRS.next())
{
// do something with each DocFile object
}

◆ size()

int FileResultset::size ( )

Get the amount of DocFile objects in the FileResultset.

Returns
integer value with the amount of DocFile objects in the FileResultset
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
var myFRS = new FileResultset("Standard", "", "");
util.out(myFRS.size());


DOCUMENTS 5 - PortalScripting API: Member List

FileResultset Member List

This is the complete list of members for FileResultset, including all inherited members.

FileResultset(String fileType, String filter="", String sortOrder="") | FileResultset
first() | FileResultset
getIds() | FileResultset
last() | FileResultset
next() | FileResultset
size() | FileResultset


DOCUMENTS 5 - PortalScripting API: Folder Class Reference

Public Member Functions | Public Attributes | List of all members
Folder Class Reference

The Folder class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS folders by scripting means. More...

Public Member Functions

boolean | addAccessProfile (String accessProfileName, boolean allowInsertFiles, boolean allowRemoveFiles)
Add a folder access right for the user group defined by an access profile to the folder. More...
boolean | addFile (DocFile docFile)
Store a reference to a desired DocFile object in the current Folder. More...
boolean | addFilterEDAServer (String serverName)
Add an EDA server to the filter of the folder. More...
boolean | addFilterEEiArchive (String archiveKey)
Add an EE.i archive to the filter of the folder. More...
boolean | addFilterEExView (String viewKey)
Add an EE.x view to the filter of the folder. More...
boolean | addFilterFileType (String fileType)
Add a file type to the filter of the folder. More...
boolean | addSystemUser (String loginName, boolean allowInsertFiles, boolean allowRemoveFiles)
Add a folder access right for a system user to the folder. More...
boolean | addToOutbar (String outbarName)
Add the folder to an outbar. More...
Folder | copyFolder (boolean includeSubFolders, boolean copyRights, boolean copyActions)
The current Folder object is duplicated to create a new Folder object. More...
Folder | createSubFolder (String name, String type)
Create a new subfolder of the specified folder type. More...
boolean | deleteFolder ()
Delete the folder in DOCUMENTS. More...
UserAction | getActionByName (String actionName)
Retrieve a user-defined action of the Folder. More...
String | getAttribute (String attribute)
Get the String value of an attribute of the Folder. More...
FileResultset getFiles ()
Retrieve a FileResultset of all the DocFile objects stored in the Folder. More...
Array | getFilterFileTypes ()
Retrieve the filter file types of the folder. More...
HitResultset getHitResultset ()
Create a HitResultset, which summarizes all DocFiles in the folder. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
String | getLocaleLabel (String locale)
Get the ergonomic label of the Folder. More...
String | getOID (boolean oidLow=false)
Returns the object-id. More...
int | getPosition (Folder subFolder)
Retrieve the position of a subfolder within the subfolder list. More...
FolderIterator getSubFolders ()
Retrieve a FolderIterator containing all Folder objects which represent subfolders of the given Folder. More...
boolean | hasFiles ()
Retrieve information whether the Folder is empty or not. More...
boolean | removeAccessProfile (String accessProfileName)
Remove all folder access rights of the user group defined by an access profile from the folder. More...
boolean | removeFile (DocFile docFile)
Remove the reference to a desired DocFile object out of the current Folder. More...
boolean | removeFilterEDAServer (String serverName)
Remove an EDA server from the filter of the folder. More...
boolean | removeFilterEEiArchive (String archiveKey)
Remove an EE.i archive from the filter of the folder. More...
boolean | removeFilterEExView (String viewKey)
Remove an EE.x view from the filter of the folder. More...
boolean | removeFilterFileType (String fileType)
Remove a file type from the filter of the folder. More...
boolean | removeFromOutbar (String outbarName)
Remove the folder from an outbar. More...
boolean | removeSystemUser (String loginName)
Remove all folder access rights of a system user from the folder. More...
boolean | setAllowedActionScript (String scriptName)
Set the script containing the allowed user-defined actions. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the Folder to the desired value. More...
boolean | setParentFolder (Folder parentFolder)
Set the parent folder of the current folder. More...
boolean | setPosition (Folder subFolder, int position)
Place a subfolder at the given position in the subfolder list. More...

Public Attributes

boolean | allowArchive
This property specifies whether the action 'Archive' is available for the folder. More...
boolean | allowCopyTo
This property specifies whether the action 'Copy to' is available for the folder. More...
boolean | allowCreatePDF
This property specifies whether the action 'PDF creation (Print)' is available for the folder. More...
boolean | allowDelete
This property specifies whether the action 'Delete' is available for the folder. More...
boolean | allowExport
This property specifies whether the action 'Export' is available for the folder. More...
boolean | allowForward
This property specifies whether the action 'Forward' is available for the folder. More...
boolean | allowMoveTo
This property specifies whether the action 'Store in' is available for the folder. More...
String | comparator1
The comparator for the first filter of the Folder object. More...
String | comparator2
The comparator for the second filter of the Folder object. More...
String | comparator3
The comparator for the third filter of the Folder object. More...
String | filterExpression
The expression of the filter of the folder. More...
String | filterfieldname1
The field to use for the first filter of the Folder object. More...
String | filterfieldname2
The field to use for the second filter of the Folder object. More...
String | filterfieldname3
The field to use for the third filter of the Folder object. More...
String | filterStyle
The filter style of the folder. More...
String | icon
The icon to use in the folder tree. More...
String | id
The internal id of the Folder object. More...
boolean | invisible
This property specifies whether the folder is invisible to the users. More...
String | label
The entire label defined for the Folder object. More...
String | name
The technical name of the Folder object. More...
boolean | released
This property specifies whether the folder is available to the users. More...
String | sortColumn
The column used to sort the entries in the folder. More...
boolean | sortDescending
This property specifies the sort order of the entries in the folder. More...
String | sortFieldName
The technical name of the custom field used to sort the entries in the folder. More...
SystemUser systemUser
Returns the owner of a private folder. More...
String | type
The type of the Folder object. More...
String | value1
The desired field value to use for the first filter of the Folder object. More...
String | value2
The desired field value to use for the second filter of the Folder object. More...
String | value3
The desired field value to use for the third filter of the Folder object. More...

Detailed Description

The Folder class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS folders by scripting means.

Since
ELC 3.50l01 / otrisPORTAL 5.0l01

Member Function Documentation

◆ addAccessProfile()

boolean Folder::addAccessProfile | ( | String | accessProfileName,
 |  | boolean | allowInsertFiles,
 |  | boolean | allowRemoveFiles
 | ) |  |

Add a folder access right for the user group defined by an access profile to the folder.

Parameters
accessProfileName | The technical name of the access profile.
allowInsertFiles | Flag indicating whether inserting files into the folder is allowed.
allowRemoveFiles | Flag indicating whether removing files from the folder is allowed.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "public");
var success = folder.addAccessProfile("AccessProfile1", true, false);
if (!success)
util.out(folder.getLastError());

◆ addFile()

boolean Folder::addFile ( DocFile docFile )

Store a reference to a desired DocFile object in the current Folder.

Note
This only works in case the Folder is a real public Folder. The Folder must not represent a dynamic folder, since a dynamic folder is sort of a hardcoded search, not a "real" folder.
Parameters
docFile DocFile object which shall be available in the given Folder
Returns
true if successful, false in case of any error
Since
ELC 3.51h / otrisPORTAL 5.1h

◆ addFilterEDAServer()

boolean Folder::addFilterEDAServer ( String serverName )

Add an EDA server to the filter of the folder.

Note
This function is only available for a Folder of type 'dynamicpublic'.
Parameters
serverName The technical name of the desired EDA server.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "dynamicpublic");
var success = folder.addFilterEDAServer("eas1");
if (!success)
util.out(folder.getLastError());

◆ addFilterEEiArchive()

boolean Folder::addFilterEEiArchive ( String archiveKey )

Add an EE.i archive to the filter of the folder.

Note
This function is only available for a Folder of type 'dynamicpublic'.
Parameters
archiveKey The key of the desired EE.i archive.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "dynamicpublic");
var archiveKey = "$(#STANDARD)\\REGTEST@eei1";
var success = folder.addFilterEEiArchive(archiveKey);
if (!success)
util.out(folder.getLastError());

◆ addFilterEExView()

boolean Folder::addFilterEExView ( String viewKey )

Add an EE.x view to the filter of the folder.

Note
This function is only available for a Folder of type 'dynamicpublic'.
Parameters
viewKey The key of the desired EE.x view.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "dynamicpublic");
var viewKey = "Unit=Default/Instance=Default/View=REGTEST";
var success = folder.addFilterEExView(viewKey);
if (!success)
util.out(folder.getLastError());

◆ addFilterFileType()

boolean Folder::addFilterFileType ( String fileType )

Add a file type to the filter of the folder.

Note
This function is only available for a Folder of type 'dynamicpublic'.
Parameters
fileType The technical name of the desired file type.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "dynamicpublic");
var success = folder.addFilterFileType("Filetype1");
if (!success)
util.out(folder.getLastError());

◆ addSystemUser()

boolean Folder::addSystemUser | ( | String | loginName,
 |  | boolean | allowInsertFiles,
 |  | boolean | allowRemoveFiles
 | ) |  |

Add a folder access right for a system user to the folder.

Parameters
loginName | The login name of the system user.
allowInsertFiles | Flag indicating whether inserting files into the folder is allowed.
allowRemoveFiles | Flag indicating whether removing files from the folder is allowed.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "public");
var success = folder.addSystemUser("user1", true, false);
if (!success)
util.out(folder.getLastError());

◆ addToOutbar()

boolean Folder::addToOutbar ( String outbarName )

Add the folder to an outbar.

Parameters
outbarName The technical name of the outbar.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0d HF2
Example:
var folder = context.createFolder("testFolder", "public");
var success = folder.addToOutbar("testOutbar");
if (!success)
util.out(folder.getLastError());

◆ copyFolder()

Folder Folder::copyFolder | ( | boolean | includeSubFolders,
 |  | boolean | copyRights,
 |  | boolean | copyActions
 | ) |  |

The current Folder object is duplicated to create a new Folder object.

The new Folder object is placed at the same hierarchical stage as the Folder used as its source object. After the duplication of the Folder you can change all its public attributes, e.g. to modify the filter definition of a dynamic public folder.

Parameters
includeSubFolders | boolean whether to duplicate any subfolders contained in the source folder as well
copyRights | boolean whether to assign the same access privileges as those assigned to the source Folder
copyActions | boolean whether to duplicate any userdefined actions attached to the source folder as well
Returns
Folder object generated by the function call
Since
ELC 3.50l01 / otrisPORTAL 5.0l01

◆ createSubFolder()

Folder Folder::createSubFolder | ( | String | name,
 |  | String | type
 | ) |  |

Create a new subfolder of the specified folder type.

Note
There are three possible types available:
  • public
  • dynamicpublic
  • onlysubfolder
Parameters
name | The technical name of the subfolder to be created.
type | The desired type of the subfolder.
Returns
New created subfolder as Folder object or null if failed.
Since
DOCUMENTS 4.0c
Example:
var parentFolder = context.createFolder("parentFolder", "public");
if (parentFolder)
{
var subFolder = parentFolder.createSubFolder("subFolder", "dynamicpublic");
if (subFolder)
util.out(subFolder.type);
else
util.out(parentFolder.getLastError());
}
See also
Context.createFolder(String name, String type);

◆ deleteFolder()

boolean Folder::deleteFolder ( )

Delete the folder in DOCUMENTS.

Note
All subfolders are also deleted recursively.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "onlysubfolder");
if (folder)
{
var success = folder.deleteFolder();
if (success)
{
var itFolder = context.getFoldersByName("testFolder", "onlysubfolder");
util.out(itFolder.size() == 0);
}
}
See also
Context.deleteFolder(Folder folderObj)

◆ getActionByName()

UserAction Folder::getActionByName ( String actionName )

Retrieve a user-defined action of the Folder.

Parameters
actionName String value containing the desired action name.
Returns
UserAction object representing the user-defined action.
Since
DOCUMENTS 4.0d
Example:
var it = context.getFoldersByName("testFolder");
var folder = it.first();
if (folder)
{
var action = folder.getActionByName("testAction");
if (action)
{
action.type = "PortalScript";
action.setPortalScript("testScript");
}
else
util.out(folder.getLastError());
}

◆ getAttribute()

String Folder::getAttribute ( String attribute )

Get the String value of an attribute of the Folder.

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Since
ELC 3.51b / otrisPORTAL 5.1b

◆ getFiles()

FileResultset Folder::getFiles ( )

Retrieve a FileResultset of all the DocFile objects stored in the Folder.

Note
It does not matter whether the Folder is a real public folder or a dynamic folder.
Returns
FileResultset containing a list of all DocFile objects stored in the Folder
Since
ELC 3.51b / otrisPORTAL 5.1b

◆ getFilterFileTypes()

Array Folder::getFilterFileTypes ( )

Retrieve the filter file types of the folder.

Returns
Array of strings containing the technical names of the file types.
Since
DOCUMENTS 5.0a HF2
Example:
var folder = context.createFolder("testFolder", "dynamicpublic");
var success = folder.addFilterFileType("Filetype1");
if (!success)
util.out(folder.getLastError());
var fileTypes = folder.getFilterFileTypes();
if (fileTypes)
{
for (var i=0; i < fileTypes.length; i++)
{
util.out(fileTypes[i]);
}
}
else
util.out(folder.getLastError());

◆ getHitResultset()

HitResultset Folder::getHitResultset ( )

Create a HitResultset, which summarizes all DocFiles in the folder.

This function executes an empty (=unfiltered) search in the folder. It creates a HitResultset, which summarizes all the Folder's files. The Resultset contains the same columns as the folder's default web view.

Note
The function operates on dynamic and on static folders, but not on the special folders "tasks" and "resubmission".
Remarks
Reading from a lean HitResultset with only a few columns can be faster than reading from a FileResultset. Sometimes this effect outweighs the time-related costs of a search. If the folder addresses an archive, the time needed to create temporary DocFiles can be saved with this function. On a failed search request the function does not throw errors. To detect this kind of errors scripts should call HitResultset.getLastErrorCode() or HitResultset.getLastError() on the returned object.
Returns
A HitResultset, which contains column headers and a list of DocHit objects.
See also
getFiles()
Since
DOCUMENTS 5.0c

◆ getLastError()

String Folder::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.50l01 / otrisPORTAL 5.0l01
See also
DocFile.getLastError()

◆ getLocaleLabel()

String Folder::getLocaleLabel ( String locale )

Get the ergonomic label of the Folder.

Parameters
locale Optional 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 label of the Folder in the appropriate portal language.
Since
DOCUMENTS 4.0b HF2

◆ getOID()

String Folder::getOID ( boolean oidLow = false )

Returns the object-id.

Parameters
oidLow Optional flag:
If true only the id of the Folder object (m_oid) will be returned.
If false the id of the Folder 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
Since
ELC 3.60c / otrisPORTAL 6.0c
DOCUMENTS 5.0 (new parameter oidLow)

◆ getPosition()

int Folder::getPosition ( Folder subFolder )

Retrieve the position of a subfolder within the subfolder list.

Parameters
subFolder Folder object whose position to be retrieved.
Returns
The zero-based position of the subfolder as integer or -1 in case of any error.
Since
DOCUMENTS 4.0c
Example:
var parentFolder = context.createFolder("parentFolder", "public");
if (parentFolder)
{
var subFolder1 = parentFolder.createSubFolder("subFolder1", "dynamicpublic");
var subFolder2 = parentFolder.createSubFolder("subFolder2", "onlysubfolder");
if (subFolder1 && subFolder2)
{
var pos = parentFolder.getPosition(subFolder2);
util.out(pos == 1);
}
}
See also
Folder.setPosition(Folder subFolder, int position) Context.getFolderPosition(Folder folder)
Context.setFolderPosition(Folder folder, int position)

◆ getSubFolders()

FolderIterator Folder::getSubFolders ( )

Retrieve a FolderIterator containing all Folder objects which represent subfolders of the given Folder.

Returns
FolderIterator with all subfolders one hierarchical level below the given Folder
Since
ELC 3.50l01 / otrisPORTAL 5.0l01

◆ hasFiles()

boolean Folder::hasFiles ( )

Retrieve information whether the Folder is empty or not.

Returns
true if DocFile objects available inside the Folder, false in case the Folder is empty
Since
ELC 3.50l01 / otrisPORTAL 5.0l01

◆ removeAccessProfile()

boolean Folder::removeAccessProfile ( String accessProfileName )

Remove all folder access rights of the user group defined by an access profile from the folder.

Parameters
accessProfileName The technical name of the access profile.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "public");
var success = folder.addAccessProfile("AccessProfile1", true, false);
if (success)
{
success = folder.removeAccessProfile("AccessProfile1");
if (!success)
util.out(folder.getLastError());
}

◆ removeFile()

boolean Folder::removeFile ( DocFile docFile )

Remove the reference to a desired DocFile object out of the current Folder.

Note
This only works in case the Folder is a real public Folder. The Folder must not represent a dynamic folder, since a dynamic folder is sort of a hardcoded search, not a "real" folder.
Parameters
docFile DocFile object which shall be removed from the given Folder
Returns
true if successful, false in case of any error
Since
ELC 3.51h / otrisPORTAL 5.1h

◆ removeFilterEDAServer()

boolean Folder::removeFilterEDAServer ( String serverName )

Remove an EDA server from the filter of the folder.

Note
This function is only available for a Folder of type 'dynamicpublic'.
Parameters
serverName The technical name of the desired EDA server.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "dynamicpublic");
var success = folder.addFilterEDAServer("eas1");
if (success)
{
success = folder.removeFilterEDAServer("eas1");
if (!success)
util.out(folder.getLastError());
}

◆ removeFilterEEiArchive()

boolean Folder::removeFilterEEiArchive ( String archiveKey )

Remove an EE.i archive from the filter of the folder.

Note
This function is only available for a Folder of type 'dynamicpublic'.
Parameters
archiveKey The key of the desired EE.i archive.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "dynamicpublic");
var archiveKey = "$(#STANDARD)\\REGTEST@eei1";
var success = folder.addFilterEEiArchive(archiveKey);
if (success)
{
success = folder.removeFilterEEiArchive(archiveKey);
if (!success)
util.out(folder.getLastError());
}

◆ removeFilterEExView()

boolean Folder::removeFilterEExView ( String viewKey )

Remove an EE.x view from the filter of the folder.

Note
This function is only available for a Folder of type 'dynamicpublic'.
Parameters
viewKey The key of the desired EE.x view.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "dynamicpublic");
var viewKey = "Unit=Default/Instance=Default/View=REGTEST";
var success = folder.addFilterEExView(viewKey);
if (success)
{
success = folder.removeFilterEExView(viewKey);
if (!success)
util.out(folder.getLastError());
}

◆ removeFilterFileType()

boolean Folder::removeFilterFileType ( String fileType )

Remove a file type from the filter of the folder.

Note
This function is only available for a Folder of type 'dynamicpublic'.
Parameters
fileType The technical name of the desired file type.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "dynamicpublic");
var success = folder.addFilterFileType("Filetype1");
if (success)
{
success = folder.removeFilterFileType("Filetype1");
if (!success)
util.out(folder.getLastError());
}

◆ removeFromOutbar()

boolean Folder::removeFromOutbar ( String outbarName )

Remove the folder from an outbar.

Parameters
outbarName The technical name of the outbar.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0d HF2
Example:
var itFolder = context.getFoldersByName("testFolder", "public");
var folder = itFolder.first();
if (folder)
{
var success = folder.removeFromOutbar("testOutbar");
if (!success)
util.out(folder.getLastError());
}

◆ removeSystemUser()

boolean Folder::removeSystemUser ( String loginName )

Remove all folder access rights of a system user from the folder.

Parameters
loginName The login name of the system user.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "public");
var success = folder.addSystemUser("user1", true, false);
if (success)
{
success = folder.removeSystemUser("user1");
if (!success)
util.out(folder.getLastError());
}

◆ setAllowedActionScript()

boolean Folder::setAllowedActionScript ( String scriptName )

Set the script containing the allowed user-defined actions.

Parameters
scriptName The name of the desired script; use empty string ('') if you want to remove the associated action script.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var folder = context.createFolder("testFolder", "public");
var success = folder.setAllowedActionScript("testScript");
if (!success)
util.out(folder.getLastError());
// We can remove the action script as follows:
success = folder.setAllowedActionScript('');

◆ setAttribute()

boolean Folder::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the Folder to the desired value.

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b

◆ setParentFolder()

boolean Folder::setParentFolder ( Folder parentFolder )

Set the parent folder of the current folder.

Parameters
parentFolder optional Folder object being the parent folder of the current folder. If no parent folder is defined, the current folder will be moved to the top level.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
Example:
var parentFolder = context.createFolder("parentFolder", "public");
if (parentFolder)
{
var subFolder = context.createFolder("subFolder", "dynamicpublic");
if (subFolder)
{
var success = subFolder.setParentFolder(parentFolder);
if (!success)
util.out(subFolder.getLastError());
// We can move subFolder to the top level as follows:
success = subFolder.setParentFolder();
}
}

◆ setPosition()

boolean Folder::setPosition | ( | Folder | subFolder,
 |  | int | position
 | ) |  |

Place a subfolder at the given position in the subfolder list.

Note
0 at the beginning and -1 at the end.
Parameters
subFolder | Folder object to be placed at the given position.
position | The 0-based position for the subfolder.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0c
Example:
var parentFolder = context.createFolder("parentFolder", "public");
if (parentFolder)
{
var subFolder1 = parentFolder.createSubFolder("subFolder1", "dynamicpublic");
var subFolder2 = parentFolder.createSubFolder("subFolder2", "onlysubfolder");
if (subFolder1 && subFolder2)
{
var pos = parentFolder.getPosition(subFolder2);
util.out(pos == 1);
parentFolder.setPosition(subFolder1, -1);
pos = parentFolder.getPosition(subFolder2);
util.out(pos == 0);
}
}
See also
Folder.getPosition(Folder subFolder) Context.getFolderPosition(Folder folder)
Context.setFolderPosition(Folder folder, int position)

Member Data Documentation

◆ allowArchive

boolean Folder::allowArchive

This property specifies whether the action 'Archive' is available for the folder.

Returns
boolean value whether the action 'Archive' is allowed.
Since
DOCUMENTS 4.0c

◆ allowCopyTo

boolean Folder::allowCopyTo

This property specifies whether the action 'Copy to' is available for the folder.

Returns
boolean value whether the action 'Copy to' is allowed.
Since
DOCUMENTS 4.0c

◆ allowCreatePDF

boolean Folder::allowCreatePDF

This property specifies whether the action 'PDF creation (Print)' is available for the folder.

Returns
boolean value whether the action 'PDF creation (Print)' is allowed.
Since
DOCUMENTS 4.0c

◆ allowDelete

boolean Folder::allowDelete

This property specifies whether the action 'Delete' is available for the folder.

Returns
boolean value whether the action 'Delete' is allowed.
Since
DOCUMENTS 4.0c

◆ allowExport

boolean Folder::allowExport

This property specifies whether the action 'Export' is available for the folder.

Returns
boolean value whether the action 'Export' is allowed.
Since
DOCUMENTS 4.0c

◆ allowForward

boolean Folder::allowForward

This property specifies whether the action 'Forward' is available for the folder.

Returns
boolean value whether the action 'Forward' is allowed.
Since
DOCUMENTS 4.0c

◆ allowMoveTo

boolean Folder::allowMoveTo

This property specifies whether the action 'Store in' is available for the folder.

Returns
boolean value whether the action 'Store in' is allowed.
Since
DOCUMENTS 4.0c

◆ comparator1

String Folder::comparator1

The comparator for the first filter of the Folder object.

Note
This attribute only exists if the Folder represents a dynamic folder
Returns
String containing the first comparator of the Folder. There are the following comparators available:
  • = equal
  • != unequal
  • < smaller than
  • > greater than
  • ~ contains
  • |~ starts with

◆ comparator2

String Folder::comparator2

The comparator for the second filter of the Folder object.

Note
This attribute only exists if the Folder represents a dynamic folder
Returns
String containing the second comparator of the Folder. There are the following comparators available:
  • = equal
  • != unequal
  • < smaller than
  • > greater than
  • ~ contains
  • |~ starts with

◆ comparator3

String Folder::comparator3

The comparator for the third filter of the Folder object.

Note
This attribute only exists if the Folder represents a dynamic folder
Returns
String containing the third comparator of the Folder. There are the following comparators available:
  • = equal
  • != unequal
  • < smaller than
  • > greater than
  • ~ contains
  • |~ starts with

◆ filterExpression

String Folder::filterExpression

The expression of the filter of the folder.

Note
This property is only available if the Folder represents a dynamic folder and the filter style 'Extended' is used.
Returns
String containing the filter expression.
Since
DOCUMENTS 4.0c
See also
Filter Expressions

◆ filterfieldname1

String Folder::filterfieldname1

The field to use for the first filter of the Folder object.

Note
This attribute only exists if the Folder represents a dynamic folder
Returns
String containing the technical field name of the Folder's first filter.

◆ filterfieldname2

String Folder::filterfieldname2

The field to use for the second filter of the Folder object.

Note
This attribute only exists if the Folder represents a dynamic folder
Returns
String containing the technical field name of the Folder's second filter.

◆ filterfieldname3

String Folder::filterfieldname3

The field to use for the third filter of the Folder object.

Note
This attribute only exists if the Folder represents a dynamic folder
Returns
String containing the technical field name of the Folder's third filter.

◆ filterStyle

String Folder::filterStyle

The filter style of the folder.

There are two filter styles available:

  • Standard
  • Extended
Returns
String containing the filter style of the folder.
Since
DOCUMENTS 4.0c

◆ icon

String Folder::icon

The icon to use in the folder tree.

Returns
String containing the file name of the icon used in the folder tree.
Since
DOCUMENTS 4.0c

◆ id

String Folder::id

The internal id of the Folder object.

Returns
String containing the internal id of the Folder.
Since
ELC 3.50l01 / otrisPORTAL 5.0l01

◆ invisible

boolean Folder::invisible

This property specifies whether the folder is invisible to the users.

Note
This property is not operative if the folder is not released.
Returns
boolean value whether the folder is invisible to the users.
Since
DOCUMENTS 4.0c

◆ label

String Folder::label

The entire label defined for the Folder object.

Returns
String containing the entire label of the Folder.
Since
ELC 3.50l01 / otrisPORTAL 5.0l01
See also
Folder.getLocaleLabel(String locale)

◆ name

String Folder::name

The technical name of the Folder object.

Returns
String containing the technical name of the Folder.
Since
ELC 3.50l01 / otrisPORTAL 5.0l01

◆ released

boolean Folder::released

This property specifies whether the folder is available to the users.

Returns
boolean value whether the folder is released.
Since
DOCUMENTS 4.0c

◆ sortColumn

String Folder::sortColumn

The column used to sort the entries in the folder.

The following sort columns are available:

  • Title
  • LastModifiedAt
  • LastEditor
  • CreateAt
  • Owner
  • CustomField
Returns
String containing the identifier of the selected sort column.
Since
DOCUMENTS 4.0c

◆ sortDescending

boolean Folder::sortDescending

This property specifies the sort order of the entries in the folder.

Returns
boolean value whether the entries in the folder are sorted by the Folder.sortColumn in descending order.
Since
DOCUMENTS 4.0c

◆ sortFieldName

String Folder::sortFieldName

The technical name of the custom field used to sort the entries in the folder.

Note
This field is only available if the Folder.sortColumn is set to 'CustomField'.
Returns
String containing the technical name of the field used to sort the entries in the folder.
Since
DOCUMENTS 4.0c

◆ systemUser

SystemUser Folder::systemUser

Returns the owner of a private folder.

Note
If the folder is a private folder (e.g. inbox) this property returns the owning SystemUser
Returns
SystemUser or null.
Since
DOCUMENTS 5.0d

◆ type

String Folder::type

The type of the Folder object.

Returns
String containing the type of the Folder. There are three possible types available:
  • public
  • dynamicpublic
  • onlysubfolder
Since
ELC 3.50l01 / otrisPORTAL 5.0l01

◆ value1

String Folder::value1

The desired field value to use for the first filter of the Folder object.

Note
This attribute only exists if the Folder represents a dynamic folder
Returns
String containing the desired field value of the Folder's first filter.

◆ value2

String Folder::value2

The desired field value to use for the second filter of the Folder object.

Note
This attribute only exists if the Folder represents a dynamic folder
Returns
String containing the desired field value of the Folder's second filter.

◆ value3

String Folder::value3

The desired field value to use for the third filter of the Folder object.

Note
This attribute only exists if the Folder represents a dynamic folder
Returns
String containing the desired field value of the Folder's third filter.


DOCUMENTS 5 - PortalScripting API: Member List

Folder Member List

This is the complete list of members for Folder, including all inherited members.

addAccessProfile(String accessProfileName, boolean allowInsertFiles, boolean allowRemoveFiles) | Folder
addFile(DocFile docFile) | Folder
addFilterEDAServer(String serverName) | Folder
addFilterEEiArchive(String archiveKey) | Folder
addFilterEExView(String viewKey) | Folder
addFilterFileType(String fileType) | Folder
addSystemUser(String loginName, boolean allowInsertFiles, boolean allowRemoveFiles) | Folder
addToOutbar(String outbarName) | Folder
allowArchive | Folder
allowCopyTo | Folder
allowCreatePDF | Folder
allowDelete | Folder
allowExport | Folder
allowForward | Folder
allowMoveTo | Folder
comparator1 | Folder
comparator2 | Folder
comparator3 | Folder
copyFolder(boolean includeSubFolders, boolean copyRights, boolean copyActions) | Folder
createSubFolder(String name, String type) | Folder
deleteFolder() | Folder
filterExpression | Folder
filterfieldname1 | Folder
filterfieldname2 | Folder
filterfieldname3 | Folder
filterStyle | Folder
getActionByName(String actionName) | Folder
getAttribute(String attribute) | Folder
getFiles() | Folder
getFilterFileTypes() | Folder
getHitResultset() | Folder
getLastError() | Folder
getLocaleLabel(String locale) | Folder
getOID(boolean oidLow=false) | Folder
getPosition(Folder subFolder) | Folder
getSubFolders() | Folder
hasFiles() | Folder
icon | Folder
id | Folder
invisible | Folder
label | Folder
name | Folder
released | Folder
removeAccessProfile(String accessProfileName) | Folder
removeFile(DocFile docFile) | Folder
removeFilterEDAServer(String serverName) | Folder
removeFilterEEiArchive(String archiveKey) | Folder
removeFilterEExView(String viewKey) | Folder
removeFilterFileType(String fileType) | Folder
removeFromOutbar(String outbarName) | Folder
removeSystemUser(String loginName) | Folder
setAllowedActionScript(String scriptName) | Folder
setAttribute(String attribute, String value) | Folder
setParentFolder(Folder parentFolder) | Folder
setPosition(Folder subFolder, int position) | Folder
sortColumn | Folder
sortDescending | Folder
sortFieldName | Folder
systemUser | Folder
type | Folder
value1 | Folder
value2 | Folder
value3 | Folder


DOCUMENTS 5 - PortalScripting API: FolderIterator Class Reference

Public Member Functions | List of all members
FolderIterator Class Reference

The FolderIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS folders by scripting means. More...

Public Member Functions

Folder first ()
Retrieve the first Folder object in the FolderIterator. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
Folder next ()
Retrieve the next Folder object in the FolderIterator. More...
int | size ()
Get the amount of Folder objects in the FolderIterator. More...

Detailed Description

The FolderIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS folders by scripting means.

Since
ELC 3.50l01 / otrisPORTAL 5.0l01
Example:
if (context.getFoldersByName(lstName, "public").size() == 0)
{
var folderIter = context.getFoldersByName("TemplateFolder", "public");
if (folderIter && folderIter.size() > 0)
{
var source = folderIter.first(); // fetch list folder
var target = source.copyFolder(true, true, true);
target.Name = lstName;
target.Label = docFile.crmName;
target.Type = "public";
}
}

Member Function Documentation

◆ first()

Folder FolderIterator::first ( )

Retrieve the first Folder object in the FolderIterator.

Returns
Folder or null in case of an empty FolderIterator
Since
ELC 3.50l01 / otrisPORTAL 5.0l01

◆ getLastError()

String FolderIterator::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.50l01 / otrisPORTAL 5.0l01
See also
DocFile.getLastError()

◆ next()

Folder FolderIterator::next ( )

Retrieve the next Folder object in the FolderIterator.

Returns
Folder or null if end of FolderIterator is reached.
Since
ELC 3.50l01 / otrisPORTAL 5.0l01

◆ size()

int FolderIterator::size ( )

Get the amount of Folder objects in the FolderIterator.

Returns
integer value with the amount of Folder objects in the FolderIterator
Since
ELC 3.50l01 / otrisPORTAL 5.0l01


DOCUMENTS 5 - PortalScripting API: Member List

FolderIterator Member List

This is the complete list of members for FolderIterator, including all inherited members.

first() | FolderIterator
getLastError() | FolderIterator
next() | FolderIterator
size() | FolderIterator


DOCUMENTS 5 - PortalScripting API: HitResultset Class Reference

Public Member Functions | List of all members
HitResultset Class Reference

The HitResultset class allows comprehensive search operations in Documents and in connected archives. More...

Public Member Functions

dispose ()
Free most of the memory of the HitResultset. More...
number | fetchedSize ()
Get the number of already loaded hits in the set. More...
boolean | fetchNextPage ()
Load the next page of hits into the Resultset. More...
DocHit first ()
Retrieve the first DocHit in the HitResultset. More...
DocHit | getAt (number pos)
Retrieve the DocHit object at a given position in the HitResultset. More...
number | getColumnCount ()
Get the number of available columns in the set of hits. More...
number | getColumnIndex (String colName)
Find the index of a column with a defined name. More...
Array | getColumnNames (boolean local=False)
List the names of all columns in the set of hits. More...
string [] | getHitIds (boolean withServer=true)
Returns an array with all Hit-Ids (file ids or archive file keys) of the HitResultset. More...
String | getLastError ()
Function to get the description of the last error (or warning) that occurred. More...
number | getLastErrorCode ()
Function to get a numeric code of the last error, that occurred. More...
HitResultset | HitResultset (Var searchResources, String filter, String sortOrder, Var hitlist, number pageSize=0, boolean unlimitedHits=false, boolean fullColumnLength=false, boolean withBlobInfo=false)
Perform a search and create a new HitResultset object. More...
DocHit next ()
Retrieve the next DocHit in the HitResultset. More...
number | size ()
Get the total amount of hits in the set. More...

Detailed Description

The HitResultset class allows comprehensive search operations in Documents and in connected archives.

While the constructor of this class launches a search operation, the created object stores the results and exposes them as a list of DocHit objects. Compared with the classes FileResultset and ArchiveFileResultset this class has got the following characteristics.

  • Several filetypes and archives can be searched at one time.
  • Extracting archive hits from a HitResultset does not make DOCUMENTS create a temporary DocFile for each hit. This can save a lot of time.
  • Objects of this class may allocate large amounts of memory, because they sustain a complete hit list instead of a lean id-list. To save memory, scripts should prefer hit lists with as few columns as possible.
  • Search-related errors and warnings do not trigger exceptions. Instead, they are stored inside the object. You can access them with getLastErrorCode() and getLastError() respectively. Advantage: The caller gets the freedom to process the results also after a warning. In this case the hit list maybe incomplete or unsorted.
Since
DOCUMENTS 4.0b
Example:
var searchResources = "Filetype1 \n Filetype2";
var filter = "";
var sortOrder = "";
var myFile;
var myHRS = new HitResultset(searchResources, filter, sortOrder);
if (myHRS.getLastErrorCode() < 0)
{
util.out(myHRS.getLastError());
}
else
{
for (var myHit = myHRS.first(); myHit; myHit = myHRS.next())
{
myFile = myHit.getFile();
if (myFile)
util.out(myFile.getAutoText("id"));
else
util.out(myHit.getLastError());
}
}
Example:
var searchResources = ["$(#STANDARD)\\REGTEST@myeei", "Filetype1@myeas", "Filetype1"];
var filter = "";
var sortOrder = "";
var hitlist = "MYHITLIST";
var pageSize = 3;
var pos = 6;
var unlimitedHits = true;
var fullColumnLength = true;
var myHRS = new HitResultset(searchResources, filter, sortOrder, hitlist, pageSize, unlimitedHits, fullColumnLength);
if (myHRS.getLastErrorCode() < 0)
throw new Error(myHRS.getLastError());
if (myHRS.size() > pos)
{
while (pos >= myHRS.fetchedSize())
myHRS.fetchNextPage();
var myHit = myHRS.getAt(pos);
if (myHit)
{
if (myHit.isArchiveHit())
util.out(myHit.getArchiveKey());
else
util.out(myHit.getFileId());
}
}
Example:
var searchResources = "Unit=Default/Instance=Default/View=REGTEST@myeex";
var filter = "";
var sortOrder = "myField+";
var hitlist = "myHitlist";
var pageSize = 10;
var myFile;
var myHRS = new HitResultset(searchResources, filter, sortOrder, hitlist, pageSize);
if (myHRS.getLastErrorCode() < 0)
throw new Error(myHRS.getLastError());
// Iterate only the hit entries on the first page.
for (var myHit = myHRS.first(); myHit; myHit = myHRS.next())
{
myFile = myHit.getArchiveFile();
if (myFile)
util.out(myFile.getAttribute("Key"));
else
util.out(myHit.getLastError());
}

Constructor & Destructor Documentation

◆ HitResultset()

HitResultset HitResultset::HitResultset | ( | Var | searchResources,
 |  | String | filter,
 |  | String | sortOrder,
 |  | Var | hitlist,
 |  | number | pageSize = 0,
 |  | boolean | unlimitedHits = false,
 |  | boolean | fullColumnLength = false,
 |  | boolean | withBlobInfo = false
 | ) |  |

Perform a search and create a new HitResultset object.

Parameters
searchResources | The list of resources to search through. The resource identifiers may be passed either as an array of strings or as an ordinary string with one identifier per line of text. Please read the remarks section about restrictions.
filter | A filter expression. Pass an empty string, if no filter ist required.
sortOrder | A sort expression. Pass an empty string, if no sorting is required.
hitlist The technical name of a hitlist or an array of field names, which specifies the available columns in the resultset. If the parameter is left empty, Documents tries to choose a hitlist automatically. Details follow in the remarks section.
Note: If this parameter is an array of field names, a search in EE.i or EE.x is not allowed and the field names must not contain commas (,).
pageSize | This is a memory-saving and performance-tuning option. If the parameter is zero, Documents will load all available hits at once. If the parameter is a positive value, Documents will initially load only the requested number of hits as a first page. In order to access each further page, a call to fetchNextPage() is necessary. A negative pageSize value will be replaced by the current user's "hits per page" preference setting.
unlimitedHits | A boolean that indicates, if the general hit limitations on filetypes and archives must be ignored. A wasteful use of this option may cause issues with the system performance or situations with low free memory.
fullColumnLength | A boolean that indicates, if the general hit column length limitations must be ignored. The default column length is 50 characters (if not a different value is defined by the property Documents-Settings: MaxHitfieldLength). If a field value exceeds this size, the first 50 characters will be displayed followed by '...'. If the parameter fullColumnLength is set to true, no truncation will be done.
withBlobInfo | A boolean that indicates, if the HitResultset should contain blob-information that can be fetched with DocHit.getBlobInfo()
Remarks
On a failed search request the constructor does not throw errors. To detect this kind of errors scripts should test the object's error state with getLastErrorCode() or getLastError().

Resource identifiers:

A "resource identifier" can be one of the following: [ examples in brackets ]

  • a filetype name [ ftOrder ]
  • a filetype name for use with an EDA store [ ftOrder@peachitStore1 ]
  • a filetype name for use with all EDA stores [ ftOrder@ALLEAS ]
  • a EE.x view key [ Unit=Default/Instance=Default/View=Orders@MyEEX ]
  • a EE.i archive key [ $(#STANDARD)\ORDERS@STDARC_360 ]

Archive resource identifiers should always get a "@Servername" appendix, though Documents recognizes EE.x and EE.i resources of the primary archive server without that appendix.

Resource ordering and hitlist specification

The resource, which owns a specified hitlist, has to be passed in the first position of the list. Search requests in EE.i/EE.x-archives do not work with a filetype's hitlist. These archives require a hitlist of their own. For this reason, a list of resources of different types must be ordered in the following way: EE.x before EE.i before anything else. Requests, which involve more than one Easy Enterprise server can work only, if a hitlist of the given name exists in each resource of these servers.

Automatic hitlist selection

If the parameter "hitlist" is an empty string, Documents scans the search resources for a named hitlist. If no named hitlist exists, Documents initializes an old-fashioned anonymous hitlist, which is based on the "Display in hit list" option of fields in the Documents Manager and on corresponding options for particular DocFile attributes (title, created, owner, last modified, last editor). An anonymous hitlist does actually not work with EE.x. It partially works with EE.i. In this case, Documents externally uses the setting "CommonDefaultHitlist" of the configuration file "ArchiveXML.ini" and transfers matching columns into the internal hitlist. As long as named hitlists become imported with the archive structure, it does not matter.

Search requests, which involve more than one Easy Enterprise server cannot rely on the automatic selection feature. Scripts should always pass an appropriate hitlist name for these requests.

See also
Using filter expressions with FileResultSets , Filter examples
Since
DOCUMENTS 4.0b
DOCUMENTS 4.0d HF1 new parameter fullColumnLength
DOCUMENTS 5.0 (New option for hitlist parameter: an array of field names instead of a hitlist name)

Member Function Documentation

◆ dispose()

HitResultset::dispose ( )

Free most of the memory of the HitResultset.

This function explicitly frees the memory used by the object. The Resultset itself becomes empty. All extracted DocHit objects become invalid and must no longer be used. Long-running scripts should use this function instead of waiting for the garbage collector to clean up.

Returns
The function does not return a value.
Since
DOCUMENTS 4.0b

◆ fetchedSize()

number HitResultset::fetchedSize ( )

Get the number of already loaded hits in the set.

Returns
integer value with the number of hits, which can actually be read from the resultset.
Remarks
If the object has been created with a non-zero page size, this value is often smaller than the total amount of hits.
Since
DOCUMENTS 4.0b
See also
size(), fetchNextPage()

◆ fetchNextPage()

boolean HitResultset::fetchNextPage ( )

Load the next page of hits into the Resultset.

If the object has been created with a non-zero page size, each call of this function appends another page of hits to the resultset until all hits are loaded.

Returns
The value indicates, if any more hits have been loaded.
Since
DOCUMENTS 4.0b

◆ first()

DocHit HitResultset::first ( )

Retrieve the first DocHit in the HitResultset.

Returns
DocHit object, null in case of an empty HitResultset
See also
next()
Since
DOCUMENTS 4.0b

◆ getAt()

DocHit HitResultset::getAt ( number pos )

Retrieve the DocHit object at a given position in the HitResultset.

Parameters
pos Integer position of the hit, beginning with 0
Returns
DocHit object or null if the position is out of bounds.
Remarks
Valid positions range from 0 to fetchedSize()-1.
Since
DOCUMENTS 4.0b

◆ getColumnCount()

number HitResultset::getColumnCount ( )

Get the number of available columns in the set of hits.

Returns
The number of columns as an Integer.
Since
DOCUMENTS 4.0b

◆ getColumnIndex()

number HitResultset::getColumnIndex ( String colName )

Find the index of a column with a defined name.

Parameters
colName The name of the column.
Returns
The zero-based index of the column or a -1, which indicates an unknown column name.
Remarks
The function tests for a technical column name prior to a localized name.
Since
DOCUMENTS 4.0b

◆ getColumnNames()

Array HitResultset::getColumnNames ( boolean local = False )

List the names of all columns in the set of hits.

Parameters
local A boolean option to read the localized names instead of the technical names.
Returns
Array of strings with the column names.
Remarks
If the resultset is bases on an EE.i hitlist, the function usually returns field numbers instead of technical names, because column descriptions of an EE.i hitlist only consist of the field number and a label. The label would not be a reliable identifier of the column.

Columns, which correspond to a DocFile attribute may be given a special constant name instead of the name in an archive's scheme. "TITLE" on EE.x and "110" on EE.i may be presented as "DlcFile_Title", for example.

Since
DOCUMENTS 4.0b

◆ getHitIds()

string [] HitResultset::getHitIds ( boolean withServer = true )

Returns an array with all Hit-Ids (file ids or archive file keys) of the HitResultset.

Parameters
withServer optional boolean value to indicate, if the archive file keys should include an "@archiveServerName" appendix.
Returns
Array of String with file ids and archive file keys of the HitResultset.
Since
DOCUMENTS 5.0d
Example:
var searchResources = ["Filetype1@myeas", "Filetype1"];
var myHRS = new HitResultset(searchResources, "", "");
util.out(myHRS.getHitIds());
See also
FileResultset.getIds()

◆ getLastError()

String HitResultset::getLastError ( )

Function to get the description of the last error (or warning) that occurred.

Returns
Text of the last error as String
Since
DOCUMENTS 4.0b
See also
getLastErrorCode()

◆ getLastErrorCode()

number HitResultset::getLastErrorCode ( )

Function to get a numeric code of the last error, that occurred.

Returns
Integer error code.
Remarks
The value 0 means "no error". Positive values indicate warnings or minor errors, while negative values indicate serious errors. After a serious error no hits should be processed. After a minor error, the resultset may be unsorted or truncated, but the contained data is still valid.
Since
DOCUMENTS 4.0b
See also
getLastError()

◆ next()

DocHit HitResultset::next ( )

Retrieve the next DocHit in the HitResultset.

Returns
DocHit object, null if either the end of the resultset or the end of the loaded pages is reached.
Remarks
Calls of getAt() do not affect the internal cursor of next().
See also
first()
Since
DOCUMENTS 4.0b

◆ size()

number HitResultset::size ( )

Get the total amount of hits in the set.

Returns
integer value with the total amount of hits. The value -1 may be returned to indicate, that the search continues in the background, and the final number is not yet known.
Remarks
If the object has been created with a non-zero page size, this value is often greater than the amount of already accessible hits.
Since
DOCUMENTS 4.0b
See also
fetchedSize(), fetchNextPage()


DOCUMENTS 5 - PortalScripting API: Member List

HitResultset Member List

This is the complete list of members for HitResultset, including all inherited members.

dispose() | HitResultset
fetchedSize() | HitResultset
fetchNextPage() | HitResultset
first() | HitResultset
getAt(number pos) | HitResultset
getColumnCount() | HitResultset
getColumnIndex(String colName) | HitResultset
getColumnNames(boolean local=False) | HitResultset
getHitIds(boolean withServer=true) | HitResultset
getLastError() | HitResultset
getLastErrorCode() | HitResultset
HitResultset(Var searchResources, String filter, String sortOrder, Var hitlist, number pageSize=0, boolean unlimitedHits=false, boolean fullColumnLength=false, boolean withBlobInfo=false) | HitResultset
next() | HitResultset
size() | HitResultset


DOCUMENTS 5 - PortalScripting API: PropertyCache Class Reference

Public Member Functions | List of all members
PropertyCache Class Reference

The PropertyCache class is a util class that allows it to store / cache data over the end of the run time of a script. More...

Public Member Functions

boolean | hasProperty (String name)
Function to check if a named property exists in the PropertyCache. More...
string [] | listProperties ()
Function to list all properties in the PropertyCache. More...
boolean | removeProperty (String name)
Function to delete a named property exists in the PropertyCache. More...

Detailed Description

The PropertyCache class is a util class that allows it to store / cache data over the end of the run time of a script.

There is exactly one global implicit object of the class PropertyCache which is named propCache. At the SystemUser and the AccessProfile are also PropertyCache objects (SystemUser.propCache, AccessProfile.propCache).

  • You can define named members (properties) at this object to store the data: propCache.Name1 = one_value; propCache.Name2 = another_value;
  • The stored data can be integer, boolean, string or array values
  • There is no limit (except the memory of the OS) in the amount of properties or in the length of an array
  • Every principal has it's own propCache object
Note
It is not possible to create objects of the class PropertyCache, since the propCache object is always available.
Example:
// If you have an enumeration field at a filetype and the enumeration
// values (enumval) are defined by a PortalScript, then every time a
// file of that filetype will be displayed, the PortalScript has to be
// excecuted. If now in the PortalScript the enum values are the result
// of a query on a filetype or an external DB (DBResultset), then this
// is a very "expensive" resource. It is recommanded to cache this data.
if (!propCache.hasProperty("Contacts"))
{
util.out("Creating cache");
propCache.Contacts = getEmployees();
}
util.out("Using cache");
// copy values to enumval "manually" - concat etc. not possible
// with the global object enumval
copyArray(propCache.Contacts, enumval);
return;
function getEmployees()
{
var myList = new Array();
var sort = "hrLastName+,hrFirstName+";
var it = new FileResultset("ftEmployee", "", sort);
for (var empl=it.first(); empl; empl=it.next())
myList.push(empl.hrLastName + ", " + empl.hrFirstName);
return myList;
}
function copyArray(srcList, trgList)
{
for (var cnt=0; cnt<srcList.length; cnt++)
trgList.push(srcList[cnt]);
}

Member Function Documentation

◆ hasProperty()

boolean PropertyCache::hasProperty ( String name )

Function to check if a named property exists in the PropertyCache.

Returns
true if the property exists, false if not
Since
DOCUMENTS 4.0

◆ listProperties()

string [] PropertyCache::listProperties ( )

Function to list all properties in the PropertyCache.

Returns
Array with the names of the properties in the PropertyCache.
Since
DOCUMENTS 5.0c

◆ removeProperty()

boolean PropertyCache::removeProperty ( String name )

Function to delete a named property exists in the PropertyCache.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0


DOCUMENTS 5 - PortalScripting API: Member List

PropertyCache Member List

This is the complete list of members for PropertyCache, including all inherited members.

hasProperty(String name) | PropertyCache
listProperties() | PropertyCache
removeProperty(String name) | PropertyCache


DOCUMENTS 5 - PortalScripting API: Register Class Reference

Public Member Functions | Public Attributes | Private Member Functions | List of all members
Register Class Reference

The Register class has been added to the DOCUMENTS PortalScripting API to gain full access to the registers of a DOCUMENTS file by scripting means. More...

Public Member Functions

boolean | addFileLink (DocFile file)
Adds a file to a file link register. More...
boolean | deleteDocument (Document doc)
Delete a Document at the Register. More...
String | getAttribute (String attribute)
Get the String value of an attribute of the Register. More...
DocumentIterator getDocuments ()
Retrieve a list of all Documents stored on the given Register. More...
DocFile getFile ()
Returns the DocFile the Register belongs to. More...
FileResultset getFiles ()
Retrieve a FileResultset of all DocFile objects linked to the register. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
String | getOID (boolean oidLow=false)
Returns the object-id. More...
boolean | removeFileLink (DocFile file)
Removes a file from a file link register. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the Register to the desired value. More...
Document | uploadDocument (String filePath, String registerFileName)
Upload a new Document stored on the server's filesystem to the Register. More...

Public Attributes

String | label
The ergonomic label of the Register object. More...
String | name
The technical name of the Register object. More...
String | type
The type of the Register object. More...

Private Member Functions

String getLocaleLabel (String locale)
Get the ergonomic label of the Register. More...

Detailed Description

The Register class has been added to the DOCUMENTS PortalScripting API to gain full access to the registers of a DOCUMENTS file by scripting means.

Since
ELC 3.50n / otrisPORTAL 5.0n

Member Function Documentation

◆ addFileLink()

boolean Register::addFileLink ( DocFile file )

Adds a file to a file link register.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0d
Example:
var file = context.file;
var linkFile = context.createFile("Filetype1");
var reg = file.getRegisterByName("flReg");
if (!reg.addFileLink(linkFile))
util.out(reg.getLastError());

◆ deleteDocument()

boolean Register::deleteDocument ( Document doc )

Delete a Document at the Register.

With the necessary access rights the user can delete a Document at the Register.

Parameters
doc Document to delete
Returns
true if successful, false in case of any error
Since
ELC 3.60d / otrisPORTAL 6.0d
Example:
// deleting all documents at a register
var docFile = context.file;
var reg = docFile.getRegisterByName("Documents");
if (reg)
{
var docs = reg.getDocuments();
for (var doc = docs.first(); doc; doc = docs.next())
reg.deleteDocument(doc);
}

◆ getAttribute()

String Register::getAttribute ( String attribute )

Get the String value of an attribute of the Register.

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ getDocuments()

DocumentIterator Register::getDocuments ( )

Retrieve a list of all Documents stored on the given Register.

This method is available for documents registers only. You cannot use it with different types of Register objects.

Returns
DocumentIterator containing the Document objects stored on the Register
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var docFile = context.file;
var reg = docFile.getRegisterByName("Documents");
var docIter = reg.getDocuments();
for (var doc = docIter.first(); doc; doc = docIter.next())
{
util.out(doc.Fullname);
}

◆ getFile()

DocFile Register::getFile ( )

Returns the DocFile the Register belongs to.

Returns
DocFile object or null if missing
Since
DOCUMENTS 5.0c HF1
Example:
var file = context.file;
var reg = file.getRegisterByName("RegisterA");
var alwaysTrue = reg.getFile().getid() == file.getid();

◆ getFiles()

FileResultset Register::getFiles ( )

Retrieve a FileResultset of all DocFile objects linked to the register.

Returns
FileResultset containing a list of all DocFile objects linked to the register.
Since
DOCUMENTS 4.0b
Example:
var docFile = context.file;
var reg = docFile.getRegisterByName("LinksReg");
if (reg)
{
var myFRS = reg.getFiles();
for (var file = myFRS.first(); file; file = myFRS.next())
util.out(file.getAutoText("title"));
}

◆ getLastError()

String Register::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files
See also
DocFile.getLastError()

◆ getLocaleLabel()

String Register::getLocaleLabel ( String locale )
private

Get the ergonomic label of the Register.

Parameters
locale Optional 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 label of the Register in the appropriate portal language.
Since
DOCUMENTS 5.0c HF1

◆ getOID()

String Register::getOID ( boolean oidLow = false )

Returns the object-id.

Parameters
oidLow Optional flag:
If true only the id of the Register object (m_oid) will be returned.
If false the id of the Register 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
Since
ELC 3.60c / otrisPORTAL 6.0c
ELC 3.60i / otrisPORTAL 6.0i available for archive files
DOCUMENTS 5.0 (new parameter oidLow)

◆ removeFileLink()

boolean Register::removeFileLink ( DocFile file )

Removes a file from a file link register.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0d
Example:
var file = context.file;
var reg = file.getRegisterByName("flReg");
var frs = reg.getFiles();
for (var linkFile = frs.first(); linkFile; linkFile = frs.next())
{
if (!reg.removeFileLink(linkFile))
util.out(reg.getLastError());
}

◆ setAttribute()

boolean Register::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the Register to the desired value.

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ uploadDocument()

Document Register::uploadDocument | ( | String | filePath,
 |  | String | registerFileName
 | ) |  |

Upload a new Document stored on the server's filesystem to the Register.

The filePath parameter must contain not only the directory path but the filename as well. Otherwise the server will take the first file to be found in the given filePath. The registerFileName parameter has the purpose to allow to rename the Document already while uploading it.

Note
After successful upload of the Document the source file on the server's directory structure is removed!
Parameters
filePath | String containing the filePath and filename of the desired file to be uploaded. Note: Backslashes contained in the filepath must be quoted with a leading backslash, since the backslash is a special char in ECMAScript!
registerFileName | String containing the desired target filename of the Document on the Register
Returns
Document if successful, null in case of any error
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var docFile = context.file;
var reg = docFile.getRegisterByName("Documents");
var newDoc = reg.uploadDocument("c:\\tmp\\sourcefile.rtf", "Filename_on_Register.rtf");
if (!newDoc)
util.out("Error while uploading the file! " + reg.getLastError());
else
util.out(newDoc.Name);

Member Data Documentation

◆ label

String Register::label

The ergonomic label of the Register object.

Note
This property is readonly and cannot be overwritten.
Returns
String containing the ergonomic label of the Register
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ name

String Register::name

The technical name of the Register object.

Note
This property is readonly and cannot be overwritten.
Returns
String containing the technical name of the Register
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ type

String Register::type

The type of the Register object.

The possible values of the type attribute are listed below:

  • documents
  • fields
  • links
  • archiveddocuments
  • externalcall
Note
This property is readonly and cannot be overwritten.
Returns
String containing the type of the Register
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files


DOCUMENTS 5 - PortalScripting API: Member List

Register Member List

This is the complete list of members for Register, including all inherited members.

addFileLink(DocFile file) | Register |
deleteDocument(Document doc) | Register |
getAttribute(String attribute) | Register |
getDocuments() | Register |
getFile() | Register |
getFiles() | Register |
getLastError() | Register |
getLocaleLabel(String locale) | Register | private
getOID(boolean oidLow=false) | Register |
label | Register |
name | Register |
removeFileLink(DocFile file) | Register |
setAttribute(String attribute, String value) | Register |
type | Register |
uploadDocument(String filePath, String registerFileName) | Register |


DOCUMENTS 5 - PortalScripting API: RegisterIterator Class Reference

Public Member Functions | List of all members
RegisterIterator Class Reference

The RegisterIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the registers of a DOCUMENTS file by scripting means. More...

Public Member Functions

Register first ()
Retrieve the first Register object in the RegisterIterator. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
Register next ()
Retrieve the next Register object in the RegisterIterator. More...
int | size ()
Get the amount of Register objects in the RegisterIterator. More...

Detailed Description

The RegisterIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the registers of a DOCUMENTS file by scripting means.

Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files
Example:
var docFile = context.file;
if (docFile)
{
var docregs = docFile.getRegisters("documents");
if (docregs && docregs.size() > 0)
{
for (var d = docregs.first(); d; d = docregs.next())
{
util.out(d.Name + ", " + d.Label);
}
}
}

Member Function Documentation

◆ first()

Register RegisterIterator::first ( )

Retrieve the first Register object in the RegisterIterator.

Returns
Register or null in case of an empty RegisterIterator
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ getLastError()

String RegisterIterator::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.50n / otrisPORTAL 5.0n
See also
DocFile.getLastError()
Since
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ next()

Register RegisterIterator::next ( )

Retrieve the next Register object in the RegisterIterator.

Returns
Register or null if end of RegisterIterator is reached.
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files

◆ size()

int RegisterIterator::size ( )

Get the amount of Register objects in the RegisterIterator.

Returns
integer value with the amount of Register objects in the RegisterIterator
Since
ELC 3.50n / otrisPORTAL 5.0n
ELC 3.60i / otrisPORTAL 6.0i available for archive files


DOCUMENTS 5 - PortalScripting API: Member List

RegisterIterator Member List

This is the complete list of members for RegisterIterator, including all inherited members.

first() | RegisterIterator
getLastError() | RegisterIterator
next() | RegisterIterator
size() | RegisterIterator


DOCUMENTS 5 - PortalScripting API: RetrievalField Class Reference

Public Member Functions | Public Attributes | List of all members
RetrievalField Class Reference

This class represents one search field or one conditon within a DOCUMENTS search request. More...

Public Member Functions

setDefault (String value, boolean writeProtect)
Place a default value in a search field. More...

Public Attributes

String | compOp
The comparison operator / relational operator as a String. More...
String | defaultValue
The actual default value of the field (read-only). More...
boolean | defValWriteProt
The UI write protection state of the defautValue (read-only) More...
String | label
The localized label of the field. Maybe an empty String. More...
String | name
The name of the look-up field (read-only). More...
number | type
The field type coded as an integer (read-only). More...
String | valueExpr
The value sought after. If the operator is "~", it can be a composed value expression. More...
Field Types

These constants are equally available in each instance of RetrievalField and in the constructor object.

Integer | FT_STRING
Integer code for the field type "String" (single line)
Integer | FT_TEXT
Integer code for the field type "Text" (multiple lines)
Integer | FT_BOOL
Integer code for the field type "boolean".
Integer | FT_DATE
Integer code for the field type "Date".
Integer | FT_ENUM
Integer code for the field type "Enumeration" (not extensible)
Integer | FT_NUMERIC
Integer code for the field type "Numeric".
Integer | FT_REFERENCE
Integer code for the field type "File reference".
Integer | FT_HISTORY
Integer code for the field type "History".
Integer | FT_DOUBLE_LIST
Integer code for the field type "Double select list".
Integer | FT_CHECKBOX
Integer code for the field type "Checkbox".
Integer | FT_SEPARATOR
Integer code for the field type "Horizontal seperator" (actually ignored by the retrieval system)
Integer | FT_USER_DEFINED
Integer code for the field type "User defeined".
Integer | FT_TEXT_FIXED_FONT
Integer code for the field type "Text (fixed font)".
Integer | FT_E_MAIL
Integer code for the field type "E-mail address".
Integer | FT_URL
Integer code for the field type "URL".
Integer | FT_TIMESTAMP
Integer code for the field type "Time stamp".
Integer | FT_FILING_PLAN
Integer code for the field type "Filing plan".
Integer | FT_HTML
Integer code for the field type "HTML".
Integer | FT_FILING_STRUCTURE
Reserved constant for a possible future use.
Integer | FT_GADGET
Integer code for the field type "Gadget" (actually ignored by the retrieval system)
Integer | FT_UNDEFINED
Integer code for fields with an unspecified data type. More...

Detailed Description

This class represents one search field or one conditon within a DOCUMENTS search request.

Since
DOCUMENTS 4.0c HF2
See also
DocQueryParams

Member Function Documentation

◆ setDefault()

RetrievalField::setDefault | ( | String | value,
 |  | boolean | writeProtect
 | ) |  |

Place a default value in a search field.

A "FillSearchMask" script-exit can call this function to place default values in an extended search formular. Calls from other scripts will rather deposit a "LastError" message in the superior DocQueryParams object.

Parameters
value | The initial text in the search field. Dates and numbers must be formatted with the current user's locale settings.
writeProtect | Indicates, if the user interface shall write-protect the field.
Returns
No return value.
Note
The DocumentsServer only forwards these parameters to the client application. If a special client implementation will ignore them, the server would not enforce the defaults, because such a behaviour would confuse users.
Calling this function does not modify the "empty" state in terms of DocQueryParams.getSearchField().
Since
DOCUMENTS 4.0d

Member Data Documentation

◆ compOp

String RetrievalField::compOp

The comparison operator / relational operator as a String.

For a list of valid operators see the page: Using filter expressions with FileResultSets.

Note
The access to this property is restricted. Only the "OnSearchScript" can effectively modify it. Modifying the operator is risky, since it can produce unexpected results from the user's point of view.
Since
DOCUMENTS 4.0c HF2

◆ defaultValue

String RetrievalField::defaultValue

The actual default value of the field (read-only).

Remarks
Actually only the "FillSearchMask" exit can attach default values (see setDefault()). There might exist another method in a future version. To improve upward compatibility a "FillSearchMask" script may check for external default values, and leave them unmodified.
Since
DOCUMENTS 4.0d

◆ defValWriteProt

boolean RetrievalField::defValWriteProt

The UI write protection state of the defautValue (read-only)

See also
setDefault()
Since
DOCUMENTS 4.0d

◆ FT_UNDEFINED

Integer RetrievalField::FT_UNDEFINED

Integer code for fields with an unspecified data type.

This constant has been added for completeness. Fields in this state should never appear in the retrieval system.

◆ label

String RetrievalField::label

The localized label of the field. Maybe an empty String.

Remarks
If the field has not got a label, DOCUMENTS falls back to the technical name. So there is no need to specify a label always. A few reserved internal fields, which are usualli never displayed on a search mask or a hit list, also come along without any label. An example is the special field "Search_EEIFileNr", which DOCUMENTS uses internally to implement a version listing for an ENTERPRISE.i file.
Since
DOCUMENTS 4.0c HF2

◆ name

String RetrievalField::name

The name of the look-up field (read-only).

Since
DOCUMENTS 4.0c HF2

◆ type

number RetrievalField::type

The field type coded as an integer (read-only).

See the enumeration constants in this class.

Since
DOCUMENTS 4.0c HF2

◆ valueExpr

String RetrievalField::valueExpr

The value sought after. If the operator is "~", it can be a composed value expression.

Note
The access to this property is restricted. Only the "OnSearchScript" can effectively modify it. Modifying the value is risky, because it can produce unexpected results from the user's point of view. Within a "FillSearchMask" exit this property contains always an empty string.
Since
DOCUMENTS 4.0c HF2


DOCUMENTS 5 - PortalScripting API: Member List

RetrievalField Member List

This is the complete list of members for RetrievalField, including all inherited members.

compOp | RetrievalField
defaultValue | RetrievalField
defValWriteProt | RetrievalField
FT_BOOL | RetrievalField
FT_CHECKBOX | RetrievalField
FT_DATE | RetrievalField
FT_DOUBLE_LIST | RetrievalField
FT_E_MAIL | RetrievalField
FT_ENUM | RetrievalField
FT_FILING_PLAN | RetrievalField
FT_FILING_STRUCTURE | RetrievalField
FT_GADGET | RetrievalField
FT_HISTORY | RetrievalField
FT_HTML | RetrievalField
FT_NUMERIC | RetrievalField
FT_REFERENCE | RetrievalField
FT_SEPARATOR | RetrievalField
FT_STRING | RetrievalField
FT_TEXT | RetrievalField
FT_TEXT_FIXED_FONT | RetrievalField
FT_TIMESTAMP | RetrievalField
FT_UNDEFINED | RetrievalField
FT_URL | RetrievalField
FT_USER_DEFINED | RetrievalField
label | RetrievalField
name | RetrievalField
setDefault(String value, boolean writeProtect) | RetrievalField
type | RetrievalField
valueExpr | RetrievalField


DOCUMENTS 5 - PortalScripting API: RetrievalSource Class Reference

Public Attributes | List of all members
RetrievalSource Class Reference

This class describes a searchable resource in the DOCUMENTS retrieval system. More...

Public Attributes

String | resId
A identifier of the resource. More...
String | server
For archive resources: the technical name of the archive server. Otherwise empty. More...
number | type
The resource type encoded as an integer. See the enumeration constants in this class. More...
Searchable Resource

These constants are equally available in each instance of RetrievalSource and in the constructor object. Resource macroes can only occur in the "FillSearchMask" exit. Within an "OnSearch" exit they have already been replaced by their single components.

Integer | ST_DLC_FILETYPE
Integer code of the source type "DOCUMENTS file type".
Integer | ST_EEI_ARCHIVE
Integer code of the source type "EASY ENTERPRISE.i archive".
Integer | ST_EEX_VIEW
Integer code of the source type "EASY ENTERPRISE.x view".
Integer | ST_EEX_USERVIEW
Integer code of the source type "EASY ENTERPRISE.x user specific view".
Integer | ST_EAS_FILETYPE
Integer code of the source type "DOCUMENTS file type within an EAS/EDA store".
Integer | MST_EAS_SERVER
Integer code of the macro source type "EAS server" (Apply selected file types also to the identified EDA-store)
Integer | MST_EAS_ONLY
Integer code of the macro source type "EAS only" (Remove standard file type sources after MST_EAS_SERVER macro expansion) More...

Detailed Description

This class describes a searchable resource in the DOCUMENTS retrieval system.

Since
DOCUMENTS 4.0c HF2

Member Data Documentation

◆ MST_EAS_ONLY

Integer RetrievalSource::MST_EAS_ONLY

Integer code of the macro source type "EAS only" (Remove standard file type sources after MST_EAS_SERVER macro expansion)

Remarks
A "FillSearchMask" script can usually find a source of this type, when the user has deselected the "actual processes" checkbox. This source has not got any parameters. If there are user accounts in the system, for which the checkbox does not show up, the script code should not interpret this source type at all.

◆ resId

String RetrievalSource::resId

A identifier of the resource.

For conventional file type resources the identifier equals the technical name of the file type. Archive related identifiers consist of a software dependent key or name plus an "@serverName" appendix.

Note
Modifications of this property won't be forwarded to the retrieval system.
Since
DOCUMENTS 4.0c

◆ server

String RetrievalSource::server

For archive resources: the technical name of the archive server. Otherwise empty.

Note
Modifications of this property won't be forwarded to the retrieval system.
Since
DOCUMENTS 4.0c

◆ type

number RetrievalSource::type

The resource type encoded as an integer. See the enumeration constants in this class.

Note
Modifications of this property won't be forwarded to the retrieval system.
Since
DOCUMENTS 4.0c


DOCUMENTS 5 - PortalScripting API: Member List

RetrievalSource Member List

This is the complete list of members for RetrievalSource, including all inherited members.

MST_EAS_ONLY | RetrievalSource
MST_EAS_SERVER | RetrievalSource
resId | RetrievalSource
server | RetrievalSource
ST_DLC_FILETYPE | RetrievalSource
ST_EAS_FILETYPE | RetrievalSource
ST_EEI_ARCHIVE | RetrievalSource
ST_EEX_USERVIEW | RetrievalSource
ST_EEX_VIEW | RetrievalSource
type | RetrievalSource


DOCUMENTS 5 - PortalScripting API: ScriptCall Class Reference

Public Member Functions | List of all members
ScriptCall Class Reference

This class allows asynchronous calling a script from another script. More...

Public Member Functions

boolean | addParameter (String name, String value)
Add a parameter to the called script. More...
string [] | getEnumval ()
Get the return enumval value of the called script. More...
String | getLastError ()
Get the description of the last error that occurred. More...
String | getReturnValue ()
Get the return value of the called script. More...
boolean | isFinished ()
Check whether the script call was finished. More...
boolean | isRunning ()
Check whether the script call is actually running. More...
boolean | launch ()
Launch the script call. More...
ScriptCall | ScriptCall (Var systemUser, String scriptName, boolean waitable)
Create a new ScriptCall object. More...
boolean | setDocFile (DocFile docFile)
Set the execution context file of the called script. More...
boolean | setDocument (Document doc)
Set the execution context document of the called script. More...
boolean | setEvent (String scriptEvent)
Set the execution context event of the called script. More...
boolean | setFolder (Folder folder)
Set the execution context folder of the called script. More...
boolean | setRegister (Register register)
Set the execution context register of the called script. More...
boolean | setRunAsEnumScript (boolean runAsEnumScript)
Let the called script run as an enumeration script. More...
boolean | waitForFinish ()
Wait for the script call to finish. More...

Detailed Description

This class allows asynchronous calling a script from another script.

You should deliberate whether a script call can be waitable or not. Only waitable script calls can be managed e.g. waiting for a script call to finish or checking whether a call is still running.

Since
DOCUMENTS 4.0d

Constructor & Destructor Documentation

◆ ScriptCall()

ScriptCall ScriptCall::ScriptCall | ( | Var | systemUser,
 |  | String | scriptName,
 |  | boolean | waitable
 | ) |  |

Create a new ScriptCall object.

The following properties of the execution context of the called script are carried over from the execution context of the script where this ScriptCall object is created:

  • file
  • register
  • document
  • event

You can change these context properties with the available set-methods.

Parameters
systemUser The system user who triggers execution of the called script and can be specified as follows:
  • String containing the login name of the system user.
  • SystemUser object representing the system user.
scriptName | String with the name of the called script.
waitable | boolean flag indicating whether this script call is waitable.
Since
DOCUMENTS 4.0d

Member Function Documentation

◆ addParameter()

boolean ScriptCall::addParameter | ( | String | name,
 |  | String | value
 | ) |  |

Add a parameter to the called script.

Parameters
name | String value containing the parameter name.
value | String value containing the parameter value.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0
Example:
var call = new ScriptCall("schreiber", "testScript", false);
call.addParameter("testParam", "testValue");

◆ getEnumval()

string [] ScriptCall::getEnumval ( )

Get the return enumval value of the called script.

Note
This function is only available for a waitable ScriptCall.
Returns
The return value as an array if the waitable ScriptCall was successfully completed, otherwise the string "Undefined".
Since
DOCUMENTS 5.0 HF2
Example:
var call = new ScriptCall("schreiber", "myEnumScript", true);
if (call.launch())
{
if (call.waitForFinish())
util.out(call.getEnumval());
}

◆ getLastError()

String ScriptCall::getLastError ( )

Get the description of the last error that occurred.

Returns
Text of the last error as String
Example:
var call = new ScriptCall("schreiber", "testScript", true);
if (!call.launch())
util.out(call.getLastError());

◆ getReturnValue()

String ScriptCall::getReturnValue ( )

Get the return value of the called script.

Note
This function is only available for a waitable ScriptCall.
Returns
The return value as String if the waitable ScriptCall was successfully completed, otherwise the string "Undefined".
Since
DOCUMENTS 5.0
Example:
var call = new ScriptCall("schreiber", "testScript", true);
if (call.launch())
{
if (call.waitForFinish())
util.out(call.getReturnValue());
}

◆ isFinished()

boolean ScriptCall::isFinished ( )

Check whether the script call was finished.

Note
This function is only available for a waitable script call.
Returns
true if the script call is finished, otherwise false
Since
DOCUMENTS 5.0e HF2
Example:
var call = new ScriptCall("schreiber", "testScript", true);
if (!call.launch())
throw call.getLastError();
while (!call.isFinished())
{
// do something different
}
// Call is finished and result is available
return call.getReturnValue();
See also
ScriptCall.isRunning

◆ isRunning()

boolean ScriptCall::isRunning ( )

Check whether the script call is actually running.

Actually running means, that the script will be executed at this moment (other states are new or queued)

Note
This function is only available for a waitable script call.
Returns
true if the script call is running, otherwise false
Since
DOCUMENTS 4.0d
Example:
var call = new ScriptCall("schreiber", "testScript", true);
if (call.launch())
{
if (call.isRunning())
{
// do something
}
}
See also
ScriptCall.isFinished

◆ launch()

boolean ScriptCall::launch ( )

Launch the script call.

In case of successful launch the script will be executed in an own context.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var call = new ScriptCall("schreiber", "testScript", true);
if (!call.launch())
util.out(call.getLastError());

◆ setDocFile()

boolean ScriptCall::setDocFile ( DocFile docFile )

Set the execution context file of the called script.

Parameters
docFile DocFile object representing the desired execution context file.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var user = context.findSystemUser("schreiber");
var call = new ScriptCall(user, "testScript", true);
var file = context.getFileById("peachit_fi20120000000016");
if (file)
call.setDocFile(file);
See also
Context.file

◆ setDocument()

boolean ScriptCall::setDocument ( Document doc )

Set the execution context document of the called script.

Parameters
doc Document object representing the desired execution context document.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var call = new ScriptCall("schreiber", "testScript", false);
var file = context.getFileById("peachit_fi20120000000016");
if (file)
{
var reg = file.getRegisterByName("Doc1");
if (reg)
{
var it = reg.getDocuments();
if (it.size() > 0)
call.setDocument(it.first());
}
}
See also
Context.document

◆ setEvent()

boolean ScriptCall::setEvent ( String scriptEvent )

Set the execution context event of the called script.

Parameters
scriptEvent String value containing the desired script event of the execution context.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var call = new ScriptCall("schreiber", "testScript", false);
call.setEvent("onArchive");
See also
Context.event

◆ setFolder()

boolean ScriptCall::setFolder ( Folder folder )

Set the execution context folder of the called script.

Parameters
folder Folder object representing the desired execution context folder.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0d
Example:
var call = new ScriptCall("schreiber", "testScript", false);
call.setFolder(context.folder);
See also
Context.folder

◆ setRegister()

boolean ScriptCall::setRegister ( Register register )

Set the execution context register of the called script.

Parameters
register Register object representing the desired execution context register.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var call = new ScriptCall("schreiber", "testScript", false);
var file = context.getFileById("peachit_fi20120000000016");
if (file)
{
var reg = file.getRegisterByName("Doc1");
call.setRegister(reg);
}
See also
Context.register

◆ setRunAsEnumScript()

boolean ScriptCall::setRunAsEnumScript ( boolean runAsEnumScript )

Let the called script run as an enumeration script.

The global parameter enumval is then available in the called script

Parameters
runAsEnumScript boolean value.
Since
DOCUMENTS 5.0 HF2
Example:
var call = new ScriptCall(context.getSystemUser(), "myEnumScript", true);
call.setRunAsEnumScript(true);
if (!call.launch())
throw call.getLastError();
call.waitForFinish();
util.out(call.getEnumval());
See also
ScriptCall.getEnumval()

◆ waitForFinish()

boolean ScriptCall::waitForFinish ( )

Wait for the script call to finish.

Note
This function is only available for a waitable script call.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var call = new ScriptCall("schreiber", "testScript", true);
if (call.launch())
{
if (call.waitForFinish())
{
// do something
}
else
util.out(call.getLastError());
}


DOCUMENTS 5 - PortalScripting API: Member List

ScriptCall Member List

This is the complete list of members for ScriptCall, including all inherited members.

addParameter(String name, String value) | ScriptCall
getEnumval() | ScriptCall
getLastError() | ScriptCall
getReturnValue() | ScriptCall
isFinished() | ScriptCall
isRunning() | ScriptCall
launch() | ScriptCall
ScriptCall(Var systemUser, String scriptName, boolean waitable) | ScriptCall
setDocFile(DocFile docFile) | ScriptCall
setDocument(Document doc) | ScriptCall
setEvent(String scriptEvent) | ScriptCall
setFolder(Folder folder) | ScriptCall
setRegister(Register register) | ScriptCall
setRunAsEnumScript(boolean runAsEnumScript) | ScriptCall
waitForFinish() | ScriptCall


DOCUMENTS 5 - PortalScripting API: SystemUser Class Reference

Public Member Functions | Public Attributes | List of all members
SystemUser Class Reference

The SystemUser class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS users by scripting means. More...

Public Member Functions

CustomProperty | addCustomProperty (String name, String type, String value)
Creates a new CustomProperty for the user. More...
boolean | addFileTypeAgent (var fileTypes, Array loginNames)
Create file type agents for the user. More...
boolean | addFileTypeAgentScript (var fileTypes, String scriptName)
Create file type agents for the user, whereby the agents are specified by the desired script. More...
boolean | addToAccessProfile (AccessProfile ap)
Make the SystemUser a member of the desired AccessProfile. More...
boolean | checkPassword (String passwd)
Evaluate if the password is correct. More...
boolean | delegateFilesOfAbsentUser ()
Move the files from the inbox of an absent user to his agent. More...
int | getAccess (DocFile docFile)
Retrieve an access mask whose bits correspond to the user's access rights supported by the given DocFile or filetype. More...
AccessProfileIterator getAccessProfiles ()
Retrieve an AccessProfileIterator representing a list of all AccessProfiles the user is a member of. More...
SystemUserIterator getAgents ()
Get a SystemUserIterator with the agents of the user. More...
FolderIterator getAllFolders ()
Retrieve a list of private and public Folders of the Systemuser. More...
String | getAttribute (String attribute)
Get the String value of an attribute of the SystemUser. More...
boolean | getBackDelegatedFiles (boolean removeFromAgentInbox)
Get back the delegated files. More...
CustomPropertyIterator | getCustomProperties (String nameFilter="", String typeFilter="")
Get a CustomPropertyIterator with all CustomProperty of the user. More...
FolderIterator getIndividualFolders ()
Retrieve a list of individual Folders of the Systemuser. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
String | getOID (boolean oidLow=false)
Returns the object-id. More...
Folder | getPrivateFolder (String folderType)
Try to retrieve a particular private Folder of the Systemuser. More...
SystemUser getSuperior ()
Get the SystemUser object representing the superior of the user. More...
FolderIterator getUserdefinedInboxFolders ()
Retrieve a list of userdefined inbox Folders of the Systemuser. More...
boolean | hasAccessProfile (String profileName)
Retrieve information whether the SystemUser is a member of a particular AccessProfile which is identified by its technical name. More...
boolean | invalidateAccessProfileCache ()
Invalidates the server sided cache of the access profiles for the SystemUser. More...
Array | listAgentFileTypes ()
Retrieve a list of file types for them an agent exists. More...
Array | listFileTypeAgents (String fileType)
Retrieve a list of all agents for the desired file type of the user. More...
boolean | notifyFileReturnedFromSending (boolean notifying=true)
Define whether to notify the user by e-mail of files returned from sending. More...
boolean | notifyNewFileInInbox (boolean notifying=true)
Define whether to notify the user by e-mail of new files in inbox. More...
boolean | removeFileTypeAgent (var fileTypes)
Remove file type agents from the user. More...
boolean | removeFromAccessProfile (AccessProfile ap)
Clear the SystemUser's membership in the given AccessProfile. More...
boolean | resetSuperior ()
Clear the user's relation to a superior. More...
boolean | setAbsent (boolean absent, boolean filesDueAbsenceToInfo=true, string[] agents=[], boolean removeFromAgentInbox=false, Date from=undefined, Date until=undefined)
Set a Systemuser absent or present. More...
boolean | setAbsentMail (boolean sendMail, String message="")
Define if an absence mail for the absent user will be sent to the sender of the file. More...
boolean | setAccessProfiles (var apNames1, var apNames2,...)
Set the AccessProfiles for an user. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the SystemUser to the desired value. More...
boolean | setEasywareAuthentication (boolean value)
Turn EASYWARE Authentication on or off. More...
CustomProperty | setOrAddCustomProperty (String name, String type, String value)
Creates a new CustomProperty or modifies a CustomProperty according the name and type for the user. More...
boolean | setPassword (String newPwd)
Set the password of the user represented by the SystemUser object to the desired new value. More...
boolean | setSuperior (SystemUser sup)
Set the SystemUser object representing the superior of the user to the desired object. More...

Public Attributes

int | ANNOTATIONS
Annotations right flag in the access mask. More...
int | ARCHIVE
Archive right flag in the access mask. More...
int | CHANGE_TYPE
Change filetype right flag in the access mask. More...
int | CHANGE_WORKFLOW
Change workflow right flag in the access mask. More...
int | COPY
Copy right flag in the access mask. More...
int | CREATE
Create right flag in the access mask. More...
int | CREATE_WORKFLOW
Create workflow right flag in the access mask. More...
String | email
String value containing the email address of the SystemUser. More...
String | firstName
String value containing the first name of the SystemUser. More...
String | lastName
String value containing the last name of the SystemUser. More...
String | login
String value containing the unique login name of the SystemUser. More...
int | MAIL
Mail right flag in the access mask. More...
int | MOVE
Move right flag in the access mask. More...
int | PDF
Create PDF right flag in the access mask. More...
PropertyCache propCache
Access to the property cache of the SystemUser. More...
int | READ
Read right flag in the access mask. More...
int | REMOVE
Remove right flag in the access mask. More...
int | START_WORKFLOW
Start workflow flag in the access mask. More...
int | VERSION
Versioning right flag in the access mask. More...
int | WRITE
Write right flag in the access mask. More...

Detailed Description

The SystemUser class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS users by scripting means.

There are several functions implemented in different classes to retrieve a SystemUser object.

Since
ELC 3.50b / otrisPORTAL 5.0b

Member Function Documentation

◆ addCustomProperty()

CustomProperty SystemUser::addCustomProperty | ( | String | name,
 |  | String | type,
 |  | String | value
 | ) |  |

Creates a new CustomProperty for the user.

Parameters
name | String value defining the name
type | String value defining the type
value | String value defining the value
Returns
CustomProperty
Since
DOCUMENTS 4.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var custProp = currentUser.addCustomProperty("favorites", "string", "peachit");
if (!custProp)
util.out(currentUser.getLastError());
See also
SystemUser.setOrAddCustomProperty(String name, String type, String value)
SystemUser.getCustomProperties(String nameFilter, String typeFilter)

◆ addFileTypeAgent()

boolean SystemUser::addFileTypeAgent | ( | var | fileTypes,
 |  | Array | loginNames
 | ) |  |

Create file type agents for the user.

Parameters
fileTypes The desired file types may be passed as follows:
  • String containing the technical name of the desired file type;
  • Array of strings containing the technical names of the desired file types;
  • String constant "*" indicating all file types.
loginNames Array of strings containing the login names of the agents.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var loginNames = new Array();
loginNames.push("user1");
loginNames.push("user2");
if (!currentUser.addFileTypeAgent("testFileType", loginNames))
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");

◆ addFileTypeAgentScript()

boolean SystemUser::addFileTypeAgentScript | ( | var | fileTypes,
 |  | String | scriptName
 | ) |  |

Create file type agents for the user, whereby the agents are specified by the desired script.

Parameters
fileTypes The desired file types may be passed as follows:
  • String containing the technical name of the desired file type;
  • Array of strings containing the technical names of the desired file types;
  • String constant "*" indicating all file types.
scriptName String containing the name of the script specifying the file type agents.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
if (!currentUser.addFileTypeAgentScript("*", "testScript"))
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");

◆ addToAccessProfile()

boolean SystemUser::addToAccessProfile ( AccessProfile ap )

Make the SystemUser a member of the desired AccessProfile.

Parameters
ap AccessProfile the user should be a member of
Returns
true if successful, false in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b for PartnerAccounts
DOCUMENTS 4.0b HF1 for Fellows
Note
If the user is already logged in, it is necessary to invalidate the cache of the user s. SystemUser.invalidateAccessProfileCache()

◆ checkPassword()

boolean SystemUser::checkPassword ( String passwd )

Evaluate if the password is correct.

Parameters
passwd String value containing the plain password
Returns
true if correct, otherwise false
Since
ELC 3.60d / otrisPORTAL 6.0d

◆ delegateFilesOfAbsentUser()

boolean SystemUser::delegateFilesOfAbsentUser ( )

Move the files from the inbox of an absent user to his agent.

If a Systemuser is set to absent, then all new files are redirected to his agent. The currently existing files (that came into the inbox before the was absent) can be moved to the agent with this method. If the user is not absent this method returns an error.

Returns
true if succeeded, otherwise false - an error message describing the error with getLastError().
Since
ELC 3.60g / otrisPORTAL 6.0g
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
if (!currentUser.delegateFilesOfAbsentUser())
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");
See also
boolean setAbsent(boolean absent, boolean filesDueAbsenceToInfo, Array agents, boolean removeFromAgentInbox, Date from, Date until);
boolean setAbsentMail(boolean sendMail, String message)
SystemUserIterator getAgents()

◆ getAccess()

int SystemUser::getAccess ( DocFile docFile )

Retrieve an access mask whose bits correspond to the user's access rights supported by the given DocFile or filetype.

Returns
32-bit value whose bits correspond to the user's access rights.
Parameters
docFile DocFile object to which the access rights should be retrieved.
Since
DOCUMENTS 5.0a HF2
Example:
var docFile = context.file;
var currentUser = context.getSystemUser();
if (!currentUser)
throw "currentUser is NULL";
var accessMask = currentUser.getAccess(docFile);
if(SystemUser.READ & accessMask)
util.out("The user " + currentUser.login + " has read access!");
Note
There is a constant for any right flag in the access mask (e.g. SystemUser.READ specifies the read right).
See also
e.g. SystemUser.READ

◆ getAccessProfiles()

AccessProfileIterator SystemUser::getAccessProfiles ( )

Retrieve an AccessProfileIterator representing a list of all AccessProfiles the user is a member of.

Returns
AccessProfileIterator containing a list of all AccessProfiles which are assigned to the user; null in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ getAgents()

SystemUserIterator SystemUser::getAgents ( )

Get a SystemUserIterator with the agents of the user.

This method returns a SystemUserIterator with the agents of the user, if the user is absent.

Returns
SystemUserIterator
Since
ELC 3.60g / otrisPORTAL 6.0g
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var itSU = currentUser.getAgents();
for (var su = itSU.first(); su; su = itSU.next())
{
util.out(su.login);
}
See also
boolean setAbsent(boolean absent, boolean filesDueAbsenceToInfo, Array agents, boolean removeFromAgentInbox, Date from, Date until);
boolean setAbsentMail(boolean sendMail, String message)
boolean delegateFilesOfAbsentUser()

◆ getAllFolders()

FolderIterator SystemUser::getAllFolders ( )

Retrieve a list of private and public Folders of the Systemuser.

Returns
FolderIterator containing a list of the folders.
Since
DOCUMENTS 5.0c
Example:
var currentUser = context.getSystemUser();
if (!currentUser)
throw "currentUser is null";
var folderIter = currentUser.getAllFolders();
See also
SystemUser.getAllFolders()

◆ getAttribute()

String SystemUser::getAttribute ( String attribute )

Get the String value of an attribute of the SystemUser.

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ getBackDelegatedFiles()

boolean SystemUser::getBackDelegatedFiles ( boolean removeFromAgentInbox )

Get back the delegated files.

If the user is not present this method returns an error.

Parameters
removeFromAgentInbox Optional boolean indicating whether the files are removed from agent inbox after getting back by the user. If this parameter is not specified, the value from the user settings in the absent dialog on the web is used.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0d
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
if (!currentUser.getBackDelegatedFiles(true))
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");
See also
boolean setAbsent(boolean absent, boolean filesDueAbsenceToInfo, Array agents, boolean removeFromAgentInbox, Date from, Date until);
boolean delegateFilesOfAbsentUser()

◆ getCustomProperties()

CustomPropertyIterator SystemUser::getCustomProperties | ( | String | nameFilter = "",
 |  | String | typeFilter = ""
 | ) |  |

Get a CustomPropertyIterator with all CustomProperty of the user.

This method returns a CustomPropertyIterator with the CustomProperty of the user.

Parameters
nameFilter | String value defining an optional filter depending on the name
typeFilter | String value defining an optional filter depending on the type
Returns
CustomPropertyIterator
Since
DOCUMENTS 4.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var itProp = currentUser.getCustomProperties();
for (var prop = itProp.first(); prop; prop = itProp.next())
{
util.out(prop.name + prop.value);
}
See also
Context.findCustomProperties(String filter)
SystemUser.setOrAddCustomProperty(String name, String type, String value)
SystemUser.addCustomProperty(String name, String type, String value)

◆ getIndividualFolders()

FolderIterator SystemUser::getIndividualFolders ( )

Retrieve a list of individual Folders of the Systemuser.

Returns
FolderIterator containing a list of all individual folders.
Since
DOCUMENTS 4.0d
Example:
var currentUser = context.getSystemUser();
if (!currentUser)
throw "currentUser is null";
var folderIter = currentUser.getIndividualFolders();
See also
SystemUser.getPrivateFolder(String folderType)

◆ getLastError()

String SystemUser::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.50b / otrisPORTAL 5.0b
See also
DocFile.getLastError()

◆ getOID()

String SystemUser::getOID ( boolean oidLow = false )

Returns the object-id.

Parameters
oidLow Optional flag:
If true only the id of the Systemuser object (m_oid) will be returned.
If false the id of the Systemuser 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
Since
ELC 3.60c / otrisPORTAL 6.0c
DOCUMENTS 5.0 (new parameter oidLow)

◆ getPrivateFolder()

Folder SystemUser::getPrivateFolder ( String folderType )

Try to retrieve a particular private Folder of the Systemuser.

In addition to the public folders you may define in DOCUMENTS, each DOCUMENTS user has a set of private folders. You might need to access a particular private folder to access its contents, for example.

Parameters
folderType String value defining the kind of private folder you want to access.
You may choose between
  • "individual" individual folder
    Note: This function returns only the first individual folder on the top level. Using SystemUser.getIndividualFolders() to retrieve all individual folders.
  • "favorites" favorites folder
  • "inbox" the user's inbox
  • "sent" the user's sent folder
  • "sendingfinished" user's folder containing files which finished their workflow
  • "inwork" folder containing the files the SystemUser created himself
  • "resubmission" folder containing files with a resubmission defined for the SystemUser
  • "trash" folder containing files the user has deleted
  • "tasks" folder containing all files the user has a task to perform to
  • "lastused" folder containing the files the SystemUser accessed latest, sorted in descending chronological order
  • "introuble" folder containing files which ran into some workflow error. This folder is only available for editors and only if it has been added manually by the administrator.
Returns
Folder object representing the desired folder, null in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b
See also
SystemUser.getIndividualFolders(), SystemUser.getUserdefinedInboxFolders()

◆ getSuperior()

SystemUser SystemUser::getSuperior ( )

Get the SystemUser object representing the superior of the user.

Returns
SystemUser object representing the superior or null if no superior available
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ getUserdefinedInboxFolders()

FolderIterator SystemUser::getUserdefinedInboxFolders ( )

Retrieve a list of userdefined inbox Folders of the Systemuser.

Returns
FolderIterator containing a list of all userdefined inbox folders.
Since
DOCUMENTS 4.0d
Example:
var currentUser = context.getSystemUser();
if (!currentUser)
throw "currentUser is null";
var folderIter = currentUser.getUserdefinedInboxFolders();
See also
SystemUser.getPrivateFolder(String folderType)

◆ hasAccessProfile()

boolean SystemUser::hasAccessProfile ( String profileName )

Retrieve information whether the SystemUser is a member of a particular AccessProfile which is identified by its technical name.

Parameters
profileName String value containing the technical name of an AccessProfile
Returns
true if the SystemUser is a member of the desired profile, otherwise false
Since
ELC 3.50e / otrisPORTAL 5.0e

◆ invalidateAccessProfileCache()

boolean SystemUser::invalidateAccessProfileCache ( )

Invalidates the server sided cache of the access profiles for the SystemUser.

Returns
true if successful, otherwise false
Since
DOCUMENTS 4.0 (HF1)

◆ listAgentFileTypes()

Array SystemUser::listAgentFileTypes ( )

Retrieve a list of file types for them an agent exists.

Returns
Array of strings containing the technical names of the file types.
If the flag 'all filetypes' for a file type agent is set, the array contains only the string "*".
Since
DOCUMENTS 5.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var fileTypes = currentUser.listAgentFileTypes();
if (fileTypes)
{
for (var i=0; i < fileTypes.length; i++)
{
util.out(fileTypes[i]);
}
}
else
util.out("Error: " + currentUser.getLastError());

◆ listFileTypeAgents()

Array SystemUser::listFileTypeAgents ( String fileType )

Retrieve a list of all agents for the desired file type of the user.

Parameters
fileType String containing the technical name of the file type.
Returns
Array of strings containing login names of all agents for the desired file type.
Since
DOCUMENTS 5.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var loginNames = currentUser.listFileTypeAgents("testFileType");
if (loginNames)
{
for (var i=0; i < loginNames.length; i++)
{
util.out(loginNames[i]);
}
}
else
util.out("Error: " + currentUser.getLastError());

◆ notifyFileReturnedFromSending()

boolean SystemUser::notifyFileReturnedFromSending ( boolean notifying = true )

Define whether to notify the user by e-mail of files returned from sending.

Parameters
notifying boolean indicating whether files returned from sending are to be notified to the user. The default value is true.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
if (!currentUser.notifyFileReturnedFromSending(true))
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");

◆ notifyNewFileInInbox()

boolean SystemUser::notifyNewFileInInbox ( boolean notifying = true )

Define whether to notify the user by e-mail of new files in inbox.

Parameters
notifying boolean indicating whether new files in inbox are to be notified to the user. The default value is true.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
if (!currentUser.notifyNewFileInInbox(true))
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");

◆ removeFileTypeAgent()

boolean SystemUser::removeFileTypeAgent ( var fileTypes )

Remove file type agents from the user.

Parameters
fileTypes The desired file types may be passed as follows:
  • String containing the technical name of the desired file type;
  • Array of strings containing the technical names of the desired file types;
  • String constant "*" indicating all file types.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 5.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var fileTypes = new Array();
fileTypes.push("Filetype1");
fileTypes.push("Filetype2");
if (!currentUser.removeFileTypeAgent(fileTypes))
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");

◆ removeFromAccessProfile()

boolean SystemUser::removeFromAccessProfile ( AccessProfile ap )

Clear the SystemUser's membership in the given AccessProfile.

Returns
true if successful, false in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b for PartnerAccounts
DOCUMENTS 4.0b HF1 for Fellows
Note
If the user is already logged in, it is necessary to invalidate the cache of the user s. SystemUser.invalidateAccessProfileCache()

◆ resetSuperior()

boolean SystemUser::resetSuperior ( )

Clear the user's relation to a superior.

Returns
true if successful, false in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ setAbsent()

boolean SystemUser::setAbsent | ( | boolean | absent,
 |  | boolean | filesDueAbsenceToInfo = true,
 |  | string [] | agents = [],
 |  | boolean | removeFromAgentInbox = false,
 |  | Date | from = undefined,
 |  | Date | until = undefined
 | ) |  |

Set a Systemuser absent or present.

If a Systemuser is on holiday with this function it is possible to set the user absent. After his return you can set him present. You can also define one or more agents for the absent user. The agent will get new files for the absent user in substitution. With the agent list you set the agents for the user (you overwrite the existing agents!). With an empty agent list you remove all agents.

Parameters
absent | boolean true, if the user should be set absent, false, if the user is present
filesDueAbsenceToInfo | boolean set to true, if the user should get the files due absence to info in his inbox
agents | Array with the login-names of the agents
removeFromAgentInbox | Optional boolean indicating whether the files are removed from agent inbox after getting back by the user. If this parameter is not specified, the value from the user settings in the absent dialog on the web is used.
from | Optional Date object specifying when the absence begins.
until | Optional Date object specifying when the absence ends.
Returns
true if correct, otherwise false an error message describing the error with getLastError().
Since
ELC 3.60g / otrisPORTAL 6.0g
DOCUMENTS 4.0d (Option: removeFromAgentInbox)
DOCUMENTS 5.0a (Option: from and until)
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
// set user absent
var agents = new Array();
agents.push("oppen");
agents.push("buch");
var from = new Date();
var until = context.addTimeInterval(from, 3, "days", false);
if (!currentUser.setAbsent(true, false, agents, true, from, until))
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");
// set user present
if (!currentUser.setAbsent(false))
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");
See also
boolean setAbsentMail(boolean sendMail, String message)
boolean delegateFilesOfAbsentUser()
boolean getBackDelegatedFiles(boolean removeFromAgentInbox)
SystemUserIterator getAgents()

◆ setAbsentMail()

boolean SystemUser::setAbsentMail | ( | boolean | sendMail,
 |  | String | message = ""
 | ) |  |

Define if an absence mail for the absent user will be sent to the sender of the file.

If a Systemuser is absent and get a file in the inbox, an absence mail to the sender of this file can be send.

Parameters
sendMail | boolean true, if an absent mail should be sent, otherwise false
message | String with an additional e-mail message from the absent user
Returns
true if succeeded, otherwise false - an error message describing the error with getLastError().
Since
ELC 3.60g / otrisPORTAL 6.0g
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
if (!currentUser.setAbsentMail(true, "I will be back on 12/31 2009"))
util.out("Error: " + currentUser.getLastError());
else
util.out("OK.");
See also
boolean setAbsent(boolean absent, boolean filesDueAbsenceToInfo, Array agents, boolean removeFromAgentInbox, Date from, Date until);
boolean delegateFilesOfAbsentUser()
SystemUserIterator getAgents()

◆ setAccessProfiles()

boolean SystemUser::setAccessProfiles | ( | var | apNames1,
 |  | var | apNames2,
 |  |  | ...
 | ) |  |

Set the AccessProfiles for an user.

All existing AccessProfiles will be removed and the AccessProfiles from the parameters will be set.

Parameters
apNames1 | String or Array with the names of the AccessProfiles
apNames2 | String or Array with the names of the AccessProfiles
...
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0c HF2
Example:
var val1 = ["AP1", "AP2"];
var val2 = "AP3\r\nAP4";
var user = context.getSystemUser();
if (!user.setAccessProfiles(val1, val2))
throw user.getLastError();

◆ setAttribute()

boolean SystemUser::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the SystemUser to the desired value.

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ setEasywareAuthentication()

boolean SystemUser::setEasywareAuthentication ( boolean value )

Turn EASYWARE Authentication on or off.

Parameters
value boolean true to turn authentication on false to turn it off.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0c HF2

◆ setOrAddCustomProperty()

CustomProperty SystemUser::setOrAddCustomProperty | ( | String | name,
 |  | String | type,
 |  | String | value
 | ) |  |

Creates a new CustomProperty or modifies a CustomProperty according the name and type for the user.

This method creates or modifies a unique CustomProperty for the user. The combination of the name and the type make the CustomProperty unique for the user.

Parameters
name | String value defining the name
type | String value defining the type
value | String value defining the value
Returns
CustomProperty
Since
DOCUMENTS 4.0a
Example:
var currentUser = context.getSystemUser();
if (!currentUser) throw "currentUser is NULL";
var custProp = currentUser.setOrAddCustomProperty("superior", "string", "oppen");
if (!custProp)
util.out(currentUser.getLastError());
See also
SystemUser.getCustomProperties(String nameFilter, String typeFilter)
SystemUser.addCustomProperty(String name, String type, String value)

◆ setPassword()

boolean SystemUser::setPassword ( String newPwd )

Set the password of the user represented by the SystemUser object to the desired new value.

Parameters
newPwd String containing the plaintext new password
Returns
true if successful, false in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ setSuperior()

boolean SystemUser::setSuperior ( SystemUser sup )

Set the SystemUser object representing the superior of the user to the desired object.

Parameters
sup Systemuser object representing the new superior of the user
Returns
true if successful, false in case of any error
Since
ELC 3.50b / otrisPORTAL 5.0b

Member Data Documentation

◆ ANNOTATIONS

int SystemUser::ANNOTATIONS

Annotations right flag in the access mask.

Returns
32-bit value in which the bit for the annotation right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ ARCHIVE

int SystemUser::ARCHIVE

Archive right flag in the access mask.

The bit that specifies the right to archive files.

Returns
32-bit value in which the bit for the archive right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ CHANGE_TYPE

int SystemUser::CHANGE_TYPE

Change filetype right flag in the access mask.

The bit that specifies the right to change the filetype of a file.

Returns
32-bit value in which the bit for the change filetype right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ CHANGE_WORKFLOW

int SystemUser::CHANGE_WORKFLOW

Change workflow right flag in the access mask.

The bit that specifies the right to change a workflow assigned to a file.

Returns
32-bit value in which the bit for the change workflow right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ COPY

int SystemUser::COPY

Copy right flag in the access mask.

The bit that specifies the right to copy files to a personal or public folder.

Returns
32-bit value in which the bit for the copy right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ CREATE

int SystemUser::CREATE

Create right flag in the access mask.

The bit that specifies the right to create new files.

Returns
32-bit value in which the bit for the create right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ CREATE_WORKFLOW

int SystemUser::CREATE_WORKFLOW

Create workflow right flag in the access mask.

Returns
32-bit value in which the bit for the create workflow right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ email

String SystemUser::email

String value containing the email address of the SystemUser.

Returns
String value containing the SystemUser's email address
Since
DOCUMENTS 5.0a

◆ firstName

String SystemUser::firstName

String value containing the first name of the SystemUser.

Returns
String value containing the SystemUser's first name.
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ lastName

String SystemUser::lastName

String value containing the last name of the SystemUser.

Returns
String value containing the SystemUser's last name.
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ login

String SystemUser::login

String value containing the unique login name of the SystemUser.

Returns
String value containing the SystemUser's login.
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ MAIL

int SystemUser::MAIL

Mail right flag in the access mask.

The bit that specifies the right to send files via an e-mail system.

Returns
32-bit value in which the bit for the mail right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ MOVE

int SystemUser::MOVE

Move right flag in the access mask.

The bit that specifies the right to move files to a personal or public folder.

Returns
32-bit value in which the bit for the move right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ PDF

int SystemUser::PDF

Create PDF right flag in the access mask.

The bit that specifies the right to create a PDF of a file.

Returns
32-bit value in which the bit for the create PDF right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ propCache

PropertyCache SystemUser::propCache

Access to the property cache of the SystemUser.

Returns
PropertyCache object of the SystemUser.
Example:
var user = context.getSystemUser();
if (!user.propCache.hasProperty("Contacts"))
{
util.out("Creating cache");
user.propCache.Contacts = ["Peter", "Paul", "Marry"];
}
Since
DOCUMENTS 5.0
See also
PropertyCache, AccessProfile.propCache

◆ READ

int SystemUser::READ

Read right flag in the access mask.

The bit that specifies the right to see files.

Returns
32-bit value in which the bit for the read right is set.
Note
the access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ REMOVE

int SystemUser::REMOVE

Remove right flag in the access mask.

The bit that specifies the right to delete files.

Returns
32-bit value in which the bit for the remove right is set.
Note
the access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ START_WORKFLOW

int SystemUser::START_WORKFLOW

Start workflow flag in the access mask.

Returns
32-bit value in which the bit for the start workflow right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ VERSION

int SystemUser::VERSION

Versioning right flag in the access mask.

Returns
32-bit value in which the bit for the versioning right is set.
Note
The access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)

◆ WRITE

int SystemUser::WRITE

Write right flag in the access mask.

The bit that specifies the right for changing index fields or documents in files.

Returns
32-bit value in which the bit for the write right is set.
Note
the access mask is returned by SystemUser.getAccess(DocFile)
See also
SystemUser.getAccess(DocFile)


DOCUMENTS 5 - PortalScripting API: Member List

SystemUser Member List

This is the complete list of members for SystemUser, including all inherited members.

addCustomProperty(String name, String type, String value) | SystemUser
addFileTypeAgent(var fileTypes, Array loginNames) | SystemUser
addFileTypeAgentScript(var fileTypes, String scriptName) | SystemUser
addToAccessProfile(AccessProfile ap) | SystemUser
ANNOTATIONS | SystemUser
ARCHIVE | SystemUser
CHANGE_TYPE | SystemUser
CHANGE_WORKFLOW | SystemUser
checkPassword(String passwd) | SystemUser
COPY | SystemUser
CREATE | SystemUser
CREATE_WORKFLOW | SystemUser
delegateFilesOfAbsentUser() | SystemUser
email | SystemUser
firstName | SystemUser
getAccess(DocFile docFile) | SystemUser
getAccessProfiles() | SystemUser
getAgents() | SystemUser
getAllFolders() | SystemUser
getAttribute(String attribute) | SystemUser
getBackDelegatedFiles(boolean removeFromAgentInbox) | SystemUser
getCustomProperties(String nameFilter="", String typeFilter="") | SystemUser
getIndividualFolders() | SystemUser
getLastError() | SystemUser
getOID(boolean oidLow=false) | SystemUser
getPrivateFolder(String folderType) | SystemUser
getSuperior() | SystemUser
getUserdefinedInboxFolders() | SystemUser
hasAccessProfile(String profileName) | SystemUser
invalidateAccessProfileCache() | SystemUser
lastName | SystemUser
listAgentFileTypes() | SystemUser
listFileTypeAgents(String fileType) | SystemUser
login | SystemUser
MAIL | SystemUser
MOVE | SystemUser
notifyFileReturnedFromSending(boolean notifying=true) | SystemUser
notifyNewFileInInbox(boolean notifying=true) | SystemUser
PDF | SystemUser
propCache | SystemUser
READ | SystemUser
REMOVE | SystemUser
removeFileTypeAgent(var fileTypes) | SystemUser
removeFromAccessProfile(AccessProfile ap) | SystemUser
resetSuperior() | SystemUser
setAbsent(boolean absent, boolean filesDueAbsenceToInfo=true, string[] agents=[], boolean removeFromAgentInbox=false, Date from=undefined, Date until=undefined) | SystemUser
setAbsentMail(boolean sendMail, String message="") | SystemUser
setAccessProfiles(var apNames1, var apNames2,...) | SystemUser
setAttribute(String attribute, String value) | SystemUser
setEasywareAuthentication(boolean value) | SystemUser
setOrAddCustomProperty(String name, String type, String value) | SystemUser
setPassword(String newPwd) | SystemUser
setSuperior(SystemUser sup) | SystemUser
START_WORKFLOW | SystemUser
VERSION | SystemUser
WRITE | SystemUser


DOCUMENTS 5 - PortalScripting API: SystemUserIterator Class Reference

Public Member Functions | List of all members
SystemUserIterator Class Reference

The SystemUserIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS users by scripting means. More...

Public Member Functions

SystemUser first ()
Retrieve the first SystemUser object in the SystemUserIterator. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
SystemUser next ()
Retrieve the next SystemUser object in the SystemUserIterator. More...
int | size ()
Get the amount of SystemUser objects in the SystemUserIterator. More...

Detailed Description

The SystemUserIterator class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS users by scripting means.

The objects of this class represent lists of Systemuser objects and allow to loop through such a list of users.

Since
ELC 3.50b / otrisPORTAL 5.0b

Member Function Documentation

◆ first()

SystemUser SystemUserIterator::first ( )

Retrieve the first SystemUser object in the SystemUserIterator.

Returns
SystemUser or null in case of an empty SystemUserIterator
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ getLastError()

String SystemUserIterator::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.50b / otrisPORTAL 5.0b
See also
DocFile.getLastError()

◆ next()

SystemUser SystemUserIterator::next ( )

Retrieve the next SystemUser object in the SystemUserIterator.

Returns
SystemUser or null if end of SystemUserIterator is reached.
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ size()

int SystemUserIterator::size ( )

Get the amount of SystemUser objects in the SystemUserIterator.

Returns
integer value with the amount of SystemUser objects in the SystemUserIterator
Since
ELC 3.50b / otrisPORTAL 5.0b


DOCUMENTS 5 - PortalScripting API: Member List

SystemUserIterator Member List

This is the complete list of members for SystemUserIterator, including all inherited members.

first() | SystemUserIterator
getLastError() | SystemUserIterator
next() | SystemUserIterator
size() | SystemUserIterator


DOCUMENTS 5 - PortalScripting API: UserAction Class Reference

Public Member Functions | Public Attributes | List of all members
UserAction Class Reference

The UserAction class represents the user-defined action of DOCUMENTS. More...

Public Member Functions

boolean | addToFolder (Folder folder)
Add the user action to a Folder. More...
String | getLastError ()
Get the description of the last error that occurred. More...
String | getOID (boolean oidLow=false)
Returns the object-id. More...
int | getPosition ()
Retrieve the position of the user action within the user-defined action list of the parent object. More...
boolean | remove ()
Remove the user action from the parent object. More...
boolean | setContext (String context)
Set the context for a user action of type JSP. More...
boolean | setCreateDefaultWorkflow (boolean createDefaultWorkflow)
Set the flag whether to create the default workflow for a user action of type NewFile. More...
boolean | setFileTypeForNewFile (String fileType)
Set the file type for a user action of type NewFile. More...
boolean | setPortalScript (String scriptName)
Set the portal script for a user action of type PortalScript. More...
boolean | setPosition (int position)
Place the user action at the given position in the user-defined action list of the parent object. More...
UserAction | UserAction (String name, String label="", String widget="Button", String type="NewFile", String scope="Unrestricted")
Create a new instance of the UserAction class. More...

Public Attributes

String | label
The entire label defined for the UserAction object. More...
String | name
The technical name of the UserAction object. More...
String | scope
The scope of the UserAction object. More...
String | type
The type of the UserAction object. More...
String | widget
The widget identifier of the UserAction object. More...

Detailed Description

The UserAction class represents the user-defined action of DOCUMENTS.

Since
DOCUMENTS 4.0d
Example:
var folder = context.createFolder("test", "public");
var action = new UserAction("testAction");
action.widget = "DropdownList";
action.setFileTypeForNewFile("FileType1");
if (!action.addToFolder(folder))
util.out(action.getLastError());

Constructor & Destructor Documentation

◆ UserAction()

UserAction UserAction::UserAction | ( | String | name,
 |  | String | label = "",
 |  | String | widget = "Button",
 |  | String | type = "NewFile",
 |  | String | scope = "Unrestricted"
 | ) |  |

Create a new instance of the UserAction class.

Parameters
name | String value containing the desired user action name.
label | String value containing the desired user action label.
widget | String value containing the desired user action widget.
type | String value containing the desired user action type.
scope | String value containting the desired user action scope.
Since
DOCUMENTS 4.0d
Example:
var action = new UserAction("testAction", "de:Aktion;en:Action", "DropdownList", "PortalScript", "ProcessesOnly");
See also
UserAction.widget, UserAction.type, UserAction.scope

Member Function Documentation

◆ addToFolder()

boolean UserAction::addToFolder ( Folder folder )

Add the user action to a Folder.

Parameters
folder Folder object representing the desired Folder.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var it = context.getFoldersByName("testFolder");
var folder = it.first();
if (folder)
{
var action = new UserAction("testAction");
if (action)
{
if (!action.addToFolder(folder))
util.out(action.getLastError());
}
}

◆ getLastError()

String UserAction::getLastError ( )

Get the description of the last error that occurred.

Returns
Text of the last error as String
Since
DOCUMENTS 4.0d

◆ getOID()

String UserAction::getOID ( boolean oidLow = false )

Returns the object-id.

Parameters
oidLow Optional flag:
If true only the id of the user action object (m_oid) will be returned.
If false the id of the user action 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 an empty string in case the user action has not yet been added to a proper parent object.
Since
DOCUMENTS 4.0d
DOCUMENTS 5.0 (new parameter oidLow)

◆ getPosition()

int UserAction::getPosition ( )

Retrieve the position of the user action within the user-defined action list of the parent object.

Returns
The zero-based position of the user action as integer or -1 in case of any error.
Since
DOCUMENTS 4.0d
Example:
var it = context.getFoldersByName("testFolder");
var folder = it.first();
if (folder)
{
var action = folder.getActionByName("testAction");
if (action)
util.out(action.getPosition());
}

◆ remove()

boolean UserAction::remove ( )

Remove the user action from the parent object.

Note
If the user action has not yet been added to a proper parent object, this function does nothing.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var it = context.getFoldersByName("testFolder");
var folder = it.first();
if (folder)
{
var action = folder.getActionByName("testAction");
if (action)
action.remove();
}

◆ setContext()

boolean UserAction::setContext ( String context )

Set the context for a user action of type JSP.

Parameters
context String containing the desired context.
Returns
true if successful, false in case of any error
Note
This function is only available for a user action of type JSP.
Since
DOCUMENTS 4.0d
Example:
var action = new UserAction("testAction");
action.type = "JSP";
if (!action.setContext("myContext"))
util.out(action.getLastError());

◆ setCreateDefaultWorkflow()

boolean UserAction::setCreateDefaultWorkflow ( boolean createDefaultWorkflow )

Set the flag whether to create the default workflow for a user action of type NewFile.

Parameters
createDefaultWorkflow Flag indicating whether to create the default workflow for a new file.
Returns
true if successful, false in case of any error
Note
This function is only available for a user action of type NewFile.
Since
DOCUMENTS 4.0d
Example:
var action = new UserAction("testAction");
if (!action.setCreateDefaultWorkflow(false))
util.out(action.getLastError());

◆ setFileTypeForNewFile()

boolean UserAction::setFileTypeForNewFile ( String fileType )

Set the file type for a user action of type NewFile.

Parameters
fileType The technical name of the desired file type; use empty string ('') if you want to remove the associated file type.
Returns
true if successful, false in case of any error
Note
This function is only available for a user action of type NewFile.
Since
DOCUMENTS 4.0d
Example:
var action = new UserAction("testAction");
if (!action.setFileTypeForNewFile("Filetype1"))
util.out(action.getLastError());
// You can remove the file type as follows:
action.setFileTypeForNewFile('');

◆ setPortalScript()

boolean UserAction::setPortalScript ( String scriptName )

Set the portal script for a user action of type PortalScript.

Parameters
scriptName The name of the desired portal script; use empty string ('') if you want to remove the associated script.
Returns
true if successful, false in case of any error
Note
This function is only available for a user action of type PortalScript.
Since
DOCUMENTS 4.0d
Example:
var action = new UserAction("testAction");
action.type = "PortalScript";
if (!action.setPortalScript("testScript"))
util.out(action.getLastError());
// You can remove the script as follows:
action.setPortalScript('');

◆ setPosition()

boolean UserAction::setPosition ( int position )

Place the user action at the given position in the user-defined action list of the parent object.

Note
0 at the beginning and -1 at the end.
Parameters
position The 0-based position for the user action.
Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0d
Example:
var it = context.getFoldersByName("testFolder");
var folder = it.first();
if (folder)
{
var action = folder.getActionByName("testAction");
if (action)
action.setPosition(-1);
}

Member Data Documentation

◆ label

String UserAction::label

The entire label defined for the UserAction object.

Returns
String containing the entire label.
Since
DOCUMENTS 4.0d

◆ name

String UserAction::name

The technical name of the UserAction object.

Returns
String containing the technical name of the UserAction.
Since
DOCUMENTS 4.0d

◆ scope

String UserAction::scope

The scope of the UserAction object.

Returns
String containing the scope. There are three possible scopes available:
  • Unrestricted
  • ProcessesOnly
  • EasArchiveOnly
Since
DOCUMENTS 4.0d

◆ type

String UserAction::type

The type of the UserAction object.

Returns
String containing the type. There are four possible types available:
  • NewFile
  • PortalScript
  • JSP
  • Gadget
Since
DOCUMENTS 4.0d

◆ widget

String UserAction::widget

The widget identifier of the UserAction object.

Returns
String containing the widget identifier. There are two possible widget identifiers available:
  • Button
  • DropdownList
Since
DOCUMENTS 4.0d


DOCUMENTS 5 - PortalScripting API: Member List

UserAction Member List

This is the complete list of members for UserAction, including all inherited members.

addToFolder(Folder folder) | UserAction
getLastError() | UserAction
getOID(boolean oidLow=false) | UserAction
getPosition() | UserAction
label | UserAction
name | UserAction
remove() | UserAction
scope | UserAction
setContext(String context) | UserAction
setCreateDefaultWorkflow(boolean createDefaultWorkflow) | UserAction
setFileTypeForNewFile(String fileType) | UserAction
setPortalScript(String scriptName) | UserAction
setPosition(int position) | UserAction
type | UserAction
UserAction(String name, String label="", String widget="Button", String type="NewFile", String scope="Unrestricted") | UserAction
widget | UserAction


DOCUMENTS 5 - PortalScripting API: Util Class Reference

Public Member Functions | Public Attributes | List of all members
Util Class Reference

The Util class supports some functions that do not need any user or file context. More...

Public Member Functions

var | base64Decode (String value, boolean returnArray=true)
Decodes a base64 string and returns a string or byte-array. More...
String | base64Encode (var value, boolean urlStyle=false)
Encodes a byte-array or string to base64 and returns the base 64 string. More...
void | beep (int frequency, int duration)
Plays a beep sound at the PortalServer's system. More...
String | concatPDF (Array pdfFilePaths, boolean deleteSinglePdfs=false)

Concatenate the given PDFs together into one PDF. More...
String | convertBlobToPDF (String sourceFilePath)
Convert a file to a PDF file and return the path in the file system. More...
number | convertDateToExcelDate (Date timeStamp)
Convert a Date object to an Excel numeric date format. More...
String | convertDateToString (Date timeStamp, String format)
Convert a Date object representing a date into a String. More...
Date | convertStringToDate (String dateOrTimeStamp, String format)
Convert a String representing a date into a Date object. More...
String | cryptPassword (String pwPlain)
Encrypt a plain password into an MD5 hash. More...
String | decodeUrlCompatible (String encodedParam)
Decode URL parameter from DOCUMENTS Urls. More...
String | decryptString (String input)
Decrypts a String value hat was encrypted with the method Util.encryptString(String input) More...
String | deleteFile (String filePath)
Delete a file (file system object) at the PortalServer's system. More...
String | encodeUrlCompatible (String param)
Encode URL parameter for DOCUMENTS Urls. More...
String | encryptString (String input)
Encrypts a String value with the AES 256 CBC algorithm for symmetric encryption/decryption. More...
String | fileCopy (String sourceFilePath, String targetFilePath)
Copy a file (file system object) at the PortalServer's system. More...
String | fileMove (String sourceFilePath, String targetFilePath)
Move a file (file system object) at the PortalServer's system from a source file path to the target file path. More...
Int | fileSize (String filePath)
Retrieve the filesize of a file (file system object) at the PortalServer's system. More...
String | generateChecksum (String input)

Creates a MD5 checksum for the String value More...
String | getDir (String dirname, Array files, Array subDirs)
Retrieving files and subdirectories of a specified directory. More...
String | getEnvironment (String variableName)
Reads an environment variable of the PortalServer's system. More...
String | getFileContentAsString (String filePath)
Get the content of a file at the PortalServer's system as string in base64 format. More...
String | getQuoted (String input)
Returns the input string enclosed in either double or single quotation marks. More...
String | getSourceLineInfo ()
Retrieve the scriptName with the current line no of this methed. More...
String | getTmpPath ()
Get the path to the temporary directory on the Portalserver. More...
String | getUniqueId ()
Get a unique id from the system. More...
number | getUsedPrivateBytes ()
Returns the current usage of private bytes memory of the documensserver process. More...
String | hash (String filePath, String hashfunction)
Generate the hash value for a file using the given hash function. More...
String | hmac (String hashfunction, String key, String message, Boolean rawOutput=false)
Generates a hash-based message authentication code (hmac) of a message string using a secret key. More...
boolean | isEncryptedBlob (String blobFilePath)
Checks, if the current blob is encrypted (Repository encryption) or not. More...
number | length_u (String value)
Returns the number of characters of a UTF-8 string. More...
log (String output)
Log a String to the DOCUMENTS server window. More...
String | makeFullDir (String dirPath)
Creates a directory with subdirectories at the PortalServer's file system. More...
String | makeGACLValue (var val1, var val2,...)
Makes a valid GACL value from the parameters. More...
String | makeHTML (String val, boolean isUTF8=false)
Masks all HTML-elements of a String. More...
out (String output)
Output a String to the Portalserver window. More...
String | prepareJSON ()
Converts JSON-Strings with Source Code entities e.g. More...
number | searchInArray (Array theArray, String searchedString, number occurence=1)
Search for a String in an Array. More...
String | sha256 (String message)
Generates the SHA256 hash of any string. More...
string | sign (string algorithm, string privateKeyPEM, string pkPassword, var payload, boolean urlStyle=false)

Create a digital signature. More...
void | sleep (number duration)
Let the PortalScript sleep for a defined duration. More...
String | substr_u (String value, int startIndex, int length)
Returns a substring of a UTF-8 string. More...
String | transcode (String nameSourceEncoding, String text, String nameTargetEncoding)
Transcode a String from encoding a to encoding b. More...
boolean | unlinkFile (String filePath)
Delete a physical file on the server's file system. More...

Public Attributes

number | buildNo
Build version number of the PortalServer. More...
String | DB
Database using by the PortalServer. More...
String | memoryModel
Memory model of the PortalServer. More...
number | version
Main version number of the PortalServer. More...

Detailed Description

The Util class supports some functions that do not need any user or file context.

These functions allow customizable Date/String conversions and other useful stuff. There is exactly ONE implicit object of the class Util which is named util.

Note
It is not possible to create objects of the class Util. There are no properties in this class, it supports only the help functions as documented below.

Member Function Documentation

◆ base64Decode()

var Util::base64Decode | ( | String | value,
 |  | boolean | returnArray = true
 | ) |  |

Decodes a base64 string and returns a string or byte-array.

Parameters
value | String to decode
returnArray | boolean as an optional parameter to define if the return value must be a byte-array or string (default)
Returns
decoded string or byte-array
Since
DOCUMENTS 4.0c HF1
Example:
var b64Str = util.base64Encode("Hello World");
util.out(b64Str); // SGVsbG8gV29ybGQ=
var str = util.base64Decode(b64Str);
util.out(str); // Hello World
var byteArr = util.base64Decode(b64Str, true);
util.out(byteArr); // 72,101,108,108,111,32,87,111,114,108,100
b64Str = util.base64Encode(byteArr);
util.out(b64Str); // SGVsbG8gV29ybGQ=

◆ base64Encode()

String Util::base64Encode | ( | var | value,
 |  | boolean | urlStyle = false
 | ) |  |

Encodes a byte-array or string to base64 and returns the base 64 string.

Parameters
value | String or byte-array to encode
urlStyle | optional boolean flag to request Base64URL encoding instead of standard Base64 encoding
Returns
base64 encoded string
Remarks
The URL style uses the characters '-' and '_' in place of '+' and '/', and it does not allow padding characters ('='). base64Decode() does actually not support this style.
Since
DOCUMENTS 4.0c HF1; urlStyle was added in 5.0d HF2.
Example:
var b64Str = util.base64Encode("Hello World");
util.out(b64Str); // SGVsbG8gV29ybGQ=
var str = util.base64Decode(b64Str);
util.out(str); // Hello World
var byteArr = util.base64Decode(b64Str, true);
util.out(byteArr); // 72,101,108,108,111,32,87,111,114,108,100
b64Str = util.base64Encode(byteArr);
util.out(b64Str); // SGVsbG8gV29ybGQ=

◆ beep()

void Util::beep | ( | int | frequency,
 |  | int | duration
 | ) |  |

Plays a beep sound at the PortalServer's system.

For testing purposes a beep sound can be played at the server

Parameters
frequency | int with the frequency in hertz
duration | int with the length of the sound in milliseconds (ms)
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
util.beep(1250, 3000);

◆ concatPDF()

String Util::concatPDF | ( | Array | pdfFilePaths,
 |  | boolean | deleteSinglePdfs = false
 | ) |  |

Concatenate the given PDFs together into one PDF.

Parameters
pdfFilePaths | Array containing the file paths of PDFs to be concatenated.
deleteSinglePdfs | Optional boolean value to decide whether to delete the single PDFs on the server's filesystem after concatenating.
Returns
String with file path of the PDF, an empty string in case of any error.
Since
DOCUMENTS 4.0c
Example:
var arr = ["C:\\temp\\number1.pdf", "C:\\temp\\number2.pdf"];
var filePath = util.concatPDF(arr, false);
util.out("PDF file path: " + filePath);

◆ convertBlobToPDF()

String Util::convertBlobToPDF ( String sourceFilePath )

Convert a file to a PDF file and return the path in the file system.

The different file types require the appropriate PDF filter programs to be installed and configured in DOCUMENTS.

Parameters
sourceFilePath String containing the path of the file to be converted.
Returns
String with file path of the PDF, an empty string in case of any error.
Since
DOCUMENTS 4.0d HF3
Example:
var pathPdfFile = util.convertBlobToPDF("C:\\tmp\\testFile.doc");
util.out(pathPdfFile);

◆ convertDateToExcelDate()

number Util::convertDateToExcelDate ( Date timeStamp )

Convert a Date object to an Excel numeric date format.

Excel stores timestamp as a double value. This value exists by two parts. The pre-decimal position is the amount of days since 01.01.1900. The fractional part is the percential time in day.

  • e.g. 10.01.1900 12:00 => 10.5
  • e.g. 19.10.2018 14:30: => 43392.6042

A date before 01.03.1900 can not be converted. The method will return -1.0.

Parameters
timeStamp Date object representing the desired date
Returns
double as excel date representation
Since
DOCUMENTS 5.0e
Example:
var now = new Date();
var excelDate = util.convertDateToExcelDate(now);
if (excelDate < 0.0)
util.out("I can only convert dates that are after 01.03.1900")
else
util.out(excelDate + " is now a numeric value");

◆ convertDateToString()

String Util::convertDateToString | ( | Date | timeStamp,
 |  | String | format
 | ) |  |

Convert a Date object representing a date into a String.

The output String may have any format you like. The second parameter defines the format to configure which part of the date String should match the according properties of the Date object.

Parameters
timeStamp Date object representing the desired date
format String defining the date format of the output String, e.g. "dd.mm.yyyy".
The possible format parts are:
  • dd = two digit day
  • mm = two digit month
  • yy = two digit year
  • yyyy = four digit year
  • HH = two digit hour (24 hour format)
  • MM = two digit minute
  • SS = two digit second
Special formats:
  • @date = @yyyymmdd (locale independant format for filter in a FileResultset, HitResultset)
  • @timestamp = @yyyymmddHHMMSS (locale independant format for filter in a FileResultset, HitResultset)
Returns
String representing the desired date
Since
ELC 3.50e / otrisPORTAL 5.0e
DOCUMENTS 5.0a (new: Special formats @date and @timestamp)
Example:
var format = "dd.mm.yyyy HH:MM";
var now = new Date();
util.out(util.convertDateToString(now, format));
See also
Util.convertStringToDate(String dateOrTimeStamp, String format)
Context.convertDateToString(Date timeStamp, String locale)

◆ convertStringToDate()

Date Util::convertStringToDate | ( | String | dateOrTimeStamp,
 |  | String | format
 | ) |  |

Convert a String representing a date into a Date object.

The String may contain a date or timestamp in any date format you like. The second parameter defines the format to configure which part of the date String should match the according properties of the Date object.

Parameters
dateOrTimeStamp String representing a date, e.g. "19.09.1974"
format String defining the date format of the input String, e.g. "dd.mm.yyyy".
The possible format parts are:
  • dd = two digit day
  • mm = two digit month
  • yy = two digit year
  • yyyy = four digit year
  • HH = two digit hour (24 hour format)
  • MM = two digit minute
  • SS = two digit second
Special formats:
  • @date = @yyyymmdd (locale independant format for filter in a FileResultset, HitResultset)
  • @timestamp = @yyyymmddHHMMSS (locale independant format for filter in a FileResultset, HitResultset)
Returns
Date object representing the desired date
Since
ELC 3.50e / otrisPORTAL 5.0e
DOCUMENTS 5.0a (new: Special formats @date and @timestamp)
Example:
var format = "dd.mm.yyyy HH:MM";
var dateString = "19.09.1974";
var birthDay = util.convertStringToDate(dateString, format);
See also
Util.convertDateToString(Date timeStamp, String format)

◆ cryptPassword()

String Util::cryptPassword ( String pwPlain )

Encrypt a plain password into an MD5 hash.

Parameters
pwPlain String containing the plain password
Returns
String containing the encrypted password
Since
ELC 3.50o / otrisPORTAL 5.0o
Example:
var cryptPW = util.cryptPassword("Hello World");
util.out(cryptPW);

◆ decodeUrlCompatible()

String Util::decodeUrlCompatible ( String encodedParam )

Decode URL parameter from DOCUMENTS Urls.

Parameters
encodedParam String containing the encoded URL param
Returns
String with decoded URL param.
Example:
// URL with an archive key
var encUrl = "http://localhost:8080/documents/UserLoginSuccessAction.act;cnvid=n0RIshUTRnOH3qAn?
pri=easyhr&lang=de#fi_96:3020/
id_{ehrmEmployeeDocument$EAstore2$HMUnit$DNDefault$CPInstance$DNDefault$CPPool$DNAdaptive
$CPPool$DNAdaptive02$CPDocument$DNADAPTIVE$CO060C8A9C3A1811E6B75A000C29E0A93B}
/ri_FileCover/di_easyhrdc0000000000000497";
var decUrl = util.decodeUrlCompatible(encUrl);
decUrl == "http://localhost:8080/documents/UserLoginSuccessAction.act;cnvid=n0RIshUTRnOH3qAn
?pri=easyhr&lang=de#fi_96:3020/
id_{ehrmEmployeeDocument@store2|Unit=Default/Instance=Default/Pool=Adaptive/Pool=
Adaptive02/Document=ADAPTIVE.060C8A9C3A1811E6B75A000C29E0A93B}
/ri_FileCover/di_easyhrdc0000000000000497";
See also
Util.encodeUrlCompatible(String param)
Since
DOCUMENTS 5.0a

◆ decryptString()

String Util::decryptString ( String input )

Decrypts a String value hat was encrypted with the method Util.encryptString(String input)

Parameters
input The string that will be decrypted
Returns
String decrypted value
Since
DOCUMENTS 5.0b
Example:
var text = "I'm a secret password";
var encryptedText = util.encryptString(text);
util.out(encryptedText); // NABPIGCGBHEBBOMECMJHDBHIIHOCDNOMODEILCABDKOLJBMFBKDDOFDABNAMCLJC
var decryptedText = util.decryptString(encryptedText);
util.out(decryptedText); // I'm a secret password
See also
Util.encryptString(String input);

◆ deleteFile()

String Util::deleteFile ( String filePath )

Delete a file (file system object) at the PortalServer's system.

This functions provides a simple delete method for files on the server's file system.

Parameters
filePath String with the file path
Returns
empty String if successful, the error message in case of any error
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
var errMsg = util.deleteFile("c:\\Test.log");
if (errMsg.length > 0)
util.out(errMsg);
else
util.out("Ok.");

◆ encodeUrlCompatible()

String Util::encodeUrlCompatible ( String param )

Encode URL parameter for DOCUMENTS Urls.

Some parameters in DOCUMENTS urls must be encoded. E.g. the archive keys can contain invalid characters like / etc.

Parameters
param String containing the value to encode
Returns
String with encoded value.
Example:
// URL with an archive key
var url = "http://localhost:8080/documents/UserLoginSuccessAction.act;cnvid=n0RIshUTRnOH3qAn?
pri=easyhr&lang=de#fi_96:3020/
id_{ehrmEmployeeDocument@store2|Unit=Default/Instance=Default/Pool=Adaptive/Pool=
Adaptive02/Document=ADAPTIVE.060C8A9C3A1811E6B75A000C29E0A93B}
/ri_FileCover/di_easyhrdc0000000000000497";
// The archive key is the value between id_{ }
// "ehrmEmployeeDocument@store2|Unit=Default/Instance=Default/Pool=
// Adaptive/Pool=Adaptive02/Document=ADAPTIVE.060C8A9C3A1811E6B75A000C29E0A93B"
// this key must be encoded
var encUrl = encodeURL(url);
encUrl == "http://localhost:8080/documents/UserLoginSuccessAction.act;cnvid=n0RIshUTRnOH3qAn?
pri=easyhr&lang=de#fi_96:3020/
id_{ehrmEmployeeDocument$EAstore2$HMUnit$DNDefault$CPInstance$DNDefault$CPPool$DNAdaptive
$CPPool$DNAdaptive02$CPDocument$DNADAPTIVE$CO060C8A9C3A1811E6B75A000C29E0A93B}
/ri_FileCover/di_easyhrdc0000000000000497";
function encodeURL(url)
{
// RegEx to split the url in it's parts
var reg = /(.*id_{)(.*)(}.*)/
if (!completeURL.match(reg))
throw "unable to encode";
var part1 = RegExp.$1;
var partKey = RegExp.$2;
var part3 = RegExp.$3;
return encoded = part1 + util.encodeUrlCompatible(partKey) + part3;
}
See also
Util.decodeUrlCompatible(String encodedParam)
Since
DOCUMENTS 5.0a

◆ encryptString()

String Util::encryptString ( String input )

Encrypts a String value with the AES 256 CBC algorithm for symmetric encryption/decryption.

The length of the input String is limited to 1024 bytes. The encrypted value depends on the principal name. Usage is e.g. storing of passwords in the database for authorization against 3rd party web services.

Parameters
input The string that will be encrypted
Returns
String encrypted value
Since
DOCUMENTS 5.0b
Example:
var text = "I'm a secret password";
var encryptedText = util.encryptString(text);
util.out(encryptedText); // NABPIGCGBHEBBOMECMJHDBHIIHOCDNOMODEILCABDKOLJBMFBKDDOFDABNAMCLJC
var decryptedText = util.decryptString(encryptedText);
util.out(decryptedText); // I'm a secret password
See also
Util.decryptString(String input);

◆ fileCopy()

String Util::fileCopy | ( | String | sourceFilePath,
 |  | String | targetFilePath
 | ) |  |

Copy a file (file system object) at the PortalServer's system.

This functions provides a simple copy method for files on the server's file system.

Parameters
sourceFilePath | String with the source file path
targetFilePath | String with the target file path
Returns
empty String if successful, the error message in case of any error
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
var errMsg = util.fileCopy("c:\\Test.log", "d:\\Test.log");
if (errMsg.length > 0)
util.out(errMsg);
else
util.out("Ok.");
See also
Util.fileMove(String sourceFilePath, String targetFilePath)

◆ fileMove()

String Util::fileMove | ( | String | sourceFilePath,
 |  | String | targetFilePath
 | ) |  |

Move a file (file system object) at the PortalServer's system from a source file path to the target file path.

This functions provides a simple move method for files on the server's file system.

Parameters
sourceFilePath | String with the source file path
targetFilePath | String with the target file path
Returns
empty String if successful, the error message in case of any error
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
var errMsg = util.fileMove("c:\\Test.log", "d:\\Test.log");
if (errMsg.length > 0)
util.out(errMsg);
else
util.out("Ok.");
See also
Util.fileCopy(String sourceFilePath, String targetFilePath)

◆ fileSize()

Int Util::fileSize ( String filePath )

Retrieve the filesize of a file (file system object) at the PortalServer's system.

This functions returns the filesize of a file.

Parameters
filePath String with the file path
Returns
Int with file size if successful, the value -1 in case of any error
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
var size = util.fileSize("c:\\Test.log");
if (size < 0)
util.out("File does not exist.");
else
util.out(size);

◆ generateChecksum()

String Util::generateChecksum ( String input )

Creates a MD5 checksum for the String value

Parameters
input The string for that the checksum will be generated
Returns
String with the checksum
Since
DOCUMENTS 4.0c
Example:
var text = "I'm some type of text";
var md5 = util.generateChecksum(text);
if (md5 != "a77c16d60b9939295c0af4c7242b6c02")
util.out("wrong md5!");

◆ getDir()

String Util::getDir | ( | String | dirname,
 |  | Array | files,
 |  | Array | subDirs
 | ) |  |

Retrieving files and subdirectories of a specified directory.

This function retrieve the content (files, subdirectories) of a specified directory of the PortalServer's file system. It expected two empty Arrays, which the function fill with the filenames and subdirectory names. The names will not contain the full path, only the name itself. This function will not work recursively.

Parameters
dirname | String containing the name of the wanted directory
[out] | files | Empty array for the filenames
[out] | subDirs | Empty array for the subdirectory names
Returns
empty String if successful, the error message in case of any error
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
var files = new Array();
var dirs = new Array();
util.getDir("c:\\Test", files, dirs);
var i=0;
for (i=0; i < files.length; i++)
util.out(files[i])
for (i=0; i < dirs.length; i++)
util.out(dirs[i])

◆ getEnvironment()

String Util::getEnvironment ( String variableName )

Reads an environment variable of the PortalServer's system.

With this function an environment variable in the server's context can be read.

Parameters
variableName String with the name of the variable
Returns
Environment value as String
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
util.out(util.getEnvironment("HOME"));

◆ getFileContentAsString()

String Util::getFileContentAsString ( String filePath )

Get the content of a file at the PortalServer's system as string in base64 format.

Parameters
filePath String with the file path.
Returns
String containing the file content in base64 format.
Since
DOCUMENTS 4.0c

◆ getQuoted()

String Util::getQuoted ( String input )

Returns the input string enclosed in either double or single quotation marks.

This function is designed to simplify the composition of filter expressions for a FileResultSet or an ArchiveFileResultSet. If the input string does not contain any double quotation mark ("), the function returns the input enclosed in double quotation marks. Otherwise the function tests if it can use single quotation marks (') instead. If both quotation styles are already used within the input, the function throws an exception.

Parameters
input The string to be enclosed
Returns
String with quotation marks around.
Since
DOCUMENTS 4.0b

◆ getSourceLineInfo()

String Util::getSourceLineInfo ( )

Retrieve the scriptName with the current line no of this methed.

This functions returns the scriptName and line no for debugging or logging purposes

Returns
String with the scriptName and line no
Since
DOCUMENTS 5.0a

◆ getTmpPath()

String Util::getTmpPath ( )

Get the path to the temporary directory on the Portalserver.

Returns
String containing the complete path to the temporary directory
Since
ELC 3.51 / otrisPORTAL 5.1
Example:
util.out(util.getTmpPath());

◆ getUniqueId()

String Util::getUniqueId ( )

Get a unique id from the system.

The length of the id is 40 characters and the id contains only the characters 'a-z','-','0-9'. This unique id can e.g. be used for file names etc.

Returns
String containing the unique id
Since
ELC 3.60 / otrisPORTAL 6.0
Example:
var uniqueId = util.getUniqueId();
util.out(uniqueId);

◆ getUsedPrivateBytes()

number Util::getUsedPrivateBytes ( )

Returns the current usage of private bytes memory of the documensserver process.

Returns
integer value with the used memory in KBytes
Since
DOCUMENTS 5.0b

◆ hash()

String Util::hash | ( | String | filePath,
 |  | String | hashfunction
 | ) |  |

Generate the hash value for a file using the given hash function.

These hash functions are supported:

  • sha1
  • sha224
  • sha256
  • sha384
  • sha512
  • md4
  • md5
  • whirlpool
  • ripemd160
Parameters
filePath | String containing the path of the file to be hashed.
hashfunction | String containing the name of the hash function.
Returns
String with the hash value of the file, an empty string in case of any error.
Since
DOCUMENTS 5.0e
Example:
try
{
var hashValue = util.hash("c:/tmp/dok1.pdf", "sha256");
util.out(hashValue);
}
catch (ex)
{
util.out(ex);
}
See also
Document.hash(String hashfunction, String version)

◆ hmac()

String Util::hmac | ( | String | hashfunction,
 |  | String | key,
 |  | String | message,
 |  | Boolean | rawOutput = false
 | ) |  |

Generates a hash-based message authentication code (hmac) of a message string using a secret key.

These hash functions are supported:

  • "sha1"
  • "sha224"
  • "sha256"
  • "sha384"
  • "sha512"
  • "md4"
  • "md5"
Parameters
hashfunction | Name of the hash function.
key | Secret key.
message | Message string to be hashed.
rawOutput Optional flag:
If set to true, the function outputs the raw binary representation of the hmac.
If set to false, the function outputs the hexadecimal representation of the hmac.
The default value is false.
Returns
String containing the hash-based message authentication code (hmac) of the message (see rawOutput for representation).
Since
DOCUMENTS 5.0a HF2
Example:
var key = "MySecretKey";
var msg = "Hello world!";
var hmac = util.hmac("sha1", key, msg);
util.out(hmac);

◆ isEncryptedBlob()

boolean Util::isEncryptedBlob ( String blobFilePath )

Checks, if the current blob is encrypted (Repository encryption) or not.

Parameters
blobFilePath String containing the path of the file to be checked.
Returns
boolean value that indicates if the blob is encrypted.
Since
DOCUMENTS 4.0d HF3

◆ length_u()

number Util::length_u ( String value )

Returns the number of characters of a UTF-8 string.

You can use this function in a x64 / UTF-8 server to count the characters in a UTF-8 string.

Parameters
value UTF-8 String of which the number of characters will be counted
Returns
Integer with the length in characters
Since
DOCUMENTS 4.0a HF1
Note
for use in x64 / UTF-8 versions
Example:
var text = "Köln is a german city";
util.out(text.length); // => 22 bytes
util.out(util.length_u(text)); // => 21 characters

◆ log()

Util::log ( String output )

Log a String to the DOCUMENTS server window.

Same as util.out() with additional debugging information (script name and line number) You may output whatever information you want. This function is useful especially for debugging purposes. Be aware that you should run the Portalserver as an application if you want to make use of the out() function, otherwise the output is stored in the Windows Eventlog instead.

Parameters
output String you want to output to the Portalserver Window
Since
ELC 3.50e / otrisPORTAL 5.0e
Example:
util.log("Hello World");

◆ makeFullDir()

String Util::makeFullDir ( String dirPath )

Creates a directory with subdirectories at the PortalServer's file system.

This functions provides a simple method for directory creation on the file system.

Parameters
dirPath String with the directory path
Returns
empty String if successful, the error message in case of any error
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
var errMsg = util.makeFullDir("c:\\log\\ELC");
if (errMsg.length > 0)
util.out(errMsg);
else
util.out("Ok.");

◆ makeGACLValue()

String Util::makeGACLValue | ( | var | val1,
 |  | var | val2,
 |  |  | ...
 | ) |  |

Makes a valid GACL value from the parameters.

This method helps to create valid GACL values when set by PortalScripting.

As separator for the single GACL values a \r\n (%CRLF%) will be used. The values will be trimed (leading and ending whitespaces) and multiple values will be removed.

The method returns a String value in the format \r\n AP1 \r\n AP2 \r\n .... \r\n APx \r\n

Parameters
val1 | String or Array
val2 | String or Array
...
Returns
String containing the GACL value.
Since
DOCUMENTS 5.0c HF2
Example:
var sep = context.getAutoText("%CRLF%"); // \r\n
var val1 = ["AP1", "AP2"];
var val2 = "AP3" + sep + "AP4";
var val3 = " AP5";
var val4 = "AP3";
var gaclVal = util.makeGACLValue(val1, val2, val3, val4);
util.out(gaclVal);
=>
AP1
AP2
AP3
AP4
AP5
<=

◆ makeHTML()

String Util::makeHTML | ( | String | val,
 |  | boolean | isUTF8 = false
 | ) |  |

Masks all HTML-elements of a String.

This function masks the following characters for HTML output:

> | &gt;
< | &lt;
\n | <br>
& | &amp;
" | &quot;

If the String is in UTF-8 Format, all UTF-8 characters will be replaced with the according HTML entities.

Parameters
val | String to be masked
isUTF8 | boolean flag, if the val is in UTF-8 format
Returns
HTML-String
Since
ELC 3.60e / otrisPORTAL 6.0e

◆ out()

Util::out ( String output )

Output a String to the Portalserver window.

You may output whatever information you want. This function is useful especially for debugging purposes. Be aware that you should run the Portalserver as an application if you want to make use of the out() function, otherwise the output is stored in the Windows Eventlog instead.

Parameters
output String you want to output to the Portalserver Window
Since
ELC 3.50e / otrisPORTAL 5.0e
Example:
util.out("Hello World");

◆ prepareJSON()

String Util::prepareJSON ( )

Converts JSON-Strings with Source Code entities e.g.

\u00FA to UTF-8 Strings representation

Returns
String with UTF-8 representation
Since
DOCUMENTS 5.0e HF2

◆ searchInArray()

number Util::searchInArray | ( | Array | theArray,
 |  | String | searchedString,
 |  | number | occurence = 1
 | ) |  |

Search for a String in an Array.

This functions provides a simple search method for Arrays to find the position of a string in an array.

Parameters
theArray | Array in that the String will be searched
searchedString | String that will be searched
occurence | Integer that define the wanted position at a multi-occurence of the String in the Array
Returns
Integer with the position of the String in the array, -1 in case of the String isn't found
Since
ELC 3.60e / otrisPORTAL 6.0e
Example:
enumval[0] = "This";
enumval[1] = "is";
enumval[2] = "a";
enumval[3] = "sample";
var pos = util.searchInArray(enumval, "is");
util.out(pos); // should be the value 1

◆ sha256()

String Util::sha256 ( String message )

Generates the SHA256 hash of any string.

Parameters
message Message string to be hashed.
Returns
SHA256 hash of the message.
Since
DOCUMENTS 5.0a HF2

◆ sign()

string Util::sign | ( | string | algorithm,
 |  | string | privateKeyPEM,
 |  | string | pkPassword,
 |  | var | payload,
 |  | boolean | urlStyle = false
 | ) |  |

Create a digital signature.

Parameters
algorithm | string Short identification of used algorithms, for example "RSASHA256". The first three characters specify an encryption standard. Actually only "RSA" is supported. The other characters select a hash algorithm, for example SHA1, SHA256.
privateKeyPEM | string with a (usually encrypted) private key in PEM format.
pkPassword | string The password to decrypt the private key.
payload | any The text or data to sign. Allowed data types are "String", "Array of Bytes (Integer 0..255)" and "ArrayBuffer".
urlStyle | boolean to request the result Base64URL-encoded
Returns
string Base64- or Base64URL-encoded String with signature data.
Note
Signing strings with characters, which are not in the 7-Bit ASCII-Charset, may require a transcoded string. This depends on how the string was created or received. See transcode().
The list of available hash algorithms depends on the linked OpenSSL libraries, not on DOCUMENTS itself.
About Arraybuffers
Passing a TypedArray (UInt8Array, Int16Array etc.) instead of an ArrayBuffer is possible, but not recommended. The actual implementation always sends the complete associated buffer. The result can be unexpected, if the TypedArray covers only a section of a bigger buffer. This behaviour might change in future releases.
Since
DOCUMENTS 5.0d HF2
Example:
// Load a private key in PEM-Format for digital signing.
// The file should look like this:
// -----BEGIN ENCRYPTED PRIVATE KEY-----
// <Base64-encoded binary data; usually 64 Characters per line>
// -----END ENCRYPTED PRIVATE KEY-----
//
// The openssl command-line tool, for instance, can be used in the
// following way to generate a private key-file for RSA enccryption.
// > openssl.exe genpkey -out testPK.pem -outform PEM -pass pass:myKeyPassword -des3 -algorithm RSA -pkeyopt rsa_keygen_bits:2048
// The next command extracts the public parts of the key and stores
// them in a separate PEM-file. A signature validator will require it.
// > openssl pkey -in testPK.pem -passin pass:myKeyPassword -out testPub.pem -pubout
function loadMyPrivateKey()
{
var f = new File("E:\\testPK.pem");
var text;
if(f.ok())
{
var text = f.read(10000);
f.close();
return text;
}
throw new Error("Keyfile not found");
}
function signMyData() {
var results = {};
var privateKey = loadMyPrivateKey();
var pkPassword = "myKeyPassword";
// 1) Sign a string.
var data = "This message needs to be signed.";
results.data1 = data;
results.signature1 = util.sign("RSASHA256", privateKey, pkPassword, data);
// 2) Sign a sequence of bytes, passed as a conventional array.
// Use the simpler SHA1 hash this time.
data = [65, 70, 70, 69, 0];
results.data2 = data;
results.signature2 = util.sign("RSASHA1", privateKey, pkPassword, data);
// 3) Sign a sequence of bytes, passes as an ArrayBuffer
data = new Uint8Array(4);
data[0] = 192;
data[1] = 168;
data[2] = 6;
data[3] = 101;
results.data3 = data;
results.signature3 = results.signature1 = util.sign("RSASHA256", privateKey, pkPassword, data.buffer);
return JSON.stringify(results);
}
return signMyData();

◆ sleep()

void Util::sleep ( number duration )

Let the PortalScript sleep for a defined duration.

Parameters
duration Integer containing the duration in milliseconds
Since
DOCUMENTS 5.0a

◆ substr_u()

String Util::substr_u | ( | String | value,
 |  | int | startIndex,
 |  | int | length
 | ) |  |

Returns a substring of a UTF-8 string.

You can use this function in a x64 / UTF-8 server to get a substring of a UTF-8 string.

Parameters
value | UTF-8 String of which the substring is wanted
startIndex | int with the 0-based start index of the substring
length | int with the length in characters of the substring
Returns
UTF-8 String with the wanted substring
Since
DOCUMENTS 4.0a HF1
Note
for use in x64 / UTF-8 versions
Example:
var text = "Köln is a german city";
util.out(util.substr_u(text, 0, 4)); // => Köln
util.out(util.substr_u(text, 5)); // => is a german city
// but
util.out(text.substr(0, 4)); // => Köl

◆ transcode()

String Util::transcode | ( | String | nameSourceEncoding,
 |  | String | text,
 |  | String | nameTargetEncoding
 | ) |  |

Transcode a String from encoding a to encoding b.

This method performs an transcoding for a String from a source encoding to a target encoding.

The following encodings are supported:

  • Local: The standard system encoding for Windows systems is Windows-1252 and for Linux systems ISO-8859-1 or UTF-8.
  • UTF-8: Unicode-characterset as ASCII-compatible 8-Bit-coding.
  • ISO-8859-1: West-European characterset without Euro-Symbol.
  • ISO-8859-15: West-European characterset with Euro-Symbol.
  • Windows-1252
  • Windows-1250
Parameters
nameSourceEncoding | String containing the name of the source encoding
text | String containing the text to transcode
nameTargetEncoding | String containing the name of the target encoding
Returns
String containing the transcoded text
Since
ELC 3.60d / otrisPORTAL 6.0d
Example:
var text = "Köln is a german city"
var utf8Text = util.transcode("windows-1252", text, "UTF-8");
util.out(utf8Text);
text = util.transcode("UTF-8", utf8Text, "windows-1252");
util.out(text);

◆ unlinkFile()

boolean Util::unlinkFile ( String filePath )

Delete a physical file on the server's file system.

Parameters
filePath String containing the full path and filename to the desired physical file
Returns
true if successful, false in case of any error
Since
ELC 3.51 / otrisPORTAL 5.1
Example:
var success = util.unlinkFile("c:\\tmp\\tempfile.txt");

Member Data Documentation

◆ buildNo

number Util::buildNo

Build version number of the PortalServer.

This property allows to retrieve the build version number of the PortalServer to customize your PortalScripts in dependence of the used PortalServer.

Returns
Integer with the build version number
Note
This property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
if (util.buildNo > 1826)
{
// do update
}

◆ DB

String Util::DB

Database using by the PortalServer.

The following databases are supported by the PortalServer:

  • oracle
  • mysql
  • mssql
Returns
String with the used database
Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ memoryModel

String Util::memoryModel

Memory model of the PortalServer.

There are two possible memory models available : x64 or x86.

Returns
String with the memory model
Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ version

number Util::version

Main version number of the PortalServer.

This property allows to retrieve the version number of the PortalServer to customize your PortalScripts in dependence of the used PortalServer. For example:

  • otrisPORTAL 5.1 / ELC 3.51 returns 5100
  • otrisPORTAL 6.0 / ELC 3.60 returns 6000
  • DOCUMENTS 4.0 returns 7000
Returns
Integer with the main version number
Note
This property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0
Example:
if (util.version < 6000)
{
// do update
}


DOCUMENTS 5 - PortalScripting API: Member List

Util Member List

This is the complete list of members for Util, including all inherited members.

base64Decode(String value, boolean returnArray=true) | Util
base64Encode(var value, boolean urlStyle=false) | Util
beep(int frequency, int duration) | Util
buildNo | Util
concatPDF(Array pdfFilePaths, boolean deleteSinglePdfs=false) | Util
convertBlobToPDF(String sourceFilePath) | Util
convertDateToExcelDate(Date timeStamp) | Util
convertDateToString(Date timeStamp, String format) | Util
convertStringToDate(String dateOrTimeStamp, String format) | Util
cryptPassword(String pwPlain) | Util
DB | Util
decodeUrlCompatible(String encodedParam) | Util
decryptString(String input) | Util
deleteFile(String filePath) | Util
encodeUrlCompatible(String param) | Util
encryptString(String input) | Util
fileCopy(String sourceFilePath, String targetFilePath) | Util
fileMove(String sourceFilePath, String targetFilePath) | Util
fileSize(String filePath) | Util
generateChecksum(String input) | Util
getDir(String dirname, Array files, Array subDirs) | Util
getEnvironment(String variableName) | Util
getFileContentAsString(String filePath) | Util
getQuoted(String input) | Util
getSourceLineInfo() | Util
getTmpPath() | Util
getUniqueId() | Util
getUsedPrivateBytes() | Util
hash(String filePath, String hashfunction) | Util
hmac(String hashfunction, String key, String message, Boolean rawOutput=false) | Util
isEncryptedBlob(String blobFilePath) | Util
length_u(String value) | Util
log(String output) | Util
makeFullDir(String dirPath) | Util
makeGACLValue(var val1, var val2,...) | Util
makeHTML(String val, boolean isUTF8=false) | Util
memoryModel | Util
out(String output) | Util
prepareJSON() | Util
searchInArray(Array theArray, String searchedString, number occurence=1) | Util
sha256(String message) | Util
sign(string algorithm, string privateKeyPEM, string pkPassword, var payload, boolean urlStyle=false) | Util
sleep(number duration) | Util
substr_u(String value, int startIndex, int length) | Util
transcode(String nameSourceEncoding, String text, String nameTargetEncoding) | Util
unlinkFile(String filePath) | Util
version | Util


DOCUMENTS 5 - PortalScripting API: WorkflowStep Class Reference

Public Member Functions | Public Attributes | List of all members
WorkflowStep Class Reference

The WorkflowStep class allows access to the according object type of DOCUMENTS. More...

Public Member Functions

boolean | forwardFile (String controlFlowId, String comment="")
Forward the file to its next WorkflowStep. More...
String | getAttribute (String attribute)
Get the String value of an attribute of the WorkflowStep. More...
ControlFlowIterator getControlFlows ()
Retrieve an iterator representing a list of all outgoing ControlFlows of the WorkflowStep. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
String | getOID (boolean oidLow=false)
Returns the object-id. More...
String | getWorkflowName ()
Retrieve the name of the workflow, the WorkflowStep belongs to. More...
String | getWorkflowProperty (String propertyName)
Retrieve a property value of the workflow action, the WorkflowStep belongs to. More...
String | getWorkflowVersion ()
Retrieve the version number of the workflow, the WorkflowStep belongs to. More...
boolean | setAttribute (String attribute, String value)
Set the String value of an attribute of the WorkflowStep to the desired value. More...
boolean | setNewExecutiveGroup (String accessProfileName)
Reassign the current WorkflowStep object to the given user group. More...
boolean | setNewExecutiveUser (String loginUser)
Reassigns the current WorkflowStep object to the given user. More...

Public Attributes

String | executiveGroup
String value containing the locking user group of the WorkflowStep. More...
String | executiveType
String value containing the type of recipient of the WorkflowStep. More...
String | executiveUser
String value containing the locking user of the WorkflowStep. More...
String | firstControlFlow
String value containing the unique internal ID of the first outgoing ControlFlow. More...
String | id
String value containing the unique internal ID of the WorkflowStep. More...
String | name
String value containing the technical name of the WorkflowStep. More...
String | status
String value containing the status of the WorkflowStep. More...
String | templateId
String value containing the unique internal ID of the Workflow template. More...

Detailed Description

The WorkflowStep class allows access to the according object type of DOCUMENTS.

You may access WorkflowStep objects by the different methods described in the DocFile chapter.

Note
This class and all of its methods and attributes require a full workflow engine license, it does not work with pure submission lists.

Member Function Documentation

◆ forwardFile()

boolean WorkflowStep::forwardFile | ( | String | controlFlowId,
 |  | String | comment = ""
 | ) |  |

Forward the file to its next WorkflowStep.

This requires the internal ID (as a String value) of the ControlFlow you want the file to pass through. The optional comment parameter will be stored as a comment in the file's monitor.

Parameters
controlFlowId | String value containing the internal ID of the ControlFlow you want to pass through.
comment | optional String value containing your desired comment for the file's monitor.
Returns
true if successful, false in case of any error
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
The current user's permissions are not checked when using this function!
Since
ELC 3.50e / otrisPORTAL 5.0e

◆ getAttribute()

String WorkflowStep::getAttribute ( String attribute )

Get the String value of an attribute of the WorkflowStep.

Parameters
attribute String containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ getControlFlows()

ControlFlowIterator WorkflowStep::getControlFlows ( )

Retrieve an iterator representing a list of all outgoing ControlFlows of the WorkflowStep.

Returns
ControlFlowIterator containing the outgoing ControlFlows of the current WorkflowStep object.
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ getLastError()

String WorkflowStep::getLastError ( )

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

Returns
Text of the last error as String
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.50 / otrisPORTAL 5.0
See also
DocFile.getLastError()

◆ getOID()

String WorkflowStep::getOID ( boolean oidLow = false )

Returns the object-id.

Parameters
oidLow Optional flag:
If true only the id of the WorkflowStep object (m_oid) will be returned.
If false the id of the WorkflowStep 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 object-id
Since
ELC 3.60c / otrisPORTAL 6.0c
DOCUMENTS 5.0 (new parameter oidLow)

◆ getWorkflowName()

String WorkflowStep::getWorkflowName ( )

Retrieve the name of the workflow, the WorkflowStep belongs to.

Returns
String containing the workflow name
Note
This function is only available for workflows, but not submission lists.
Since
ELC 3.60d / otrisPORTAL 6.0d
See also
WorkflowStep.getWorkflowVersion()

◆ getWorkflowProperty()

String WorkflowStep::getWorkflowProperty ( String propertyName )

Retrieve a property value of the workflow action, the WorkflowStep belongs to.

Parameters
propertyName String containing the name of the desired property
Returns
String containing the property value
Note
This function is only available for workflows, but not submission lists.
Since
DOCUMENTS 4.0a

◆ getWorkflowVersion()

String WorkflowStep::getWorkflowVersion ( )

Retrieve the version number of the workflow, the WorkflowStep belongs to.

Returns
String containing the workflow version number
Note
This function is only available for workflows, but not submission lists.
Since
ELC 3.60d / otrisPORTAL 6.0d
See also
WorkflowStep.getWorkflowName()

◆ setAttribute()

boolean WorkflowStep::setAttribute | ( | String | attribute,
 |  | String | value
 | ) |  |

Set the String value of an attribute of the WorkflowStep to the desired value.

Parameters
attribute | String containing the name of the desired attribute
value | String containing the desired value of the attribute
Returns
true if successful, false in case of any error
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ setNewExecutiveGroup()

boolean WorkflowStep::setNewExecutiveGroup ( String accessProfileName )

Reassign the current WorkflowStep object to the given user group.

Parameters
accessProfileName String containing the technical name of the access profile.
Returns
true if successful, false in case of any error.
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
DOCUMENTS 4.0c
Example:
var f = context.file;
var step = f.getCurrentWorkflowStep();
if (!step)
step = f.getFirstLockingWorkflowStep();
if (!step)
util.out("File is not in a workflow.");
if (!step.setNewExecutiveGroup("AccessProfile1"))
util.out(step.getLastError());

◆ setNewExecutiveUser()

boolean WorkflowStep::setNewExecutiveUser ( String loginUser )

Reassigns the current WorkflowStep object to the given user.

Parameters
loginUser String containing the login name of the desired user.
Returns
true if successful, false in case of any error
Note
This function requires a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.50e / otrisPORTAL 5.0e

Member Data Documentation

◆ executiveGroup

String WorkflowStep::executiveGroup

String value containing the locking user group of the WorkflowStep.

Returns
String value containing the WorkflowStep's locking user group.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
DOCUMENTS 4.0c

◆ executiveType

String WorkflowStep::executiveType

String value containing the type of recipient of the WorkflowStep.

Returns
String value containing the type of recipient.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0

◆ executiveUser

String WorkflowStep::executiveUser

String value containing the locking user of the WorkflowStep.

Returns
String value containing the WorkflowStep's locking user.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0

◆ firstControlFlow

String WorkflowStep::firstControlFlow

String value containing the unique internal ID of the first outgoing ControlFlow.

Returns
String value containing the first outgoing ControlFlow's unique ID.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0

◆ id

String WorkflowStep::id

String value containing the unique internal ID of the WorkflowStep.

Returns
String value containing the unique WorkflowStep ID.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0

◆ name

String WorkflowStep::name

String value containing the technical name of the WorkflowStep.

Returns
String value containing the WorkflowStep's technical name.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0

◆ status

String WorkflowStep::status

String value containing the status of the WorkflowStep.

Returns
String value containing the WorkflowStep's status.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0

◆ templateId

String WorkflowStep::templateId

String value containing the unique internal ID of the Workflow template.

Returns
String value containing the unique Workflow template ID.
Note
This property requires a full workflow engine license, it does not work with pure submission lists. The property is readonly.
Since
ELC 3.50 / otrisPORTAL 5.0


DOCUMENTS 5 - PortalScripting API: Member List

WorkflowStep Member List

This is the complete list of members for WorkflowStep, including all inherited members.

executiveGroup | WorkflowStep
executiveType | WorkflowStep
executiveUser | WorkflowStep
firstControlFlow | WorkflowStep
forwardFile(String controlFlowId, String comment="") | WorkflowStep
getAttribute(String attribute) | WorkflowStep
getControlFlows() | WorkflowStep
getLastError() | WorkflowStep
getOID(boolean oidLow=false) | WorkflowStep
getWorkflowName() | WorkflowStep
getWorkflowProperty(String propertyName) | WorkflowStep
getWorkflowVersion() | WorkflowStep
id | WorkflowStep
name | WorkflowStep
setAttribute(String attribute, String value) | WorkflowStep
setNewExecutiveGroup(String accessProfileName) | WorkflowStep
setNewExecutiveUser(String loginUser) | WorkflowStep
status | WorkflowStep
templateId | WorkflowStep


DOCUMENTS 5 - PortalScripting API: WorkflowStepIterator Class Reference

Public Member Functions | List of all members
WorkflowStepIterator Class Reference

The WorkflowStepIterator class has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means. More...

Public Member Functions

WorkflowStep first ()
Retrieve the first WorkflowStep object in the WorkflowStepIterator. More...
WorkflowStep next ()
Retrieve the next WorkflowStep object in the WorkflowStepIterator. More...
int size ()
Get the amount of WorkflowStep objects in the WorkflowStepIterator. More...

Detailed Description

The WorkflowStepIterator class has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means.

You may access WorkflowStepIterator objects by the getAllLockingWorkflowSteps() method described in the DocFile chapter.

Note
This class and all of its methods and attributes require a full workflow engine license, it does not work with pure submission lists.
Since
ELC 3.51e / otrisPORTAL 5.1e

Member Function Documentation

◆ first()

WorkflowStep WorkflowStepIterator::first ( )

Retrieve the first WorkflowStep object in the WorkflowStepIterator.

Returns
WorkflowStep or null in case of an empty WorkflowStepIterator
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ next()

WorkflowStep WorkflowStepIterator::next ( )

Retrieve the next WorkflowStep object in the WorkflowStepIterator.

Returns
WorkflowStep or null if end of WorkflowStepIterator is reached.
Since
ELC 3.51e / otrisPORTAL 5.1e

◆ size()

int WorkflowStepIterator::size ( )

Get the amount of WorkflowStep objects in the WorkflowStepIterator.

Returns
integer value with the amount of WorkflowStep objects in the WorkflowStepIterator
Since
ELC 3.51e / otrisPORTAL 5.1e


DOCUMENTS 5 - PortalScripting API: Member List

WorkflowStepIterator Member List

This is the complete list of members for WorkflowStepIterator, including all inherited members.

first() | WorkflowStepIterator
next() | WorkflowStepIterator
size() | WorkflowStepIterator


DOCUMENTS 5 - PortalScripting API: XLSXChart Class Reference

Public Member Functions | List of all members
XLSXChart Class Reference

The XLSXChart class allows creating an Excel chart. More...

Public Member Functions

XLSXChartSeries | addSeries (String categories="", String values="")
Add a data series to the current chart. More...
XLSXChartAxis | getAxis (String axisType)
Get an axis from the chart. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
boolean | setStyle (number styleId=2)
Set the chart style type. More...
boolean | setTable ()
Add a data table below the horizontal axis with the data used to plot the chart. More...
boolean | setTitle (String title)
Set the title of the chart. More...
boolean | setTitleRange (String sheetname, number row, number col)
Set a chart title formula using row and column values. More...

Detailed Description

The XLSXChart class allows creating an Excel chart.

An XLSXChart object represents an Excel chart. It provides functions for adding data series to the chart and for configuring the chart. An XLSXChart object isn't created directly. Instead it is created by calling the XLSXWriter.addChart(number type) function from an XLSXWriter object.

The basic procedure for adding a chart to a worksheet is:

  1. Create the chart with XLSXWriter.addChart().
  2. Add one or more data series to the chart which refers to data in the Excel file using XLSXChart.addSeries().
  3. Configure the chart with the other available functions shown below.
  4. Insert the chart into a worksheet using XLSXWorksheet.insertChart().
Since
DOCUMENTS 5.0e
Example:
var writer = new XLSXWriter("c:\\tmp\\chart.xlsx");
var worksheet1 = writer.addWorksheet("Worksheet1");
// Write some data to the worksheet.
writeWorksheetData(worksheet1);
// Create a chart object.
var chart = writer.addChart(writer.CHART_COLUMN);
// Configure the chart. In simplest case we just add some value data series.
// The empty categories will default to 1 to 6 like in Excel.
var series1 = chart.addSeries("", "=Worksheet1!$A$1:$A$6");
var series2 = chart.addSeries("", "=Worksheet1!$B$1:$B$6");
var series3 = chart.addSeries("", "=Worksheet1!$C$1:$C$6");
chart.setTable(); // Turn on the data table
chart.setStyle(37);
chart.setTitle("Chart with Data Table");
// Insert the chart into the worksheet
worksheet1.insertChart(8, 1, chart);
if (!writer.save())
throw writer.getLastError();
function writeWorksheetData(worksheet)
{
var data = [
// Three columns of data.
[1, 2, 3],
[2, 4, 6],
[3, 6, 9],
[4, 8, 12],
[5, 10, 15],
[6, 12, 18]
];
var row, col;
for (row = 0; row < 6; row++)
for (col = 0; col < 3; col++)
worksheet.writeCell("number", row, col, data[row][col]);
}
See also
XLSXWriter.addChart(number type)
XLSXChart.addSeries(String categories, String values)
XLSXWorksheet.insertChart(number row, number col, XLSXChart chart, number xOffset, number yOffset, number xScale, number yScale)
XLSXChartsheet.insertChart(XLSXChart chart )

Member Function Documentation

◆ addSeries()

XLSXChartSeries XLSXChart::addSeries | ( | String | categories = "",
 |  | String | values = ""
 | ) |  |

Add a data series to the current chart.

The series numbering and order in the Excel chart will be the same as the order in which they are added with this function.

Parameters
categories | Optional range of categories in the data series being a string formula like "=Worksheet1!$A$1:$A$6". The category is more or less the same as the X axis. In most Excel chart types the categories property is optional and the chart will just assume a sequential series from 1..n.
values | Optional range of values in the data series being a string formula like "=Worksheet1!$A$1:$A$6". This parameter links the chart with the worksheet data that it displays.
Returns
An XLSXChartSeries object if successful, null in case of any error.
Since
DOCUMENTS 5.0e
Example:
// The empty categories will default to 1 to 6 like in Excel.
var series1 = chart1.addSeries("", "=Worksheet1!$A$1:$A$6");
var series2 = chart1.addSeries("", "=Worksheet1!$B$1:$B$6");
// It is also possible to specify non-contiguous ranges:
chart2.addSeries("=(Sheet1!$A$1:$A$9,Sheet1!$A$14:$A$25)", "=(Sheet1!$B$1:$B$9,Sheet1!$B$14:$B$25)");
See also
XLSXChartSeries.setCategories(String sheetname, number firstRow, number firstCol, number lastRow, number lastCol)
XLSXChartSeries.setValues(String sheetname, number firstRow, number firstCol, number lastRow, number lastCol)

◆ getAxis()

XLSXChartAxis XLSXChart::getAxis ( String axisType )

Get an axis from the chart.

Parameters
axisType The axis type: x or y.
Returns
An XLSXChartAxis object if successful, null in case of any error.
Since
DOCUMENTS 5.0e
Example:
var xAxis = chart.getAxis("x");

◆ getLastError()

String XLSXChart::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 5.0e

◆ setStyle()

boolean XLSXChart::setStyle ( number styleId = 2 )

Set the chart style type.

This function is used to set the style of the chart to one of the 48 built-in styles available on the "Design" tab in Excel 2007.

Parameters
styleId Optional index representing the chart style, 1 - 48. The style index number is counted from 1 on the top left in the Excel dialog. The default style is 2.
Returns
true if successful, false in case of any error
Note
In Excel 2013 the Styles section of the "Design" tab in Excel shows what were referred to as "Layouts" in previous versions of Excel. These layouts are not defined in the file format. They are a collection of modifications to the base chart type. They can not be defined by this function.
Since
DOCUMENTS 5.0e
Example:
chart.setStyle(37);

◆ setTable()

boolean XLSXChart::setTable ( )

Add a data table below the horizontal axis with the data used to plot the chart.

Returns
true if successful, false in case of any error
Note
The data table can only be shown with Bar, Column, Line and Area charts.
Since
DOCUMENTS 5.0e

◆ setTitle()

boolean XLSXChart::setTitle ( String title )

Set the title of the chart.

Parameters
title The chart title displayed above the chart. This parameter can also be a formula such as "=Worksheet1!$A$1" to point to a cell in the Excel file that contains the title. The Excel default is to have no chart title.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
chart1.setTitle("Test Results");
chart2.setTitle("=Worksheet1!$B$1");
See also
XLSXChart.setTitleRange(String sheetname, number row, number col);

◆ setTitleRange()

boolean XLSXChart::setTitleRange | ( | String | sheetname,
 |  | number | row,
 |  | number | col
 | ) |  |

Set a chart title formula using row and column values.

This function can be used to set a chart title range and is an alternative to using XLSXChart.setTitle(String title) and a string formula.

Parameters
sheetname | The name of the worksheet that contains the cell range.
row | The zero indexed row number of the range.
col | The zero indexed column number of the range.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
chart2.setTitleRange("Worksheet1", 0, 1);


DOCUMENTS 5 - PortalScripting API: Member List

XLSXChart Member List

This is the complete list of members for XLSXChart, including all inherited members.

addSeries(String categories="", String values="") | XLSXChart
getAxis(String axisType) | XLSXChart
getLastError() | XLSXChart
setStyle(number styleId=2) | XLSXChart
setTable() | XLSXChart
setTitle(String title) | XLSXChart
setTitleRange(String sheetname, number row, number col) | XLSXChart


DOCUMENTS 5 - PortalScripting API: XLSXChartAxis Class Reference

Public Member Functions | List of all members
XLSXChartAxis Class Reference

The XLSXChartAxis class represents the Excel chart axis. More...

Public Member Functions

String | getLastError ()
Function to get the description of the last error that occurred. More...
boolean | setLabelAlign (String align)
Set the alignment of the axis labels. More...
boolean | setLabelPosition (String position)
Position the axis labels. More...
boolean | setName (String name)
Set the name caption of the chart axis. More...
boolean | setNameRange (String sheetname, number row, number col)
Set a chart axis name formula using row and column values. More...
boolean | setNumberFormat (String numFormat)
Set the format of the numbers on the axis. More...
boolean | setReverse ()
Reverse the order of the axis categories or values. More...

Detailed Description

The XLSXChartAxis class represents the Excel chart axis.

An XLSXChartAxis object isn't created directly. You can get it using the XLSXChart.getAxis(String axisType) function. It provides functions for configuring a chart axis.

Since
DOCUMENTS 5.0e
Example:
var writer = new XLSXWriter("c:\\tmp\\chartAxis.xlsx");
var worksheet1 = writer.addWorksheet("Worksheet1");
// Write some data to the worksheet.
writeWorksheetData(worksheet1);
// Create a chart object.
var chart = writer.addChart(writer.CHART_COLUMN);
// Configure the chart. In simplest case we just add some value data series.
// The empty categories will default to 1 to 6 like in Excel.
var series1 = chart.addSeries("", "=Worksheet1!$A$2:$A$7");
var series2 = chart.addSeries("", "=Worksheet1!$B$2:$B$7");
var series3 = chart.addSeries("", "=Worksheet1!$C$2:$C$7");
// Get the X axis
var xAxis = chart.getAxis("x");
xAxis.setName("Months");
xAxis.setLabelPosition("high");
xAxis.setLabelAlign("right");
// Get the Y axis
var yAxis = chart.getAxis("y");
yAxis.setName("Earnings (Millions)");
yAxis.setNumberFormat("$#,##0.00");
chart.setTitle("A sample chart");
worksheet1.insertChart(8, 1, chart);
if (!writer.save())
throw writer.getLastError();
function writeWorksheetData(worksheet)
{
var data = [
// Three columns of data.
[1, 2, 3],
[2, 4, 6],
[3, 6, 9],
[4, 8, 12],
[5, 10, 15],
[6, 12, 18]
];
var row, col;
for (row = 1; row < 7; row++)
for (col = 0; col < 3; col++)
worksheet.writeCell("number", row, col, data[row-1][col]);
}

Member Function Documentation

◆ getLastError()

String XLSXChartAxis::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 5.0e

◆ setLabelAlign()

boolean XLSXChartAxis::setLabelAlign ( String align )

Set the alignment of the axis labels.

Position the category axis labels for the chart. The labels are the numbers, or strings or dates, on the axis that indicate the categories of the axis.

Parameters
align The axis label alignment with the following available values:
  • center
  • left
  • right
Returns
true if successful, false in case of any error
Note
This function is applicable to category axes only.
Since
DOCUMENTS 5.0e
Example:
xAxis.setLabelAlign("right");

◆ setLabelPosition()

boolean XLSXChartAxis::setLabelPosition ( String position )

Position the axis labels.

Position the axis labels for the chart. The labels are the numbers, or strings or dates, on the axis that indicate the categories or values of the axis.

Parameters
position Option to position the axis labels. The following values are available:
  • nextTo: Position the axis labels next to the axis. The default.
  • high: Position the axis labels at the top of the chart, for horizontal axes, or to the right for vertical axes.
  • low: Position the axis labels at the bottom of the chart, for horizontal axes, or to the left for vertical axes.
  • none: Turn off the the axis labels.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
yAxis.setLabelPosition("high");

◆ setName()

boolean XLSXChartAxis::setName ( String name )

Set the name caption of the chart axis.

Parameters
name String containing the name caption of the axis or a formula such as "=Worksheet1!$A$1" to point to a cell in the Excel file that contains the name.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
xAxis.setName("Months");
yAxis.setName("=Worksheet1!$A$1");
See also
XLSXChartAxis.setNameRange(String sheetname, number row, number col)

◆ setNameRange()

boolean XLSXChartAxis::setNameRange | ( | String | sheetname,
 |  | number | row,
 |  | number | col
 | ) |  |

Set a chart axis name formula using row and column values.

This function can be used to set an axis name range and is an alternative to using XLSXChartAxis.setName(String name) and a string formula.

Parameters
sheetname | The name of the worksheet that contains the cell range.
row | The zero indexed row number of the range.
col | The zero indexed column number of the range.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
// Set the name formula programmatically
yAxis.setNameRange("Worksheet1", 0, 0);

◆ setNumberFormat()

boolean XLSXChartAxis::setNumberFormat ( String numFormat )

Set the format of the numbers on the axis.

Parameters
numFormat The number format string being similar to the parameter numFormat of the function XLSXFormat.setNumberFormat(String numFormat).
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
yAxis.setNumberFormat("$#,##0.00");

◆ setReverse()

boolean XLSXChartAxis::setReverse ( )

Reverse the order of the axis categories or values.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e


DOCUMENTS 5 - PortalScripting API: Member List

XLSXChartAxis Member List

This is the complete list of members for XLSXChartAxis, including all inherited members.

getLastError() | XLSXChartAxis
setLabelAlign(String align) | XLSXChartAxis
setLabelPosition(String position) | XLSXChartAxis
setName(String name) | XLSXChartAxis
setNameRange(String sheetname, number row, number col) | XLSXChartAxis
setNumberFormat(String numFormat) | XLSXChartAxis
setReverse() | XLSXChartAxis


DOCUMENTS 5 - PortalScripting API: XLSXChartSeries Class Reference

Public Member Functions | List of all members
XLSXChartSeries Class Reference

The XLSXChartSeries class represents the Excel chart data series. More...

Public Member Functions

String | getLastError ()
Function to get the description of the last error that occurred. More...
boolean | setCategories (String sheetname, number firstRow, number firstCol, number lastRow, number lastCol)
Set a series "categories" range using row and column values. More...
boolean | setName (String name)
Set the name of a chart series range. More...
boolean | setNameRange (String sheetname, number row, number col)
Set a series name formula using row and column values. More...
boolean | setValues (String sheetname, number firstRow, number firstCol, number lastRow, number lastCol)
Set a series "values" range using row and column values. More...

Detailed Description

The XLSXChartSeries class represents the Excel chart data series.

An XLSXChartSeries object is created using the XLSXChart.addSeries() function. It provides functions for configuring the chart series.

Since
DOCUMENTS 5.0e
Example:
var writer = new XLSXWriter("c:\\tmp\\chartseries.xlsx");
var worksheet1 = writer.addWorksheet("Worksheet1");
worksheet1.writeCell("string", 0, 0, "Series I");
worksheet1.writeCell("string", 0, 1, "Series II");
worksheet1.writeCell("string", 0, 2, "Series III");
// Write some data to the worksheet.
writeWorksheetData(worksheet1);
// Create a chart object.
var chart = writer.addChart(writer.CHART_COLUMN);
// Configure the chart. In simplest case we just add some value data series.
// The empty categories will default to 1 to 6 like in Excel.
var series1 = chart.addSeries("", "=Worksheet1!$A$2:$A$7");
var series2 = chart.addSeries("", "=Worksheet1!$B$2:$B$7");
var series3 = chart.addSeries();
// Configure the series using a syntax that is easier to define programmatically.
series3.setCategories("Worksheet1", 1, 0, 6, 0); // "=Worksheet1!$A$2:$A$7"
series3.setValues("Worksheet1", 1, 2, 6, 2); // "=Worksheet1!$C$2:$C$7"
series1.setName("Series I");
series2.setName("=Worksheet1!$B$1");
series3.setNameRange("Worksheet1", 0, 2);
chart.setTitle("A sample chart");
worksheet1.insertChart(8, 1, chart);
if (!writer.save())
throw writer.getLastError();
function writeWorksheetData(worksheet)
{
var data = [
// Three columns of data.
[1, 2, 3],
[2, 4, 6],
[3, 6, 9],
[4, 8, 12],
[5, 10, 15],
[6, 12, 18]
];
var row, col;
for (row = 1; row < 7; row++)
for (col = 0; col < 3; col++)
worksheet.writeCell("number", row, col, data[row-1][col]);
}
See also
XLSXChart.addSeries(String categories, String values)

Member Function Documentation

◆ getLastError()

String XLSXChartSeries::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 5.0e

◆ setCategories()

boolean XLSXChartSeries::setCategories | ( | String | sheetname,
 |  | number | firstRow,
 |  | number | firstCol,
 |  | number | lastRow,
 |  | number | lastCol
 | ) |  |

Set a series "categories" range using row and column values.

The categories and values of a chart data series are generally set using the XLSXChart.addSeries(String categories, String values) function and Excel range formulas like "=Worksheet1!$A$2:$A$7". This function is an alternative method that is easier to generate programmatically. It requires that you do not set the optional parameters (categories and values) in XLSXChart.addSeries() and then set them using row and column values in this function and XLSXChartSeries.setValues().

Parameters
sheetname | The name of the worksheet that contains the data range.
firstRow | The first row of the range. (All zero indexed.)
firstCol | The first column of the range.
lastRow | The last row of the range.
lastCol | The last col of the range.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var series3 = chart.addSeries();
// Configure the series using a syntax that is easier to define programmatically.
series3.setCategories("Worksheet1", 0, 0, 5, 0); // "=Worksheet1!$A$1:$A$6"
series3.setValues("Worksheet1", 0, 2, 5, 2); // "=Worksheet1!$C$1:$C$6"
See also
XLSXChartSeries.setValues(String sheetname, number firstRow, number firstCol, number lastRow, number lastCol)

◆ setName()

boolean XLSXChartSeries::setName ( String name )

Set the name of a chart series range.

The series name in Excel is displayed in the chart legend and in the formula bar. The name property is optional and if it isn't supplied it will default to Series 1..n.

Parameters
name String containing the series name or a formula such as "=Worksheet1!$A$1" to point to a cell in the Excel file that contains the name.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
series1.setName("Quarterly budget data");
series2.setName("=Worksheet1!$A$1");
See also
XLSXChartSeries.setNameRange(String sheetname, number row, number col)

◆ setNameRange()

boolean XLSXChartSeries::setNameRange | ( | String | sheetname,
 |  | number | row,
 |  | number | col
 | ) |  |

Set a series name formula using row and column values.

This function can be used to set a series name range and is an alternative to using XLSXChartSeries.setName(String name) and a string formula.

Parameters
sheetname | The name of the worksheet that contains the cell range.
row | The zero indexed row number of the range.
col | The zero indexed column number of the range.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
// Set the name formula programmatically
series2.setNameRange("Worksheet1", 0, 0);

◆ setValues()

boolean XLSXChartSeries::setValues | ( | String | sheetname,
 |  | number | firstRow,
 |  | number | firstCol,
 |  | number | lastRow,
 |  | number | lastCol
 | ) |  |

Set a series "values" range using row and column values.

This function is an alternative method to configure the series using a syntax that is easier to define programmatically. See the documentation for XLSXChartSeries.setCategories().

Parameters
sheetname | The name of the worksheet that contains the data range.
firstRow | The first row of the range. (All zero indexed.)
firstCol | The first column of the range.
lastRow | The last row of the range.
lastCol | The last col of the range.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
See also
XLSXChartSeries.setCategories(String sheetname, number firstRow, number firstCol, number lastRow, number lastCol)


DOCUMENTS 5 - PortalScripting API: Member List

XLSXChartSeries Member List

This is the complete list of members for XLSXChartSeries, including all inherited members.

getLastError() | XLSXChartSeries
setCategories(String sheetname, number firstRow, number firstCol, number lastRow, number lastCol) | XLSXChartSeries
setName(String name) | XLSXChartSeries
setNameRange(String sheetname, number row, number col) | XLSXChartSeries
setValues(String sheetname, number firstRow, number firstCol, number lastRow, number lastCol) | XLSXChartSeries


DOCUMENTS 5 - PortalScripting API: XLSXChartsheet Class Reference

Public Member Functions | List of all members
XLSXChartsheet Class Reference

The XLSXChartsheet class represents the Excel chartsheet. More...

Public Member Functions

String | getLastError ()
Function to get the description of the last error that occurred. More...
boolean | insertChart (XLSXChart chart)
Insert a chart into the current chartsheet. More...
boolean | setFirstSheet ()
Set current chartsheet as the first visible sheet tab. More...
boolean | setFooter (String footer, number margin=0.3)

Set the printed page footer caption. More...
boolean | setHeader (String header, number margin=0.3)

Set the printed page header caption. More...
boolean | setLandscape ()
Set the page orientation as landscape. More...
boolean | setMargins (number left=-1, number right=-1, number top=-1, number bottom=-1)

Set the worksheet margins for the printed page. More...
boolean | setPaperType (number type=0)

Set the paper format for the printed output of the current chartsheet. More...
boolean | setPortrait ()
Set the page orientation as portrait. More...
boolean | setTabColor (number color)

Set the color of the current chartsheet tab. More...
boolean | setZoom (number scale=100)

Set the chartsheet zoom factor. More...

Detailed Description

The XLSXChartsheet class represents the Excel chartsheet.

An Excel chartsheet is a type of worksheet that only contains a chart. An XLSXChartsheet object isn't created directly. Instead it is created by calling the XLSXWriter.addChartsheet(String name) function from an XLSXWriter object. A chartsheet functions as a worksheet and not as a chart. In order to have it display data a chart must be created and added to the chartsheet. The data for the chartsheet chart must be contained on a separate worksheet. That is why it is always created in conjunction with at least one data worksheet.

Since
DOCUMENTS 5.0e
Example:
var writer = new XLSXWriter("c:\\tmp\\chartsheet.xlsx");
// Add an worksheet with a user defined sheet name.
var worksheet1 = writer.addWorksheet("Worksheet1");
// Write some data to the worksheet.
writeWorksheetData(worksheet1);
// Create a chart object.
var chart = writer.addChart(writer.CHART_COLUMN);
// Configure the chart. In simplest case we just add some value data
// series. The NULL categories will default to 1 to 5 like in Excel.
var series1 = chart.addSeries("", "=Worksheet1!$A$1:$A$5");
var series2 = chart.addSeries("", "=Worksheet1!$B$1:$B$5");
var series3 = chart.addSeries("", "=Worksheet1!$C$1:$C$5");
// Add a chartsheet with a user defined name
var chartsheet1 = writer.addChartsheet("Chartsheet1");
// Insert the chart into the chartsheet
chartsheet1.insertChart(chart);
// Save the file.
if (!writer.save())
throw writer.getLastError();
function writeWorksheetData(worksheet)
{
var data = [
// Three columns of data.
[1, 2, 3],
[2, 4, 6],
[3, 6, 9],
[4, 8, 12],
[5, 10, 15]
];
var row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet.writeCell("number", row, col, data[row][col]);
}

Member Function Documentation

◆ getLastError()

String XLSXChartsheet::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 5.0e

◆ insertChart()

boolean XLSXChartsheet::insertChart ( XLSXChart chart )

Insert a chart into the current chartsheet.

This function can be used to insert an XLSXChart object into the chartsheet. The XLSXChart object must be created first using the XLSXWriter.addChart(number type) function and configured using the functions from the class XLSXChart.

Parameters
chart An XLSXChart object created via XLSXWriter.addChart(number type).
Returns
true if successful, false in case of any error
Note
A chart may only be inserted into a chartsheet or a worksheet once. If several similar charts are required then each one must be created separately with XLSXWriter.addChart(number type).
Since
DOCUMENTS 5.0e
Example:
// Create a chart object.
var chart = writer.addChart(writer.CHART_COLUMN);
// Add some data series to the chart.
var series1 = chart.addSeries("", "Worksheet1!$A$1:$A$5");
var series2 = chart.addSeries("", "Worksheet1!$B$1:$B$5");
var series3 = chart.addSeries("", "Worksheet1!$C$1:$C$5");
// Insert the chart into the chartsheet.
if (!chartsheet1.insertChart(chart))
throw chartsheet1.getLastError();
See also
XLSXWorksheet.insertChart(number row, number col, XLSXChart chart, number xOffset, number yOffset, number xScale, number yScale);

◆ setFirstSheet()

boolean XLSXChartsheet::setFirstSheet ( )

Set current chartsheet as the first visible sheet tab.

The XLSXWriter.activateChartsheet(var chartsheet) function determines which chartsheet is initially selected. However, if there are a large number of chartsheets the selected chartsheet may not appear on the screen. To avoid this you can select the leftmost visible chartsheet tab using this function. The default value is the first chartsheet.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
chartsheet19.setFirstSheet(); // chartsheet19: First visible chartsheet tab.
writer.activateChartsheet(Chartsheet20); // chartsheet20: First visible chartsheet.

◆ setFooter()

boolean XLSXChartsheet::setFooter | ( | String | footer,
 |  | number | margin = 0.3
 | ) |  |

Set the printed page footer caption.

Footers are generated using a string which is a combination of plain text and control characters (see Generating header/footer for more details).

Parameters
footer | The footer string.
margin | Optional footer margin in inches. Excel default is 0.3.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!chartsheet1.setFooter("some text", 0.2))
throw chartsheet1.getLastError();

◆ setHeader()

boolean XLSXChartsheet::setHeader | ( | String | header,
 |  | number | margin = 0.3
 | ) |  |

Set the printed page header caption.

Headers are generated using a string which is a combination of plain text and control characters (see Generating header/footer for more details).

Parameters
header | The header string.
margin | Optional header margin in inches. Excel default is 0.3.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!chartsheet1.setHeader("some text", 0.2))
throw chartsheet1.getLastError();

◆ setLandscape()

boolean XLSXChartsheet::setLandscape ( )

Set the page orientation as landscape.

This function is used to set the orientation of the chartsheet's printed page to landscape.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ setMargins()

boolean XLSXChartsheet::setMargins | ( | number | left = -1,
 |  | number | right = -1,
 |  | number | top = -1,
 |  | number | bottom = -1
 | ) |  |

Set the worksheet margins for the printed page.

This function is used to set the margins of the chartsheet when it is printed. The units are in inches. Specifying -1 for any parameter will give the default Excel value as shown below.

Parameters
left | Optional left margin in inches. Excel default is 0.7.
right | Optional right margin in inches. Excel default is 0.7.
top | Optional top margin in inches. Excel default is 0.75.
bottom | Optional bottom margin in inches. Excel default is 0.75.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
chartsheet1.setMargins(1.3, 1.2, -1, -1);

◆ setPaperType()

boolean XLSXChartsheet::setPaperType ( number type = 0 )

Set the paper format for the printed output of the current chartsheet.

Parameters
type Optional integer paper format type. If you do not specify a paper type the chartsheet will print using the printer's default paper style. See XLSXWorksheet.setPaperType(number type) for a full list of available paper sizes.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
chartsheet1.setPaperType(1); // US Letter
chartsheet2.setPaperType(9); // A4

◆ setPortrait()

boolean XLSXChartsheet::setPortrait ( )

Set the page orientation as portrait.

This function is used to set the orientation of the chartsheet's printed page to portrait. The default chartsheet orientation is portrait, so this function isn't generally required.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ setTabColor()

boolean XLSXChartsheet::setTabColor ( number color )

Set the color of the current chartsheet tab.

Parameters
color The desired tab color specified using a HTML style RGB integer value.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
chartsheet1.setTabColor(0xFF9900); // Orange
chartsheet1.setTabColor(writer.COLOR_RED); // from Predefined values for common colors

◆ setZoom()

boolean XLSXChartsheet::setZoom ( number scale = 100 )

Set the chartsheet zoom factor.

Parameters
scale Optional integer chartsheet zoom factor in the range 10 <= zoom <= 400.
The default zoom factor is 100.
Returns
true if successful, false in case of any error
Note
This function does not affect the scale of the printed page.
Since
DOCUMENTS 5.0e
Example:
chartsheet1.setZoom(50);


DOCUMENTS 5 - PortalScripting API: Member List

XLSXChartsheet Member List

This is the complete list of members for XLSXChartsheet, including all inherited members.

getLastError() | XLSXChartsheet
insertChart(XLSXChart chart) | XLSXChartsheet
setFirstSheet() | XLSXChartsheet
setFooter(String footer, number margin=0.3) | XLSXChartsheet
setHeader(String header, number margin=0.3) | XLSXChartsheet
setLandscape() | XLSXChartsheet
setMargins(number left=-1, number right=-1, number top=-1, number bottom=-1) | XLSXChartsheet
setPaperType(number type=0) | XLSXChartsheet
setPortrait() | XLSXChartsheet
setTabColor(number color) | XLSXChartsheet
setZoom(number scale=100) | XLSXChartsheet


DOCUMENTS 5 - PortalScripting API: XLSXFormat Class Reference

Public Member Functions | List of all members
XLSXFormat Class Reference

The XLSXFormat class allows formatting cells in Excel. More...

Public Member Functions

String | getLastError ()
Function to get the description of the last error that occurred. More...
boolean | setAlign (number alignment)
Set the alignment for data in a cell. More...
boolean | setBackgroundColor (number color)
Set the background color of the pattern for a cell. More...
boolean | setBackgroundPattern (number pattern)
Set the background fill pattern for a cell. More...
boolean | setBorderColor (String border, number color)
Set the color of the cell border. More...
boolean | setBorderStyle (String border, number style)
Set the cell border style. More...
boolean | setFontColor (number color)
Set the color of the font used in the cell. More...
boolean | setFontName (String name)
Set the font used in the cell. More...
boolean | setFontScript (String style)
Set the script style of the font. More...
boolean | setFontSize (number size)
Set the size of the font used in the cell. More...
boolean | setFontStyle (String style)
Set the font style for the format. More...
boolean | setForegroundColor (number color)
Set the foreground color of the pattern for a cell. More...
boolean | setIndent (number level)
Set the cell text indentation level. More...
boolean | setNumberFormat (String numFormat)
Set the number format for a cell. More...
boolean | setShrink ()
Turn on the text "shrink to fit" for a cell. More...
boolean | setTextWrap ()
Wrap text in a cell. More...

Detailed Description

The XLSXFormat class allows formatting cells in Excel.

An XLSXFormat object isn't created directly. Instead an XLSXFormat is created by calling the XLSXWriter.addFormat(String name) function from an XLSXWriter object. The properties of a cell that can be formatted include: fonts, colors, patterns, borders, alignment and number formatting.

Since
DOCUMENTS 5.0e
Example:
var writer = new XLSXWriter("c:\\tmp\\format.xlsx");
// Add a worksheet with a user defined sheet name.
var worksheet1 = writer.addWorksheet("Worksheet1");
// Add a cell format.
var format1 = writer.addFormat("format1");
// Set the font name for the format
format1.setFontName("Times New Roman");
// Set the bold property for the format.
format1.setFontStyle("bold");
// Set the alignment for the format
format1.setAlign(writer.ALIGN_CENTER);
// Wrap text in a cell
format1.setTextWrap();
// Set cell border color
format1.setBorderColor("right", writer.COLOR_RED);
// Set cell border style
format1.setBorderStyle("right", writer.BORDER_DOUBLE);
// Write a string using the format
worksheet1.writeCell("string", 0, 0, "Some long text to wrap in a cell", format1);
// Set a number format
format1.setNumberFormat("0 \"dollar and\" .00 \"cents\"");
// Write a number using the format.
worksheet1.writeCell("number", 0, 1, 1.87, format1);
// Change the column width
worksheet1.setColumn(1, 1, 30);
// Save the file.
if (!writer.save())
throw writer.getLastError();

Member Function Documentation

◆ getLastError()

String XLSXFormat::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 5.0e

◆ setAlign()

boolean XLSXFormat::setAlign ( number alignment )

Set the alignment for data in a cell.

As in Excel, vertical and horizontal alignments can be combined. Text can be aligned across two or more adjacent cells using the center_across property. However, for genuine merged cells it is better to use the XLSXWorksheet.mergeRange() method.

The vertical justify option can be used to provide automatic text wrapping in a cell. The height of the cell will be adjusted to accommodate the wrapped text.

Parameters
alignment The horizontal or vertical alignment direction (see "Text alignments").
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var format1 = writer.addFormat("format1");
// Vertical and horizontal alignments can be combined
format1.setAlign(writer.ALIGN_CENTER);
format1.setAlign(writer.ALIGN_VERTICAL_CENTER);
See also
XLSXWorksheet.mergeRange(number firstRow, number firstCol, number lastRow, number lastCol, String value, XLSXFormat format)
XLSXFormat.setTextWrap()

◆ setBackgroundColor()

boolean XLSXFormat::setBackgroundColor ( number color )

Set the background color of the pattern for a cell.

Parameters
color The cell pattern background color being a RGB integer value.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ setBackgroundPattern()

boolean XLSXFormat::setBackgroundPattern ( number pattern )

Set the background fill pattern for a cell.

Parameters
pattern Pattern index from "Background patterns".
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var format1 = writer.addFormat("format1");
// The most common pattern is a solid fill of the background color.
format1.setBackgroundPattern(writer.PATTERN_SOLID);
format1.setBackgroundColor(writer.COLOR_YELLOW);

◆ setBorderColor()

boolean XLSXFormat::setBorderColor | ( | String | border,
 |  | number | color
 | ) |  |

Set the color of the cell border.

Parameters
border String specifying which cell border(s) the color to be set for. The following values are available:
  • left: the left cell border
  • right: the right cell border
  • top: the top cell border
  • bottom: the bottom cell border
  • all: all cell borders
color The desired cell border color being a RGB integer value.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var format1 = writer.addFormat("format1");
format1.setBorderColor("bottom", writer.COLOR_RED);
format1.setBorderStyle("bottom", writer.BORDER_DOUBLE);

◆ setBorderStyle()

boolean XLSXFormat::setBorderStyle | ( | String | border,
 |  | number | style
 | ) |  |

Set the cell border style.

Parameters
border String specifying which cell border(s) the style to be set for. The following values are available:
  • left: the left cell border
  • right: the right cell border
  • top: the top cell border
  • bottom: the bottom cell border
  • all: all cell borders
style Border style index from "Cell border styles".
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var format1 = writer.addFormat("format1");
format1.setBorderStyle("bottom", writer.BORDER_THIN);

◆ setFontColor()

boolean XLSXFormat::setFontColor ( number color )

Set the color of the font used in the cell.

Parameters
color The cell font color being a RGB integer value.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ setFontName()

boolean XLSXFormat::setFontName ( String name )

Set the font used in the cell.

Parameters
name Optional String containing the cell font name. The default value is "Calibri".
Returns
true if successful, false in case of any error
Note
Excel can only display fonts that are installed on the system that it is running on. Therefore it is generally best to use the fonts that come as standard with Excel such as Calibri, Times New Roman and Courier New. The default font in Excel 2007, and later, is Calibri.
Since
DOCUMENTS 5.0e

◆ setFontScript()

boolean XLSXFormat::setFontScript ( String style )

Set the script style of the font.

Parameters
style Script style. The following styles are available:
  • super:superscript style
  • sub: subscript style
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ setFontSize()

boolean XLSXFormat::setFontSize ( number size )

Set the size of the font used in the cell.

Parameters
size The cell font size.
Returns
true if successful, false in case of any error
Note
Excel adjusts the height of a row to accommodate the largest font size in the row. You can also explicitly specify the height of a row using the XLSXWorksheet.setRow() function.
Since
DOCUMENTS 5.0e

◆ setFontStyle()

boolean XLSXFormat::setFontStyle ( String style )

Set the font style for the format.

Parameters
style String containing the font style. The following font styles are available:
  • bold
  • italic
  • underline
  • strikeout
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var format1 = writer.addFormat("format1");
format1.setFontStyle("bold");

◆ setForegroundColor()

boolean XLSXFormat::setForegroundColor ( number color )

Set the foreground color of the pattern for a cell.

Parameters
color The cell pattern foreground color being a RGB integer value.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ setIndent()

boolean XLSXFormat::setIndent ( number level )

Set the cell text indentation level.

Parameters
level Integer indentation level.
Returns
true if successful, false in case of any error
Note
Indentation is a horizontal alignment property. It will override any other horizontal properties but it can be used in conjunction with vertical properties.
Since
DOCUMENTS 5.0e
Example:
var format1 = writer.addFormat("format1");
var format2 = writer.addFormat("format2");
format1.setIndent(1);
format2.setIndent(2);
worksheet1.writeString(0, 0, "This text is indented 1 level", format1);
worksheet1.writeString(1, 0, "This text is indented 2 levels", format2);

◆ setNumberFormat()

boolean XLSXFormat::setNumberFormat ( String numFormat )

Set the number format for a cell.

This method is used to define the numerical format of a number in Excel. It controls whether a number is displayed as an integer, a floating point number, a date, a currency value or some other user defined format. For more information about number formats in Excel refer to the Microsoft documentation for number formats.

Parameters
numFormat The numerical format of a cell specified by using a format string.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var writer = new XLSXWriter("c:\\tmp\\numFormat.xlsx");
// Add a worksheet with a user defined sheet name.
var worksheet1 = writer.addWorksheet("Worksheet1");
// Widen the first column to make the text clearer.
worksheet1.setColumn(0, 0, 30);
// Add some formats.
var format01 = writer.addFormat("format01");
var format02 = writer.addFormat("format02");
var format03 = writer.addFormat("format03");
var format04 = writer.addFormat("format04");
var format05 = writer.addFormat("format05");
var format06 = writer.addFormat("format06");
var format07 = writer.addFormat("format07");
var format08 = writer.addFormat("format08");
var format09 = writer.addFormat("format09");
var format10 = writer.addFormat("format10");
var format11 = writer.addFormat("format11");
// Set some example number formats.
format01.setNumberFormat("0.000");
format02.setNumberFormat("#,##0");
format03.setNumberFormat("#,##0.00");
format04.setNumberFormat("0.00");
format05.setNumberFormat("mm/dd/yyyy");
format06.setNumberFormat("mmm d yyyy");
format07.setNumberFormat("d mmmm yyyy");
format08.setNumberFormat("dd/mm/yyyy hh:mm AM/PM");
format09.setNumberFormat("0 \"dollar and\" .00 \"cents\"");
// Write data using the formats.
worksheet1.writeCell("number", 0, 0, 3.1415926); // 3.1415926
worksheet1.writeCell("number", 1, 0, 3.1415926, format01); // 3.142
worksheet1.writeCell("number", 2, 0, 1234.56, format02); // 1,235
worksheet1.writeCell("number", 3, 0, 1234.56, format03); // 1,234.56
worksheet1.writeCell("number", 4, 0, 49.99, format04); // 49.99
worksheet1.writeCell("number", 5, 0, 36892.521, format05); // 01/01/2001
worksheet1.writeCell("number", 6, 0, 36892.521, format06); // Jan 1 2001
worksheet1.writeCell("number", 7, 0, 36892.521, format07); // 1 January 2001
worksheet1.writeCell("number", 8, 0, 36892.521, format08); // 01/01/2001 12:30 PM
worksheet1.writeCell("number", 9, 0, 1.87, format09); // 1 dollar and .87 cents
// Show limited conditional number formats.
format10.setNumberFormat("[Green]General;[Red]-General;General");
worksheet1.writeCell("number", 10, 0, 123, format10); // > 0 Green
worksheet1.writeCell("number", 11, 0, -45, format10); // < 0 Red
worksheet1.writeCell("number", 12, 0, 0, format10); // = 0 Default color
// Format a Zip code.
format11.setNumberFormat("00000");
worksheet1.writeCell("number", 13, 0, 1209, format11);
worksheet1.setGridlines("showPrint");
// Save the file.
if (!writer.save())
throw writer.getLastError();

◆ setShrink()

boolean XLSXFormat::setShrink ( )

Turn on the text "shrink to fit" for a cell.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var format1 = writer.addFormat("format1");
format1.setShrink();
worksheet1.writeCell("string", 0, 0, "Shrink text so that it fits in a cell", format1);

◆ setTextWrap()

boolean XLSXFormat::setTextWrap ( )

Wrap text in a cell.

If you wish to control where the text is wrapped you can add newline characters to the string. Excel will adjust the height of the row to accommodate the wrapped text. A similar effect can be obtained without newlines using the XLSXFormat.setAlign(number alignment) function with XLSXWriter.ALIGN_VERTICAL_JUSTIFY.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var format1 = writer.addFormat("format1");
format1.setTextWrap();
worksheet1.writeCell("string", 0, 0, "Some long text to wrap in a cell", format1);


DOCUMENTS 5 - PortalScripting API: Member List

XLSXFormat Member List

This is the complete list of members for XLSXFormat, including all inherited members.

getLastError() | XLSXFormat
setAlign(number alignment) | XLSXFormat
setBackgroundColor(number color) | XLSXFormat
setBackgroundPattern(number pattern) | XLSXFormat
setBorderColor(String border, number color) | XLSXFormat
setBorderStyle(String border, number style) | XLSXFormat
setFontColor(number color) | XLSXFormat
setFontName(String name) | XLSXFormat
setFontScript(String style) | XLSXFormat
setFontSize(number size) | XLSXFormat
setFontStyle(String style) | XLSXFormat
setForegroundColor(number color) | XLSXFormat
setIndent(number level) | XLSXFormat
setNumberFormat(String numFormat) | XLSXFormat
setShrink() | XLSXFormat
setTextWrap() | XLSXFormat


DOCUMENTS 5 - PortalScripting API: XLSXWorksheet Class Reference

Public Member Functions | List of all members
XLSXWorksheet Class Reference

The XLSXWorksheet class represents the Excel worksheet. More...

Public Member Functions

boolean | addAutofilter (number firstRow, number firstCol, number lastRow, number lastCol)
Add an autofilter area to the current worksheet. More...
boolean | freezePanes (number row, number col)
Split and freeze the current worksheet into panes. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
boolean | importFromJSON (String jsonString, number row=0, number col=0)
Import data from a JSON-String to the current worksheet. More...
boolean | importFromJSONFile (String jsonFilePath, number row=0, number col=0)
Import data from a file containing a JSON-String to the current worksheet. More...
boolean | insertChart (number row, number col, XLSXChart chart, number xOffset=0, number yOffset=0, number xScale=1, number yScale=1)
Insert a chart into the current worksheet. More...
boolean | insertImage (number row, number col, String filename, number xOffset=0, number yOffset=0, number xScale=1, number yScale=1)
Insert an image in a worksheet cell specified by row and column. More...
boolean | mergeRange (number firstRow, number firstCol, number lastRow, number lastCol, String value, XLSXFormat format=null)
Merge a range of cells. More...
boolean | setColumn (number firstCol, number lastCol, number width=8.43, XLSXFormat format=null, boolean hidden=false, number level=0, boolean collapsed=false)
Set the properties for one or more columns of cells. More...
boolean | setFirstSheet ()
Set current worksheet as the first visible sheet tab. More...
boolean | setFooter (String footer, number margin=0.3)
Set the printed page footer caption. More...
boolean | setGridlines (string option)
Set the option to display or hide gridlines on the screen and the printed page. More...
boolean | setHeader (String header, number margin=0.3)
Set the printed page header caption. More...
boolean | setHorizontalPagebreaks (number[] breaks)
Set the horizontal page breaks on the current worksheet. More...
boolean | setLandscape ()
Set the page orientation as landscape. More...
boolean | setMargins (number left=-1, number right=-1, number top=-1, number bottom=-1)
Set the worksheet margins for the printed page. More...
boolean | setPageView ()
Set the page layout to page view mode. More...
boolean | setPaperType (number type=0)
Set the paper format for the printed output of the current worksheet. More...
boolean | setPortrait ()
Set the page orientation as portrait. More...
boolean | setRow (number row, number height=15, XLSXFormat format=null, boolean hidden=false, number level=0, boolean collapsed=false)
Set the properties for a row of cells. More...
boolean | setTabColor (number color)
Set the color of the current worksheet tab. More...
boolean | setVerticalPagebreaks (number[] breaks)
Set the vertical page breaks on the current worksheet. More...
boolean | setZoom (number scale=100)
Set the worksheet zoom factor. More...
boolean | splitPanes (number vertical, number horizontal)
Split the current worksheet into panes. More...
boolean | writeBlank (number row, number col, XLSXFormat format=null)
Write a blank cell specified by row and column. More...
boolean | writeBoolean (number row, number col, boolean value, XLSXFormat format=null)
Write an Excel boolean to a worksheet cell specified by row and column. More...
boolean | writeCell (String type, number row, number col, var value, XLSXFormat format=null)
Write a value to a worksheet cell. More...
boolean | writeDatetime (number row, number col, Date value, XLSXFormat format=null)
Write a date or time to a worksheet cell specified by row and column. More...
boolean | writeFormula (number row, number col, String value, XLSXFormat format=null)
Write a formula or function to a worksheet cell specified by row and column. More...
boolean | writeLink (number row, number col, String value, XLSXFormat format=null)
Write a URL/hyperlink to a worksheet cell specified by row and column. More...
boolean | writeNumber (number row, number col, number value, XLSXFormat format=null)
Write a numeric value to a worksheet cell specified by row and column. More...
boolean | writeRichString (number row, number col, String value, XLSXFormat format=null)
Write strings with multiple formats to a worksheet cell specified by row and column. More...
boolean | writeString (number row, number col, String value, XLSXFormat format=null)
Write a string to a worksheet cell specified by row and column. More...

Detailed Description

The XLSXWorksheet class represents the Excel worksheet.

An XLSXWorksheet object isn't created directly. Instead an XLSXWorksheet is created by calling the XLSXWriter.addWorksheet(String name) function from an XLSXWriter object. It handles operations such as writing data to cells or formatting worksheet layout.

Since
DOCUMENTS 5.0e
Example:
var writer = new XLSXWriter("c:\\tmp\\worksheet.xlsx");
// Add a worksheet with a user defined sheet name.
var worksheet1 = writer.addWorksheet("Worksheet1");
// Add a cell format.
var format1 = writer.addFormat("format1");
// Set the bold property for the format.
format1.setFontStyle("bold");
// Set the alignment for the format
format1.setAlign(writer.ALIGN_CENTER);
// Write formatted data.
worksheet1.writeCell("string", 0, 0, "Hello Excel", format1);
// Change the row height
worksheet1.setRow(0, 20);
// Change the column width
worksheet1.setColumn(0, 0, 15);
// Save the file.
if (!writer.save())
throw writer.getLastError();

Member Function Documentation

◆ addAutofilter()

boolean XLSXWorksheet::addAutofilter | ( | number | firstRow,
 |  | number | firstCol,
 |  | number | lastRow,
 |  | number | lastCol
 | ) |  |

Add an autofilter area to the current worksheet.

An autofilter is a way of adding drop down lists to the headers of a 2D range of worksheet data. This allows users to filter the data based on simple criteria so that some data is shown and some is hidden.

Parameters
firstRow | The first row of the range. (All zero indexed.)
firstCol | The first column of the range.
lastRow | The last row of the range.
lastCol | The last column of the range.
Returns
true if successful, false in case of any error
Note
It isn't currently possible to apply filter conditions to the autofilter.
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.addAutofilter(0, 0, 50, 3))
throw worksheet1.getLastError();

◆ freezePanes()

boolean XLSXWorksheet::freezePanes | ( | number | row,
 |  | number | col
 | ) |  |

Split and freeze the current worksheet into panes.

This function can be used to divide a worksheet into horizontal or vertical regions known as panes and to "freeze" these panes so that the splitter bars are not visible.

The parameters row and col are used to specify the location of the split. It should be noted that the split is specified at the top or left of a cell and that the function uses zero based indexing. Therefore to freeze the first row of a worksheet it is necessary to specify the split at row 2 (which is 1 as the zero-based index).

You can set one of the row and col parameters as zero if you do not want either a vertical or horizontal split.

Parameters
row | The cell row (zero indexed).
col | The cell column (zero indexed).
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
worksheet1.freezePanes(1, 0); // Freeze the first row.
worksheet2.freezePanes(0, 1); // Freeze the first column.
worksheet3.freezePanes(1, 1); // Freeze first row/column.

◆ getLastError()

String XLSXWorksheet::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 5.0e

◆ importFromJSON()

boolean XLSXWorksheet::importFromJSON | ( | String | jsonString,
 |  | number | row = 0,
 |  | number | col = 0
 | ) |  |

Import data from a JSON-String to the current worksheet.

Parameters
jsonString | Containing the data to be imported.
row | Optional the zero indexed row number of the first cell of the area the data to be written to.
col | Optional the zero indexed column number of the first cell of the area the data to be written to.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

Specification of the JSON-String / object-structure

The JSON-String represents a table and has the following structure:

{
"formats" : [Format-Defintion1, Format-Defintion2, ...],
"table" : {
"columns" : [Column-Defintion1, Column-Defintion2, Column-Defintion3, ...],
"body" : {
"rows" : [
[val_11, val_12, val_13, ...],
[val_21, val_22, val_23, ...],
....
]
}
}
}
  • formats: array of format-definitions, that can be used for the columns-header and body (how shall a cell look like)
  • table: contains columns definition and the table-data (body)
  • columns: array of columns-definitions with specification of column-label and column style
  • rows: array of arrays - each array specify one line in the table

Format-Definition

{
"name" : formatName,
"bgcolor" : colorName, // optional
"pattern" : patternName, // optional
"fontcolor" : colorName, // optional
"fontstyle" : styleName, // optional
"fontsize" : int-value, // optional
"cellborder" : int-value, // optional
"align" : alignStyle, // optional
"numformat" : "format-string" // optional
// colorName = 0xaabbcc , "black", "blue", "brown", "cyan", "gray", "green", "lime", "magenta", "navy", "orange", "pink", "purple", "red", "silver", "white", "yellow"
// patternName = "solid", "mediumgrey", "lightgrey"
// styleName = "bold", "italic"
// alignStyle = "left", "center", "right"
}

Column-Definition

{
"label" : "Column-Label", // optional
"header" : "Name of Format-Definition for the column in the 1. row", // optional
"body" : "Name of Format-Definition for the column in the 2+. row", // optional
"width" : int-value, // optional
}
Example:
// Definition of the data object
var impobj = {}
// first some format definitions, that will be used as header and body defs
impobj.formats = [];
impobj.formats[0] = {};
impobj.formats[0].name = "header";
impobj.formats[0].fontsize = 11;
impobj.formats[0].bgcolor = "gray";
impobj.formats[1] = {};
impobj.formats[1].name = "headerRight";
impobj.formats[1].fontsize = 11;
impobj.formats[1].bgcolor = 0x00FF00;
impobj.formats[1].align = "right";
impobj.formats[2] = {};
impobj.formats[2].name = "headerBold";
impobj.formats[2].fontsize = 11;
impobj.formats[2].bgcolor = "silver";
impobj.formats[2].fontstyle = "bold";
impobj.formats[3] = {};
impobj.formats[3].name = "bodyString";
impobj.formats[3].cellborder = 1;
impobj.formats[4] = {};
impobj.formats[4].name = "bodyNum";
impobj.formats[4].cellborder = 1;
impobj.formats[4].numformat = "#,##0.00";
impobj.formats[5] = {};
impobj.formats[5].name = "bodyDate";
impobj.formats[5].numformat = "yyyy-mm-dd";
// Data table
impobj.table = {};
impobj.table.columns = [];
// Definition of the columns
impobj.table.columns[0] = {};
impobj.table.columns[0].label = "String Label";
impobj.table.columns[0].width = 100;
impobj.table.columns[0].header = "headerBold";
impobj.table.columns[0].body = "bodyString";
impobj.table.columns[1] = {};
impobj.table.columns[1].label = "Number Label";
impobj.table.columns[1].width = 20;
impobj.table.columns[1].header = "headerRight";
impobj.table.columns[1].body = "bodyNum";
impobj.table.columns[2] = {};
impobj.table.columns[2].label = "Date Label";
impobj.table.columns[2].width = 30;
impobj.table.columns[2].header = "header";
impobj.table.columns[2].body = "bodyDate";
// Now add 3 rows with data
impobj.table.body = {};
impobj.table.body.rows = [];
impobj.table.body.rows.push( ["Hello", 2117.99, util.convertDateToExcelDate(new Date())] );
impobj.table.body.rows.push( ["World", 42, util.convertDateToExcelDate(new Date(2018, 11, 31))] );
impobj.table.body.rows.push( ["again", -42.30, new Date()] );
// Data object is now complete
// Create the JSON String..
var jsonString = JSON.stringify(impobj, null, 2);
var writer = new XLSXWriter("c:\\tmp\\importJson.xlsx")
var sheet = writer.addWorksheet("Sheet1");
if (!sheet.importFromJSON(jsonString))
throw sheet.getLastError();
if (!writer.save())
throw writer.getLastError();
See also
XLSXWorksheet.importFromJSONFile(String jsonFilePath, number row, number col)

◆ importFromJSONFile()

boolean XLSXWorksheet::importFromJSONFile | ( | String | jsonFilePath,
 |  | number | row = 0,
 |  | number | col = 0
 | ) |  |

Import data from a file containing a JSON-String to the current worksheet.

Parameters
jsonFilePath | The JSON-file path.
row | Optional the zero indexed row number of the first cell of the area the data to be written to.
col | Optional the zero indexed column number of the first cell of the area the data to be written to.
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.importFromJSONFile("c:\\tmp\\json.txt"))
throw worksheet1.getLastError();
See also
XLSXWorksheet.importFromJSON(String jsonString, number row, number col)

◆ insertChart()

boolean XLSXWorksheet::insertChart | ( | number | row,
 |  | number | col,
 |  | XLSXChart | chart,
 |  | number | xOffset = 0,
 |  | number | yOffset = 0,
 |  | number | xScale = 1,
 |  | number | yScale = 1
 | ) |  |

Insert a chart into the current worksheet.

This function can be used to insert an XLSXChart object into a worksheet. It takes additional optional parameters to position and scale the image of the chart. The XLSXChart object must be created first using the XLSXWriter.addChart(number type) function and configured using the functions from the class XLSXChart.

Parameters
row | The zero indexed row number.
col | The zero indexed column number.
chart | An XLSXChart object created via XLSXWriter.addChart(number type).
xOffset | Optional integer offset from the left of the cell in pixels.
yOffset | Optional integer offset from the top of the cell in pixels.
xScale | Optional X scale of the image as a decimal.
yScale | Optional Y scale of the image as a decimal.
Returns
true if successful, false in case of any error
Note
A chart may only be inserted once into a chartsheet or a worksheet. If several similar charts are required then each one must be created separately with XLSXWriter.addChart(number type).
Since
DOCUMENTS 5.0e
Example:
// Create a chart object.
var chart = writer.addChart(writer.CHART_COLUMN);
// Add some data series to the chart.
var series1 = chart.addSeries("", "Worksheet1!$A$1:$A$5");
var series2 = chart.addSeries("", "Worksheet1!$B$1:$B$5");
var series3 = chart.addSeries("", "Worksheet1!$C$1:$C$5");
// Insert the chart into the worksheet.
if (!worksheet1.insertChart(6, 1, chart, 30, 10, 0.5, 0.75))
throw worksheet1.getLastError();
See also
XLSXChartsheet.insertChart(XLSXChart chart)

◆ insertImage()

boolean XLSXWorksheet::insertImage | ( | number | row,
 |  | number | col,
 |  | String | filename,
 |  | number | xOffset = 0,
 |  | number | yOffset = 0,
 |  | number | xScale = 1,
 |  | number | yScale = 1
 | ) |  |

Insert an image in a worksheet cell specified by row and column.

This function can be used to insert an image (in PNG or JPEG format) into a worksheet. It takes additional optional parameters to position and scale the image.

Parameters
row | The zero indexed row number.
col The zero indexed column number.
filename | The image filename, with path if required.
xOffset | Optional integer offset from the left of the cell in pixels.
yOffset | Optional integer offset from the top of the cell in pixels.
xScale | Optional X scale of the image as a decimal.
yScale | Optional Y scale of the image as a decimal.
Returns
true if successful, false in case of any error
Note
The scaling of an image may be affected if it crosses a row that has its default height changed due to a font that is larger than the default font size or that has text wrapping turned on. To avoid this you should explicitly set the height of the row using XLSXWorksheet.setRow() if it crosses an inserted image.
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.insertImage(12, 4, "C:\\temp\\logo.jpg", 15, 10, 0.2, 0.2))
throw worksheet1.getLastError();

◆ mergeRange()

boolean XLSXWorksheet::mergeRange | ( | number | firstRow,
 |  | number | firstCol,
 |  | number | lastRow,
 |  | number | lastCol,
 |  | String | value,
 |  | XLSXFormat | format = null
 | ) |  |

Merge a range of cells.

This function allows cells to be merged together so that they act as a single area. Excel generally merges and centers cells at same time. To get similar behavior you need to apply a format object with the appropriate alignment:

var mergeFormat = writer.addFormat("mergeFormat");
mergeFormat.setAlign(writer.ALIGN_CENTER);
worksheet1.mergeRange(1, 1, 1, 3, "Merged Range", mergeFormat);
Parameters
firstRow | The first row of the range. (All zero indexed.)
firstCol | The first column of the range.
lastRow | The last row of the range.
lastCol | The last col of the range.
value | String value to write to the merged range.
format | Optional XLSXFormat object used to apply formatting to the merged cells. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Note
This function writes a string value to the merged range. In order to write other data types, such as a number or a formula, you can overwrite the first cell with a call to the function XLSXWorksheet.writeCell(String type, number row, number col, var value, XLSXFormat format) with the appropriate value type. The same format should be used as was used in the merged range.
// First write a range with a blank string.
worksheet1.mergeRange(1, 1, 1, 3, "", format);
// Then overwrite the first cell with a number.
worksheet1.writeCell("number", 1, 1, 123, format);
Since
DOCUMENTS 5.0e

◆ setColumn()

boolean XLSXWorksheet::setColumn | ( | number | firstCol,
 |  | number | lastCol,
 |  | number | width = 8.43,
 |  | XLSXFormat | format = null,
 |  | boolean | hidden = false,
 |  | number | level = 0,
 |  | boolean | collapsed = false
 | ) |  |

Set the properties for one or more columns of cells.

This function can be used to change the default properties of a single column or a range of columns.
If it is applied to a single column the value of firstCol and lastCol should be the same. It can also be used to create Outlines and Grouping of columns with the optional parameters hidden, level and collapsed. Adjacent columns with the same outline level are grouped together into a single outline. Columns can be collapsed by setting the parameter hidden
for the hidden columns and setting the parameter collapsed for a column that has the collapsed '+' symbol.

Parameters
firstCol | The zero indexed first column.
lastCol | The zero indexed last column.
width Optional width of the column(s). The default column width is 8.43. The width parameter sets the column width in the same units used by Excel which is: the number of characters in the default font. The default width is 8.43 in the default font of Calibri 11. The actual relationship between a string width and a column width in Excel is complex. See the following explanation of column widths from the Microsoft support documentation for more details.
Note: There is no way to specify "AutoFit" for a column in the Excel file format. This feature is only available at runtime from within Excel. It is possible to simulate "AutoFit" in your application by tracking the maximum width of the data in the column as your write it and then adjusting the column width at the end.
format | Optional XLSXFormat object used to apply formatting to any cells in the column that don't have a format. As in Excel a row format takes precedence over a default column format.
hidden | Optional flag used to hide the column(s).
level | Optional integer outline level of the column(s) used to create Outlines and Grouping. Excel allows up to 7 outline levels. Therefore the level parameter should be in the range 0 <= level <= 7.
collapsed | Optional flag used to create Outlines and Grouping and indicating whether to collapse a column that has the collapsed '+' symbol.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.setColumn(1, 6, 5, null, false, 1, false))
throw worksheet1.getLastError();
See also
setRow(number row, number height, XLSXFormat format, boolean hidden, number level, boolean collapsed)

◆ setFirstSheet()

boolean XLSXWorksheet::setFirstSheet ( )

Set current worksheet as the first visible sheet tab.

The XLSXWriter.activateWorksheet(var worksheet) function determines which worksheet is initially selected. However, if there are a large number of worksheets the selected worksheet may not appear on the screen. To avoid this you can select the leftmost visible worksheet tab using this function. The default value is the first worksheet.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
worksheet19.setFirstSheet(); // worksheet19: First visible worksheet tab.
writer.activateWorksheet(worksheet20); // worksheet20: First visible worksheet.

◆ setFooter()

boolean XLSXWorksheet::setFooter | ( | String | footer,
 |  | number | margin = 0.3
 | ) |  |

Set the printed page footer caption.

Footers are generated using a string which is a combination of plain text and control characters (see Generating header/footer for more details).

Parameters
footer | The footer string.
margin | Optional footer margin in inches. Excel default is 0.3.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.setFooter("some text", 0.2))
throw worksheet1.getLastError();

◆ setGridlines()

boolean XLSXWorksheet::setGridlines ( string option )

Set the option to display or hide gridlines on the screen and the printed page.

There are two options

  • hideAll: Hide gridlines on the screen and the printed page.
  • showPrint: Display gridlines on the screen and the printed page.
Parameters
option string Gridline option. Possible values are hideAll and showPrint. See description for details.
Returns
true if successful, false in case of any error
Note
The Excel default is that the screen gridlines are on and the printed worksheet is off.
Since
DOCUMENTS 5.0e
Example:
worksheet1.setGridlines("showPrint");

◆ setHeader()

boolean XLSXWorksheet::setHeader | ( | String | header,
 |  | number | margin = 0.3
 | ) |  |

Set the printed page header caption.

Headers are generated using a string which is a combination of plain text and control characters (see Generating header/footer for more details).

Parameters
header | The header string.
margin | Optional header margin in inches. Excel default is 0.3.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.setHeader("some text", 0.2))
throw worksheet1.getLastError();

◆ setHorizontalPagebreaks()

boolean XLSXWorksheet::setHorizontalPagebreaks ( number [] breaks )

Set the horizontal page breaks on the current worksheet.

This function adds horizontal page breaks to the worksheet. A page break causes all the data that follows it to be printed on the next page. Horizontal page breaks act between rows.

Parameters
breaks Integer array of page breaks.
Returns
true if successful, false in case of any error
Note
There is an Excel limitation of 1023 horizontal page breaks per worksheet.
Since
DOCUMENTS 5.0e
Example:
// To create a page break between rows 20 and 21 you must specify the break at
// row 21. However in zero index notation this is actually row 20:
if (!worksheet1.setHorizontalPagebreaks([20]))
throw worksheet1.getLastError();

◆ setLandscape()

boolean XLSXWorksheet::setLandscape ( )

Set the page orientation as landscape.

This function is used to set the orientation of the worksheet's printed page to landscape.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ setMargins()

boolean XLSXWorksheet::setMargins | ( | number | left = -1,
 |  | number | right = -1,
 |  | number | top = -1,
 |  | number | bottom = -1
 | ) |  |

Set the worksheet margins for the printed page.

This function is used to set the margins of the worksheet when it is printed. The units are in inches. Specifying -1 for any parameter will give the default Excel value as shown below.

Parameters
left | Optional left margin in inches. Excel default is 0.7.
right | Optional right margin in inches. Excel default is 0.7.
top | Optional top margin in inches. Excel default is 0.75.
bottom | Optional bottom margin in inches. Excel default is 0.75.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
worksheet1.setMargins(1.3, 1.2, -1, -1);

◆ setPageView()

boolean XLSXWorksheet::setPageView ( )

Set the page layout to page view mode.

This function is used to display the worksheet in "Page View/Layout" mode.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ setPaperType()

boolean XLSXWorksheet::setPaperType ( number type = 0 )

Set the paper format for the printed output of the current worksheet.

The following paper styles are available:

Index | Paper format | Paper size :-—
0 | Printer default | Printer default
1 | Letter | 8 1/2 x 11 in
2 | Letter Small | 8 1/2 x 11 in
3 | Tabloid | 11 x 17 in
4 | Ledger | 17 x 11 in
5 | Legal | 8 1/2 x 14 in
6 | Statement | 5 1/2 x 8 1/2 in
7 | Executive | 7 1/4 x 10 1/2 in
8 | A3 | 297 x 420 mm
9 | A4 | 210 x 297 mm
10 | A4 Small | 210 x 297 mm
11 | A5 | 148 x 210 mm
12 | B4 | 250 x 354 mm
13 | B5 | 182 x 257 mm
14 | Folio | 8 1/2 x 13 in
15 | Quarto | 215 x 275 mm
16 | — | 10x14 in
17 | — | 11x17 in
18 | Note | 8 1/2 x 11 in
19 | Envelope 9 | 3 7/8 x 8 7/8
20 | Envelope 10 | 4 1/8 x 9 1/2
21 | Envelope 11 | 4 1/2 x 10 3/8
22 | Envelope 12 | 4 3/4 x 11
23 | Envelope 14 | 5 x 11 1/2
24 | C size sheet | —
25 | D size sheet | —
26 | E size sheet | —
27 | Envelope DL | 110 x 220 mm
28 | Envelope C3 | 324 x 458 mm
29 | Envelope C4 | 229 x 324 mm
30 | Envelope C5 | 162 x 229 mm
31 | Envelope C6 | 114 x 162 mm
32 | Envelope C65 | 114 x 229 mm
33 | Envelope B4 | 250 x 353 mm
34 | Envelope B5 | 176 x 250 mm
35 | Envelope B6 | 176 x 125 mm
36 | Envelope | 110 x 230 mm
37 | Monarch | 3.875 x 7.5 in
38 | Envelope | 3 5/8 x 6 1/2 in
39 | Fanfold | 14 7/8 x 11 in
40 | German Std Fanfold | 8 1/2 x 12 in
41 | German Legal Fanfold | 8 1/2 x 13 in

Note: It is likely that not all of these paper types will be available to the end user since it will depend on the paper formats that the user's printer supports. Therefore, it is best to stick to standard paper types. If you do not specify a paper type the worksheet will print using the printer's default paper style.

Parameters
type Optional integer paper format type (see table of paper styles).
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
worksheet1.setPaperType(1); // US Letter
worksheet2.setPaperType(9); // A4

◆ setPortrait()

boolean XLSXWorksheet::setPortrait ( )

Set the page orientation as portrait.

This function is used to set the orientation of the worksheet's printed page to portrait. The default worksheet orientation is portrait, so this function isn't generally required.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

◆ setRow()

boolean XLSXWorksheet::setRow | ( | number | row,
 |  | number | height = 15,
 |  | XLSXFormat | format = null,
 |  | boolean | hidden = false,
 |  | number | level = 0,
 |  | boolean | collapsed = false
 | ) |  |

Set the properties for a row of cells.

The function is used to change the default properties of a row. The most common use for this function is to change the height of a row. It can also be used to create Outlines and Grouping of rows with the optional parameters hidden, level and collapsed. Adjacent rows with the same outline level are grouped together into a single outline. Rows can be collapsed by setting the parameter hidden
for the hidden rows and setting the parameter collapsed for a row that has the collapsed '+' symbol.

Parameters
row | The zero indexed row number.
height | Optional row height. The default row height is 15.
format | Optional XLSXFormat object used to apply formatting to any cells in the row that don't have a format. As with Excel the row format is overridden by an explicit cell format.
hidden | Optional flag used to hide the row.
level | Optional integer outline level of the row used to create Outlines and Grouping. Excel allows up to 7 outline levels. Therefore the level parameter should be in the range 0 <= level <= 7.
collapsed | Optional flag used to create Outlines and Grouping and indicating whether to collapse a row that has the collapsed '+' symbol.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
// Set the row options with the outline level.
worksheet1.setRow(1, 15, null, false, 2, false);
worksheet1.setRow(2, 15, null, false, 2, false);
worksheet1.setRow(3, 15, null, false, 2, false);
worksheet1.setRow(4, 15, null, false, 2, false);
worksheet1.setRow(5, 15, null, false, 1, false);
worksheet1.setRow(6, 15, null, false, 2, false);
worksheet1.setRow(7, 15, null, false, 2, false);
worksheet1.setRow(8, 15, null, false, 2, false);
worksheet1.setRow(9, 15, null, false, 2, false);
worksheet1.setRow(10, 15, null, false, 1, false);
See also
setColumn(number firstCol, number lastCol, number width, XLSXFormat format, boolean hidden, number level, boolean collapsed)

◆ setTabColor()

boolean XLSXWorksheet::setTabColor ( number color )

Set the color of the current worksheet tab.

Parameters
color The desired tab color specified using a HTML style RGB integer value.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
worksheet1.setTabColor(0xFF9900); // Orange
worksheet1.setTabColor(writer.COLOR_RED); // from Predefined values for common colors

◆ setVerticalPagebreaks()

boolean XLSXWorksheet::setVerticalPagebreaks ( number [] breaks )

Set the vertical page breaks on the current worksheet.

This function adds vertical page breaks to the worksheet. A page break causes all the data that follows it to be printed on the next page. Vertical page breaks act between columns.

Parameters
breaks Integer array of page breaks.
Returns
true if successful, false in case of any error
Note
There is an Excel limitation of 1023 vertical page breaks per worksheet.
Since
DOCUMENTS 5.0e
Example:
// To create a page break between columns 20 and 21 you must specify the break
// at column 21. However in zero index notation this is actually column 20:
if (!worksheet1.setVerticalPagebreaks([20]))
throw worksheet1.getLastError();

◆ setZoom()

boolean XLSXWorksheet::setZoom ( number scale = 100 )

Set the worksheet zoom factor.

Parameters
scale Optional integer worksheet zoom factor in the range 10 <= zoom <= 400.
The default zoom factor is 100.
Returns
true if successful, false in case of any error
Note
This function does not affect the scale of the printed page.
Since
DOCUMENTS 5.0e
Example:
worksheet1.setZoom(50);

◆ splitPanes()

boolean XLSXWorksheet::splitPanes | ( | number | vertical,
 |  | number | horizontal
 | ) |  |

Split the current worksheet into panes.

This function can be used to divide a worksheet into horizontal or vertical regions known as panes. This function is different from the function XLSXWorksheet.freezePanes(number row, number col) in that the splits between the panes will be visible to the user and each pane will have its own scroll bars.

The parameters vertical and horizontal are used to specify the vertical and horizontal position of the split. The units for vertical and horizontal are the same as those used by Excel to specify row height and column width. However, the vertical and horizontal units are different from each other. Therefore you must specify the vertical and horizontal parameters in terms of the row heights and column widths that you have set or the default values which are 15 for a row and 8.43 for a column.

Parameters
vertical | The position for the vertical split.
horizontal | The position for the horizontal split.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
worksheet1.splitPanes(15, 0); // First row.
worksheet2.splitPanes(0, 8.43); // First column.
worksheet3.splitPanes(15, 8.43); // First row and column.

◆ writeBlank()

boolean XLSXWorksheet::writeBlank | ( | number | row,
 |  | number | col,
 |  | XLSXFormat | format = null
 | ) |  |

Write a blank cell specified by row and column.

This function is used to add formatting to a cell which doesn't contain a string or number value.

Excel differentiates between an "Empty" cell and a "Blank" cell. An Empty cell is a cell which doesn't contain data or formatting whilst a Blank cell doesn't contain data but does contain formatting. Excel stores Blank cells but ignores Empty cells.

As such, if you write an empty cell without formatting it is ignored.

Parameters
row | The zero indexed row number.
col | The zero indexed column number.
format | Optional XLSXFormat object used to apply formatting to the cell. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
format1.setBackgroundColor(writer.COLOR_RED);
worksheet1.writeBlank(0, 0, format1);

◆ writeBoolean()

boolean XLSXWorksheet::writeBoolean | ( | number | row,
 |  | number | col,
 |  | boolean | value,
 |  | XLSXFormat | format = null
 | ) |  |

Write an Excel boolean to a worksheet cell specified by row and column.

This function is an alternative to using XLSXWorksheet.writeCell(String type, number row, number col, var value, XLSXFormat format) with type = "boolean".

Parameters
row | The zero indexed row number.
col | The zero indexed column number.
value | The boolean value to write to the cell.
format | Optional XLSXFormat object used to apply formatting to the cell. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.writeBoolean(1,5, false))
throw worksheet1.getLastError();

◆ writeCell()

boolean XLSXWorksheet::writeCell | ( | String | type,
 |  | number | row,
 |  | number | col,
 |  | var | value,
 |  | XLSXFormat | format = null
 | ) |  |

Write a value to a worksheet cell.

This function writes a value according to the type (see below) to a worksheet cell specified by row and column.

Parameters
type The type (see below) of the value to write to the cell.
row | The zero indexed row number.
col | The zero indexed column number.
value The value to write to the cell can be specified as follows:
  • String for the value types string, formula, link and richString.
  • Number for the value type number.
  • Boolean for the value type boolean.
  • Date object for the value type datetime.
format | Optional XLSXFormat object used to apply formatting to the cell. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e

Available value types:

  • string
    A value of this type is a string. Unicode strings are supported in UTF-8 encoding. This generally requires that your source file is UTF-8 encoded or that the data has been read from a UTF-8 source.
  • number
    A value of this type is a number. The native data type for all numbers in Excel is an IEEE-754 64-bit double-precision floating point, which is also the default type used by this function. According to the used number format, a number can be displayed as an integer, a floating point number, a date, a currency value or some other user defined format. See XLSXFormat.setNumberFormat(String numFormat) for more details.
    Note: Excel doesn't support NaN, Inf or -Inf as a number value. If you are writing data that contains these values then your application should convert them to a string or handle them in some other way.
  • boolean
    A value of this type is a boolean value.
  • formula
    A value of this type is a string containing a formula. Formulas must be written with the US style separator/range operator which is a comma (not semi-colon). Therefore a formula with multiple values should be written e.g. as follows: "=SUM(1, 2, 3)".

  • link
    A value of this type is a string containing a URL/hyperlink. The usual web style URI's are supported: http://, https://, ftp:// and mailto:. An Excel hyperlink is comprised of two elements: the displayed string and the non-displayed link. By default the displayed string is the same as the link. However, it is possible to overwrite it with any other value type. The most common case is to overwrite the displayed link text with another string:

    // The typical worksheet format for a hyperlink is a blue underline:
    var urlFormat = writer.addFormat("urlFormat");
    urlFormat.setFontStyle("underline");
    urlFormat.setFontColor(writer.COLOR_BLUE);
    // Write a hyperlink but overwrite the displayed string.
    worksheet1.writeCell("link", 2, 0, "http://libxlsxwriter.github.io", urlFormat);
    worksheet1.writeCell("string", 2, 0, "Read the documentation.", urlFormat);

    Two local URIs are supported: internal: and external:. These are used for hyperlinks to internal worksheet references or external Excel file and worksheet references.

    Worksheet references are typically of the form Worksheet1!A1. You can also link to a worksheet range using the standard Excel notation: Worksheet1!A1:B2.

    In external links the Excel file and worksheet name must be separated by the # character:

    worksheet1.writeCell("link", 0, 0, "external:c:\\foo.xlsx#Worksheet2!A1", urlFormat);

    Excel requires that worksheet names containing spaces or non alphanumeric characters are single quoted as follows:

    worksheet1.writeCell("link", 0, 0, "internal:'Sales Data'!A1", urlFormat);

    Links to network files are also supported. Network files normally begin with two back slashes as follows \\NETWORK\etc.

    worksheet1.writeCell("link", 0, 0, "external:c:/temp/foo.xlsx", urlFormat);
    worksheet1.writeCell("link", 1, 0, "external://NET/share/foo.xlsx", urlFormat);

    Note: This function will escape the following characters in URLs as required by Excel: \s " < > \ [ ] ^ { } unless the URL already contains %xx style escapes. In which case it is assumed that the URL was escaped correctly by the user and will by passed directly to Excel.

  • datetime
    A value of this type is a Date object. Dates and times in Excel are represented by real numbers. For example a date that is displayed in Excel as "Feb 28 2013 12:00 PM" is stored as the number 41333.5. The integer part of the number stores the number of days since the epoch, which is generally 1900, and the fractional part stores the percentage of the day. A date or time in Excel is just like any other number. To display the number as a date you must apply an Excel number format to it.
    // Write the number without formatting.
    worksheet1.writeCell("number", 0, 0, 41333.5); // 41333.5
    // Write the date without formatting.
    worksheet1.writeCell("datetime", 0, 1, new Date(2013, 1, 28, 12)); // 41333.5
    // Add a format with date formatting.
    var dtFormat = writer.addFormat("dtFormat");
    dtFormat.setNumberFormat("mmm d yyyy hh:mm AM/PM");
    // Write the number with formatting.
    worksheet1.writeCell("number", 1, 0, 41333.5, dtFormat); // Feb 28 2013 12:00 PM
    // Write the date with formatting.
    worksheet1.writeCell("datetime", 1, 1, new Date(2013, 1, 28, 12), dtFormat); // Feb 28 2013 12:00 PM
    // Widen the columns to make the text clearer.
    worksheet1.setColumn(0, 1, 20);
    Dates in Excel do not support timezones and the maximum resolution of times is milliseconds. Dates can be formatted using any of the date formats supported by Excel. See XLSXFormat.setNumberFormat(String numFormat) for more details.
  • richString
    This type is used to write strings with multiple formats. A value of this type is a JSON-String containing an array of objects with the property pair format and string. Each object represents a fragment of the rich multi-format string with an XLSXFormat (specified with the format name or null) to define the format for the string part. If the string fragment is unformatted then null can be used for the format.
    Note: An empty string fragment is not allowed in a rich string.
Example:
var writer = new XLSXWriter("c:\\tmp\\exWriteCell.xlsx");
var worksheet1 = writer.addWorksheet("Worksheet1");
var format1 = writer.addFormat("format1");
format1.setFontStyle("bold");
format1.setFontColor(writer.COLOR_RED);
format1.setNumberFormat("$#,##0.00");
var format2 = writer.addFormat("format2");
format2.setNumberFormat("d-mm-yy");
// Value type : string
if (!worksheet1.writeCell("string", 1,2,"Hello World", format1))
throw worksheet1.getLastError();
// Value type : formula
if (!worksheet1.writeCell("formula", 1,3, "=DATEVALUE(\"1-Jan-2013\")", format2))
throw worksheet1.getLastError();
// Value type : number
if (!worksheet1.writeCell("number", 1,4, 100, format1))
throw worksheet1.getLastError();
// Value type : boolean
if (!worksheet1.writeCell("boolean", 1,5, false))
throw worksheet1.getLastError();
// Value type : datetime
// Without a date format the datetime will appear as a number only.
if (!worksheet1.writeCell("datetime", 1,6, new Date(2014, 1, 14), format2))
throw worksheet1.getLastError();
// Value type : link
if (!worksheet1.writeCell("link", 1,7, "http://libxlsxwriter.github.io"))
throw worksheet1.getLastError();
var richString = [];
richString[0] = {};
richString[0].format = "format1";
richString[0].string = "Rich";
richString[1] = {};
richString[1].format = null;
richString[1].string = " string";
var jsonString = JSON.stringify(richString);
// Value type : richString
if (!worksheet1.writeCell("richString", 1, 8, jsonString))
throw worksheet1.getLastError()
// Change the column width
worksheet1.setColumn(2, 8, 12);
worksheet1.setColumn(7, 7, 25);
if (!writer.save())
throw writer.getLastError();
See also
XLSXWorksheet.writeString(number row, number col, String value, XLSXFormat format)
XLSXWorksheet.writeNumber(number row, number col, number value, XLSXFormat format)
XLSXWorksheet.writeBoolean(number row, number col, boolean value, XLSXFormat format)
XLSXWorksheet.writeFormula(number row, number col, String value, XLSXFormat format)
XLSXWorksheet.writeLink(number row, number col, String value, XLSXFormat format)
XLSXWorksheet.writeDatetime(number row, number col, Date value, XLSXFormat format)
XLSXWorksheet.writeRichString(number row, number col, String value, XLSXFormat format)

◆ writeDatetime()

boolean XLSXWorksheet::writeDatetime | ( | number | row,
 |  | number | col,
 |  | Date | value,
 |  | XLSXFormat | format = null
 | ) |  |

Write a date or time to a worksheet cell specified by row and column.

This function is an alternative to using XLSXWorksheet.writeCell(String type, number row, number col, var value, XLSXFormat format) with type = "datetime".

Parameters
row | The zero indexed row number.
col | The zero indexed column number.
value The datetime to write to the cell.
See the value type datetime in the documentation of XLSXWorksheet.writeCell() for more details.
format | Optional XLSXFormat object used to apply formatting to the cell. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.writeDatetime(1,6, new Date(2014, 1, 14), format2))
throw worksheet1.getLastError();

◆ writeFormula()

boolean XLSXWorksheet::writeFormula | ( | number | row,
 |  | number | col,
 |  | String | value,
 |  | XLSXFormat | format = null
 | ) |  |

Write a formula or function to a worksheet cell specified by row and column.

This function is an alternative to using XLSXWorksheet.writeCell(String type, number row, number col, var value, XLSXFormat format) with type = "formula".

Parameters
row | The zero indexed row number.
col | The zero indexed column number.
value | Formula string to write to cell. See the value type formula in the documentation of XLSXWorksheet.writeCell() for more details.
format | Optional XLSXFormat object used to apply formatting to the cell. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.writeFormula(1,3, "=DATEVALUE(\"1-Jan-2013\")", format2))
throw worksheet1.getLastError();

◆ writeLink()

boolean XLSXWorksheet::writeLink | ( | number | row,
 |  | number | col,
 |  | String | value,
 |  | XLSXFormat | format = null
 | ) |  |

Write a URL/hyperlink to a worksheet cell specified by row and column.

This function is an alternative to using XLSXWorksheet.writeCell(String type, number row, number col, var value, XLSXFormat format) with type = "link".

Parameters
row | The zero indexed row number.
col | The zero indexed column number.
value The URL/hyperlink to write to the cell.
See the value type link in the documentation of XLSXWorksheet.writeCell() for more details.
format | Optional XLSXFormat object used to apply formatting to the cell. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.writeLink(1,7, "http://libxlsxwriter.github.io"))
throw worksheet1.getLastError();

◆ writeNumber()

boolean XLSXWorksheet::writeNumber | ( | number | row,
 |  | number | col,
 |  | number | value,
 |  | XLSXFormat | format = null
 | ) |  |

Write a numeric value to a worksheet cell specified by row and column.

This function is an alternative to using XLSXWorksheet.writeCell(String type, number row, number col, var value, XLSXFormat format) with type = "number".

Parameters
row | The zero indexed row number.
col | The zero indexed column number.
value | The number to write to the cell. See the value type number in the documentation of XLSXWorksheet.writeCell() for more details.
format | Optional XLSXFormat object used to apply formatting to the cell. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.writeNumber(1,4, 100, format1))
throw worksheet1.getLastError();

◆ writeRichString()

boolean XLSXWorksheet::writeRichString | ( | number | row,
 |  | number | col,
 |  | String | value,
 |  | XLSXFormat | format = null
 | ) |  |

Write strings with multiple formats to a worksheet cell specified by row and column.

This function is an alternative to using XLSXWorksheet.writeCell(String type, number row, number col, var value, XLSXFormat format) with type = "richString".

Parameters
row | The zero indexed row number.
col | The zero indexed column number.
value | A JSON-String containing an array of objects with the property pair format and string. See the value type richString in the documentation of XLSXWorksheet.writeCell() for more details.
format | Optional XLSXFormat object used to apply formatting to the cell. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var writer = new XLSXWriter("c:\\tmp\\exWriteRichString.xlsx");
var worksheet1 = writer.addWorksheet("Worksheet1");
var format1 = writer.addFormat("format1");
format1.setFontStyle("bold");
format1.setFontColor(writer.COLOR_RED);
format1.setNumberFormat("$#,##0.00");
var format2 = writer.addFormat("format2");
format2.setFontStyle("italic");
format2.setFontColor(writer.COLOR_ORANGE);
// Array of objects with format/string pairs
var richString = [];
richString[0] = {};
richString[0].format = "format1";
richString[0].string = "Rich";
richString[1] = {};
richString[1].format = null;
richString[1].string = " string";
richString[2] = {};
richString[2].format = "format2";
richString[2].string = " example";
var jsonString = JSON.stringify(richString);
if (!worksheet1.writeRichString(0, 0, jsonString))
throw worksheet1.getLastError()
// Change the column width
worksheet1.setColumn(0, 0, 20);
if (!writer.save())
throw writer.getLastError();

◆ writeString()

boolean XLSXWorksheet::writeString | ( | number | row,
 |  | number | col,
 |  | String | value,
 |  | XLSXFormat | format = null
 | ) |  |

Write a string to a worksheet cell specified by row and column.

This function is an alternative to using XLSXWorksheet.writeCell(String type, number row, number col, var value, XLSXFormat format) with type = "string".

Parameters
row | The zero indexed row number.
col | The zero indexed column number.
value | String to write to cell. See the value type string in the documentation of XLSXWorksheet.writeCell() for more details.
format | Optional XLSXFormat object used to apply formatting to the cell. The default value is null to indicate no formatting.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!worksheet1.writeString(1,2,"Hello World", format1))
throw worksheet1.getLastError();


DOCUMENTS 5 - PortalScripting API: Member List

XLSXWorksheet Member List

This is the complete list of members for XLSXWorksheet, including all inherited members.

addAutofilter(number firstRow, number firstCol, number lastRow, number lastCol) | XLSXWorksheet
freezePanes(number row, number col) | XLSXWorksheet
getLastError() | XLSXWorksheet
importFromJSON(String jsonString, number row=0, number col=0) | XLSXWorksheet
importFromJSONFile(String jsonFilePath, number row=0, number col=0) | XLSXWorksheet
insertChart(number row, number col, XLSXChart chart, number xOffset=0, number yOffset=0, number xScale=1, number yScale=1) | XLSXWorksheet
insertImage(number row, number col, String filename, number xOffset=0, number yOffset=0, number xScale=1, number yScale=1) | XLSXWorksheet
mergeRange(number firstRow, number firstCol, number lastRow, number lastCol, String value, XLSXFormat format=null) | XLSXWorksheet
setColumn(number firstCol, number lastCol, number width=8.43, XLSXFormat format=null, boolean hidden=false, number level=0, boolean collapsed=false) | XLSXWorksheet
setFirstSheet() | XLSXWorksheet
setFooter(String footer, number margin=0.3) | XLSXWorksheet
setGridlines(string option) | XLSXWorksheet
setHeader(String header, number margin=0.3) | XLSXWorksheet
setHorizontalPagebreaks(number[] breaks) | XLSXWorksheet
setLandscape() | XLSXWorksheet
setMargins(number left=-1, number right=-1, number top=-1, number bottom=-1) | XLSXWorksheet
setPageView() | XLSXWorksheet
setPaperType(number type=0) | XLSXWorksheet
setPortrait() | XLSXWorksheet
setRow(number row, number height=15, XLSXFormat format=null, boolean hidden=false, number level=0, boolean collapsed=false) | XLSXWorksheet
setTabColor(number color) | XLSXWorksheet
setVerticalPagebreaks(number[] breaks) | XLSXWorksheet
setZoom(number scale=100) | XLSXWorksheet
splitPanes(number vertical, number horizontal) | XLSXWorksheet
writeBlank(number row, number col, XLSXFormat format=null) | XLSXWorksheet
writeBoolean(number row, number col, boolean value, XLSXFormat format=null) | XLSXWorksheet
writeCell(String type, number row, number col, var value, XLSXFormat format=null) | XLSXWorksheet
writeDatetime(number row, number col, Date value, XLSXFormat format=null) | XLSXWorksheet
writeFormula(number row, number col, String value, XLSXFormat format=null) | XLSXWorksheet
writeLink(number row, number col, String value, XLSXFormat format=null) | XLSXWorksheet
writeNumber(number row, number col, number value, XLSXFormat format=null) | XLSXWorksheet
writeRichString(number row, number col, String value, XLSXFormat format=null) | XLSXWorksheet
writeString(number row, number col, String value, XLSXFormat format=null) | XLSXWorksheet


DOCUMENTS 5 - PortalScripting API: XLSXWriter Class Reference

Public Member Functions | Public Attributes | List of all members
XLSXWriter Class Reference

The XLSXWriter class allows creating files in the Excel 2007+ XLSX file format by use of the library Libxlsxwriter. More...

Public Member Functions

boolean | activateChartsheet (var chartsheet)
Make a chartsheet the active, i.e., visible chartsheet. More...
boolean | activateWorksheet (var worksheet)
Make a worksheet the active, i.e., visible worksheet. More...
XLSXChart | addChart (number type)
Create a new chart to be added to a worksheet/chartsheet. More...
XLSXChartsheet | addChartsheet (String name="")
Add a new chartsheet to the current Excel document. More...
XLSXWorksheet | addFormat (String name)
Create a new format object to format cells in worksheets. More...
XLSXWorksheet | addWorksheet (String name="")
Add a new worksheet to the current Excel document. More...
XLSXChartsheet | getChartsheetByName (String name)
Get a chartsheet object from its name. More...
String | getFilePath ()
Get the file path of the created Excel file. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
XLSXWorksheet | getWorksheetByName (String name)
Get a worksheet object from its name. More...
boolean | hideChartsheet (var chartsheet)
Hide the given chartsheet. More...
boolean | hideWorksheet (var worksheet)
Hide the given worksheet. More...
boolean | save ()
Write the Excel file to disk and free any memory allocated internally to the Excel file. More...
boolean | selectChartsheet (var chartsheet)
Set a chartsheet tab as selected. More...
boolean | selectWorksheet (var worksheet)
Set a worksheet tab as selected. More...
boolean | setProperties (String title, String subject, String author, String manager, String company, String category, String keywords, String comments, String status, String hyperlinkBase)
Set the document properties. More...
XLSXWriter | XLSXWriter (String filename)
Create a new XLSXWriter object with a given filename. More...

Public Attributes

String | version
String value containing the version number of the used library Libxlsxwriter. More...
Predefined values for common colors

The colors are specified using a HTML style RGB integer value. For convenience a limited number of common colors are predefined as follows.

Note
Black in HTML is actually 0x000000 but XLSXWriter.COLOR_BLACK is defined as 0x1000000 to avoid confusion with an undefined or Zero color value. It is converted to the correct HTML code internally.
See also
XLSXWorksheet.setTabColor(number color), XLSXChartsheet.setTabColor(number color)
XLSXFormat.setFontColor(number color), XLSXFormat.setBorderColor(String border, number color)
XLSXFormat.setForegroundColor(number color), XLSXFormat.setBackgroundColor(number color)
Since
DOCUMENTS 5.0e
number | COLOR_BLACK
Black defined as 0x1000000.
number | COLOR_BLUE
Blue defined as 0x0000FF.
number | COLOR_BROWN
Brown defined as 0x800000.
number | COLOR_CYAN
Cyan defined as 0x00FFFF.
number | COLOR_GRAY
Gray defined as 0x808080.
number | COLOR_GREEN
Green defined as 0x008000.
number | COLOR_LIME
Lime defined as 0x00FF00.
number | COLOR_MAGENTA
Magenta defined as 0xFF00FF.
number | COLOR_NAVY
Navy defined as 0x000080.
number | COLOR_ORANGE
Orange defined as 0xFF6600.
number | COLOR_PINK
Pink defined as 0xFF00FF.
number | COLOR_PURPLE
Purple defined as 0x800080.
number | COLOR_RED
Red defined as 0xFF0000.
number | COLOR_SILVER
Silver defined as 0xC0C0C0.
number | COLOR_WHITE
White defined as 0xFFFFFF.
number | COLOR_YELLOW
Yellow defined as 0xFFFF00.
Cell border styles

The constants build an enumeration of the available values for cell border styles.

See also
XLSXFormat.setBorderStyle(String border, number style)
Since
DOCUMENTS 5.0e
number | BORDER_NONE
No border.
number | BORDER_THIN
Thin border style.
number | BORDER_MEDIUM
Medium border style.
number | BORDER_DASHED
Dashed border style.
number | BORDER_DOTTED
Dotted border style.
number | BORDER_THICK
Thick border style.
number | BORDER_DOUBLE
Double border style.
number | BORDER_HAIR
Hair border style.
number | BORDER_MEDIUM_DASHED
Medium dashed border style.
number | BORDER_DASH_DOT
Dash-dot border style.
number | BORDER_MEDIUM_DASH_DOT
Medium dash-dot border style.
number | BORDER_DASH_DOT_DOT
Dash-dot-dot border style.
number | BORDER_MEDIUM_DASH_DOT_DOT
Medium dash-dot-dot border style.
number | BORDER_SLANT_DASH_DOT
Slant dash-dot border style.
Text alignments

These constants build an enumeration of the available values for the horizontal and vertical text alignment within a cell.

See also
XLSXFormat.setAlign(number alignment)
Since
DOCUMENTS 5.0e
number | ALIGN_NONE
No alignment. Cell will use Excel's default for the data type.
number | ALIGN_LEFT
Left horizontal alignment.
number | ALIGN_CENTER
Center horizontal alignment.
number | ALIGN_RIGHT
Right horizontal alignment.
number | ALIGN_FILL
Cell fill horizontal alignment.
number | ALIGN_JUSTIFY
Justify horizontal alignment.
number | ALIGN_CENTER_ACROSS
Center Across horizontal alignment.
number | ALIGN_DISTRIBUTED
Distributed horizontal alignment.
number | ALIGN_VERTICAL_TOP
Top vertical alignment.
number | ALIGN_VERTICAL_BOTTOM
Bottom vertical alignment.
number | ALIGN_VERTICAL_CENTER
Center vertical alignment.
number | ALIGN_VERTICAL_JUSTIFY
Justify vertical alignment.
number | ALIGN_VERTICAL_DISTRIBUTED
Distributed vertical alignment.
Background Patterns

These constants build an enumeration of the available fill patterns for the background of a cell.

See also
XLSXFormat.setBackgroundPattern(number pattern)
Since
DOCUMENTS 5.0e
number | PATTERN_NONE
Empty pattern.
number | PATTERN_SOLID
Solid pattern.
number | PATTERN_MEDIUM_GRAY
Medium gray pattern.
number | PATTERN_DARK_GRAY
Dark gray pattern.
number | PATTERN_LIGHT_GRAY
Light gray pattern.
number | PATTERN_DARK_HORIZONTAL
Dark horizontal line pattern.
number | PATTERN_DARK_VERTICAL
Dark vertical line pattern.
number | PATTERN_DARK_DOWN
Dark diagonal stripe pattern.
number | PATTERN_DARK_UP
Reverse dark diagonal stripe pattern.
number | PATTERN_DARK_GRID
Dark grid pattern.
number | PATTERN_DARK_TRELLIS
Dark trellis pattern.
number | PATTERN_LIGHT_HORIZONTAL
Light horizontal Line pattern.
number | PATTERN_LIGHT_VERTICAL
Light vertical line pattern.
number | PATTERN_LIGHT_DOWN
Light diagonal stripe pattern.
number | PATTERN_LIGHT_UP
Reverse light diagonal stripe pattern.
number | PATTERN_LIGHT_GRID
Light grid pattern.
number | PATTERN_LIGHT_TRELLIS
Light trellis pattern.
number | PATTERN_GRAY_125
12.5% gray pattern
number | PATTERN_GRAY_0625
6.25% gray pattern
Chart types

These constants build an enumeration of the available chart types.

See also
XLSXWriter.addChart(number type)
Since
DOCUMENTS 5.0e
number | CHART_AREA
Area chart.
number | CHART_AREA_STACKED
Area chart - stacked.
number | CHART_AREA_STACKED_PERCENT
Area chart - percentage stacked.
number | CHART_BAR
Bar chart.
number | CHART_BAR_STACKED
Bar chart - stacked.
number | CHART_BAR_STACKED_PERCENT
Bar chart - percentage stacked.
number | CHART_COLUMN
Column chart.
number | CHART_COLUMN_STACKED
Column chart - stacked.
number | CHART_COLUMN_STACKED_PERCENT
Column chart - percentage stacked.
number | CHART_DOUGHNUT
Doughnut chart.
number | CHART_LINE
Line chart.
number | CHART_PIE
Pie chart.
number | CHART_SCATTER
Scatter chart.
number | CHART_SCATTER_STRAIGHT
Scatter chart - straight.
number | CHART_SCATTER_STRAIGHT_WITH_MARKERS
Scatter chart - straight with markers.
number | CHART_SCATTER_SMOOTH
Scatter chart - smooth.
number | CHART_SCATTER_SMOOTH_WITH_MARKERS
Scatter chart - smooth with markers.
number | CHART_RADAR
Radar chart.
number | CHART_RADAR_WITH_MARKERS
Radar chart - with markers.
number | CHART_RADAR_FILLED
Radar chart - filled.

Detailed Description

The XLSXWriter class allows creating files in the Excel 2007+ XLSX file format by use of the library Libxlsxwriter.

An XLSXWriter object represents an entire Excel document. It can be used to write text, numbers, formulas and hyperlinks to multiple worksheets. It supports features such as:

  • 100% compatible Excel XLSX files
  • Excel formatting
  • Merged cells
  • Autofilters
  • Charts
  • Worksheet PNG/JPEG images
Note
However, the XLSXWriter can only create new files. It CANNOT READ OR MODIFY existing files.
Since
DOCUMENTS 5.0e
Example:
var writer = new XLSXWriter("c:\\tmp\\writer.xlsx");
// Add a worksheet with a user defined sheet name.
var worksheet1 = writer.addWorksheet("Worksheet1");
// Add a cell format.
var format1 = writer.addFormat("format1");
// Set the bold property for the format.
format1.setFontStyle("bold");
// Set the alignment for the format
format1.setAlign(writer.ALIGN_CENTER);
// Write formatted data.
worksheet1.writeCell("string", 0, 0, "Hello Excel", format1);
// Change the row height
worksheet1.setRow(0, 20);
// Change the column width
worksheet1.setColumn(0, 0, 15);
// Add an other worksheet with a user defined sheet name.
var worksheet2 = writer.addWorksheet("Worksheet2");
// Write some data to the worksheet.
writeWorksheetData(worksheet2);
// Create a chart object.
var chart = writer.addChart(writer.CHART_COLUMN);
// Configure the chart. In simplest case we just add some value data
// series. The empty categories will default to 1 to 5 like in Excel.
var series1 = chart.addSeries("", "=Worksheet2!$A$1:$A$5");
var series2 = chart.addSeries("", "=Worksheet2!$B$1:$B$5");
var series3 = chart.addSeries("", "=Worksheet2!$C$1:$C$5");
// Insert the chart into the worksheet
worksheet2.insertChart(6, 1, chart);
// Save the file.
if (!writer.save())
throw writer.getLastError();
function writeWorksheetData(worksheet)
{
var data = [
// Three columns of data.
[1, 2, 3],
[2, 4, 6],
[3, 6, 9],
[4, 8, 12],
[5, 10, 15]
];
var row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet.writeCell("number", row, col, data[row][col]);
}

Constructor & Destructor Documentation

◆ XLSXWriter()

XLSXWriter XLSXWriter::XLSXWriter ( String filename )

Create a new XLSXWriter object with a given filename.

Parameters
filename The name of the new Excel file to create.
Returns
An XLSXWriter instance
Note
When specifying a filename it is recommended that you use an .xlsx extension or Excel will generate a warning when opening the file.
Since
DOCUMENTS 5.0e

Member Function Documentation

◆ activateChartsheet()

boolean XLSXWriter::activateChartsheet ( var chartsheet )

Make a chartsheet the active, i.e., visible chartsheet.

This function is used to specify which chartsheet is initially visible in a multi-sheet Excel document.

Parameters
chartsheet The chartsheet to be updated can be specified as follows:
  • String containing the chartsheet name.
  • XLSXChartsheet object representing the chartsheet.
Returns
true if successful, false in case of any error
Note
More than one chartsheet can be selected via the XLSXWriter.selectChartsheet(var chartsheet) function, however only one chartsheet can be active.
Since
DOCUMENTS 5.0e
Example:
writer.activateChartsheet(chartsheet2);
See also
XLSXWriter.activateWorksheet(var worksheet)

◆ activateWorksheet()

boolean XLSXWriter::activateWorksheet ( var worksheet )

Make a worksheet the active, i.e., visible worksheet.

This function is used to specify which worksheet is initially visible in a multi-sheet Excel document.

Parameters
worksheet The worksheet to be updated can be specified as follows:
  • String containing the worksheet name.
  • XLSXWorksheet object representing the worksheet.
Returns
true if successful, false in case of any error
Note
More than one worksheet can be selected via the XLSXWriter.selectWorksheet(var worksheet) function, however only one worksheet can be active. The default active worksheet is the first worksheet.
Since
DOCUMENTS 5.0e
Example:
writer.activateWorksheet(worksheet2);
See also
XLSXWriter.activateChartsheet(var chartsheet)

◆ addChart()

XLSXChart XLSXWriter::addChart ( number type )

Create a new chart to be added to a worksheet/chartsheet.

Parameters
type The type (from 'Chart types') of chart to be created.
Returns
An XLSXChart object if successful, null in case of any error.
Since
DOCUMENTS 5.0e
Example:
// Create a chart object.
var chart = writer.addChart(writer.CHART_COLUMN);
// Add data series to the chart.
chart.addSeries(NULL, "Worksheet2!$A$1:$A$5");
chart.addSeries(NULL, "Worksheet2!$B$1:$B$5");
chart.addSeries(NULL, "Worksheet2!$C$1:$C$5");
// Insert the chart into the worksheet
worksheet2.insertChart(6, 1, chart);

◆ addChartsheet()

XLSXChartsheet XLSXWriter::addChartsheet ( String name = "" )

Add a new chartsheet to the current Excel document.

Parameters
name Optional chartsheet name. If it is empty the default Excel convention will be followed, i.e. Chart1, Chart2, etc. The chartsheet name must be a valid Excel chartsheet name, i.e. it must be less than 32 character and it cannot contain any of the characters: / \ [ ] : * ?
In addition, you cannot use the same, case insensitive, sheetname for more than one worksheet, or chartsheet.
Returns
An XLSXChartsheet object if successful, null in case of any error.
Note
At least one worksheet should be added to a new Excel file when creating a chartsheet in order to provide data for the chart.
Since
DOCUMENTS 5.0e
Example:
var worksheet1 = writer.addWorksheet("Worksheet1");
var chartsheet1 = writer.addChartsheet("Chartsheet1");

◆ addFormat()

XLSXWorksheet XLSXWriter::addFormat ( String name )

Create a new format object to format cells in worksheets.

Parameters
name Unique format name.
Returns
An XLSXFormat object if successful, null in case of any error.
Since
DOCUMENTS 5.0e
Example:
// Create the Format.
var format1 = writer.addFormat("format1");
// Set some of the format properties.
format1.setFontStyle("bold");
format1.setFontColor(writer.COLOR_RED); // see Predefined values for common colors
// Use the format to change the text format in a cell.
worksheet1.writeCell("string", 0, 0, "Hello", format1);

◆ addWorksheet()

XLSXWorksheet XLSXWriter::addWorksheet ( String name = "" )

Add a new worksheet to the current Excel document.

Parameters
name Optional worksheet name. If it is empty the default Excel convention will be followed, i.e. Sheet1, Sheet2, etc. The worksheet name must be a valid Excel worksheet name, i.e. it must be less than 32 character and it cannot contain any of the characters: / \ [ ] : * ?
In addition, you cannot use the same, case insensitive, sheetname for more than one worksheet, or chartsheet.
Returns
An XLSXWorksheet object if successful, null in case of any error.
Note
At least one worksheet should be added to a new Excel file.
Since
DOCUMENTS 5.0e
Example:
var worksheet1 = writer.addWorksheet("Worksheet1");

◆ getChartsheetByName()

XLSXChartsheet XLSXWriter::getChartsheetByName ( String name )

Get a chartsheet object from its name.

Parameters
name Chartsheet name.
Returns
An XLSXChartsheet object if successful, null in case of any error.
Since
DOCUMENTS 5.0e
Example:
var chartsheet1 = writer.getChartsheetByName("Chartsheet1");

◆ getFilePath()

String XLSXWriter::getFilePath ( )

Get the file path of the created Excel file.

Returns
The file path as String.
Since
DOCUMENTS 5.0e
Example:
util.out(writer.getFilePath());

◆ getLastError()

String XLSXWriter::getLastError ( )

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

Returns
Text of the last error as String
Since
DOCUMENTS 5.0e

◆ getWorksheetByName()

XLSXWorksheet XLSXWriter::getWorksheetByName ( String name )

Get a worksheet object from its name.

Parameters
name Worksheet name.
Returns
An XLSXWorksheet object if successful, null in case of any error.
Since
DOCUMENTS 5.0e
Example:
var worksheet1 = writer.getWorksheetByName("Worksheet1");

◆ hideChartsheet()

boolean XLSXWriter::hideChartsheet ( var chartsheet )

Hide the given chartsheet.

Parameters
chartsheet The chartsheet to be updated can be specified as follows:
  • String containing the chartsheet name.
  • XLSXChartsheet object representing the chartsheet.
Returns
true if successful, false in case of any error
Note
A hidden chartsheet can not be activated or selected so this function is mutually exclusive with the XLSXWriter.activateChartsheet(var chartsheet) and XLSXWriter.selectChartsheet(var chartsheet) functions.
Since
DOCUMENTS 5.0e
Example:
writer.activateChartsheet(chartsheet2);
writer.hideChartsheet(chartsheet1);
See also
XLSXWriter.hideWorksheet(var worksheet)

◆ hideWorksheet()

boolean XLSXWriter::hideWorksheet ( var worksheet )

Hide the given worksheet.

Parameters
worksheet The worksheet to be updated can be specified as follows:
  • String containing the worksheet name.
  • XLSXWorksheet object representing the worksheet.
Returns
true if successful, false in case of any error
Note
A hidden worksheet can not be activated or selected so this function is mutually exclusive with the XLSXWriter.activateWorksheet(var worksheet) and XLSXWriter.selectWorksheet(var worksheet) functions. In addition, since the first worksheet will default to being the active worksheet, you cannot hide the first worksheet without activating another sheet.
Since
DOCUMENTS 5.0e
Example:
writer.hideWorksheet(worksheet2);
See also
XLSXWriter.hideChartsheet(var chartsheet)

◆ save()

boolean XLSXWriter::save ( )

Write the Excel file to disk and free any memory allocated internally to the Excel file.

Note
After calling this function only both functions XLSXWriter.getFilePath() and XLSXWriter.getLastError() are available for the XLSXWriter object.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
if (!writer.save())
util.out(writer.getLastError());

◆ selectChartsheet()

boolean XLSXWriter::selectChartsheet ( var chartsheet )

Set a chartsheet tab as selected.

This function is used to indicate that a chartsheet is selected in a multi-sheet Excel document.

Parameters
chartsheet The chartsheet to be updated can be specified as follows:
  • String containing the chartsheet name.
  • XLSXChartsheet object representing the chartsheet.
Returns
true if successful, false in case of any error
Note
A selected chartsheet has its tab highlighted. Selecting chartsheets is a way of grouping them together so that, for example, several chartsheets could be printed in one go. A chartsheet that has been activated via the XLSXWriter.activateChartsheet(var chartsheet) function will also appear as selected.
Since
DOCUMENTS 5.0e
Example:
writer.selectChartsheet("Chartsheet2");
See also
XLSXWriter.selectWorksheet(var worksheet)

◆ selectWorksheet()

boolean XLSXWriter::selectWorksheet ( var worksheet )

Set a worksheet tab as selected.

This function is used to indicate that a worksheet is selected in a multi-sheet Excel document.

Parameters
worksheet The worksheet to be updated can be specified as follows:
  • String containing the worksheet name.
  • XLSXWorksheet object representing the worksheet.
Returns
true if successful, false in case of any error
Note
A selected worksheet has its tab highlighted. Selecting worksheets is a way of grouping them together so that, for example, several worksheets could be printed in one go. A worksheet that has been activated via the XLSXWriter.activateWorksheet(var worksheet) function will also appear as selected.
Since
DOCUMENTS 5.0e
Example:
writer.selectWorksheet(worksheet2);
See also
XLSXWriter.selectChartsheet(var chartsheet)

◆ setProperties()

boolean XLSXWriter::setProperties | ( | String | title,
 |  | String | subject,
 |  | String | author,
 |  | String | manager,
 |  | String | company,
 |  | String | category,
 |  | String | keywords,
 |  | String | comments,
 |  | String | status,
 |  | String | hyperlinkBase
 | ) |  |

Set the document properties.

This function can be used to set the document properties of the current Excel document. These properties are visible in Excel (e.g. under File -> Information -> Properties in Excel 2013) and are also available to external applications that read or index windows files.

Parameters
title | Title of the Excel document.
subject | Optional subject of the Excel document.
author | Optional author of the Excel document.
manager | Optional manager field of the Excel document.
company | Optional company field of the Excel document.
category | Optional category of the Excel document.
keywords | Optional keywords of the Excel document.
comments | Optional comment of the Excel document.
status | Optional status of the Excel document.
hyperlinkBase | Optional hyperlink base url of the Excel document.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
writer.setProperties("This is an example spreadsheet");

Member Data Documentation

◆ version

String XLSXWriter::version

String value containing the version number of the used library Libxlsxwriter.

Returns
String value containing the version number.
Since
DOCUMENTS 5.0e


DOCUMENTS 5 - PortalScripting API: Member List

XLSXWriter Member List

This is the complete list of members for XLSXWriter, including all inherited members.

activateChartsheet(var chartsheet) | XLSXWriter
activateWorksheet(var worksheet) | XLSXWriter
addChart(number type) | XLSXWriter
addChartsheet(String name="") | XLSXWriter
addFormat(String name) | XLSXWriter
addWorksheet(String name="") | XLSXWriter
ALIGN_CENTER | XLSXWriter
ALIGN_CENTER_ACROSS | XLSXWriter
ALIGN_DISTRIBUTED | XLSXWriter
ALIGN_FILL | XLSXWriter
ALIGN_JUSTIFY | XLSXWriter
ALIGN_LEFT | XLSXWriter
ALIGN_NONE | XLSXWriter
ALIGN_RIGHT | XLSXWriter
ALIGN_VERTICAL_BOTTOM | XLSXWriter
ALIGN_VERTICAL_CENTER | XLSXWriter
ALIGN_VERTICAL_DISTRIBUTED | XLSXWriter
ALIGN_VERTICAL_JUSTIFY | XLSXWriter
ALIGN_VERTICAL_TOP | XLSXWriter
BORDER_DASH_DOT | XLSXWriter
BORDER_DASH_DOT_DOT | XLSXWriter
BORDER_DASHED | XLSXWriter
BORDER_DOTTED | XLSXWriter
BORDER_DOUBLE | XLSXWriter
BORDER_HAIR | XLSXWriter
BORDER_MEDIUM | XLSXWriter
BORDER_MEDIUM_DASH_DOT | XLSXWriter
BORDER_MEDIUM_DASH_DOT_DOT | XLSXWriter
BORDER_MEDIUM_DASHED | XLSXWriter
BORDER_NONE | XLSXWriter
BORDER_SLANT_DASH_DOT | XLSXWriter
BORDER_THICK | XLSXWriter
BORDER_THIN | XLSXWriter
CHART_AREA | XLSXWriter
CHART_AREA_STACKED | XLSXWriter
CHART_AREA_STACKED_PERCENT | XLSXWriter
CHART_BAR | XLSXWriter
CHART_BAR_STACKED | XLSXWriter
CHART_BAR_STACKED_PERCENT | XLSXWriter
CHART_COLUMN | XLSXWriter
CHART_COLUMN_STACKED | XLSXWriter
CHART_COLUMN_STACKED_PERCENT | XLSXWriter
CHART_DOUGHNUT | XLSXWriter
CHART_LINE | XLSXWriter
CHART_PIE | XLSXWriter
CHART_RADAR | XLSXWriter
CHART_RADAR_FILLED | XLSXWriter
CHART_RADAR_WITH_MARKERS | XLSXWriter
CHART_SCATTER | XLSXWriter
CHART_SCATTER_SMOOTH | XLSXWriter
CHART_SCATTER_SMOOTH_WITH_MARKERS | XLSXWriter
CHART_SCATTER_STRAIGHT | XLSXWriter
CHART_SCATTER_STRAIGHT_WITH_MARKERS | XLSXWriter
COLOR_BLACK | XLSXWriter
COLOR_BLUE | XLSXWriter
COLOR_BROWN | XLSXWriter
COLOR_CYAN | XLSXWriter
COLOR_GRAY | XLSXWriter
COLOR_GREEN | XLSXWriter
COLOR_LIME | XLSXWriter
COLOR_MAGENTA | XLSXWriter
COLOR_NAVY | XLSXWriter
COLOR_ORANGE | XLSXWriter
COLOR_PINK | XLSXWriter
COLOR_PURPLE | XLSXWriter
COLOR_RED | XLSXWriter
COLOR_SILVER | XLSXWriter
COLOR_WHITE | XLSXWriter
COLOR_YELLOW | XLSXWriter
getChartsheetByName(String name) | XLSXWriter
getFilePath() | XLSXWriter
getLastError() | XLSXWriter
getWorksheetByName(String name) | XLSXWriter
hideChartsheet(var chartsheet) | XLSXWriter
hideWorksheet(var worksheet) | XLSXWriter
PATTERN_DARK_DOWN | XLSXWriter
PATTERN_DARK_GRAY | XLSXWriter
PATTERN_DARK_GRID | XLSXWriter
PATTERN_DARK_HORIZONTAL | XLSXWriter
PATTERN_DARK_TRELLIS | XLSXWriter
PATTERN_DARK_UP | XLSXWriter
PATTERN_DARK_VERTICAL | XLSXWriter
PATTERN_GRAY_0625 | XLSXWriter
PATTERN_GRAY_125 | XLSXWriter
PATTERN_LIGHT_DOWN | XLSXWriter
PATTERN_LIGHT_GRAY | XLSXWriter
PATTERN_LIGHT_GRID | XLSXWriter
PATTERN_LIGHT_HORIZONTAL | XLSXWriter
PATTERN_LIGHT_TRELLIS | XLSXWriter
PATTERN_LIGHT_UP | XLSXWriter
PATTERN_LIGHT_VERTICAL | XLSXWriter
PATTERN_MEDIUM_GRAY | XLSXWriter
PATTERN_NONE | XLSXWriter
PATTERN_SOLID | XLSXWriter
save() | XLSXWriter
selectChartsheet(var chartsheet) | XLSXWriter
selectWorksheet(var worksheet) | XLSXWriter
setProperties(String title, String subject, String author, String manager, String company, String category, String keywords, String comments, String status, String hyperlinkBase) | XLSXWriter
version | XLSXWriter
XLSXWriter(String filename) | XLSXWriter


DOCUMENTS 5 - PortalScripting API: XMLExport Class Reference

Public Member Functions | List of all members
XMLExport Class Reference

The XMLExport class allows to export DOCUMENTS elements as an XML file by scripting means. More...

Public Member Functions

boolean | addAccessProfile (var accessProfile)
Add the desired access profile to the XMLExport. More...
boolean | addAlias (String aliasName)
Add the desired alias to the XMLExport. More...
boolean | addCustomProperty (String propName)
Add the desired global custom property to the XMLExport. More...
boolean | addDistributionList (String distributionListName)
Add the desired distribution list to the XMLExport. More...
boolean | addDocumentsSettings ()
Add the DOCUMENTS settings data to the XMLExport. More...
boolean | addFellow (var editor, boolean includePrivateFolders=true)
Add the desired editor (fellow) to the XMLExport. More...
boolean | addFile (DocFile docFile, var exportCondition=true)
Add the desired DocFile object to the XMLExport. More...
boolean | addFileType (String fileTypeName)
Add the desired file type to the XMLExport. More...
boolean | addFileTypesFromCategory (String categoryName)
Add all file types belonging to the specified category to the XMLExport. More...
boolean | addFileTypesFromFolder (String folderName)
Add all file types belonging to the specified file type folder to the XMLExport. More...
boolean | addFilingPlan (String filingPlanName)
Add the desired filing plan to the XMLExport. More...
boolean | addFolder (Folder folder, boolean exportStructure, var exportCondition, boolean updateXML=false)
Add the desired Folder object to the XMLExport. More...
boolean | addNumberRange (String name, boolean withCounter=false)
Add the desired number range alias to the XMLExport. More...
boolean | addOutbar (String outbarName)
Add the desired outbar to the XMLExport. More...
boolean | addPartnerAccount (var userAccount, boolean includePrivateFolders=true)
Add the desired user account (not fellow) to the XMLExport. More...
boolean | addPortalScript (String namePattern, String format="5.0")
Add all PortalScripts with the desired name pattern to the XMLExport. More...
boolean | addPortalScriptCall (String nameScript)
Defines a PortalScript, that will be executed after the XML-import. More...
boolean | addPortalScriptsFromCategory (String nameCategory, String format="5.0")
Add all PortalScripts belonging to the specified category to the XMLExport. More...
boolean | addSystemUser (var systemUser, boolean includePrivateFolders=true)
Add the desired SystemUser (user account or fellow) to the XMLExport. More...
boolean | addWorkflow (String workflowName)
Add the desired workflow to the XMLExport. More...
boolean | clearXML ()
Remove all references to DocFile objects from the XMLExport object. More...
String | getLastError ()
Function to get the description of the last error that occurred. More...
String | getXML ()
Retrieve the XML structure of the DocFile objects already added to the XMLExport. More...
boolean | saveXML ()
Performs the final save process of the XML structure. More...
XMLExport | XMLExport (String pathFileName, boolean exportDocFile=true)
Create a new instance of the XMLExport class. More...

Detailed Description

The XMLExport class allows to export DOCUMENTS elements as an XML file by scripting means.

The exported XML structure may then, for example, be used for further manipulation by an external ERP environment. The following elements can be exported:

  • DocFile
  • PortalScript
  • Filetype
  • Folder
  • Workflow
  • Distribution List
  • Editor (Fellow)
  • AccessProfile
  • Alias
  • Filing Plan
  • Outbar
  • DocumentsSettings
  • CustomProperties

The XML files may also be reimported into another (or the same) Portal environment by the Docimport application for DocFile objects and by the XML-import of DOCUMENTS Manager for the remaining elements, respectively.

Since
ELC 3.51b / otrisPORTAL 5.1b available for DocFile
DOCUMENTS 4.0c available for PortalScript, Filetype, Folder, Workflow, Distribution List, Editor, AccessProfile, Alias and Filing Plan
DOCUMENTS 4.0d available for Outbar
DOCUMENTS 4.0e available for DocumentsSettings
DOCUMENTS 5.0d available for CustomProperties
Example:
var f = context.file;
if (f)
{
// create a new XMLExport
var xml = new XMLExport("c:\\tmp\\" + f.getAutoText("id") + ".xml");
xml.addFile(f); // add the current file to the export
xml.saveXML(); // perform the export operation
var xmlString = xml.getXML(); // get XML as String for further use
xml.clearXML(); // empty XMLExport object
}

Constructor & Destructor Documentation

◆ XMLExport()

XMLExport XMLExport::XMLExport | ( | String | pathFileName,
 |  | boolean | exportDocFile = true
 | ) |  |

Create a new instance of the XMLExport class.

The constructor is neccessary to initialize the XMLExport object with some basic settings. The pathFileName parameter is mandatory, the path must be an existing directory structure, and the target file should not yet exist in that directory structure.

Parameters
pathFileName String containing full path and file name of the desired target output XML file
exportDocFile Optional boolean value:
  • true indicating that the created XMLExport instance is only able to export DocFile objects;
  • false indicating the created XMLExport instance is able to export the following elements:
    • PortalScript
    • Filetype
    • Folder
    • Workflow
    • Distribution List
    • Editor (Fellow)
    • AccessProfile
    • Alias
    • Filing Plan
    • Outbar
    • DocumentsSettings
    • CustomProperties
The default value is true.
Returns
XMLExport object, preinitialised to the desired target output path
Since
ELC 3.51b / otrisPORTAL 5.1b
DOCUMENTS 4.0c (new parameter exportDocFile)

Member Function Documentation

◆ addAccessProfile()

boolean XMLExport::addAccessProfile ( var accessProfile )

Add the desired access profile to the XMLExport.

Parameters
accessProfile The desired access profile to be added to the XML output and specified as follows:
  • String containing the technical name of the access profile
  • AccessProfile object
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
Example:
var path = "C:\\temp\\expAccessProfile.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addAccessProfile("AccessProfile1");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addAlias()

boolean XMLExport::addAlias ( String aliasName )

Add the desired alias to the XMLExport.

Parameters
aliasName String value containing the technical name of the alias to be added to the XML output.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
Example:
var xmlExp = new XMLExport("C:\\temp\\expAlias.xml", false);
var success = xmlExp.addAlias("alias1");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addCustomProperty()

boolean XMLExport::addCustomProperty ( String propName )

Add the desired global custom property to the XMLExport.

Parameters
propName The technical name of the desired global custom property to be added to the XML output.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0d
Example:
var path = "C:\\temp\\expCustomProperty.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addCustomProperty("testProp");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addDistributionList()

boolean XMLExport::addDistributionList ( String distributionListName )

Add the desired distribution list to the XMLExport.

Parameters
distributionListName String containing the name of the distribution list to be added to the XML output.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
Example:
var path = "C:\\temp\\expDistributionList.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addDistributionList("DistributionList1");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addDocumentsSettings()

boolean XMLExport::addDocumentsSettings ( )

Add the DOCUMENTS settings data to the XMLExport.

Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0e

◆ addFellow()

boolean XMLExport::addFellow | ( | var | editor,
 |  | boolean | includePrivateFolders = true
 | ) |  |

Add the desired editor (fellow) to the XMLExport.

Parameters
editor The editor to be added to the XML output and specified as follows:
  • String containing the login name of the editor.
  • SystemUser object representing the editor.
includePrivateFolders boolean value indicating whether to export the private folders of the fellow
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
DOCUMENTS 4.0c HF2 (new parameter includePrivateFolders)
Example:
var path = "C:\\temp\\expFellow.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addFellow("editor1");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addFile()

boolean XMLExport::addFile | ( | DocFile | docFile,
 |  | var | exportCondition = true
 | ) |  |

Add the desired DocFile object to the XMLExport.

Parameters
docFile An object of the DocFile class which should be added to the XML output
exportCondition Optional export conditions specified as follows:
  • boolean value indicating whether the file id should be exported as update key.
  • XMLExportDescription object defining serveral conditions for the exporting process of the DocFile object.
The default value is true.
Returns
true if successful, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b
Example:
var path = "C:\\temp\\expDocFile.xml";
var xmlExp = new XMLExport(path, true);
var success = xmlExp.addFile(context.file);
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addFileType()

boolean XMLExport::addFileType ( String fileTypeName )

Add the desired file type to the XMLExport.

The XML output is able to update the same file type (Update-XML).

Parameters
fileTypeName The technical name of the file type to be added to the XML output.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
Example:
var path = "C:\\temp\\expFileType.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addFileType("Filetype1");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addFileTypesFromCategory()

boolean XMLExport::addFileTypesFromCategory ( String categoryName )

Add all file types belonging to the specified category to the XMLExport.

The XML output is able to update the same file types (Update-XML).

Parameters
categoryName The category name of the file types to be added to the XML output.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var path = "C:\\temp\\expFileTypesFromCategory.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addFileTypesFromCategory("ftCategory");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addFileTypesFromFolder()

boolean XMLExport::addFileTypesFromFolder ( String folderName )

Add all file types belonging to the specified file type folder to the XMLExport.

The XML output is able to update the same file types (Update-XML).

Parameters
folderName The folder name of the file types to be added to the XML output.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0e
Example:
var path = "C:\\temp\\expFileTypesFromFolder.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addFileTypesFromFolder("ftFolder");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addFilingPlan()

boolean XMLExport::addFilingPlan ( String filingPlanName )

Add the desired filing plan to the XMLExport.

The XML output is able to update the same filing plan (Update-XML).

Parameters
filingPlanName String containing the technical name of the filing plan to be added to the XML output.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
Example:
var path = "C:\\temp\\expFilingPlan.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addFilingPlan("myFilingPlan");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addFolder()

boolean XMLExport::addFolder | ( | Folder | folder,
 |  | boolean | exportStructure,
 |  | var | exportCondition,
 |  | boolean | updateXML = false
 | ) |  |

Add the desired Folder object to the XMLExport.

This function is able to add the folder structure or the files in the folder to the XMLExport.

Parameters
folder | The Folder object to be added to the XML output.
exportStructure | Boolean value indicating whether to export the folder structure or the files in the folder, on which the current user has read rights. If you want to export the files in the folder, an XMLExport instance being able to export DocFile should be used.
exportCondition The export conditions can be specified as follows:
  • boolean value
    • indicating whether the file id should be exported as update key in case of exporting files in the folder;
    • indicating whether the subfolders should be exported in case of exporting the folder structure.
  • XMLExportDescription object defining several conditions for the exporting process of the files in the folder.
updateXML Optional boolean value indicating whether the XML output is able to update the same folder (Update-XML) in case of exporting the folder structure. The default value is false.
Note: This Parameter is ignored in case of exporting the files in the folder.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
DOCUMENTS 5.0e HF2 (optional parameter updateXML)
Example:
var xmlExpFiles = new XMLExport("C:\\temp\\expFolderFiles.xml", true); // for exporting the files in the folder
var xmlExpStructure = new XMLExport("C:\\temp\\expFolderStructure.xml", false); // for exporting the folder structure
var it = context.getFoldersByName("myFolder", "dynamicpublic");
var folder = it.first();
if (folder)
{
var success = xmlExpFiles.addFolder(folder, false, true); // add the files in the folder to the XML output
if (success)
xmlExpFiles.saveXML();
success = xmlExpStructure.addFolder(folder, true, true); // add the folder structure to the XML output
if (success)
xmlExpStructure.saveXML();
}

◆ addNumberRange()

boolean XMLExport::addNumberRange | ( | String | name,
 |  | boolean | withCounter = false
 | ) |  |

Add the desired number range alias to the XMLExport.

Parameters
name | String value containing the technical name of the number range to be added to the XML output.
withCounter | boolean value indicating whether to export the actual counter value of the number range
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d HF1

◆ addOutbar()

boolean XMLExport::addOutbar ( String outbarName )

Add the desired outbar to the XMLExport.

Parameters
outbarName String value containing the technical name of the outbar to be added to the XML output.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0d
Example:
var xmlExp = new XMLExport("C:\\temp\\expOutbar.xml", false);
var success = xmlExp.addOutbar("outbar1");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addPartnerAccount()

boolean XMLExport::addPartnerAccount | ( | var | userAccount,
 |  | boolean | includePrivateFolders = true
 | ) |  |

Add the desired user account (not fellow) to the XMLExport.

Parameters
userAccount The user account to be added to the XML output and specified as follows:
  • String containing the login name of the user account.
  • SystemUser object representing the user account.
includePrivateFolders boolean value indicating whether to export the private folders of the user account
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0 HF2
Example:
var path = "C:\\temp\\expUserAccount.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addPartnerAccount("login1");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addPortalScript()

boolean XMLExport::addPortalScript | ( | String | namePattern,
 |  | String | format = "5.0"
 | ) |  |

Add all PortalScripts with the desired name pattern to the XMLExport.

Parameters
namePattern The name pattern of the PortalScripts to be added to the XML output.
format Optional String value defining the desired export format. The following formats are available:
  • 4.0 (DOCUMENTS 4.0)
  • 5.0 (DOCUMENTS 5.0)
The default value is "5.0".
Note
The XML files exported in DOCUMENTS 5.0 format are incompatible with DOCUMENTS 4.0.
Returns
true if successful, false in case of any error
Example:
var path = "C:\\temp\\expPortalScript.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addPortalScript("test*", "4.0");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());
Since
DOCUMENTS 4.0c
DOCUMENTS 5.0 HF1 (default format is 5.0)

◆ addPortalScriptCall()

boolean XMLExport::addPortalScriptCall ( String nameScript )

Defines a PortalScript, that will be executed after the XML-import.

This method does not export the content of a PortalScript (see XMLExport.addPortalScript()), but executes a PortalScript at the end of the XML-Import of the whole xml file.

Parameters
nameScript The name of the PortalScript, that should be executed.
Returns
true if successful, false in case of any error
Example:
var path = "C:\\temp\\expPortalScript.xml";
var xmlExp = new XMLExport(path, false);
...
var success = xmlExp.addPortalScriptCall("updateSolution");
...
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());
Since
DOCUMENTS 5.0c HF1

◆ addPortalScriptsFromCategory()

boolean XMLExport::addPortalScriptsFromCategory | ( | String | nameCategory,
 |  | String | format = "5.0"
 | ) |  |

Add all PortalScripts belonging to the specified category to the XMLExport.

Parameters
nameCategory The category name of the PortalScripts to be added to the XML output.
format Optional String value defining the desired export format. The following formats are available:
  • 4.0 (DOCUMENTS 4.0)
  • 4.0 (DOCUMENTS 5.0)
The default value is "5.0".
Note
The XML files exported in DOCUMENTS 5.0 format are incompatible with DOCUMENTS 4.0.
Returns
true if successful, false in case of any error
Example:
var path = "C:\\temp\\expPortalScript.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addPortalScriptsFromCategory("testScripts", "5.0");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());
Since
DOCUMENTS 4.0d HF1
DOCUMENTS 5.0 HF1 (default format is 5.0)

◆ addSystemUser()

boolean XMLExport::addSystemUser | ( | var | systemUser,
 |  | boolean | includePrivateFolders = true
 | ) |  |

Add the desired SystemUser (user account or fellow) to the XMLExport.

Parameters
systemUser The SystemUser to be added to the XML output and specified as follows:
  • String containing the login name of the SystemUser.
  • SystemUser object representing the user account.
includePrivateFolders boolean value indicating whether to export the private folders of the SystemUser
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0 HF2
Example:
var path = "C:\\temp\\expSystemUser.xml";
var xmlExp = new XMLExport(path, false);
var success = xmlExp.addSystemUser("login1");
if (success)
xmlExp.saveXML();
else
util.out(xmlExp.getLastError());

◆ addWorkflow()

boolean XMLExport::addWorkflow ( String workflowName )

Add the desired workflow to the XMLExport.

Parameters
workflowName String containing the technical name and optional the version number of the workflow to be added to the XML output. The format of the workflowName is technicalName[-version]. If you don't specify the version of the workflow, the workflow with the highest workflow version number will be used. If you want to add a specific version, you have to use technicalName-version e.g. "Invoice-2" as workflowName.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 4.0c
Example:
var path = "C:\\temp\\expWorkflow.xml";
var xmlExp = new XMLExport(path, false);
xmlExp.addWorkflow("Invoice"); // add the latest version of the workflow "Invoice"
xmlExp.addWorkflow("Invoice-2"); // add the version 2 of the workflow "Invoice"
xmlExp.saveXML();

◆ clearXML()

boolean XMLExport::clearXML ( )

Remove all references to DocFile objects from the XMLExport object.

After the execution of this method the XMLExport object is in the same state as right after its construction.

Returns
true if successful, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b

◆ getLastError()

String XMLExport::getLastError ( )

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

Returns
Text of the last error as String
Since
ELC 3.51b / otrisPORTAL 5.1b
See also
DocFile.getLastError()

◆ getXML()

String XMLExport::getXML ( )

Retrieve the XML structure of the DocFile objects already added to the XMLExport.

The XML structure is returned as a String, so it is possible to further manipulate it (e.g. with the E4X scripting extension (not discussed in this documentation) before outputting it to its final destination.

Returns
String containing the complete XMl structure of the XMLExport
Since
ELC 3.51b / otrisPORTAL 5.1b

◆ saveXML()

boolean XMLExport::saveXML ( )

Performs the final save process of the XML structure.

Not earlier than when executing this instruction the XML file is created in the target file path.

Returns
true if successful, false in case of any error
Since
ELC 3.51b / otrisPORTAL 5.1b


DOCUMENTS 5 - PortalScripting API: Member List

XMLExport Member List

This is the complete list of members for XMLExport, including all inherited members.

addAccessProfile(var accessProfile) | XMLExport
addAlias(String aliasName) | XMLExport
addCustomProperty(String propName) | XMLExport
addDistributionList(String distributionListName) | XMLExport
addDocumentsSettings() | XMLExport
addFellow(var editor, boolean includePrivateFolders=true) | XMLExport
addFile(DocFile docFile, var exportCondition=true) | XMLExport
addFileType(String fileTypeName) | XMLExport
addFileTypesFromCategory(String categoryName) | XMLExport
addFileTypesFromFolder(String folderName) | XMLExport
addFilingPlan(String filingPlanName) | XMLExport
addFolder(Folder folder, boolean exportStructure, var exportCondition, boolean updateXML=false) | XMLExport
addNumberRange(String name, boolean withCounter=false) | XMLExport
addOutbar(String outbarName) | XMLExport
addPartnerAccount(var userAccount, boolean includePrivateFolders=true) | XMLExport
addPortalScript(String namePattern, String format="5.0") | XMLExport
addPortalScriptCall(String nameScript) | XMLExport
addPortalScriptsFromCategory(String nameCategory, String format="5.0") | XMLExport
addSystemUser(var systemUser, boolean includePrivateFolders=true) | XMLExport
addWorkflow(String workflowName) | XMLExport
clearXML() | XMLExport
getLastError() | XMLExport
getXML() | XMLExport
saveXML() | XMLExport
XMLExport(String pathFileName, boolean exportDocFile=true) | XMLExport


DOCUMENTS 5 - PortalScripting API: XMLExportDescription Class Reference

Public Member Functions | Public Attributes | List of all members
XMLExportDescription Class Reference

The XMLExportDescription class has been added to the DOCUMENTS PortalScripting API to improve the XML Export process of DOCUMENTS files by scripting means. More...

Public Member Functions

XMLExportDescription XMLExportDescription ()
Create a new XMLExportDescription object. More...

Public Attributes

boolean | exportCreatedAt
boolean value whether export the create timestamp of the file. More...
boolean | exportFileId
boolean value whether export the id of the file. More...
boolean | exportLastModifiedAt
boolean value whether export the timestamp of the last modification of the file. More...
boolean | exportLastModifiedBy
boolean value whether export the name of the last editor of the file. More...
boolean | exportOwner
boolean value whether export the name of the owner of the file. More...

Detailed Description

The XMLExportDescription class has been added to the DOCUMENTS PortalScripting API to improve the XML Export process of DOCUMENTS files by scripting means.

For instance this allows to use different target archives for each file as well as to influence the archiving process by the file's contents itself. The XMLExportDescription object can only be used as parameter for the method XMLExport.addFile(XMLExportDescription)

Since
DOCUMENTS 4.0c

Constructor & Destructor Documentation

◆ XMLExportDescription()

XMLExportDescription XMLExportDescription::XMLExportDescription ( )

Create a new XMLExportDescription object.

Like in other programming languages you create a new object with the new operator (refer to example below).

Returns
XMLExportDescription which allows to define several conditions for the archiving process of a certain DocFile object
Since
DOCUMENTS 4.0c
Example:
var docFile = context.file;
if (!docFile)
{
// error handling
}
var desc = new XMLExportDescription();
desc.exportFileId = true;
desc.exportOwner = true;
desc.exportLastModifiedBy = true;
desc.exportCreatedAt = true;
desc.exportLastModifiedAt = true;
// create a new XMLExport
var xml = new XMLExport("c:\\tmp\\" + docFile.getAutoText("id") + ".xml");
xml.addFile(docFile, desc); // add the current file to the export
xml.saveXML(); // perform the export operation
See also
XMLExport.addFile()

Member Data Documentation

◆ exportCreatedAt

boolean XMLExportDescription::exportCreatedAt

boolean value whether export the create timestamp of the file.

Since
DOCUMENTS 4.0c

◆ exportFileId

boolean XMLExportDescription::exportFileId

boolean value whether export the id of the file.

Since
DOCUMENTS 4.0c

◆ exportLastModifiedAt

boolean XMLExportDescription::exportLastModifiedAt

boolean value whether export the timestamp of the last modification of the file.

Since
DOCUMENTS 4.0c

◆ exportLastModifiedBy

boolean XMLExportDescription::exportLastModifiedBy

boolean value whether export the name of the last editor of the file.

Since
DOCUMENTS 4.0c

◆ exportOwner

boolean XMLExportDescription::exportOwner

boolean value whether export the name of the owner of the file.

Since
DOCUMENTS 4.0c


DOCUMENTS 5 - PortalScripting API: Member List

XMLExportDescription Member List

This is the complete list of members for XMLExportDescription, including all inherited members.

exportCreatedAt | XMLExportDescription
exportFileId | XMLExportDescription
exportLastModifiedAt | XMLExportDescription
exportLastModifiedBy | XMLExportDescription
exportOwner | XMLExportDescription
XMLExportDescription() | XMLExportDescription


DOCUMENTS 5 - PortalScripting API: XMLHTTPRequest Class Reference

Public Member Functions | Public Attributes | List of all members
XMLHTTPRequest Class Reference

The XMLHTTPRequest class represents a HTTP request. More...

Public Member Functions

boolean | abort ()
Abort an asynchronous request if it already has been sent. More...
boolean | addRequestHeader (String name, String value)
Add a HTTP header to the request to be sent. More...
String | getAllResponseHeaders ()
Get all response headers as a string. More...
String | getResponseHeader (String name)
Get the value of the specified response header. More...
boolean | open (String method, String url, boolean async=false, String user="", String passwd="")
Initialize a HTTP request. More...
boolean | send (String content="")
Send the request to the HTTP server. More...
void | setCAInfo (String pemFile, int options)
Set one or more certificates to verify the peer if using HTTPS. More...
XMLHTTPRequest | XMLHTTPRequest (String proxy="", int proxyPort=3128, String proxyUser="", String proxyPasswd="")
Create a new XMLHTTPRequest object. More...
XMLHTTPRequest | XMLHTTPRequest (bool useProxySetting=true)
Create a new XMLHTTPRequest object with option to switch off the query mechanism for proxy settings. More...

Public Attributes

boolean | canAsync
Flag indicating whether asynchronous requests are possible on the used plattform. More...
boolean | canProxy
Flag indicating whether the implementation on the used plattform allows the direct specifying of a proxy server. More...
int | COMPLETED
The constant 4 for XMLHTTPRequest.readyState. More...
int | FileSizeHint
Optional File size indicator for sending pure sequential files. More...
int | INTERACTIVE
The constant 3 for XMLHTTPRequest.readyState. More...
int | NOTSENT
The constant 1 for XMLHTTPRequest.readyState. More...
int | readyState
The current state of the asynchronous request. More...
Var | response
The response received from the HTTP server or null if no response is received. More...
File responseFile
An optional writable file for streaming a large response. More...
String | responseType
Preferred output format of the response property (optional). More...
int | SENT
The constant 2 for XMLHTTPRequest.readyState. More...
int | status
The HTTP status code of the request. More...
String | statusText
The HTTP status text of the request. More...
int | UNINITIALIZED
The constant 0 for XMLHTTPRequest.readyState. More...
int | VERIFYHOST
Constant for CA Certificate verification if using HTTPS. More...
int | VERIFYPEER
Constant for CA Certificate verification if using HTTPS. More...

Detailed Description

The XMLHTTPRequest class represents a HTTP request.

Though the name of this class traditionally refers to XML, it can be used to transfer arbitrary strings or binary data. The interface is based on the definition of the class IXMLHTTPRequest from MSXML. As http-library the libcurl is used. To send a HTTP request the following steps are needed:

  • Creating an instance of this class.
  • Initializing the request via open(). Possibly also adding header data by means of addRequestHeader().
  • Sending the request via send().
  • In case of asynchronous request checking for completion of the request operation via XMLHTTPRequest.readyState.
  • Evaluating the result via e.g. XMLHTTPRequest.status, XMLHTTPRequest.response and getAllResponseHeaders().

See SOAP Client using DOM for a detailed example using XMLHTTPRequest.

Example:
// synchron
var xmlHttp = new XMLHTTPRequest();
var async = false;
var url = "http://localhost:11001/";
xmlHttp.open("GET", url + "?wsdl", async);
xmlHttp.send();
util.out(xmlHttp.response);
Example:
// asynchron
var xmlHttp = new XMLHTTPRequest();
var async = true;
var url = "http://localhost:11001/";
xmlHttp.open("GET", url + "?wsdl", async);
xmlHttp.send();
while(xmlHttp.status != xmlHttp.COMPLETED) {
util.sleep(500); // sleep 500 ms
}
util.out(xmlHttp.response);
Note
The XMLHTTPRequest is able to use a proxy configuration. The server searches the proxy settings in the following order (priority)
  • Specification in the constructor function s. XMLHTTPRequest(String proxy, int proxyPort, String proxyUser, String proxyPasswd)
  • Global specification in the documents.ini
  • On Windows systems: Internet Explorer proxy configuration for the current user
  • On Windows systems: Default WinHTTP proxy configuration from the registry.
If you want to be sure, that no proxy must be used, then use the constructor function XMLHTTPRequest(bool useProxySetting) with useProxySetting = false
Since
DOCUMENTS 4.0

Constructor & Destructor Documentation

◆ XMLHTTPRequest() [1/2]

XMLHTTPRequest XMLHTTPRequest::XMLHTTPRequest | ( | String | proxy = "",
 |  | int | proxyPort = 3128,
 |  | String | proxyUser = "",
 |  | String | proxyPasswd = ""
 | ) |  |

Create a new XMLHTTPRequest object.

Parameters
proxy | Optional string value specifying the hostname of the proxy server being resolvable by the nameserver. On windows OS: If this parameter is not specified, the windows proxy configuration will be used. E.g. the proxy server specified in Internet Explorer is used in the registry.
proxyPort | Optional number of the port on which the proxy accepts requests.
proxyUser | Optional string value specifying the desired login name for the proxy
proxyPasswd | Optional string value specifying the password for logging in to the proxy
Note
On windows OS: If no proxy is specified as first parameter, the proxy settings of the Internet Explorer and and the WinHTTP configuration will be checked, and a defined proxy setting will be used.
Since
DOCUMENTS 4.0
DOCUMENTS 5.0c (on windows OS support of system proxy configuration)
See also
XMLHTTPRequest.canProxy

◆ XMLHTTPRequest() [2/2]

XMLHTTPRequest XMLHTTPRequest::XMLHTTPRequest ( bool useProxySetting = true )

Create a new XMLHTTPRequest object with option to switch off the query mechanism for proxy settings.

Parameters
useProxySetting Boolean value. Set to false to switch off the query for proxy settings.
Since
DOCUMENTS 5.0d HF2

Member Function Documentation

◆ abort()

boolean XMLHTTPRequest::abort ( )

Abort an asynchronous request if it already has been sent.

Returns
true if successful, false in case of any error.
Since
DOCUMENTS 4.0
Example:
var xmlHttp = new XMLHTTPRequest();
var async = true;
var url = "http://localhost:11001/";
xmlHttp.open("POST", url, async);
xmlHttp.send(content);
var timeout = 3000; // milliseconds
var idle = 200; // 200 ms
var timeoutTS = (new Date()).getTime() + timeout;
while (httpCon.readyState != httpCon.COMPLETED) {
if ((new Date()).getTime() > timeoutTS) {
xmlHttp.abort();
xmlHttp = null;
}
util.sleep(idle);
}
if (xmlHttp)
util.out(xmlHttp.status);

◆ addRequestHeader()

boolean XMLHTTPRequest::addRequestHeader | ( | String | name,
 |  | String | value
 | ) |  |

Add a HTTP header to the request to be sent.

Parameters
name | String specifying the header name.
value | String specifying the header value.
Returns
true if the header was added successfully, false in case of any error.
Note
The request must be initialized via open() before.
Since
DOCUMENTS 4.0
Example:
var xmlHttp = new XMLHTTPRequest();
var async = true;
var url = "http://localhost:11001/";
xmlHttp.open("POST", url, async);
xmlHttp.addRequestHeader("Content-Type", "text/xml");
xmlHttp.send(c);

◆ getAllResponseHeaders()

String XMLHTTPRequest::getAllResponseHeaders ( )

Get all response headers as a string.

Each entry is in a separate line and has the form 'name:value'.

Returns
All response headers as a string.
Since
DOCUMENTS 4.0
Example:
var xmlHttp = new XMLHTTPRequest();
var async = false;
var url = "http://localhost:11001/";
xmlHttp.open("POST", url, async);
if (xmlHttp.send(content))
util.out(xmlHttp.getAllResponseHeaders());

◆ getResponseHeader()

String XMLHTTPRequest::getResponseHeader ( String name )

Get the value of the specified response header.

Parameters
name String specifying the response header name.
Returns
String with the value of the response header, an empty string in case of any error.
Since
DOCUMENTS 4.0
Example:
var xmlHttp = new XMLHTTPRequest();
var async = false;
var url = "http://localhost:11001/";
xmlHttp.open("POST", url, async);
if (xmlHttp.send(content))
util.out(xmlHttp.getResponseHeader("Content-Type"));

◆ open()

boolean XMLHTTPRequest::open | ( | String | method,
 |  | String | url,
 |  | boolean | async = false,
 |  | String | user = "",
 |  | String | passwd = ""
 | ) |  |

Initialize a HTTP request.

Parameters
method String specifying the used HTTP method. The following methods are available:
  • GET: Sending a GET request, for example, for querying a HTML file.
  • PUT: Sending data to the HTTP server. The data must be passed in the send() call. The URI represents the name under which the data should be stored. Under this name, the data are then normally retrievable.
  • POST: Sending data to the HTTP server. The data must be passed in the send() call. The URI represents the name of the consumer of the data.
  • DELETE: Sending a DELETE request.
  • PATCH: Sending a PATCH request, see RFC 5789 (https://tools.ietf.org/html/rfc5789).
url | String containing the URL for this request.
async | Optional flag indicating whether to handle the request asynchronously. In this case the operation send() returns immediately, in other word, it will not be waiting until a response is received. Asynchronous sending is only possible, when XMLHTTPRequest.canAsync returns true. If asynchronous sending is not possible, this flag will be ignored. For an asynchronous request you can use XMLHTTPRequest.readyState to get the current state of the request.
user | Optional user name must be specified only if the HTTP server requires authentication.
passwd | Optional password must also be specified only if the HTTP server requires authentication.
Returns
true if the request was successfully initialized, false in case of any error.
Since
DOCUMENTS 4.0
DOCUMENTS 5.0e (support PATCH request)
Example:
var xmlHttp = new XMLHTTPRequest();
var async = false;
var url = "http://localhost:11001/";
xmlHttp.open("GET", url + "?wsdl", async);
xmlHttp.send();
See also
XMLHTTPRequest.send(String content), XMLHTTPRequest.canAsync

◆ send()

boolean XMLHTTPRequest::send ( String content = "" )

Send the request to the HTTP server.

The request must be prepared via open() before.

Parameters
content Optional content to be sent; usually a String. See the remarks section about using other types.
Returns
true if the request was successfully performed or initiated (for asynchronous requests), false in case of any error.
Note
The request must be initialized via open() before. You can use XMLHTTPRequest.readyState to get the current state of an asynchronous request. The properties XMLHTTPRequest.status and XMLHTTPRequest.statusText return the status of the completed request while using getResponseHeader() and XMLHTTPRequest.response the actual result of the request can be retrieved. An asynchronous request can be canceled using abort().
Remarks
The type of the content parameter can be one of the following: String, ArrayBuffer, File. Caution: all other types will be converted to a string! Given a conventional array, the function will only send a string like "[object Array]".

About files
Passed files must be opened in binary read mode. If the file is not rewindable (a named pipe, for instance), the property FileSizeHint should be set before sending. The property is useful to supress an automatic length scan. The function implicitly closes the File object, though the file may remain open for asynchronous operation. When an asynchronous request is completed, its associated files become closed outside the JavaScript environment.

About Arraybuffers
Passing a TypedArray (UInt8Array, Int16Array etc.) instead of an ArrayBuffer is possible, but not recommended. The actual implementation always sends the complete associated buffer. The result can be unexpected, if the TypedArray covers only a section of a bigger buffer. This behaviour might change in future releases.

Since
DOCUMENTS 4.0
DOCUMENTS 5.0c (Support for sending File and ArrayBuffer)
Example:
var xmlHttp = new XMLHTTPRequest();
var async = false;
if (xmlHttp.canAsync)
async = true;
var url = "http://localhost:11001/";
xmlHttp.open("GET", url + "?wsdl", async);
xmlHttp.send(null);
if (async) {
while(xmlHttp.status != xmlHttp.COMPLETED) {
util.sleep(500); // sleep 500 ms
}
}
util.out(xmlHttp.status); // should be 200
Example:
var file = new File("E:\\test\\Lighthouse.jpg", "rb");
if(!file || !file.ok())
throw "File not found";
var req = new XMLHTTPRequest();
var url = "http://localhost:8080/myUploadServlet";
req.open("PUT", url, false);
// Uncomment the following instruction to suppress the
// "100-continue" communication cycle, if the target server
// does not support it. This might also speed up very little
// uploads. Otherwise better keep the default behaviour.
// req.addRequestHeader("Expect", " ");
req.addRequestHeader("Filename", "Lighthouse.jpg");
req.send(file);
util.out(req.status);
util.out(req.response);
// No need to close file here; send() already did.
util.out(req.status); // should be 200
See also
XMLHTTPRequest.open(String method, String url, boolean async, String user, String passwd), FileSizeHint

◆ setCAInfo()

void XMLHTTPRequest::setCAInfo | ( | String | pemFile,
 |  | int | options
 | ) |  |

Set one or more certificates to verify the peer if using HTTPS.

Parameters
pemFile | String with the path to pem-file with the servers certificates (bundle of X.509 certificates in PEM format).
options | Integer with a bitmask of verification-options (XMLHTTPRequest.VERIFYPEER, XMLHTTPRequest.VERIFYHOST)
Since
DOCUMENTS 5.0c
Example:
var url = "https://someserver:443/";
var xmlHttp = new XMLHTTPRequest();
xmlHttp.setCAInfo("c:\\certs\\cabundle.pem", XMLHTTPRequest.VERIFYPEER + XMLHTTPRequest.VERIFYHOST);
var async = false;
xmlHttp.open("POST", url, async);
if (xmlHttp.send(content))
util.out(xmlHttp.getAllResponseHeaders());

Member Data Documentation

◆ canAsync

boolean XMLHTTPRequest::canAsync

Flag indicating whether asynchronous requests are possible on the used plattform.

Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ canProxy

boolean XMLHTTPRequest::canProxy

Flag indicating whether the implementation on the used plattform allows the direct specifying of a proxy server.

Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ COMPLETED

int XMLHTTPRequest::COMPLETED

The constant 4 for XMLHTTPRequest.readyState.

In this state the request is completed. All the data are available now.

Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ FileSizeHint

int XMLHTTPRequest::FileSizeHint

Optional File size indicator for sending pure sequential files.

When uploading files, the send() function usually detects the file size and forwards it to lower APIs. This is helpful in most cases, because old simple HTTP servers do not support the transfer mode "chunked". Web services may reject uploads without an announced content-length, too.
However, the auto-detection will fail, if a given file is not rewindable (a named pipe, for instance). To avoid errors this property should be set before sending such a special file. After the transmission the property should be either set to "-1" or deleted.
The value is interpreted in the following way.

  • Values > 0 specify a precise file size in bytes.
  • The value -1 has the same effect as leaving the property undefined (enable auto-detection).
  • The value -2 disables file size detection and enforces a chunked transfer.
Note
This property serves as a hidden optional parameter to the send() function. On new objects it is undefined. Assigning an incorrect value >= 0 may trigger deadlocks or timeouts.
See also
send()
Since
DOCUMENTS 5.0c

◆ INTERACTIVE

int XMLHTTPRequest::INTERACTIVE

The constant 3 for XMLHTTPRequest.readyState.

In this state the request is partially completed. This means that some data has been received.

Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ NOTSENT

int XMLHTTPRequest::NOTSENT

The constant 1 for XMLHTTPRequest.readyState.

In this state the object has been initialized, but not sent yet.

Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ readyState

int XMLHTTPRequest::readyState

The current state of the asynchronous request.

The following states are available:

  • XMLHTTPRequest.UNINITIALIZED = 0 : the method open() has not been called.
  • XMLHTTPRequest.NOTSENT = 1: the object has been initialized, but not sent yet.
  • XMLHTTPRequest.SENT = 2 : the object has been sent. No data is available yet.
  • XMLHTTPRequest.INTERACTIVE = 3: the request is partially completed. This means that some data has been received.
  • XMLHTTPRequest.COMPLETED = 4: the request is completed. All the data are available now.
Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ response

Var XMLHTTPRequest::response

The response received from the HTTP server or null if no response is received.

Note
This property is readonly. Starting with DOCUMENTS 5.0c its data type is influenced by the optional property responseType. The default type is String. For requests with an attached responseFile this value can be truncated after a few kBytes.
See also
responseType, responseFile
Since
DOCUMENTS 4.0
Example:
var xmlHttp = new XMLHTTPRequest();
var async = false;
var url = "http://localhost:11001/";
xmlHttp.open("POST", url, async);
if (xmlHttp.send(content))
util.out(xmlHttp.response);

◆ responseFile

File XMLHTTPRequest::responseFile

An optional writable file for streaming a large response.

To achieve an efficient download scripts can create a writable File an attach it to the request. The complete response will then be written into this file. The value of the response property, however, will be truncated after the first few kBytes.

Note
On new objects this property is undefined.
When send() is called, the request takes exclusive ownership of the attached file. The property will then be reset to null. Even in asynchronous mode send() seems to close the file immediately. In fact, send() detaches the native file handle from the JavaScript object to ensure exclusive access.
Received content will be written to the file, disregarding the HTTP status.
See also
response, responseType, File
Since
DOCUMENTS 5.0c
Example:
var url = "http://localhost:8080/documents/img/documents/skin/black/module/dashboard/48/view.png";
var req = new XMLHTTPRequest;
req.open("GET", url);
var file = new File("E:\\test\\downloaded.png", "wb");
if(!file.ok())
return "Cannot open response file for writing";
req.responseFile = file;
req.send();
return req.status;

◆ responseType

String XMLHTTPRequest::responseType

Preferred output format of the response property (optional).

By default, the object expects text responses and stores them in a String. If the application expects binary data, it may request an ArrayBuffer by setting this property to "arraybuffer".

Note
On new objects this property is undefined. ArrayBuffer responses are created only once after each request. If a script changes the received buffer, the response property will reflect these changes until a new request starts.
See also
response, responseFile
Since
DOCUMENTS 5.0c

◆ SENT

int XMLHTTPRequest::SENT

The constant 2 for XMLHTTPRequest.readyState.

In this state the object has been sent. No data is available yet.

Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ status

int XMLHTTPRequest::status

The HTTP status code of the request.

Note
This property is readonly.
Since
DOCUMENTS 4.0
See also
XMLHTTPRequest.statusText

◆ statusText

String XMLHTTPRequest::statusText

The HTTP status text of the request.

Note
This property is readonly.
Since
DOCUMENTS 4.0
See also
XMLHTTPRequest.status

◆ UNINITIALIZED

int XMLHTTPRequest::UNINITIALIZED

The constant 0 for XMLHTTPRequest.readyState.

In this state the method open() has not been called.

Note
This property is readonly.
Since
DOCUMENTS 4.0

◆ VERIFYHOST

int XMLHTTPRequest::VERIFYHOST

Constant for CA Certificate verification if using HTTPS.

This option activate the verification of the host.

Note
This property is readonly.
Since
DOCUMENTS 5.0c
See also
XMLHTTPRequest.setCAInfo(String pemFile, int options)

◆ VERIFYPEER

int XMLHTTPRequest::VERIFYPEER

Constant for CA Certificate verification if using HTTPS.

This option activate the verification of the certificate chain.

Note
This property is readonly.
Since
DOCUMENTS 5.0c
See also
XMLHTTPRequest.setCAInfo(String pemFile, int options)


DOCUMENTS 5 - PortalScripting API: Member List

XMLHTTPRequest Member List

This is the complete list of members for XMLHTTPRequest, including all inherited members.

abort() | XMLHTTPRequest
addRequestHeader(String name, String value) | XMLHTTPRequest
canAsync | XMLHTTPRequest
canProxy | XMLHTTPRequest
COMPLETED | XMLHTTPRequest
FileSizeHint | XMLHTTPRequest
getAllResponseHeaders() | XMLHTTPRequest
getResponseHeader(String name) | XMLHTTPRequest
INTERACTIVE | XMLHTTPRequest
NOTSENT | XMLHTTPRequest
open(String method, String url, boolean async=false, String user="", String passwd="") | XMLHTTPRequest
readyState | XMLHTTPRequest
response | XMLHTTPRequest
responseFile | XMLHTTPRequest
responseType | XMLHTTPRequest
send(String content="") | XMLHTTPRequest
SENT | XMLHTTPRequest
setCAInfo(String pemFile, int options) | XMLHTTPRequest
status | XMLHTTPRequest
statusText | XMLHTTPRequest
UNINITIALIZED | XMLHTTPRequest
VERIFYHOST | XMLHTTPRequest
VERIFYPEER | XMLHTTPRequest
XMLHTTPRequest(String proxy="", int proxyPort=3128, String proxyUser="", String proxyPasswd="") | XMLHTTPRequest
XMLHTTPRequest(bool useProxySetting=true) | XMLHTTPRequest


DOCUMENTS 5 - PortalScripting API: Class Index

Class Index
a | c | d | e | f | h | p | r | s | u | w | x
a
CustomPropertyIterator DOMNode
r
WorkflowStepIterator
d
DOMNodeList
x
AccessProfile DOMParser Register
AccessProfileIterator DBConnection
e
RegisterIterator XLSXChart
ArchiveConnection DBResultSet RetrievalField XLSXChartAxis
ArchiveConnectionBlob DocFile E4X RetrievalSource XLSXChartSeries
ArchiveConnectionBlobIterator DocFileDataField Email
s
XLSXChartsheet
ArchiveFileResultset DocHit
f
XLSXFormat
ArchiveServer DocQueryParams ScriptCall XLSXWorksheet
ArchiveServerIterator Document File SystemUser XLSXWriter
ArchivingDescription DocumentIterator FileResultset SystemUserIterator XMLExport
c
DOMAttr Folder
u
XMLExportDescription
DOMCharacterData FolderIterator XMLHTTPRequest
Context DOMDocument
h
UserAction
ControlFlow DOMElement Util
ControlFlowIterator DOMException HitResultset
w
CustomProperty DOMNamedNodeMap
p
WorkflowStep
PropertyCache
a | c | d | e | f | h | p | r | s | u | w | x


DOCUMENTS 5 - PortalScripting API: Class Hierarchy

Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 12]
C AccessProfile | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means
C AccessProfileIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means
C ArchiveConnection | Allows low level access to the EAS Interface, EBIS and the EASY ENTERPRISE XML-Server
C ArchiveConnectionBlob | Access to each single attachment of files in the archive
C ArchiveConnectionBlobIterator | Iterator that holds a list of objects of the class ArchiveConnectionBlob
C ArchiveFileResultset | Supports basic functions to loop through a list of ArchiveFile objects
C ArchiveServer | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS ArchiveServer by scripting means
C ArchiveServerIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS ArchiveSerevrby scripting means
C ArchivingDescription | Has been added to the DOCUMENTS PortalScripting API to improve the archiving process of DOCUMENTS files by scripting means
C Context | Basic anchor for the most important attributes and methods to customize DOCUMENTS through PortalScripting
C ControlFlow | Has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means
C ControlFlowIterator | Has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means
C CustomProperty | Access to the user properties
C CustomPropertyIterator | Iterator that holds a list of objects of the class CustomProperty
C DBConnection | This class enables you to connect to a database and execute SQL statements
C DBResultSet | List of resultset rows
C DocFile | Implements the file object of DOCUMENTS
C DocFileDataField | The JS_DocFileDataField class represents the special comment field at the DocFile
C DocHit | Presents the hit object collected by a HitResultset
C DocQueryParams | This class encapsulates the basic parameters of a Documents search request
C Document | Has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means
C DocumentIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means
C DOMException | Many of the DOM API functions throw a DOMException, when an error has occurred
C DOMNamedNodeMap | A DOMNamedNodeMap is a kind of index for a set of DOMNodes, in which each node has got a unique name
▼C DOMNode | DOMNode is the base class of all tree elements in a DOMDocument
C DOMAttr | This class models a single attribute of a DOMElement
C DOMCharacterData | DOMCharacterData represents text-like nodes in the DOM tree
C DOMDocument | The DOMDocument is the root of a DOM tree
C DOMElement | An object of this class represents a HTML or XML element in the DOM
C DOMNodeList | A dynamic, ordered list of DOMNodes
C DOMParser | This class provides basic methods to parse or synthesize XML documents using the Document Object Model (DOM)
C E4X |
C Email | Allows to create and send an email
C File | Allows full access to files stored on the Portal Server's filesystem
C FileResultset | Supports basic functions to loop through a list of DocFile objects
C Folder | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS folders by scripting means
C FolderIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS folders by scripting means
C HitResultset | Allows comprehensive search operations in Documents and in connected archives
C PropertyCache | Util class that allows it to store / cache data over the end of the run time of a script
C Register | Has been added to the DOCUMENTS PortalScripting API to gain full access to the registers of a DOCUMENTS file by scripting means
C RegisterIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the registers of a DOCUMENTS file by scripting means
C RetrievalField | This class represents one search field or one conditon within a DOCUMENTS search request
C RetrievalSource | This class describes a searchable resource in the DOCUMENTS retrieval system
C ScriptCall | This class allows asynchronous calling a script from another script
C SystemUser | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS users by scripting means
C SystemUserIterator | Has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS users by scripting means
C UserAction | User-defined action of DOCUMENTS
C Util | Supports some functions that do not need any user or file context
C WorkflowStep | Allows access to the according object type of DOCUMENTS
C WorkflowStepIterator | Has been added to the DOCUMENTS PortalScripting API to gain full control over a file's workflow by scripting means
C XLSXChart | Allows creating an Excel chart
C XLSXChartAxis | Excel chart axis
C XLSXChartSeries | Excel chart data series
C XLSXChartsheet | Excel chartsheet
C XLSXFormat | Allows formatting cells in Excel
C XLSXWorksheet | Excel worksheet
C XLSXWriter | Allows creating files in the Excel 2007+ XLSX file format by use of the library Libxlsxwriter
C XMLExport | Allows to export DOCUMENTS elements as an XML file by scripting means
C XMLExportDescription | Has been added to the DOCUMENTS PortalScripting API to improve the XML Export process of DOCUMENTS files by scripting means
C XMLHTTPRequest | HTTP request


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • abort() : DocFile , XMLHTTPRequest
  • AccessProfile() : AccessProfile
  • activateChartsheet() : XLSXWriter
  • activateWorksheet() : XLSXWriter
  • addAccessProfile() : Folder , XMLExport
  • addAlias() : XMLExport
  • addAttachment() : Email
  • addAutofilter() : XLSXWorksheet
  • addChart() : XLSXWriter
  • addChartsheet() : XLSXWriter
  • addCustomProperty() : AccessProfile , Context , SystemUser , XMLExport
  • addDistributionList() : XMLExport
  • addDocumentFromFileSystem() : DocFile
  • addDocumentsSettings() : XMLExport
  • addFellow() : XMLExport
  • addFile() : Folder , XMLExport
  • addFileLink() : Register
  • addFileType() : XMLExport
  • addFileTypeAgent() : SystemUser
  • addFileTypeAgentScript() : SystemUser
  • addFileTypesFromCategory() : XMLExport
  • addFileTypesFromFolder() : XMLExport
  • addFilingPlan() : XMLExport
  • addFilterEDAServer() : Folder
  • addFilterEEiArchive() : Folder
  • addFilterEExView() : Folder
  • addFilterFileType() : Folder
  • addFolder() : XMLExport
  • addFormat() : XLSXWriter
  • addNumberRange() : XMLExport
  • addOutbar() : XMLExport
  • addParameter() : ScriptCall
  • addPartnerAccount() : XMLExport
  • addPDF() : DocFile
  • addPortalScript() : XMLExport
  • addPortalScriptCall() : XMLExport
  • addPortalScriptsFromCategory() : XMLExport
  • addRegister() : ArchivingDescription
  • addRequestHeader() : XMLHTTPRequest
  • addSeries() : XLSXChart
  • addSubProperty() : CustomProperty
  • addSystemUser() : Folder , XMLExport
  • addTimeInterval() : Context
  • addToAccessProfile() : SystemUser
  • addToFolder() : UserAction
  • addToOutbar() : Folder
  • addWorkflow() : XMLExport
  • addWorksheet() : XLSXWriter
  • ALIGN_CENTER : XLSXWriter
  • ALIGN_CENTER_ACROSS : XLSXWriter
  • ALIGN_DISTRIBUTED : XLSXWriter
  • ALIGN_FILL : XLSXWriter
  • ALIGN_JUSTIFY : XLSXWriter
  • ALIGN_LEFT : XLSXWriter
  • ALIGN_NONE : XLSXWriter
  • ALIGN_RIGHT : XLSXWriter
  • ALIGN_VERTICAL_BOTTOM : XLSXWriter
  • ALIGN_VERTICAL_CENTER : XLSXWriter
  • ALIGN_VERTICAL_DISTRIBUTED : XLSXWriter
  • ALIGN_VERTICAL_JUSTIFY : XLSXWriter
  • ALIGN_VERTICAL_TOP : XLSXWriter
  • allowArchive : Folder
  • allowCopyTo : Folder
  • allowCreatePDF : Folder
  • allowDelete : Folder
  • allowExport : Folder
  • allowForward : Folder
  • allowMoveTo : Folder
  • ANNOTATIONS : SystemUser
  • API : DocQueryParams
  • appendChild() : DOMNode
  • appendData() : DOMCharacterData
  • archive() : DocFile
  • ARCHIVE : SystemUser
  • archiveAndDelete() : DocFile
  • ArchiveFileResultset() : ArchiveFileResultset
  • archiveMonitor : ArchivingDescription
  • archiveServer : ArchivingDescription
  • archiveStatus : ArchivingDescription
  • ArchivingDescription() : ArchivingDescription
  • asJSON() : DocFile
  • ATTRIBUTE_NODE : DOMNode
  • attributes : DOMNode


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- b -

  • base64Decode() : Util
  • base64Encode() : Util
  • beep() : Util
  • BORDER_DASH_DOT : XLSXWriter
  • BORDER_DASH_DOT_DOT : XLSXWriter
  • BORDER_DASHED : XLSXWriter
  • BORDER_DOTTED : XLSXWriter
  • BORDER_DOUBLE : XLSXWriter
  • BORDER_HAIR : XLSXWriter
  • BORDER_MEDIUM : XLSXWriter
  • BORDER_MEDIUM_DASH_DOT : XLSXWriter
  • BORDER_MEDIUM_DASH_DOT_DOT : XLSXWriter
  • BORDER_MEDIUM_DASHED : XLSXWriter
  • BORDER_NONE : XLSXWriter
  • BORDER_SLANT_DASH_DOT : XLSXWriter
  • BORDER_THICK : XLSXWriter
  • BORDER_THIN : XLSXWriter
  • buildNo : Util
  • bytes : ArchiveConnectionBlob , Document


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- c -

  • canAsync : XMLHTTPRequest
  • cancelWorkflow() : DocFile
  • canProxy : XMLHTTPRequest
  • CDATA_SECTION_NODE : DOMNode
  • CHANGE_TYPE : SystemUser
  • CHANGE_WORKFLOW : SystemUser
  • changeFiletype() : DocFile
  • changeScriptUser() : Context
  • CHART_AREA : XLSXWriter
  • CHART_AREA_STACKED : XLSXWriter
  • CHART_AREA_STACKED_PERCENT : XLSXWriter
  • CHART_BAR : XLSXWriter
  • CHART_BAR_STACKED : XLSXWriter
  • CHART_BAR_STACKED_PERCENT : XLSXWriter
  • CHART_COLUMN : XLSXWriter
  • CHART_COLUMN_STACKED : XLSXWriter
  • CHART_COLUMN_STACKED_PERCENT : XLSXWriter
  • CHART_DOUGHNUT : XLSXWriter
  • CHART_LINE : XLSXWriter
  • CHART_PIE : XLSXWriter
  • CHART_RADAR : XLSXWriter
  • CHART_RADAR_FILLED : XLSXWriter
  • CHART_RADAR_WITH_MARKERS : XLSXWriter
  • CHART_SCATTER : XLSXWriter
  • CHART_SCATTER_SMOOTH : XLSXWriter
  • CHART_SCATTER_SMOOTH_WITH_MARKERS : XLSXWriter
  • CHART_SCATTER_STRAIGHT : XLSXWriter
  • CHART_SCATTER_STRAIGHT_WITH_MARKERS : XLSXWriter
  • checkPassword() : SystemUser
  • checkWorkflowReceiveSignal() : DocFile
  • childNodes : DOMNode
  • clearEnumvalCache() : Context
  • clearFollowUpDate() : DocFile
  • clearXML() : XMLExport
  • clientId : Context
  • cloneNode() : DOMNode
  • close() : DBConnection , DBResultSet , File
  • code : DOMException
  • COLOR_BLACK : XLSXWriter
  • COLOR_BLUE : XLSXWriter
  • COLOR_BROWN : XLSXWriter
  • COLOR_CYAN : XLSXWriter
  • COLOR_GRAY : XLSXWriter
  • COLOR_GREEN : XLSXWriter
  • COLOR_LIME : XLSXWriter
  • COLOR_MAGENTA : XLSXWriter
  • COLOR_NAVY : XLSXWriter
  • COLOR_ORANGE : XLSXWriter
  • COLOR_PINK : XLSXWriter
  • COLOR_PURPLE : XLSXWriter
  • COLOR_RED : XLSXWriter
  • COLOR_SILVER : XLSXWriter
  • COLOR_WHITE : XLSXWriter
  • COLOR_YELLOW : XLSXWriter
  • columnName : DocHit
  • comment : Document
  • COMMENT_NODE : DOMNode
  • commit() : DocFile
  • comparator1 : Folder
  • comparator2 : Folder
  • comparator3 : Folder
  • COMPLETED : XMLHTTPRequest
  • compOp : RetrievalField
  • concatPDF() : Util
  • connectFolder() : DocFile
  • convertBlobToPDF() : Util
  • convertDateToExcelDate() : Util
  • convertDateToString() : Context , Util
  • convertNumericToString() : Context
  • convertStringToDate() : Context , Util
  • convertStringToNumeric() : Context
  • COPY : SystemUser
  • copyFolder() : Folder
  • countFields() : DocFile
  • countPoolFiles() : Context
  • CREATE : SystemUser
  • CREATE_WORKFLOW : SystemUser
  • createAccessProfile() : Context
  • createArchiveServer() : Context
  • createAttribute() : DOMDocument
  • createCDATASection() : DOMDocument
  • createComment() : DOMDocument
  • createElement() : DOMDocument
  • createFellow() : Context
  • createFile() : Context
  • createFolder() : Context
  • createMonitorFile() : DocFile
  • createPoolFile() : Context
  • createStatusFile() : DocFile
  • createSubFolder() : Folder
  • createSystemUser() : Context
  • createTextNode() : DOMDocument
  • cryptPassword() : Util
  • currentUser : Context


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- d -

  • data : DOMCharacterData
  • DB : Util
  • DBConnection() : DBConnection
  • decodeUrlCompatible() : Util
  • decryptString() : Util
  • defaultValue : RetrievalField
  • defValWriteProt : RetrievalField
  • delegateFilesOfAbsentUser() : SystemUser
  • deleteAccessProfile() : Context
  • deleteCustomProperty() : CustomProperty
  • deleteData() : DOMCharacterData
  • deleteDocument() : Document , Register
  • deleteFile() : DocFile , Util
  • deleteFolder() : Context , Folder
  • deleteSystemUser() : Context
  • DIRECT : DocQueryParams
  • disconnectArchivedFile() : DocFile
  • disconnectFolder() : DocFile
  • dispose() : HitResultset
  • docKey : ArchiveConnectionBlob
  • document : Context
  • DOCUMENT_FRAGMENT_NODE : DOMNode
  • DOCUMENT_NODE : DOMNode
  • DOCUMENT_TYPE_NODE : DOMNode
  • documentElement : DOMDocument
  • doMaintenance() : Context
  • DOMDocument() : DOMDocument
  • DOMParser() : DOMParser
  • DOMSTRING_SIZE_ERR : DOMException
  • doOCR() : Document
  • download() : ArchiveConnectionBlob
  • downloadBlob() : ArchiveConnection
  • downloadBlobs() : ArchiveConnection
  • downloadDocument() : Document
  • downloaded : ArchiveConnectionBlob


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- e -

  • ELEMENT_NODE : DOMNode
  • Email() : Email
  • email : SystemUser
  • enableModules() : Context
  • encodeUrlCompatible() : Util
  • encrypted : Document
  • encryptString() : Util
  • ENTITY_NODE : DOMNode
  • ENTITY_REFERENCE_NODE : DOMNode
  • eof() : File
  • ErrCatDOM : DOMParser
  • ErrCatEnv : DOMParser
  • ErrCatNone : DOMParser
  • ErrCatSAX : DOMParser
  • ErrCatXML : DOMParser
  • error() : File
  • errorMessage : Context
  • event : Context
  • executeQuery() : DBConnection
  • executeQueryUC() : DBConnection
  • executeStatement() : DBConnection
  • executeStatementUC() : DBConnection
  • executiveGroup : WorkflowStep
  • executiveType : WorkflowStep
  • executiveUser : WorkflowStep
  • exportCreatedAt : XMLExportDescription
  • exportFileId : XMLExportDescription
  • exportLastModifiedAt : XMLExportDescription
  • exportLastModifiedBy : XMLExportDescription
  • exportOwner : XMLExportDescription
  • exportXML() : DocFile
  • extCall() : Context
  • EXTENDED : DocQueryParams
  • extension : Document
  • extProcess() : Context


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- f -

  • fetchedSize() : HitResultset
  • fetchNextPage() : HitResultset
  • fieldName : Context , DocFile
  • file : Context
  • File() : File
  • fileCopy() : Util
  • fileKey : ArchiveConnectionBlob
  • fileMove() : Util
  • FileResultset() : FileResultset
  • fileSize() : Util
  • FileSizeHint : XMLHTTPRequest
  • fileType : Context
  • FILING_PLAN : DocQueryParams
  • filledSearchFieldCount : DocQueryParams
  • filterExpression : Folder
  • filterfieldname1 : Folder
  • filterfieldname2 : Folder
  • filterfieldname3 : Folder
  • filterStyle : Folder
  • findAccessProfile() : Context
  • findCustomProperties() : Context
  • findSystemUser() : Context
  • findSystemUserByAlias() : Context
  • first() : AccessProfileIterator , ArchiveConnectionBlobIterator , ArchiveFileResultset , ArchiveServerIterator , ControlFlowIterator , CustomPropertyIterator , DocumentIterator , FileResultset , FolderIterator , HitResultset , RegisterIterator , SystemUserIterator , WorkflowStepIterator
  • firstChild : DOMNode
  • firstControlFlow : WorkflowStep
  • firstName : SystemUser
  • folder : Context
  • FOLDER_D : DocQueryParams
  • FOLDER_S : DocQueryParams
  • folderFiles : Context
  • folderName : Context
  • forwardFile() : DocFile , WorkflowStep
  • freezePanes() : XLSXWorksheet
  • fromJSON() : DocFile
  • FT_BOOL : RetrievalField
  • FT_CHECKBOX : RetrievalField
  • FT_DATE : RetrievalField
  • FT_DOUBLE_LIST : RetrievalField
  • FT_E_MAIL : RetrievalField
  • FT_ENUM : RetrievalField
  • FT_FILING_PLAN : RetrievalField
  • FT_FILING_STRUCTURE : RetrievalField
  • FT_GADGET : RetrievalField
  • FT_HISTORY : RetrievalField
  • FT_HTML : RetrievalField
  • FT_NUMERIC : RetrievalField
  • FT_REFERENCE : RetrievalField
  • FT_SEPARATOR : RetrievalField
  • FT_STRING : RetrievalField
  • FT_TEXT : RetrievalField
  • FT_TEXT_FIXED_FONT : RetrievalField
  • FT_TIMESTAMP : RetrievalField
  • FT_UNDEFINED : RetrievalField
  • FT_URL : RetrievalField
  • FT_USER_DEFINED : RetrievalField
  • fullname : Document


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- g -

  • generateChecksum() : Util
  • getAccess() : SystemUser
  • getAccessProfiles() : Context , SystemUser
  • getActionByName() : Folder
  • getAgents() : SystemUser
  • getAllFolders() : SystemUser
  • getAllLockingWorkflowSteps() : DocFile
  • getAllResponseHeaders() : XMLHTTPRequest
  • getAllWorkflowSteps() : DocFile
  • getArchiveConnection() : ArchiveServer , Context
  • getArchiveFile() : Context , DocHit
  • getArchiveKey() : DocFile , DocHit
  • getArchiveServer() : Context
  • getArchiveServers() : Context
  • getAsPDF() : DocFile , Document
  • getAt() : HitResultset
  • getAttribute() : AccessProfile , ArchiveServer , ControlFlow , CustomProperty , DocFile , Document , DOMElement , Folder , Register , SystemUser , WorkflowStep
  • getAttributeNode() : DOMElement
  • getAutoText() : Context , DocFile
  • getAxis() : XLSXChart
  • getBackDelegatedFiles() : SystemUser
  • getBlobInfo() : DocHit
  • getBool() : DBResultSet
  • getChartsheetByName() : XLSXWriter
  • getClientLang() : Context
  • getClientSystemLang() : Context
  • getClientType() : Context
  • getColName() : DBResultSet
  • getColumnCount() : HitResultset
  • getColumnIndex() : HitResultset
  • getColumnNames() : HitResultset
  • getControlFlows() : WorkflowStep
  • getCopy() : DocFile
  • getCreationDate() : DocFile
  • getCreator() : DocFile
  • getCurrentUserAttribute() : Context
  • getCurrentWorkflowStep() : DocFile
  • getCustomProperties() : AccessProfile , Context , SystemUser
  • getDate() : DBResultSet
  • getDatesDiff() : Context
  • getDir() : Util
  • getDocFileComment() : DocFile
  • getDocument() : DOMParser
  • getDocumentById() : Context
  • getDocuments() : Register
  • getDoubleSelectListValues() : DocFile
  • getElementsByTagName() : DOMDocument , DOMElement
  • getEnumAutoText() : Context , DocFile
  • getEnumErgValue() : Context
  • getEnumval() : ScriptCall
  • getEnumValues() : Context
  • getEnvironment() : Util
  • getFieldAttribute() : DocFile
  • getFieldAutoText() : DocFile
  • getFieldErgName() : Context
  • getFieldName() : DocFile
  • getFieldValue() : DocFile
  • getFile() : DocHit , Register
  • getFileById() : Context
  • getFileContentAsString() : Util
  • getFileId() : DocHit
  • getFileOwner() : DocFile
  • getFilePath() : XLSXWriter
  • getFiles() : Folder , Register
  • getFileTypeErgName() : Context
  • getFileTypeOID() : Context
  • getFilterFileTypes() : Folder
  • getFirstLockingWorkflowStep() : DocFile
  • getFloat() : DBResultSet
  • getFolderPosition() : Context
  • getFoldersByName() : Context
  • getFromSystemTable() : Context
  • getHitIds() : HitResultset
  • getHitResultset() : Folder
  • getid() : DocFile
  • getIds() : FileResultset
  • getIndividualFolders() : SystemUser
  • getInt() : DBResultSet
  • getJSObject() : Context
  • getLastError() : AccessProfile , AccessProfileIterator , ArchiveConnection , ArchiveConnectionBlob , ArchiveFileResultset , ArchiveServer , ArchiveServerIterator , Context , ControlFlow , CustomProperty , DBConnection , DBResultSet , DocFile , DocFileDataField , DocHit , DocQueryParams , Document , DocumentIterator , DOMParser , Email , Folder , FolderIterator , HitResultset , Register , RegisterIterator , ScriptCall , SystemUser , SystemUserIterator , UserAction , WorkflowStep , XLSXChart , XLSXChartAxis , XLSXChartSeries , XLSXChartsheet , XLSXFormat , XLSXWorksheet , XLSXWriter , XMLExport
  • getLastErrorCode() : HitResultset
  • getLastModificationDate() : DocFile
  • getLastModifier() : DocFile
  • getLocaleLabel() : Folder , Register
  • getLocaleValue() : Context
  • getLocalValue() : DocHit
  • getLocalValueByName() : DocHit
  • getNamedItem() : DOMNamedNodeMap
  • getNumCols() : DBResultSet
  • getOID() : AccessProfile , ArchiveServer , DocFile , Document , Folder , Register , SystemUser , UserAction , WorkflowStep
  • getOriginal() : DocFile
  • getPosition() : Folder , UserAction
  • getPrincipalAttribute() : Context
  • getPrivateFolder() : SystemUser
  • getProgressBar() : Context
  • getQueryParams() : Context
  • getQuoted() : Util
  • getReferenceFile() : DocFile
  • getRegister() : Document
  • getRegisterByName() : DocFile
  • getRegisterErgName() : Context
  • getRegisters() : DocFile
  • getResponseHeader() : XMLHTTPRequest
  • getReturnValue() : ScriptCall
  • getSchema() : DocHit
  • getSearchField() : DocQueryParams
  • getServerInstallPath() : Context
  • getSource() : DocQueryParams
  • getSourceLineInfo() : Util
  • getString() : DBResultSet
  • getSubFolders() : Folder
  • getSubProperties() : CustomProperty
  • getSuperior() : SystemUser
  • getSystemUser() : Context
  • getSystemUsers() : AccessProfile , Context
  • getTechValue() : DocHit
  • getTechValueByName() : DocHit
  • getTempPathByToken() : Context
  • getTimestamp() : DBResultSet
  • getTitle() : DocFile
  • getTmpFilePath() : Context
  • getTmpPath() : Util
  • getUCString() : DBResultSet
  • getUniqueId() : Util
  • getUsedPrivateBytes() : Util
  • getUserdefinedInboxFolders() : SystemUser
  • getUserStatus() : DocFile
  • getValue() : DocFileDataField
  • getWorkflowName() : WorkflowStep
  • getWorkflowProperty() : WorkflowStep
  • getWorkflowVersion() : WorkflowStep
  • getWorksheetByName() : XLSXWriter
  • getXML() : XMLExport
  • getXMLServer() : Context


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- h -

  • hasAccessProfile() : SystemUser
  • hasAttributes() : DOMNode
  • hasChildNodes() : DOMNode
  • hasField() : DocFile
  • hasFiles() : Folder
  • hash : DocFileDataField , Document , Util
  • hasPEMModule() : Context
  • hasProperty() : PropertyCache
  • hideChartsheet() : XLSXWriter
  • hideWorksheet() : XLSXWriter
  • HIERARCHY_REQUEST_ERR : DOMException
  • HitResultset() : HitResultset
  • hmac() : Util


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- i -

  • icon : Folder
  • id : ArchiveConnection , ControlFlow , Document , Folder , WorkflowStep
  • importFromJSON() : XLSXWorksheet
  • importFromJSONFile() : XLSXWorksheet
  • INDEX_SIZE_ERR : DOMException
  • insertBefore() : DOMNode
  • insertChart() : XLSXChartsheet , XLSXWorksheet
  • insertData() : DOMCharacterData
  • insertImage() : XLSXWorksheet
  • insertStatusEntry() : DocFile
  • INTERACTIVE : XMLHTTPRequest
  • INUSE_ATTRIBUTE_ERR : DOMException
  • INVALID_ACCESS_ERR : DOMException
  • INVALID_CHARACTER_ERR : DOMException
  • INVALID_MODIFICATION_ERR : DOMException
  • INVALID_STATE_ERR : DOMException
  • invalidateAccessProfileCache() : SystemUser
  • invisible : Folder
  • isArchiveFile() : DocFile
  • isArchiveHit() : DocHit
  • isDeletedFile() : DocFile
  • isEncryptedBlob() : Util
  • isFinished() : ScriptCall
  • isNewFile() : DocFile
  • isRunning() : ScriptCall
  • item() : DOMNamedNodeMap , DOMNodeList


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- l -

  • label : ControlFlow , Folder , Register , RetrievalField , UserAction
  • last() : ArchiveFileResultset , FileResultset
  • lastChild : DOMNode
  • lastName : SystemUser
  • launch() : ScriptCall
  • length : DOMCharacterData , DOMNamedNodeMap , DOMNodeList
  • length_u() : Util
  • listAgentFileTypes() : SystemUser
  • listFileTypeAgents() : SystemUser
  • listProperties() : PropertyCache
  • localPath : ArchiveConnectionBlob
  • log() : Util
  • login : SystemUser


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- m -

  • MAIL : SystemUser
  • makeFullDir() : Util
  • makeGACLValue() : Util
  • makeHTML() : Util
  • memoryModel : Util
  • mergeRange() : XLSXWorksheet
  • message : DOMException
  • mimeType : ArchiveConnectionBlob
  • MOVE : SystemUser
  • moveToRegister() : Document
  • MST_EAS_ONLY : RetrievalSource
  • MST_EAS_SERVER : RetrievalSource


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- n -

  • name : AccessProfile , ArchiveConnectionBlob , ArchiveServer , ControlFlow , CustomProperty , DocFileDataField , Document , DOMAttr , Folder , Register , RetrievalField , UserAction , WorkflowStep
  • NAMESPACE_ERR : DOMException
  • next() : AccessProfileIterator , ArchiveConnectionBlobIterator , ArchiveFileResultset , ArchiveServerIterator , ControlFlowIterator , CustomPropertyIterator , DBResultSet , DocumentIterator , FileResultset , FolderIterator , HitResultset , RegisterIterator , SystemUserIterator , WorkflowStepIterator
  • nextSibling : DOMNode
  • NO_DATA_ALLOWED_ERR : DOMException
  • NO_MODIFICATION_ALLOWED_ERR : DOMException
  • nodeName : DOMNode
  • nodeType : DOMNode
  • nodeValue : DOMNode
  • normalize() : DOMNode
  • NOT_FOUND_ERR : DOMException
  • NOT_SUPPORTED_ERR : DOMException
  • NOTATION_NODE : DOMNode
  • notifyFileReturnedFromSending() : SystemUser
  • notifyNewFileInInbox() : SystemUser
  • NOTSENT : XMLHTTPRequest


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- o -

  • ok() : File
  • open() : XMLHTTPRequest
  • out() : Util
  • ownerDocument : DOMNode


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- p -

  • parentNode : DOMNode
  • parse() : DOMParser
  • PATTERN_DARK_DOWN : XLSXWriter
  • PATTERN_DARK_GRAY : XLSXWriter
  • PATTERN_DARK_GRID : XLSXWriter
  • PATTERN_DARK_HORIZONTAL : XLSXWriter
  • PATTERN_DARK_TRELLIS : XLSXWriter
  • PATTERN_DARK_UP : XLSXWriter
  • PATTERN_DARK_VERTICAL : XLSXWriter
  • PATTERN_GRAY_0625 : XLSXWriter
  • PATTERN_GRAY_125 : XLSXWriter
  • PATTERN_LIGHT_DOWN : XLSXWriter
  • PATTERN_LIGHT_GRAY : XLSXWriter
  • PATTERN_LIGHT_GRID : XLSXWriter
  • PATTERN_LIGHT_HORIZONTAL : XLSXWriter
  • PATTERN_LIGHT_TRELLIS : XLSXWriter
  • PATTERN_LIGHT_UP : XLSXWriter
  • PATTERN_LIGHT_VERTICAL : XLSXWriter
  • PATTERN_MEDIUM_GRAY : XLSXWriter
  • PATTERN_NONE : XLSXWriter
  • PATTERN_SOLID : XLSXWriter
  • PDF : SystemUser
  • prepareJSON() : Util
  • previousSibling : DOMNode
  • PROCESSING_INSTRUCTION_NODE : DOMNode
  • propCache : AccessProfile , SystemUser
  • putBlob() : ArchiveConnection


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- q -

  • qsession : Context
  • queryRawEEx() : ArchiveConnection
  • QUICK_VIEW : DocQueryParams


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- r -

  • reactivate() : DocFile
  • read() : File
  • READ : SystemUser
  • readAccess : DocFileDataField
  • readLine() : File
  • readyState : XMLHTTPRequest
  • REFERENCE : DocQueryParams
  • register : Context
  • REGISTER : DocQueryParams
  • reindexBlob() : Document
  • released : Folder
  • reloadCurrentPrincipal() : Context
  • reloadPrincipal() : Context
  • REMOVE : SystemUser
  • remove() : UserAction
  • removeAccessProfile() : Folder
  • removeAttribute() : DOMElement
  • removeAttributeNode() : DOMElement
  • removeChild() : DOMNode
  • removeFile() : Folder
  • removeFileLink() : Register
  • removeFileTypeAgent() : SystemUser
  • removeFilterEDAServer() : Folder
  • removeFilterEEiArchive() : Folder
  • removeFilterEExView() : Folder
  • removeFilterFileType() : Folder
  • removeFromAccessProfile() : SystemUser
  • removeFromOutbar() : Folder
  • removeNamedItem() : DOMNamedNodeMap
  • removeProperty() : PropertyCache
  • removeSource() : DocQueryParams
  • removeSystemUser() : Folder
  • replaceChild() : DOMNode
  • replaceData() : DOMCharacterData
  • requestType : DocQueryParams
  • resetSuperior() : SystemUser
  • resId : RetrievalSource
  • response : XMLHTTPRequest
  • responseFile : XMLHTTPRequest
  • responseType : XMLHTTPRequest
  • returnType : Context


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- s -

  • save() : XLSXWriter
  • saveXML() : XMLExport
  • scope : UserAction
  • SCRIPT_TREE : DocQueryParams
  • ScriptCall() : ScriptCall
  • scriptName : Context
  • searchFieldCount : DocQueryParams
  • searchInArray() : Util
  • searchMaskName : DocQueryParams
  • selectChartsheet() : XLSXWriter
  • selectedArchiveFiles : Context
  • selectedArchiveKeys : Context
  • selectedDocuments : Context
  • selectedFiles : Context
  • selectWorksheet() : XLSXWriter
  • send() : Email , XMLHTTPRequest
  • sendEbisRequest() : ArchiveConnection
  • sendFileAdHoc() : DocFile
  • sendMail() : DocFile
  • sendRequest() : ArchiveConnection
  • sendTCPStringRequest() : Context
  • SENT : XMLHTTPRequest
  • server : RetrievalSource
  • setAbsent() : SystemUser
  • setAbsentMail() : SystemUser
  • setAccessProfile() : CustomProperty
  • setAccessProfiles() : SystemUser
  • setAlign() : XLSXFormat
  • setAllowedActionScript() : Folder
  • setAttribute() : AccessProfile , ArchiveServer , ControlFlow , CustomProperty , DocFile , Document , DOMElement , Folder , Register , SystemUser , WorkflowStep
  • setAttributeNode() : DOMElement
  • setBackgroundColor() : XLSXFormat
  • setBackgroundPattern() : XLSXFormat
  • setBCC() : Email
  • setBody() : Email
  • setBorderColor() : XLSXFormat
  • setBorderStyle() : XLSXFormat
  • setCAInfo() : XMLHTTPRequest
  • setCategories() : XLSXChartSeries
  • setCC() : Email
  • setClientLang() : Context
  • setClientSystemLang() : Context
  • setColumn() : XLSXWorksheet
  • setContext() : UserAction
  • setCreateDefaultWorkflow() : UserAction
  • setDefault() : RetrievalField
  • setDeleteAfterSending() : Email
  • setDocFile() : ScriptCall
  • setDocument() : ScriptCall
  • setDocumentName() : Document
  • setEasywareAuthentication() : SystemUser
  • setEvent() : ScriptCall
  • setFieldAttribute() : DocFile
  • setFieldValue() : DocFile
  • setFileOwner() : DocFile
  • setFiletype() : CustomProperty
  • setFileTypeForNewFile() : UserAction
  • setFirstSheet() : XLSXChartsheet , XLSXWorksheet
  • setFolder() : ScriptCall
  • setFolderPosition() : Context
  • setFollowUpDate() : DocFile
  • setFontColor() : XLSXFormat
  • setFontName() : XLSXFormat
  • setFontScript() : XLSXFormat
  • setFontSize() : XLSXFormat
  • setFontStyle() : XLSXFormat
  • setFooter() : XLSXChartsheet , XLSXWorksheet
  • setForegroundColor() : XLSXFormat
  • setFrom() : Email
  • setGridlines() : XLSXWorksheet
  • setHeader() : XLSXChartsheet , XLSXWorksheet
  • setHorizontalPagebreaks() : XLSXWorksheet
  • setIndent() : XLSXFormat
  • setLabelAlign() : XLSXChartAxis
  • setLabelPosition() : XLSXChartAxis
  • setLandscape() : XLSXChartsheet , XLSXWorksheet
  • setMargins() : XLSXChartsheet , XLSXWorksheet
  • setName() : XLSXChartAxis , XLSXChartSeries
  • setNamedItem() : DOMNamedNodeMap
  • setNameRange() : XLSXChartAxis , XLSXChartSeries
  • setNewExecutiveGroup() : WorkflowStep
  • setNewExecutiveUser() : WorkflowStep
  • setNumberFormat() : XLSXChartAxis , XLSXFormat
  • setOrAddCustomProperty() : AccessProfile , Context , SystemUser
  • setOrAddSubProperty() : CustomProperty
  • setPageView() : XLSXWorksheet
  • setPaperType() : XLSXChartsheet , XLSXWorksheet
  • setParentFolder() : Folder
  • setParentProfile() : AccessProfile
  • setPassword() : SystemUser
  • setPortalScript() : UserAction
  • setPortrait() : XLSXChartsheet , XLSXWorksheet
  • setPosition() : Folder , UserAction
  • setPrincipalAttribute() : Context
  • setProgressBar() : Context
  • setProgressBarText() : Context
  • setProperties() : XLSXWriter
  • setReferenceFile() : DocFile
  • setRegister() : ScriptCall
  • setReverse() : XLSXChartAxis
  • setRow() : XLSXWorksheet
  • setRunAsEnumScript() : ScriptCall
  • setSendingTime() : Email
  • setShrink() : XLSXFormat
  • setStyle() : XLSXChart
  • setSubject() : Email
  • setSuperior() : SystemUser
  • setSystemUser() : CustomProperty
  • setTabColor() : XLSXChartsheet , XLSXWorksheet
  • setTable() : XLSXChart
  • setTextWrap() : XLSXFormat
  • setTitle() : XLSXChart
  • setTitleRange() : XLSXChart
  • setTo() : Email
  • setUserRead() : DocFile
  • setUserStatus() : DocFile
  • setValue() : DocFileDataField
  • setValues() : XLSXChartSeries
  • setVerticalPagebreaks() : XLSXWorksheet
  • setZoom() : XLSXChartsheet , XLSXWorksheet
  • sha256() : Util
  • sign() : Util
  • size() : AccessProfileIterator , ArchiveConnectionBlob , ArchiveConnectionBlobIterator , ArchiveFileResultset , ArchiveServerIterator , ControlFlowIterator , CustomPropertyIterator , Document , DocumentIterator , FileResultset , FolderIterator , HitResultset , RegisterIterator , SystemUserIterator , WorkflowStepIterator
  • sleep() : Util
  • sortColumn : Folder
  • sortDescending : Folder
  • sortFieldName : Folder
  • sourceCode : Context
  • sourceCount : DocQueryParams
  • specified : DOMAttr
  • splitPanes() : XLSXWorksheet
  • splitText() : DOMCharacterData
  • ST_DLC_FILETYPE : RetrievalSource
  • ST_EAS_FILETYPE : RetrievalSource
  • ST_EEI_ARCHIVE : RetrievalSource
  • ST_EEX_USERVIEW : RetrievalSource
  • ST_EEX_VIEW : RetrievalSource
  • START_WORKFLOW : SystemUser
  • startEdit() : DocFile
  • startWorkflow() : DocFile
  • status : WorkflowStep , XMLHTTPRequest
  • statusText : XMLHTTPRequest
  • submitChanges() : ArchiveServer
  • substr_u() : Util
  • substringData() : DOMCharacterData
  • sync() : DocFile
  • SYNTAX_ERR : DOMException
  • systemUser : Folder


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- t -

  • tagName : DOMElement
  • targetArchive : ArchivingDescription
  • targetSchema : ArchivingDescription
  • targetView : ArchivingDescription
  • templateId : WorkflowStep
  • TEXT_NODE : DOMNode
  • transcode() : Util
  • type : CustomProperty , Folder , Register , RetrievalField , RetrievalSource , UserAction


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- u -

  • undeleteFile() : DocFile
  • UNINITIALIZED : XMLHTTPRequest
  • unlinkFile() : Util
  • uploadDocument() : Document , Register
  • UserAction() : UserAction


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- v -

  • VALIDATION_ERR : DOMException
  • value : CustomProperty , DOMAttr
  • value1 : Folder
  • value2 : Folder
  • value3 : Folder
  • valueExpr : RetrievalField
  • VERIFYHOST : XMLHTTPRequest
  • VERIFYPEER : XMLHTTPRequest
  • VERSION : SystemUser
  • version : Util , XLSXWriter
  • versioning : ArchivingDescription


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- w -

  • waitForFinish() : ScriptCall
  • widget : UserAction
  • workflowActionId : Context
  • workflowActionName : Context
  • workflowControlFlowId : Context
  • workflowControlFlowName : Context
  • workflowStep : Context
  • write() : DOMParser , File
  • WRITE : SystemUser
  • writeAccess : DocFileDataField
  • writeBlank() : XLSXWorksheet
  • writeBoolean() : XLSXWorksheet
  • writeBuffer() : File
  • writeCell() : XLSXWorksheet
  • writeDatetime() : XLSXWorksheet
  • writeFormula() : XLSXWorksheet
  • writeLink() : XLSXWorksheet
  • writeLogBook() : Context
  • writeNumber() : XLSXWorksheet
  • writeRichString() : XLSXWorksheet
  • writeString() : XLSXWorksheet
  • WRONG_DOCUMENT_ERR : DOMException


DOCUMENTS 5 - PortalScripting API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- x -

  • XLSXWriter() : XLSXWriter
  • XMLExport() : XMLExport
  • XMLExportDescription() : XMLExportDescription
  • XMLHTTPRequest() : XMLHTTPRequest


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- a -

  • abort() : DocFile , XMLHTTPRequest
  • AccessProfile() : AccessProfile
  • activateChartsheet() : XLSXWriter
  • activateWorksheet() : XLSXWriter
  • addAccessProfile() : Folder , XMLExport
  • addAlias() : XMLExport
  • addAttachment() : Email
  • addAutofilter() : XLSXWorksheet
  • addChart() : XLSXWriter
  • addChartsheet() : XLSXWriter
  • addCustomProperty() : AccessProfile , Context , SystemUser , XMLExport
  • addDistributionList() : XMLExport
  • addDocumentFromFileSystem() : DocFile
  • addDocumentsSettings() : XMLExport
  • addFellow() : XMLExport
  • addFile() : Folder , XMLExport
  • addFileLink() : Register
  • addFileType() : XMLExport
  • addFileTypeAgent() : SystemUser
  • addFileTypeAgentScript() : SystemUser
  • addFileTypesFromCategory() : XMLExport
  • addFileTypesFromFolder() : XMLExport
  • addFilingPlan() : XMLExport
  • addFilterEDAServer() : Folder
  • addFilterEEiArchive() : Folder
  • addFilterEExView() : Folder
  • addFilterFileType() : Folder
  • addFolder() : XMLExport
  • addFormat() : XLSXWriter
  • addNumberRange() : XMLExport
  • addOutbar() : XMLExport
  • addParameter() : ScriptCall
  • addPartnerAccount() : XMLExport
  • addPDF() : DocFile
  • addPortalScript() : XMLExport
  • addPortalScriptCall() : XMLExport
  • addPortalScriptsFromCategory() : XMLExport
  • addRegister() : ArchivingDescription
  • addRequestHeader() : XMLHTTPRequest
  • addSeries() : XLSXChart
  • addSubProperty() : CustomProperty
  • addSystemUser() : Folder , XMLExport
  • addTimeInterval() : Context
  • addToAccessProfile() : SystemUser
  • addToFolder() : UserAction
  • addToOutbar() : Folder
  • addWorkflow() : XMLExport
  • addWorksheet() : XLSXWriter
  • appendChild() : DOMNode
  • appendData() : DOMCharacterData
  • archive() : DocFile
  • archiveAndDelete() : DocFile
  • ArchiveFileResultset() : ArchiveFileResultset
  • ArchivingDescription() : ArchivingDescription
  • asJSON() : DocFile


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- b -

  • base64Decode() : Util
  • base64Encode() : Util
  • beep() : Util


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- c -

  • cancelWorkflow() : DocFile
  • changeFiletype() : DocFile
  • changeScriptUser() : Context
  • checkPassword() : SystemUser
  • checkWorkflowReceiveSignal() : DocFile
  • clearEnumvalCache() : Context
  • clearFollowUpDate() : DocFile
  • clearXML() : XMLExport
  • cloneNode() : DOMNode
  • close() : DBConnection , DBResultSet , File
  • commit() : DocFile
  • concatPDF() : Util
  • connectFolder() : DocFile
  • convertBlobToPDF() : Util
  • convertDateToExcelDate() : Util
  • convertDateToString() : Context , Util
  • convertNumericToString() : Context
  • convertStringToDate() : Context , Util
  • convertStringToNumeric() : Context
  • copyFolder() : Folder
  • countFields() : DocFile
  • countPoolFiles() : Context
  • createAccessProfile() : Context
  • createArchiveServer() : Context
  • createAttribute() : DOMDocument
  • createCDATASection() : DOMDocument
  • createComment() : DOMDocument
  • createElement() : DOMDocument
  • createFellow() : Context
  • createFile() : Context
  • createFolder() : Context
  • createMonitorFile() : DocFile
  • createPoolFile() : Context
  • createStatusFile() : DocFile
  • createSubFolder() : Folder
  • createSystemUser() : Context
  • createTextNode() : DOMDocument
  • cryptPassword() : Util


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- d -

  • DBConnection() : DBConnection
  • decodeUrlCompatible() : Util
  • decryptString() : Util
  • delegateFilesOfAbsentUser() : SystemUser
  • deleteAccessProfile() : Context
  • deleteCustomProperty() : CustomProperty
  • deleteData() : DOMCharacterData
  • deleteDocument() : Document , Register
  • deleteFile() : DocFile , Util
  • deleteFolder() : Context , Folder
  • deleteSystemUser() : Context
  • disconnectArchivedFile() : DocFile
  • disconnectFolder() : DocFile
  • dispose() : HitResultset
  • doMaintenance() : Context
  • DOMDocument() : DOMDocument
  • DOMParser() : DOMParser
  • doOCR() : Document
  • download() : ArchiveConnectionBlob
  • downloadBlob() : ArchiveConnection
  • downloadBlobs() : ArchiveConnection
  • downloadDocument() : Document


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- e -

  • Email() : Email
  • enableModules() : Context
  • encodeUrlCompatible() : Util
  • encryptString() : Util
  • eof() : File
  • error() : File
  • executeQuery() : DBConnection
  • executeQueryUC() : DBConnection
  • executeStatement() : DBConnection
  • executeStatementUC() : DBConnection
  • exportXML() : DocFile
  • extCall() : Context
  • extProcess() : Context


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- f -

  • fetchedSize() : HitResultset
  • fetchNextPage() : HitResultset
  • File() : File
  • fileCopy() : Util
  • fileMove() : Util
  • FileResultset() : FileResultset
  • fileSize() : Util
  • findAccessProfile() : Context
  • findCustomProperties() : Context
  • findSystemUser() : Context
  • findSystemUserByAlias() : Context
  • first() : AccessProfileIterator , ArchiveConnectionBlobIterator , ArchiveFileResultset , ArchiveServerIterator , ControlFlowIterator , CustomPropertyIterator , DocumentIterator , FileResultset , FolderIterator , HitResultset , RegisterIterator , SystemUserIterator , WorkflowStepIterator
  • forwardFile() : DocFile , WorkflowStep
  • freezePanes() : XLSXWorksheet
  • fromJSON() : DocFile


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- g -

  • generateChecksum() : Util
  • getAccess() : SystemUser
  • getAccessProfiles() : Context , SystemUser
  • getActionByName() : Folder
  • getAgents() : SystemUser
  • getAllFolders() : SystemUser
  • getAllLockingWorkflowSteps() : DocFile
  • getAllResponseHeaders() : XMLHTTPRequest
  • getAllWorkflowSteps() : DocFile
  • getArchiveConnection() : ArchiveServer , Context
  • getArchiveFile() : Context , DocHit
  • getArchiveKey() : DocFile , DocHit
  • getArchiveServer() : Context
  • getArchiveServers() : Context
  • getAsPDF() : DocFile , Document
  • getAt() : HitResultset
  • getAttribute() : AccessProfile , ArchiveServer , ControlFlow , CustomProperty , DocFile , Document , DOMElement , Folder , Register , SystemUser , WorkflowStep
  • getAttributeNode() : DOMElement
  • getAutoText() : Context , DocFile
  • getAxis() : XLSXChart
  • getBackDelegatedFiles() : SystemUser
  • getBlobInfo() : DocHit
  • getBool() : DBResultSet
  • getChartsheetByName() : XLSXWriter
  • getClientLang() : Context
  • getClientSystemLang() : Context
  • getClientType() : Context
  • getColName() : DBResultSet
  • getColumnCount() : HitResultset
  • getColumnIndex() : HitResultset
  • getColumnNames() : HitResultset
  • getControlFlows() : WorkflowStep
  • getCopy() : DocFile
  • getCreationDate() : DocFile
  • getCreator() : DocFile
  • getCurrentUserAttribute() : Context
  • getCurrentWorkflowStep() : DocFile
  • getCustomProperties() : AccessProfile , Context , SystemUser
  • getDate() : DBResultSet
  • getDatesDiff() : Context
  • getDir() : Util
  • getDocFileComment() : DocFile
  • getDocument() : DOMParser
  • getDocumentById() : Context
  • getDocuments() : Register
  • getDoubleSelectListValues() : DocFile
  • getElementsByTagName() : DOMDocument , DOMElement
  • getEnumAutoText() : Context , DocFile
  • getEnumErgValue() : Context
  • getEnumval() : ScriptCall
  • getEnumValues() : Context
  • getEnvironment() : Util
  • getFieldAttribute() : DocFile
  • getFieldAutoText() : DocFile
  • getFieldErgName() : Context
  • getFieldName() : DocFile
  • getFieldValue() : DocFile
  • getFile() : DocHit , Register
  • getFileById() : Context
  • getFileContentAsString() : Util
  • getFileId() : DocHit
  • getFileOwner() : DocFile
  • getFilePath() : XLSXWriter
  • getFiles() : Folder , Register
  • getFileTypeErgName() : Context
  • getFileTypeOID() : Context
  • getFilterFileTypes() : Folder
  • getFirstLockingWorkflowStep() : DocFile
  • getFloat() : DBResultSet
  • getFolderPosition() : Context
  • getFoldersByName() : Context
  • getFromSystemTable() : Context
  • getHitIds() : HitResultset
  • getHitResultset() : Folder
  • getid() : DocFile
  • getIds() : FileResultset
  • getIndividualFolders() : SystemUser
  • getInt() : DBResultSet
  • getJSObject() : Context
  • getLastError() : AccessProfile , AccessProfileIterator , ArchiveConnection , ArchiveConnectionBlob , ArchiveFileResultset , ArchiveServer , ArchiveServerIterator , Context , ControlFlow , CustomProperty , DBConnection , DBResultSet , DocFile , DocFileDataField , DocHit , DocQueryParams , Document , DocumentIterator , DOMParser , Email , Folder , FolderIterator , HitResultset , Register , RegisterIterator , ScriptCall , SystemUser , SystemUserIterator , UserAction , WorkflowStep , XLSXChart , XLSXChartAxis , XLSXChartSeries , XLSXChartsheet , XLSXFormat , XLSXWorksheet , XLSXWriter , XMLExport
  • getLastErrorCode() : HitResultset
  • getLastModificationDate() : DocFile
  • getLastModifier() : DocFile
  • getLocaleLabel() : Folder , Register
  • getLocaleValue() : Context
  • getLocalValue() : DocHit
  • getLocalValueByName() : DocHit
  • getNamedItem() : DOMNamedNodeMap
  • getNumCols() : DBResultSet
  • getOID() : AccessProfile , ArchiveServer , DocFile , Document , Folder , Register , SystemUser , UserAction , WorkflowStep
  • getOriginal() : DocFile
  • getPosition() : Folder , UserAction
  • getPrincipalAttribute() : Context
  • getPrivateFolder() : SystemUser
  • getProgressBar() : Context
  • getQueryParams() : Context
  • getQuoted() : Util
  • getReferenceFile() : DocFile
  • getRegister() : Document
  • getRegisterByName() : DocFile
  • getRegisterErgName() : Context
  • getRegisters() : DocFile
  • getResponseHeader() : XMLHTTPRequest
  • getReturnValue() : ScriptCall
  • getSchema() : DocHit
  • getSearchField() : DocQueryParams
  • getServerInstallPath() : Context
  • getSource() : DocQueryParams
  • getSourceLineInfo() : Util
  • getString() : DBResultSet
  • getSubFolders() : Folder
  • getSubProperties() : CustomProperty
  • getSuperior() : SystemUser
  • getSystemUser() : Context
  • getSystemUsers() : AccessProfile , Context
  • getTechValue() : DocHit
  • getTechValueByName() : DocHit
  • getTempPathByToken() : Context
  • getTimestamp() : DBResultSet
  • getTitle() : DocFile
  • getTmpFilePath() : Context
  • getTmpPath() : Util
  • getUCString() : DBResultSet
  • getUniqueId() : Util
  • getUsedPrivateBytes() : Util
  • getUserdefinedInboxFolders() : SystemUser
  • getUserStatus() : DocFile
  • getValue() : DocFileDataField
  • getWorkflowName() : WorkflowStep
  • getWorkflowProperty() : WorkflowStep
  • getWorkflowVersion() : WorkflowStep
  • getWorksheetByName() : XLSXWriter
  • getXML() : XMLExport
  • getXMLServer() : Context


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- h -

  • hasAccessProfile() : SystemUser
  • hasAttributes() : DOMNode
  • hasChildNodes() : DOMNode
  • hasField() : DocFile
  • hasFiles() : Folder
  • hash() : Document , Util
  • hasPEMModule() : Context
  • hasProperty() : PropertyCache
  • hideChartsheet() : XLSXWriter
  • hideWorksheet() : XLSXWriter
  • HitResultset() : HitResultset
  • hmac() : Util


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- i -

  • importFromJSON() : XLSXWorksheet
  • importFromJSONFile() : XLSXWorksheet
  • insertBefore() : DOMNode
  • insertChart() : XLSXChartsheet , XLSXWorksheet
  • insertData() : DOMCharacterData
  • insertImage() : XLSXWorksheet
  • insertStatusEntry() : DocFile
  • invalidateAccessProfileCache() : SystemUser
  • isArchiveFile() : DocFile
  • isArchiveHit() : DocHit
  • isDeletedFile() : DocFile
  • isEncryptedBlob() : Util
  • isFinished() : ScriptCall
  • isNewFile() : DocFile
  • isRunning() : ScriptCall
  • item() : DOMNamedNodeMap , DOMNodeList


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- l -

  • last() : ArchiveFileResultset , FileResultset
  • launch() : ScriptCall
  • length_u() : Util
  • listAgentFileTypes() : SystemUser
  • listFileTypeAgents() : SystemUser
  • listProperties() : PropertyCache
  • log() : Util


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- m -

  • makeFullDir() : Util
  • makeGACLValue() : Util
  • makeHTML() : Util
  • mergeRange() : XLSXWorksheet
  • moveToRegister() : Document


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- n -

  • next() : AccessProfileIterator , ArchiveConnectionBlobIterator , ArchiveFileResultset , ArchiveServerIterator , ControlFlowIterator , CustomPropertyIterator , DBResultSet , DocumentIterator , FileResultset , FolderIterator , HitResultset , RegisterIterator , SystemUserIterator , WorkflowStepIterator
  • normalize() : DOMNode
  • notifyFileReturnedFromSending() : SystemUser
  • notifyNewFileInInbox() : SystemUser


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- o -

  • ok() : File
  • open() : XMLHTTPRequest
  • out() : Util


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- p -

  • parse() : DOMParser
  • prepareJSON() : Util
  • putBlob() : ArchiveConnection


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- q -

  • queryRawEEx() : ArchiveConnection


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- r -

  • reactivate() : DocFile
  • read() : File
  • readLine() : File
  • reindexBlob() : Document
  • reloadCurrentPrincipal() : Context
  • reloadPrincipal() : Context
  • remove() : UserAction
  • removeAccessProfile() : Folder
  • removeAttribute() : DOMElement
  • removeAttributeNode() : DOMElement
  • removeChild() : DOMNode
  • removeFile() : Folder
  • removeFileLink() : Register
  • removeFileTypeAgent() : SystemUser
  • removeFilterEDAServer() : Folder
  • removeFilterEEiArchive() : Folder
  • removeFilterEExView() : Folder
  • removeFilterFileType() : Folder
  • removeFromAccessProfile() : SystemUser
  • removeFromOutbar() : Folder
  • removeNamedItem() : DOMNamedNodeMap
  • removeProperty() : PropertyCache
  • removeSource() : DocQueryParams
  • removeSystemUser() : Folder
  • replaceChild() : DOMNode
  • replaceData() : DOMCharacterData
  • resetSuperior() : SystemUser


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- s -

  • save() : XLSXWriter
  • saveXML() : XMLExport
  • ScriptCall() : ScriptCall
  • searchInArray() : Util
  • selectChartsheet() : XLSXWriter
  • selectWorksheet() : XLSXWriter
  • send() : Email , XMLHTTPRequest
  • sendEbisRequest() : ArchiveConnection
  • sendFileAdHoc() : DocFile
  • sendMail() : DocFile
  • sendRequest() : ArchiveConnection
  • sendTCPStringRequest() : Context
  • setAbsent() : SystemUser
  • setAbsentMail() : SystemUser
  • setAccessProfile() : CustomProperty
  • setAccessProfiles() : SystemUser
  • setAlign() : XLSXFormat
  • setAllowedActionScript() : Folder
  • setAttribute() : AccessProfile , ArchiveServer , ControlFlow , CustomProperty , DocFile , Document , DOMElement , Folder , Register , SystemUser , WorkflowStep
  • setAttributeNode() : DOMElement
  • setBackgroundColor() : XLSXFormat
  • setBackgroundPattern() : XLSXFormat
  • setBCC() : Email
  • setBody() : Email
  • setBorderColor() : XLSXFormat
  • setBorderStyle() : XLSXFormat
  • setCAInfo() : XMLHTTPRequest
  • setCategories() : XLSXChartSeries
  • setCC() : Email
  • setClientLang() : Context
  • setClientSystemLang() : Context
  • setColumn() : XLSXWorksheet
  • setContext() : UserAction
  • setCreateDefaultWorkflow() : UserAction
  • setDefault() : RetrievalField
  • setDeleteAfterSending() : Email
  • setDocFile() : ScriptCall
  • setDocument() : ScriptCall
  • setDocumentName() : Document
  • setEasywareAuthentication() : SystemUser
  • setEvent() : ScriptCall
  • setFieldAttribute() : DocFile
  • setFieldValue() : DocFile
  • setFileOwner() : DocFile
  • setFiletype() : CustomProperty
  • setFileTypeForNewFile() : UserAction
  • setFirstSheet() : XLSXChartsheet , XLSXWorksheet
  • setFolder() : ScriptCall
  • setFolderPosition() : Context
  • setFollowUpDate() : DocFile
  • setFontColor() : XLSXFormat
  • setFontName() : XLSXFormat
  • setFontScript() : XLSXFormat
  • setFontSize() : XLSXFormat
  • setFontStyle() : XLSXFormat
  • setFooter() : XLSXChartsheet , XLSXWorksheet
  • setForegroundColor() : XLSXFormat
  • setFrom() : Email
  • setGridlines() : XLSXWorksheet
  • setHeader() : XLSXChartsheet , XLSXWorksheet
  • setHorizontalPagebreaks() : XLSXWorksheet
  • setIndent() : XLSXFormat
  • setLabelAlign() : XLSXChartAxis
  • setLabelPosition() : XLSXChartAxis
  • setLandscape() : XLSXChartsheet , XLSXWorksheet
  • setMargins() : XLSXChartsheet , XLSXWorksheet
  • setName() : XLSXChartAxis , XLSXChartSeries
  • setNamedItem() : DOMNamedNodeMap
  • setNameRange() : XLSXChartAxis , XLSXChartSeries
  • setNewExecutiveGroup() : WorkflowStep
  • setNewExecutiveUser() : WorkflowStep
  • setNumberFormat() : XLSXChartAxis , XLSXFormat
  • setOrAddCustomProperty() : AccessProfile , Context , SystemUser
  • setOrAddSubProperty() : CustomProperty
  • setPageView() : XLSXWorksheet
  • setPaperType() : XLSXChartsheet , XLSXWorksheet
  • setParentFolder() : Folder
  • setParentProfile() : AccessProfile
  • setPassword() : SystemUser
  • setPortalScript() : UserAction
  • setPortrait() : XLSXChartsheet , XLSXWorksheet
  • setPosition() : Folder , UserAction
  • setPrincipalAttribute() : Context
  • setProgressBar() : Context
  • setProgressBarText() : Context
  • setProperties() : XLSXWriter
  • setReferenceFile() : DocFile
  • setRegister() : ScriptCall
  • setReverse() : XLSXChartAxis
  • setRow() : XLSXWorksheet
  • setRunAsEnumScript() : ScriptCall
  • setSendingTime() : Email
  • setShrink() : XLSXFormat
  • setStyle() : XLSXChart
  • setSubject() : Email
  • setSuperior() : SystemUser
  • setSystemUser() : CustomProperty
  • setTabColor() : XLSXChartsheet , XLSXWorksheet
  • setTable() : XLSXChart
  • setTextWrap() : XLSXFormat
  • setTitle() : XLSXChart
  • setTitleRange() : XLSXChart
  • setTo() : Email
  • setUserRead() : DocFile
  • setUserStatus() : DocFile
  • setValue() : DocFileDataField
  • setValues() : XLSXChartSeries
  • setVerticalPagebreaks() : XLSXWorksheet
  • setZoom() : XLSXChartsheet , XLSXWorksheet
  • sha256() : Util
  • sign() : Util
  • size() : AccessProfileIterator , ArchiveConnectionBlobIterator , ArchiveFileResultset , ArchiveServerIterator , ControlFlowIterator , CustomPropertyIterator , DocumentIterator , FileResultset , FolderIterator , HitResultset , RegisterIterator , SystemUserIterator , WorkflowStepIterator
  • sleep() : Util
  • splitPanes() : XLSXWorksheet
  • splitText() : DOMCharacterData
  • startEdit() : DocFile
  • startWorkflow() : DocFile
  • submitChanges() : ArchiveServer
  • substr_u() : Util
  • substringData() : DOMCharacterData
  • sync() : DocFile


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- t -

  • transcode() : Util


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- u -

  • undeleteFile() : DocFile
  • unlinkFile() : Util
  • uploadDocument() : Document , Register
  • UserAction() : UserAction


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- w -

  • waitForFinish() : ScriptCall
  • write() : DOMParser , File
  • writeBlank() : XLSXWorksheet
  • writeBoolean() : XLSXWorksheet
  • writeBuffer() : File
  • writeCell() : XLSXWorksheet
  • writeDatetime() : XLSXWorksheet
  • writeFormula() : XLSXWorksheet
  • writeLink() : XLSXWorksheet
  • writeLogBook() : Context
  • writeNumber() : XLSXWorksheet
  • writeRichString() : XLSXWorksheet
  • writeString() : XLSXWorksheet


DOCUMENTS 5 - PortalScripting API: Class Members - Functions

- x -

  • XLSXWriter() : XLSXWriter
  • XMLExport() : XMLExport
  • XMLExportDescription() : XMLExportDescription
  • XMLHTTPRequest() : XMLHTTPRequest


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- a -

  • ALIGN_CENTER : XLSXWriter
  • ALIGN_CENTER_ACROSS : XLSXWriter
  • ALIGN_DISTRIBUTED : XLSXWriter
  • ALIGN_FILL : XLSXWriter
  • ALIGN_JUSTIFY : XLSXWriter
  • ALIGN_LEFT : XLSXWriter
  • ALIGN_NONE : XLSXWriter
  • ALIGN_RIGHT : XLSXWriter
  • ALIGN_VERTICAL_BOTTOM : XLSXWriter
  • ALIGN_VERTICAL_CENTER : XLSXWriter
  • ALIGN_VERTICAL_DISTRIBUTED : XLSXWriter
  • ALIGN_VERTICAL_JUSTIFY : XLSXWriter
  • ALIGN_VERTICAL_TOP : XLSXWriter
  • allowArchive : Folder
  • allowCopyTo : Folder
  • allowCreatePDF : Folder
  • allowDelete : Folder
  • allowExport : Folder
  • allowForward : Folder
  • allowMoveTo : Folder
  • ANNOTATIONS : SystemUser
  • API : DocQueryParams
  • ARCHIVE : SystemUser
  • archiveMonitor : ArchivingDescription
  • archiveServer : ArchivingDescription
  • archiveStatus : ArchivingDescription
  • ATTRIBUTE_NODE : DOMNode
  • attributes : DOMNode


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- b -

  • BORDER_DASH_DOT : XLSXWriter
  • BORDER_DASH_DOT_DOT : XLSXWriter
  • BORDER_DASHED : XLSXWriter
  • BORDER_DOTTED : XLSXWriter
  • BORDER_DOUBLE : XLSXWriter
  • BORDER_HAIR : XLSXWriter
  • BORDER_MEDIUM : XLSXWriter
  • BORDER_MEDIUM_DASH_DOT : XLSXWriter
  • BORDER_MEDIUM_DASH_DOT_DOT : XLSXWriter
  • BORDER_MEDIUM_DASHED : XLSXWriter
  • BORDER_NONE : XLSXWriter
  • BORDER_SLANT_DASH_DOT : XLSXWriter
  • BORDER_THICK : XLSXWriter
  • BORDER_THIN : XLSXWriter
  • buildNo : Util
  • bytes : ArchiveConnectionBlob , Document


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- c -

  • canAsync : XMLHTTPRequest
  • canProxy : XMLHTTPRequest
  • CDATA_SECTION_NODE : DOMNode
  • CHANGE_TYPE : SystemUser
  • CHANGE_WORKFLOW : SystemUser
  • CHART_AREA : XLSXWriter
  • CHART_AREA_STACKED : XLSXWriter
  • CHART_AREA_STACKED_PERCENT : XLSXWriter
  • CHART_BAR : XLSXWriter
  • CHART_BAR_STACKED : XLSXWriter
  • CHART_BAR_STACKED_PERCENT : XLSXWriter
  • CHART_COLUMN : XLSXWriter
  • CHART_COLUMN_STACKED : XLSXWriter
  • CHART_COLUMN_STACKED_PERCENT : XLSXWriter
  • CHART_DOUGHNUT : XLSXWriter
  • CHART_LINE : XLSXWriter
  • CHART_PIE : XLSXWriter
  • CHART_RADAR : XLSXWriter
  • CHART_RADAR_FILLED : XLSXWriter
  • CHART_RADAR_WITH_MARKERS : XLSXWriter
  • CHART_SCATTER : XLSXWriter
  • CHART_SCATTER_SMOOTH : XLSXWriter
  • CHART_SCATTER_SMOOTH_WITH_MARKERS : XLSXWriter
  • CHART_SCATTER_STRAIGHT : XLSXWriter
  • CHART_SCATTER_STRAIGHT_WITH_MARKERS : XLSXWriter
  • childNodes : DOMNode
  • clientId : Context
  • code : DOMException
  • COLOR_BLACK : XLSXWriter
  • COLOR_BLUE : XLSXWriter
  • COLOR_BROWN : XLSXWriter
  • COLOR_CYAN : XLSXWriter
  • COLOR_GRAY : XLSXWriter
  • COLOR_GREEN : XLSXWriter
  • COLOR_LIME : XLSXWriter
  • COLOR_MAGENTA : XLSXWriter
  • COLOR_NAVY : XLSXWriter
  • COLOR_ORANGE : XLSXWriter
  • COLOR_PINK : XLSXWriter
  • COLOR_PURPLE : XLSXWriter
  • COLOR_RED : XLSXWriter
  • COLOR_SILVER : XLSXWriter
  • COLOR_WHITE : XLSXWriter
  • COLOR_YELLOW : XLSXWriter
  • columnName : DocHit
  • comment : Document
  • COMMENT_NODE : DOMNode
  • comparator1 : Folder
  • comparator2 : Folder
  • comparator3 : Folder
  • COMPLETED : XMLHTTPRequest
  • compOp : RetrievalField
  • COPY : SystemUser
  • CREATE : SystemUser
  • CREATE_WORKFLOW : SystemUser
  • currentUser : Context


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- d -

  • data : DOMCharacterData
  • DB : Util
  • defaultValue : RetrievalField
  • defValWriteProt : RetrievalField
  • DIRECT : DocQueryParams
  • docKey : ArchiveConnectionBlob
  • document : Context
  • DOCUMENT_FRAGMENT_NODE : DOMNode
  • DOCUMENT_NODE : DOMNode
  • DOCUMENT_TYPE_NODE : DOMNode
  • documentElement : DOMDocument
  • DOMSTRING_SIZE_ERR : DOMException
  • downloaded : ArchiveConnectionBlob


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- e -

  • ELEMENT_NODE : DOMNode
  • email : SystemUser
  • encrypted : Document
  • ENTITY_NODE : DOMNode
  • ENTITY_REFERENCE_NODE : DOMNode
  • ErrCatDOM : DOMParser
  • ErrCatEnv : DOMParser
  • ErrCatNone : DOMParser
  • ErrCatSAX : DOMParser
  • ErrCatXML : DOMParser
  • errorMessage : Context
  • event : Context
  • executiveGroup : WorkflowStep
  • executiveType : WorkflowStep
  • executiveUser : WorkflowStep
  • exportCreatedAt : XMLExportDescription
  • exportFileId : XMLExportDescription
  • exportLastModifiedAt : XMLExportDescription
  • exportLastModifiedBy : XMLExportDescription
  • exportOwner : XMLExportDescription
  • EXTENDED : DocQueryParams
  • extension : Document


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- f -

  • fieldName : Context , DocFile
  • file : Context
  • fileKey : ArchiveConnectionBlob
  • FileSizeHint : XMLHTTPRequest
  • fileType : Context
  • FILING_PLAN : DocQueryParams
  • filledSearchFieldCount : DocQueryParams
  • filterExpression : Folder
  • filterfieldname1 : Folder
  • filterfieldname2 : Folder
  • filterfieldname3 : Folder
  • filterStyle : Folder
  • firstChild : DOMNode
  • firstControlFlow : WorkflowStep
  • firstName : SystemUser
  • folder : Context
  • FOLDER_D : DocQueryParams
  • FOLDER_S : DocQueryParams
  • folderFiles : Context
  • folderName : Context
  • FT_BOOL : RetrievalField
  • FT_CHECKBOX : RetrievalField
  • FT_DATE : RetrievalField
  • FT_DOUBLE_LIST : RetrievalField
  • FT_E_MAIL : RetrievalField
  • FT_ENUM : RetrievalField
  • FT_FILING_PLAN : RetrievalField
  • FT_FILING_STRUCTURE : RetrievalField
  • FT_GADGET : RetrievalField
  • FT_HISTORY : RetrievalField
  • FT_HTML : RetrievalField
  • FT_NUMERIC : RetrievalField
  • FT_REFERENCE : RetrievalField
  • FT_SEPARATOR : RetrievalField
  • FT_STRING : RetrievalField
  • FT_TEXT : RetrievalField
  • FT_TEXT_FIXED_FONT : RetrievalField
  • FT_TIMESTAMP : RetrievalField
  • FT_UNDEFINED : RetrievalField
  • FT_URL : RetrievalField
  • FT_USER_DEFINED : RetrievalField
  • fullname : Document


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- h -

  • hash : DocFileDataField
  • HIERARCHY_REQUEST_ERR : DOMException


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- i -

  • icon : Folder
  • id : ArchiveConnection , ControlFlow , Document , Folder , WorkflowStep
  • INDEX_SIZE_ERR : DOMException
  • INTERACTIVE : XMLHTTPRequest
  • INUSE_ATTRIBUTE_ERR : DOMException
  • INVALID_ACCESS_ERR : DOMException
  • INVALID_CHARACTER_ERR : DOMException
  • INVALID_MODIFICATION_ERR : DOMException
  • INVALID_STATE_ERR : DOMException
  • invisible : Folder


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- l -

  • label : ControlFlow , Folder , Register , RetrievalField , UserAction
  • lastChild : DOMNode
  • lastName : SystemUser
  • length : DOMCharacterData , DOMNamedNodeMap , DOMNodeList
  • localPath : ArchiveConnectionBlob
  • login : SystemUser


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- m -

  • MAIL : SystemUser
  • memoryModel : Util
  • message : DOMException
  • mimeType : ArchiveConnectionBlob
  • MOVE : SystemUser
  • MST_EAS_ONLY : RetrievalSource
  • MST_EAS_SERVER : RetrievalSource


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- n -

  • name : AccessProfile , ArchiveConnectionBlob , ArchiveServer , ControlFlow , CustomProperty , DocFileDataField , Document , DOMAttr , Folder , Register , RetrievalField , UserAction , WorkflowStep
  • NAMESPACE_ERR : DOMException
  • nextSibling : DOMNode
  • NO_DATA_ALLOWED_ERR : DOMException
  • NO_MODIFICATION_ALLOWED_ERR : DOMException
  • nodeName : DOMNode
  • nodeType : DOMNode
  • nodeValue : DOMNode
  • NOT_FOUND_ERR : DOMException
  • NOT_SUPPORTED_ERR : DOMException
  • NOTATION_NODE : DOMNode
  • NOTSENT : XMLHTTPRequest


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- o -

  • ownerDocument : DOMNode


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- p -

  • parentNode : DOMNode
  • PATTERN_DARK_DOWN : XLSXWriter
  • PATTERN_DARK_GRAY : XLSXWriter
  • PATTERN_DARK_GRID : XLSXWriter
  • PATTERN_DARK_HORIZONTAL : XLSXWriter
  • PATTERN_DARK_TRELLIS : XLSXWriter
  • PATTERN_DARK_UP : XLSXWriter
  • PATTERN_DARK_VERTICAL : XLSXWriter
  • PATTERN_GRAY_0625 : XLSXWriter
  • PATTERN_GRAY_125 : XLSXWriter
  • PATTERN_LIGHT_DOWN : XLSXWriter
  • PATTERN_LIGHT_GRAY : XLSXWriter
  • PATTERN_LIGHT_GRID : XLSXWriter
  • PATTERN_LIGHT_HORIZONTAL : XLSXWriter
  • PATTERN_LIGHT_TRELLIS : XLSXWriter
  • PATTERN_LIGHT_UP : XLSXWriter
  • PATTERN_LIGHT_VERTICAL : XLSXWriter
  • PATTERN_MEDIUM_GRAY : XLSXWriter
  • PATTERN_NONE : XLSXWriter
  • PATTERN_SOLID : XLSXWriter
  • PDF : SystemUser
  • previousSibling : DOMNode
  • PROCESSING_INSTRUCTION_NODE : DOMNode
  • propCache : AccessProfile , SystemUser


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- q -

  • qsession : Context
  • QUICK_VIEW : DocQueryParams


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- r -

  • READ : SystemUser
  • readAccess : DocFileDataField
  • readyState : XMLHTTPRequest
  • REFERENCE : DocQueryParams
  • register : Context
  • REGISTER : DocQueryParams
  • released : Folder
  • REMOVE : SystemUser
  • requestType : DocQueryParams
  • resId : RetrievalSource
  • response : XMLHTTPRequest
  • responseFile : XMLHTTPRequest
  • responseType : XMLHTTPRequest
  • returnType : Context


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- s -

  • scope : UserAction
  • SCRIPT_TREE : DocQueryParams
  • scriptName : Context
  • searchFieldCount : DocQueryParams
  • searchMaskName : DocQueryParams
  • selectedArchiveFiles : Context
  • selectedArchiveKeys : Context
  • selectedDocuments : Context
  • selectedFiles : Context
  • SENT : XMLHTTPRequest
  • server : RetrievalSource
  • size : ArchiveConnectionBlob , Document
  • sortColumn : Folder
  • sortDescending : Folder
  • sortFieldName : Folder
  • sourceCode : Context
  • sourceCount : DocQueryParams
  • specified : DOMAttr
  • ST_DLC_FILETYPE : RetrievalSource
  • ST_EAS_FILETYPE : RetrievalSource
  • ST_EEI_ARCHIVE : RetrievalSource
  • ST_EEX_USERVIEW : RetrievalSource
  • ST_EEX_VIEW : RetrievalSource
  • START_WORKFLOW : SystemUser
  • status : WorkflowStep , XMLHTTPRequest
  • statusText : XMLHTTPRequest
  • SYNTAX_ERR : DOMException
  • systemUser : Folder


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- t -

  • tagName : DOMElement
  • targetArchive : ArchivingDescription
  • targetSchema : ArchivingDescription
  • targetView : ArchivingDescription
  • templateId : WorkflowStep
  • TEXT_NODE : DOMNode
  • type : CustomProperty , Folder , Register , RetrievalField , RetrievalSource , UserAction


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- u -

  • UNINITIALIZED : XMLHTTPRequest


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- v -

  • VALIDATION_ERR : DOMException
  • value : CustomProperty , DOMAttr
  • value1 : Folder
  • value2 : Folder
  • value3 : Folder
  • valueExpr : RetrievalField
  • VERIFYHOST : XMLHTTPRequest
  • VERIFYPEER : XMLHTTPRequest
  • VERSION : SystemUser
  • version : Util , XLSXWriter
  • versioning : ArchivingDescription


DOCUMENTS 5 - PortalScripting API: Class Members - Variables

- w -

  • widget : UserAction
  • workflowActionId : Context
  • workflowActionName : Context
  • workflowControlFlowId : Context
  • workflowControlFlowName : Context
  • workflowStep : Context
  • WRITE : SystemUser
  • writeAccess : DocFileDataField
  • WRONG_DOCUMENT_ERR : DOMException


DOCUMENTS 5 - PortalScripting API: portal80e Directory Reference

  • E:
  • projekte
  • portal80e
portal80e Directory Reference

Directories

directory doc


DOCUMENTS 5 - PortalScripting API: server Directory Reference

  • E:
  • projekte
  • portal80e
  • server
server Directory Reference


DOCUMENTS 5 - PortalScripting API: portalscript Directory Reference

  • E:
  • projekte
  • portal80e
  • doc
  • portalscript
portalscript Directory Reference

Directories

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


DOCUMENTS 5 - PortalScripting API: xlsxWriter Directory Reference

  • E:
  • j
  • 296-fixes_80e
  • xlsxWriter
xlsxWriter Directory Reference

Directories

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


DOCUMENTS 5 - PortalScripting API: doc Directory Reference

  • E:
  • j
  • 296-fixes_80e
  • xlsxWriter
  • doc
doc Directory Reference


DOCUMENTS 5 - PortalScripting API: E: Directory Reference

  • E:
E: Directory Reference


DOCUMENTS 5 - PortalScripting API: 296-fixes_80e Directory Reference

  • E:
  • j
  • 296-fixes_80e
296-fixes_80e Directory Reference

Directories

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


DOCUMENTS 5 - PortalScripting API: tutorials Directory Reference

  • E:
  • projekte
  • portal80e
  • doc
  • portalscript
  • tutorials
tutorials Directory Reference


DOCUMENTS 5 - PortalScripting API: doc Directory Reference

  • E:
  • projekte
  • portal80e
  • doc
doc Directory Reference


DOCUMENTS 5 - PortalScripting API: projekte Directory Reference

  • E:
  • projekte
projekte Directory Reference


DOCUMENTS 5 - PortalScripting API: j Directory Reference

  • E:
  • j
j Directory Reference


DOCUMENTS 5 - PortalScripting API: Related Pages

Related Pages
Here is a list of all related documentation pages:
Availabe Script Exits |
Field Access Methods | The DocFile class offers the following ways to access the field values:
Filter Expressions |
Filter Expression Examples |
XML-DOM Example | The following code shows in a short example how to create and parse a XML using the DOM classes
SOAP Client using DOM | This JavaScript SOAP Client is based on DOM and XMLHTTPRequest supported by PortalScripting
The Property Cache and enumval | Since DOCUMENTS 5.0 HF1 (Caching at the FIELD)
User DLLs | Die Funktionalitaet von PortalScripting kann mit Hilfe von externen DLLs (oder shared libraries unter Unix/Linux) erweitert werden
Change log for the Scripting API | Changes in version DOCUMENTS 5.0e HF2:
Generating header/footer in Excel | Page headers/footers in Excel are generated using a string which is a combination of plain text and control characters
Deprecated List |