DataMapper Scripts API

This page describes the different features available in scripts created inside DataMapper. See Write Your Own Scripts.

Objects

Name Description Available In
automation Returns a ScriptableAutomation object encapsulating the properties of the PlanetPress Workflow process that triggered the current operation.

Boundaries, all Steps except Goto

boundaries Returns a boundaries object encapsulating properties and methods allowing to define the boundaries of each document in the job.

Boundaries

data Returns a data object encapsulating properties and methods pertaining to the original data stream.

Boundaries, all Steps except Goto

db Returns a db object allowing you to connect to a database.

Boundaries, all Steps except Goto

logger Allows to log messages as error, warning or informational message.

Boundaries, all Steps except Goto

record The current record in the main data set.

Extract, Condition, Repeat and Multiple Conditions Steps

region The region object defines a subsection of the input data.

Boundaries

sourceRecord Returns a source record object containing properties specific to the current source record being processed.

Boundaries, all Steps except Goto and Postprocessor

steps Returns a steps object encapsulating properties and methods pertaining to the current DataMapper process.

Extract, Condition, Repeat and Multiple Conditions Steps

Functions

Name Description Available In
copyFile() Copies a file to the target file path, replacing it if it already exists.

Boundaries, Steps

createTmpFile() Creates a file with a unique name in the temporary work folder and returns a file object.

Boundaries, Steps

deleteFile() Deletes a file.

Boundaries, Steps

execute() Calls an external program and wait for its end.

Boundaries, Steps

newByteArray() Returns a new byte array.

Boundaries, Steps

newCharArray() Returns a character array.

Boundaries, Steps

newDoubleArray() Returns a double array.

Boundaries, Steps

newFloatArray() Returns a float array.

Boundaries, Steps

newIntArray() Returns an integer array.

Boundaries, Steps

newLongArray() Returns a long array.

Boundaries, Steps

newStringArray() Returns a string array.

Boundaries, Steps

openBinaryReader() Opens a file as a binary file for reading purposes.

Boundaries, Steps

openBinaryWriter() Opens a file as a binary file for writing purposes.

Boundaries, Steps

openTextReader() Opens a file as a text file for reading purposes.

Boundaries, Steps

openTextWriter() Opens a file as a text file for writing purposes.

Boundaries, Steps

Methods

Name Description Object Related Available In File Type
connect() Method that returns a new database connection object.

db

Boundaries settings

Proprocessor, Extract, Condition, Repeat, Action, and Postprocessor steps

all

createRegion() Read-only object containing the physical coordinates of the region.

region

Boundaries

all

currentPosition()

Returns the current position of the pointer in the data.

steps

Extract, Condition, Repeat, and Action steps

all

currentLoopCounter()

Returns an integer value representing the current iteration of the containing loop.

steps

Extract, Condition, Repeat, and Action steps

all

currentPage()

Returns an integer value representing the current page where the current position is located, inside the current record.

steps

Extract, Condition, Repeat, and Action steps

Text and PDF

currentPageHeight()

Returns the height of the current page in millimeters.

steps

Extract, Condition, Repeat, and Action steps

PDF

currentPageWidth()

Returns the height of the current page in millimeters.

steps

Extract, Condition, Repeat, and Action steps

PDF

extract() Extracts the text value from a rectangular region.

data

Extract, Condition, Repeat, and Action steps

all

extractMeta() Method that extracts the value of a metadata field.

data

Extract, Condition, Repeat, and Action steps

all

fieldExists() Method that returns True if metadata field exists.

data

Boundaries

Preprocessor, Extract, Condition, Repeat, Action and Postprocessor steps

all

find() Finds the first occurrence of a string starting from the current position.

data and boundaries

Boundaries

Extract, Condition, Repeat, and Action steps

all

found() Method that returns a Boolean value indicating whether the last call to find() was successful.

region

Boundaries

all

get() Retrieves an array of strings.

automation and boundaries

Boundaries

all

getVariable() Method that retrieves the value currently stored in a variable.

automation and boundaries

Boundaries

all

moveLines()

Scope constant that can be used as a parameter to moveTo() and moveToNext() methods.

steps

Extract, Condition, Repeat, and Action steps

Text

moveDelimiters()

Scope constant that can be used as a parameter to moveTo() and moveToNext() methods.

steps

Extract, Condition, Repeat, and Action steps

Text

moveMeasure()

Scope constant that can be used as a parameter to moveTo() and moveToNext() methods.

steps

Extract, Condition, Repeat, and Action steps

PDF

moveNode()

Scope constant that can be used as a parameter to moveTo() and moveToNext() methods.

steps

Extract, Condition, Repeat, and Action steps

XML

movePage()

Scope constant that can be used as a parameter to moveTo() and moveToNext() methods.

steps

Extract, Condition, Repeat, and Action steps

PDF

moveSibling()

Scope constant that can be used as a parameter to moveTo() and moveToNext() methods.

steps

Extract, Condition, Repeat and Multiple Conditions Steps

XML

moveTo() Moves the current position to a number.

steps

Extract, Condition, Repeat and Action steps

all

moveToNext() Moves the current position to the next instance of a number.

steps

Extract, Condition, Repeat and Action steps

all

range() Read-only object containing the physical coordinates of the region.

region

Boundaries

all

set() Sets a new DataMapper record boundary.

automation and boundaries

Boundaries

all

setVariable() Method that sets a variable to the specified value, automatically creating the variable if it doesn't exist yet.

automation and boundaries

Boundaries

all

totalPages()

Returns an integer value representing the total number of pages inside the current record.

steps

Extract, Condition, Repeat, and Action steps

Text and PDF

 
  • Last Topic Update: 24/01/2017 09:32
  • Last Published: 7/6/2017 : 9:48 AM