Interface INode
The base class of the ImageTrust Object Model.
Note: Write-access to properties depends on the context in which the model is used. When in a read-only context, set* methods will throw an UnmodifiableException.
Properties list
Methods list
Properties
allNodes
Declaration
readonly allNodes: INode[];
Property Value
| Type | Description |
|---|---|
| INode[] |
batch
see INode.getBatch()
Declaration
readonly batch: IBatch;
Property Value
| Type | Description |
|---|---|
| IBatch |
childCount
Declaration
readonly childCount: number;
Property Value
| Type | Description |
|---|---|
| number |
children
Declaration
readonly children: INode[];
Property Value
| Type | Description |
|---|---|
| INode[] |
documentCount
Declaration
readonly documentCount: number;
Property Value
| Type | Description |
|---|---|
| number |
documents
Declaration
readonly documents: IDocument[];
Property Value
| Type | Description |
|---|---|
| IDocument[] |
fields
Declaration
readonly fields: Map<string, IField>;
Property Value
| Type | Description |
|---|---|
| Map<string, IField> |
folderCount
Declaration
readonly folderCount: number;
Property Value
| Type | Description |
|---|---|
| number |
folders
Declaration
readonly folders: IFolder[];
Property Value
| Type | Description |
|---|---|
| IFolder[] |
id
see INode.getId()
Declaration
readonly id: number;
Property Value
| Type | Description |
|---|---|
| number |
indexClass
Declaration
indexClass: IIndexClass;
Property Value
| Type | Description |
|---|---|
| IIndexClass |
job
see INode.getJob()
Declaration
readonly job: IJob;
Property Value
| Type | Description |
|---|---|
| IJob |
jobName
Declaration
readonly jobName: string;
Property Value
| Type | Description |
|---|---|
| string |
levelIndex
Declaration
readonly levelIndex: number;
Property Value
| Type | Description |
|---|---|
| number |
levelName
A friendly name for the node level (e.g. Job, Batch, Stack, Folder, Document, Page, PageEDoc)
Declaration
readonly levelName: string;
Property Value
| Type | Description |
|---|---|
| string |
name
see INode.getName()
Declaration
readonly name: string;
Property Value
| Type | Description |
|---|---|
| string |
nodeIndex
Declaration
readonly nodeIndex: number;
Property Value
| Type | Description |
|---|---|
| number |
pageCount
Declaration
readonly pageCount: number;
Property Value
| Type | Description |
|---|---|
| number |
pages
see INode.getPages()
Declaration
readonly pages: IPage[];
Property Value
| Type | Description |
|---|---|
| IPage[] |
parent
Declaration
readonly parent: INode;
Property Value
| Type | Description |
|---|---|
| INode |
properties
Declaration
readonly properties: any;
Property Value
| Type | Description |
|---|---|
| any |
reviewComments
Declaration
readonly reviewComments: INodeReviewComment[];
Property Value
| Type | Description |
|---|---|
| INodeReviewComment[] |
stackCount
see
Declaration
readonly stackCount: number;
Property Value
| Type | Description |
|---|---|
| number |
stacks
see
Declaration
readonly stacks: IStack[];
Property Value
| Type | Description |
|---|---|
| IStack[] |
typeName
Declaration
readonly typeName: string;
Property Value
| Type | Description |
|---|---|
| string |
userObject
Declaration
userObject: any;
Property Value
| Type | Description |
|---|---|
| any |
uuid
see INode.getUuid()
Declaration
readonly uuid: string;
Property Value
| Type | Description |
|---|---|
| string |
Methods
add(newChild)
Removes newChild from its parent and makes it a child of this node by adding it to the end of this node's child array.
see INode.insert()
Declaration
add(newChild: INode): void;
Parameters
| Type | Name | Description |
|---|---|---|
| INode | newChild |
node to add as a child of this node exception IllegalArgumentException if |
Returns
| Type | Description |
|---|---|
| void |
assignDefaultValuesToEmptyIndexFields(doChildren)
This method assigns the default values to all index fields which are empty.
Note that index field values are node properties and they are stored in the default namespace or during indexing, in a custom namespace according to the index step configuration.
If the index class of the node is not set, then this method will attempt to find a unique index class based on the Job definition and assign it to the node. If the index class cannot be uniquely determined, then this method will not have any effect.
Declaration
assignDefaultValuesToEmptyIndexFields(doChildren: boolean): void;
Parameters
| Type | Name | Description |
|---|---|---|
| boolean | doChildren |
if |
Returns
| Type | Description |
|---|---|
| void |
deleteProperty(name)
Delete a property
Declaration
deleteProperty(name: string): void;
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
the name of the property to delete |
Returns
| Type | Description |
|---|---|
| void |
duplicate()
Create a copy of this node and all it's children. This method will only work for folders documents and pages. The returned copy is not added to the nodes tree, you still need to add it as a child to a target parent node. When duplicating a page in a server context, the images of the page are not copied automatically, you need to do this manually.
exception IllegaleStateException if this not a folder, document or page
Declaration
duplicate(): INode;
Returns
| Type | Description |
|---|---|
| INode | an exact copy of this node |
evaluate(expression)
Returns a Promise object which asynchronously evaluates the value of a dynamic expression.
* * **NOTE:** This method returns immediately with a Promise object which at that moment does not have any defined value (undefined). The value will be available when the process has been completed and the Promise has been resolved. Use the then() and catch() methods of the returned Promise object in order to run any code after the result becomes available.
Declaration
evaluate(expression: string): Promise<string>;
Parameters
| Type | Name | Description |
|---|---|---|
| string | expression |
a dynamic expression that may contain variables. The allowed variables (e.g. global variables like
The expression may contain more than one variables and also literal values that are left unchanged. |
Returns
| Type | Description |
|---|---|
| Promise<string> |
executeDbActions(onMultipleResultsUseFirst)
Executes all active Database Actions on this node. This method works for Batches, Folders and Documents, but not for Pages.
An Index Class must be assigned on this node, in order for the method to work. If an Index Class has not been assigned, but there is only one possible Index Class, then it will be assigned automatically.
Database Actions that are not active, are skipped.
If a Database Action is used to validate an Index Field against a database, then the associated Index Field will be marked as valid if the database query returned at least one row of results. If no results are returned, then the Index Fields will be marked as invalid.
If a Database Action is used to automatically fill other Index Fields and the database query returns multiple results, then the behaviour of the method depends on the value of parameter onMultipleResultsUseFirst. If onMultipleResultsUseFirst is true, then the first row in the results will be used to fill the other Index Fields. If onMultipleResultsUseFirst is false, then no values will be assigned to the other Index Fields.
If an Exception happens during the execution of a Database Action, it will be ignored and processing will continue with the remaining Database Actions.
Changes in Index Fields (either to set/reset their validity, or to change their value) are stored in their default namespace. For example, if a Database Action auto-fills an Index Field named "LastName", then its value will be saved in property "idx.LastName.value".
Note: this method does not work when executed in a client environment. This method can only be used in a script that runs on the server.
Declaration
executeDbActions(onMultipleResultsUseFirst: boolean): void;
Parameters
| Type | Name | Description |
|---|---|---|
| boolean | onMultipleResultsUseFirst |
if |
Returns
| Type | Description |
|---|---|
| void |
getAllNodes()
Declaration
getAllNodes(): INode[];
Returns
| Type | Description |
|---|---|
| INode[] |
getBatch()
Returns a reference to the IBatch object, that represents the Batch this object is a part of.
Declaration
getBatch(): IBatch;
Returns
| Type | Description |
|---|---|
| IBatch |
getChildCount()
Returns the number of objects immediately owned by this object in the Batch.
Declaration
getChildCount(): number;
Returns
| Type | Description |
|---|---|
| number |
getChildren()
Returns the list of INode objects immediately owned by this object in the Batch.
Declaration
getChildren(): INode[];
Returns
| Type | Description |
|---|---|
| INode[] |
getDocumentCount()
Returns the number of Documents owned by this object in the Batch. See method INode.getDocuments() for which Documents are included in the count.
Declaration
getDocumentCount(): number;
Returns
| Type | Description |
|---|---|
| number |
getDocuments()
Returns the list of IDocument objects owned by this object in the Batch. If this object is an IBatch instance, this method will include all Documents in the Batch. If this object is an IFolder instance, this method will only return the Documents immediately owned by this Folder.
Declaration
getDocuments(): IDocument[];
Returns
| Type | Description |
|---|---|
| IDocument[] |
getField(name)
Returns the IField object that corresponds to the specified Index Field name. If no Index Field with that name is defined, null is returned.
Declaration
getField(name: string): IField;
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
the name of the Index Field |
Returns
| Type | Description |
|---|---|
| IField |
getFields()
Returns a name-IField object mapping for the Index Fields of this object. The names are as defined for the Index Fields for this Class of object (e.g. Document or Folder Class), or Job Definition (for Batch-level Index Fields).
Declaration
getFields(): Map<string, IField>;
Returns
| Type | Description |
|---|---|
| Map<string, IField> |
getFieldsAsList()
Returns the list of IField objects for this INode. The IField objects in the list are in the order of the defined Index Fields in the Document Class, Folder Class, or Job Definition.
Declaration
getFieldsAsList(): IField[];
Returns
| Type | Description |
|---|---|
| IField[] |
getFieldValue(field)
Returns the value of the specified Index Field, as a string.
Declaration
getFieldValue(field: IField): string;
Parameters
| Type | Name | Description |
|---|---|---|
| IField | field |
the IField object that corresponds to the Index Field |
Returns
| Type | Description |
|---|---|
| string | the value of the specified Index Field |
getFieldValues(field)
Returns the value of the specified Index Field, as a string.
Declaration
getFieldValues(field: IField): Array<string>;
Parameters
| Type | Name | Description |
|---|---|---|
| IField | field |
Returns
| Type | Description |
|---|---|
| Array<string> |
getFolderCount()
Returns the number of Folders in this Batch
Declaration
getFolderCount(): number;
Returns
| Type | Description |
|---|---|
| number |
getFolders()
Returns the list of IFolder objects owned by this IBatch object. This method only returns a meaningful value when invoked on a IBatch object.
Declaration
getFolders(): IFolder[];
Returns
| Type | Description |
|---|---|
| IFolder[] |
getId()
Returns the internal ID value of this object. This value is not guaranteed to be unique outside the ImageTrust system.
Declaration
getId(): number;
Returns
| Type | Description |
|---|---|
| number |
getIndexClass()
Returns the assigned IIndexClass of this node. If this node is a:
- IBatch, return value is of type IBatchClass
- IFolder, return value is of type IFolderClass
- IDocument, return value is of type IDocumentClass
Declaration
getIndexClass(): IIndexClass;
Returns
| Type | Description |
|---|---|
| IIndexClass |
getIndexClasses()
This method actually returns the proper sub-class, depending on the actual INode type.
Declaration
getIndexClasses(): IIndexClass[];
Returns
| Type | Description |
|---|---|
| IIndexClass[] |
getJob()
Returns a reference to the IJob object, that represents the Job Definition for this object and its owner Batch.
Declaration
getJob(): IJob;
Returns
| Type | Description |
|---|---|
| IJob |
getJobName()
Returns the name of the Job Definition for this object and its owner Batch.
Declaration
getJobName(): string;
Returns
| Type | Description |
|---|---|
| string |
getLevelIndex()
Return the index of this node in relation to its level.
Declaration
getLevelIndex(): number;
Returns
| Type | Description |
|---|---|
| number |
getLevelName()
Returns a friendly name for the node level, e.g. Job, Batch, Stack, Folder, Document, Page, PageEDoc
Declaration
getLevelName(): string;
Returns
| Type | Description |
|---|---|
| string |
getName()
Returns the name of this object, as specified by a user, or determined by other rules.
Declaration
getName(): string;
Returns
| Type | Description |
|---|---|
| string |
getNodeIndex()
Returns the index of this node in relation to it's parent. Returned index is zero-based
Declaration
getNodeIndex(): number;
Returns
| Type | Description |
|---|---|
| number |
getPageCount()
Returns the number of Pages owned by this object in the Batch. See method INode.getPages() for which Pages are included in the count.
Declaration
getPageCount(): number;
Returns
| Type | Description |
|---|---|
| number |
getPages()
Returns the list of objects owned by this object in the Batch. If this object is an IBatch instance, this method will include all Pages in the Batch; if it is an instance, this method will include all Pages of all Documents of all Folders in this Stack; if it is an IFolder instance, this method will include all Pages of all Documents in this Folder; and if it is an IDocument instance, only the Pages that belong to this Document will be included.
Declaration
getPages(): IPage[];
Returns
| Type | Description |
|---|---|
| IPage[] |
getParent()
Returns the parent INode object of this object in the Batch.
Declaration
getParent(): INode;
Returns
| Type | Description |
|---|---|
| INode |
getProperties()
Get a reference to the INode properties. This object is to be used to hold any custom property that a Node might require and provides property change event functionality. You can read or write directly to this object. The keys of the properties object are always strings (not numbers, as can be the case in Javascript).
Note: in Transactional HTML Client, the method Dispatch.setLevelName that does custom node naming makes use of this object.
Declaration
getProperties(): any;
Returns
| Type | Description |
|---|---|
| any |
getProperty(name)
Get the value of a property. This is equivalent to properties.<name>.
Declaration
getProperty(name: string): any;
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
the name of the property whose value you want to get |
Returns
| Type | Description |
|---|---|
| any |
getReviewComments()
Returns a list of all INodeReviewComment of this node.
Declaration
getReviewComments(): INodeReviewComment[];
Returns
| Type | Description |
|---|---|
| INodeReviewComment[] |
getStackCount()
Returns the number of Stacks in this Batch
Declaration
getStackCount(): number;
Returns
| Type | Description |
|---|---|
| number |
getStacks()
Returns the list of objects owned by this IBatch object. This method only returns a meaningful value when invoked on a IBatch object.
Declaration
getStacks(): IStack[];
Returns
| Type | Description |
|---|---|
| IStack[] |
getTable(name)
Returns the ITable object that corresponds to the specified Table name. If no table with that name is defined, >null is returned.
Declaration
getTable(name: string): ITable;
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| ITable |
getTypeName()
Declaration
getTypeName(): string;
Returns
| Type | Description |
|---|---|
| string | a String representation of the type of this node (a constant |
getUserObject()
Returns this node's user object.
The user object is a transient object that can be used for scripting purposes.
Declaration
getUserObject(): any;
Returns
| Type | Description |
|---|---|
| any |
getUuid()
Returns the internally-generated UUID of this object. This value is guaranteed to be globally unique.
Declaration
getUuid(): string;
Returns
| Type | Description |
|---|---|
| string |
insert(newChild, childIndex)
Removes newChild from its present parent (if it has a parent), sets the child's parent to this node, and then adds the child to this node's child array at index childIndex. newChild must not be null and must not be an ancestor of this node.
Declaration
insert(newChild: INode, childIndex: number): void;
Parameters
| Type | Name | Description |
|---|---|---|
| INode | newChild |
the INode to insert under this node |
| number | childIndex |
the index in this node's child array where this node is to be inserted exception ArrayIndexOutOfBoundsException if |
Returns
| Type | Description |
|---|---|
| void |
isAtLeastOneFieldEmptyOrInvalid(checkRequiredFieldsOnly)
Returns true if there is at least one invalid indexing field.
This method will:
- always return
falsefor objects, - return
falsefor IDocument, IFolder and IBatch nodes which belong to a IJob without Index classes or with hidden fields only. - return
truefor IDocument nodes which belong to a IJob with multiple Document classes defined, if no Document class has yet been assigned. - return
truefor IFolder nodes which belong to a IJob with multiple Folder classes defined, if no Folder class has yet been assigned.
Non-required fields are considered valid if they are empty. If they are not empty, they should be valid.
Required fields are considered valid if they are not empty and have valid values.
Declaration
isAtLeastOneFieldEmptyOrInvalid(checkRequiredFieldsOnly: boolean): boolean;
Parameters
| Type | Name | Description |
|---|---|---|
| boolean | checkRequiredFieldsOnly |
whether to only check the required fields or all fields |
Returns
| Type | Description |
|---|---|
| boolean |
isNodeRejected(checkChildren)
This method returns true if the status of this node's last INodeReviewComment is NodeReviewStatus.REJECTED, false otherwise.
In addition, if parameter checkChildren is true, then it will also check all children below this node. If any rejected nodes are found, then it will return true.
Declaration
isNodeRejected(checkChildren: boolean): boolean;
Parameters
| Type | Name | Description |
|---|---|---|
| boolean | checkChildren |
|
Returns
| Type | Description |
|---|---|
| boolean |
merge(target, childIndex)
Merges the children of this node with the children of the target node. This node is removed from the tree after the merging, thus leaving only the target node in the tree: you should not use this node after you call merge
exception IllegalStateException if this is not a document of folder node exception IllegalArgumentException if the target node is not of the same type as this node
Declaration
merge(target: INode, childIndex: number): void;
Parameters
| Type | Name | Description |
|---|---|---|
| INode | target |
the node to merge this node's children into |
| number | childIndex |
the position to insert this node's children in relation to the target nodes children. If childIndex is greater than the childCount of the target node, then all child nodes are appended to the end of the target node. If childIndex is zero, then all child nodes are inserted to the beginning of the target node. |
Returns
| Type | Description |
|---|---|
| void |
removeAllChildren()
Removes all of this node's children, setting their parents to null. If this node has no children, this method does nothing
Declaration
removeAllChildren(): void;
Returns
| Type | Description |
|---|---|
| void |
removeFromParent()
Removes the subtree rooted at this node from the tree, giving this node a null parent. Does nothing if this node is the root of its tree.
Declaration
removeFromParent(): void;
Returns
| Type | Description |
|---|---|
| void |
setIndexClass(indexClass)
You may use this method for an IFolder or a IDocument. Be sure to use the appropriate IIndexClass sub-type, e.g. use:
- an IDocumentClass for a IDocument
- an IFolderClass for a IFolder
Declaration
setIndexClass(indexClass: IIndexClass): void;
Parameters
| Type | Name | Description |
|---|---|---|
| IIndexClass | indexClass |
the new index class |
Returns
| Type | Description |
|---|---|
| void |
setProperty(name, value, deleteIfEmpty)
Set a property value on the node. Properties are set on the properties object of the INode. This method is equivalent to properties.<name> = <value>; the difference is that this method will always cause a PropertyChangeEvent to be emitted.
Declaration
setProperty(name: string, value: any, deleteIfEmpty?: boolean): void;
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
the name of the property to set |
| any | value |
the value of the property to set |
| boolean | deleteIfEmpty |
whether to delete the property, if value is empty (e.g. null or undefined or <empty string>) |
Returns
| Type | Description |
|---|---|
| void |
setUserObject(userObject)
Sets the user object for this node to userObject.
Declaration
setUserObject(userObject: any): void;
Parameters
| Type | Name | Description |
|---|---|---|
| any | userObject |
the Object that constitutes this node's user-specified data |
Returns
| Type | Description |
|---|---|
| void |