3 Creating Client Scripts

This chapter describes the various events and classes that can be used to create scripts for Capture client.

Capture enables you to create custom scripts to suit your business requirements. Scripts provide hooks into client events. You can create a client script that gets executed when certain Capture client events are triggered.

Extensions allow you to customize client scripts. You can write and incorporate JavaScript extensions to extend Capture functionality. For more information on JavaScript extensions, see Managing Oracle WebCenter Enterprise Capture.

This chapter includes the following sections:

3.1 Client Events

Client scripts are JavaScript modules that enable you to customize the behavior of certain client events.

This section describes the following events:

3.1.1 AttachmentCreated

The AttachmentCreated event occurs after an attachment has been created.

Syntax Parameter
public void AttachmentCreated(AttachmentCreatedEvent event); AttachmentCreatedEvent event

3.1.2 AttachmentRemoved

The AttachmentRemoved event occurs after an attachment has been removed.

Syntax Parameter
public void AttachmentRemoved(AttachmentRemoveEvent event); AttachmentRemoveEvent event

3.1.3 AttachmentSelected

The AttachmentSelected event occurs when an attachment has been selected.

Syntax Parameter
public void AttachmentSelected(AttachmentSelectedEvent event); AttachmentSelectedEvent event

3.1.4 BatchScanBegin

The BatchScanBegin event occurs when scanning into a batch is about to begin.

Syntax Parameter
public void BatchScanBegin(BatchScanEvent event); BatchScanEvent event

3.1.5 BatchScanComplete

The BatchScanComplete event occurs when scanning into a batch is complete.

Syntax Parameter
public void BatchScanComplete(BatchScanEvent event); BatchScanEvent event

3.1.6 BatchSelected

The BatchSelected event occurs when a batch has been selected.

Syntax Parameter
public void BatchSelected(BatchSelectedEvent event); BatchScanEvent event

3.17 CaptureImage

The CaptureImage event occurs when an image is about to be captured from the scan source.

Syntax Parameter
public void CaptureImage(ImageCaptureEvent event); ImageCaptureEvent event

3.1.8 CaptureInitialize

The CaptureInitialize event occurs prior to images being captured, and it can be used to initialize properties of the Capture source.

Syntax Parameter
public void CaptureInitialize(ImageCaptureEvent event); ImageCaptureEvent event

3.1.9 DBSearchComplete

The DBSearchComplete event occurs when the database search is completed and before the results are being processed.

Syntax Parameter
public void DBSearchComplete(DBSearchEvent event); DBSearchEvent event

3.1.10 DBSearchResults

The DBSearchResults event occurs as database search results are being processed.

Syntax Parameter
public void DBSearchResults(DBSearchEvent event); DBSearchEvent event

3.1.11 DBSearchStart

The DBSearchStart event occurs just before a database search.

Syntax Parameter
public void DBSearchStart(DBSearchEvent event); DBSearchEvent event

3.1.12 DocumentCreated

The DocumentCreated event occurs after a document has been created.

Syntax Parameter
public void DocumentCreated(CaptureDocument document); CaptureDocument document

3.1.13 DocumentRemoved

The DocumentRemoved event occurs after a document has been removed.

Syntax Parameter
public void DocumentRemoved(DocumentRemoveEvent event); DocumentRemoveEvent event

3.1.14 DocumentSelected

The DocumentSelected event occurs when a document has been selected.

Syntax Parameter
public void DocumentSelected(DocumentSelectedEvent event); DocumentSelectedEvent event

3.1.15 FieldGotFocus

The FieldGotFocus event occurs when a metadata field receives the input focus.

Syntax Parameter
public void FieldGotFocus(FieldEvent event); FieldEvent event

3.1.16 FieldLostFocus

The FieldLostFocus event occurs when a field has lost the input focus.

Syntax Parameter
public void FieldLostFocus(FieldEvent event); FieldEvent event

3.1.17 FieldProcessKey

The FieldProcessKey event occurs when a key event happens while the focus is in a metadata field.

Syntax Parameter
public void FieldProcessKey(FieldEvent event); FieldEvent event

3.1.18 InitializeFields

The InitializeFields event occurs before the dataFields model is initialized.

Syntax Parameter
public void InitializeFields(InitializeFieldsEvent event) InitializeFieldsEvent event

3.1.19 PageCreated

The PageCreated event occurs when a page is being added to a document.

Syntax Parameter
public void PageCreated(PageCreatedEvent event); PageCreatedEvent event

3.1.20 PreBatchDelete

The PreBatchDelete event occurs when a batch is about to be deleted.

Syntax Parameter
public void PreBatchDelete(BatchDeleteEvent event); BatchDeleteEvent event

3.1.21 PreBatchScan

The PreBatchScan event occurs before a batch is about to be scanned.

Syntax Parameter
public void PreBatchScan(BatchScanEvent event); BatchScanEvent event

3.1.22 PreCaptureImage

The PreCaptureImage event occurs before an image has been captured from the scan source.

Syntax Parameter
public void PreCaptureImage(ImageCaptureEvent event); ImageCaptureEvent event

3.1.23 PreDocumentProfileChange

The PreDocumentProfileChange event occurs when a document profile is about to change.

Syntax Parameter
public void PreDocumentProfileChange(PreDocumentProfileChangeEvent event); PreDocumentProfileChangeEvent event

3.1.24 DocumentProfileChanged

The DocumentProfileChanged event occurs after a document profile is changed.

Syntax Parameter
public void DocumentProfileChanged(DocumentProfileChangedEvent event); DocumentProfileChangedEvent event

3.1.25 PreDownloadItem

The PreDownloadItem event occurs when a batch item is about to be downloaded.

Syntax Parameter
public void PreDownloadItem(DownloadItemEvent event); DownloadItemEvent event

3.1.26 PrePageDelete

The PrePageDelete event occurs when one or more pages are about to be deleted.

Syntax Parameter
public void PrePageDelete(PageDeleteEvent event); PageDeleteEvent event

3.1.27 PreReleaseBatch

The PreReleaseBatch event occurs when a batch is about to be released.

Syntax Parameter
public void PreReleaseBatch(ReleaseBatchEvent event); ReleaseBatchEvent event

3.1.28 PreUploadItem

The PreUploadItem event occurs when a batch item is about to be uploaded.

Syntax Parameter
public void PreUploadItem(UploadItemEvent event); UploadItemEvent event

3.1.29 PostCaptureImage

The PostCaptureImage event occurs after an image has been captured from the scan source.

Syntax Parameter
public void PostCaptureImage(ImageCaptureEvent event); ImageCaptureEvent event

3.1.30 PostDownloadItem

The PostDownloadItem event occurs after a batch item has been downloaded.

Syntax Parameter
public void PostDownloadItem(DownloadItemEvent event); DownloadItemEvent event

3.1.31 PostUploadItem

The PostUploadItem event occurs after a batch item has been uploaded.

Syntax Parameter
public void PostUploadItem(UploadItemEvent event); UploadItemEvent event

3.1.32 RegionSelected

The RegionSelected event occurs when a region has been selected on a document page.

Syntax Parameter
public void RegionSelected(RegionSelectedEvent event); RegionSelectedEvent event

3.1.33 ScriptStart

The ScriptStart event occurs when scripting is first initialized.

The syntax for this event is: public void ScriptStart();

3.2 Event Classes

An event class is used to define an event. This section describes the following event classes:

3.2.1 AttachmentCreatedEvent

The AttachmentCreatedEvent class is used in events that occur when an attachment has been created.

Property Type Description
attachment CaptureAttachment The attachment that has been created.

3.2.2 AttachmentRemoveEvent

The AttachmentRemoveEvent class is used in events that occur when a user removes one or more attachments from a document.

Property Type Description
attachments List<CaptureAttachment> The attachments being removed from the document.

3.2.3 AttachmentSelectedEvent

The AttachmentSelectedEvent class is used in events that occur when a user selects an attachment.

Property Type Description
attachment CaptureAttachment The attachment that has been selected in the batch pane.

3.2.4 BatchDeleteEvent

The BatchDeleteEvent class is used in events that occur when a user deletes a batch.

Property Type Description
batches List<CaptureBatch> List of batches that will be deleted.
canceled boolean If set to True, the delete operation will be canceled.

3.2.5 BatchScanEvent

The BatchScanEvent class is used in events that occur when a user scans a batch.

Property Type Description
batch CaptureBatch The batch that new items will be added to during scan or import.
canceled boolean If set to True, the scan or import will be canceled.
sourceFiles List<File> When using the Import Source, this contains the list of files being imported.
operation CaptureOperation Indicates the operation that triggered this event.
allowConfiguration boolean Setting this property to True in the PreBatchScan event allows scanners to display their configuration dialog, before the first page is scanned.

3.2.6 BatchSelectedEvent

The BatchSelectedEvent class is used in events that occur when a user selects a batch.

Property Type Description
batch CaptureBatch Batch that has been selected in the batch pane.

3.2.7 DBSearchEvent

The DBSearchEvent class is used in events that occur when a user initiates a database lookup.

Property Type Description
displayHitlist boolean If set toTrue, displays the database lookup results.
exactMatch boolean If set to True, the search value must be an exact match.
metadataID String Unique identifier of the metadata field being searched.
metadataValue String Value of the metadata field being searched.
rowResults List<DbSearchResultRow> List of row results returned from the search.
canceled boolean If set to True, cancels the search.

3.2.8 DocumentRemoveEvent

The DocumentRemoveEvent class is used in events that occur when a user removes a document from the batch.

Property Type Description
documents List<CaptureDocument> A list of documents being removed from the batch.
destinationDocument CaptureDocument When removing a document separation, this property contains the document to which all pages are to be moved.

The following table describes the syntax for isRemove() method:

Syntax Description
public boolean isRemove() ReturnsTrue if a document separation is being removed.

The following table describes the syntax for isDelete() method:

Syntax Description
public boolean isDelete() Returns True if the list of documents is being deleted.

3.2.9 DocumentSelectedEvent

The DocumentSelectedEvent class is used in events that occur when a user selects a document.

Property Type Description
document CaptureDocument The document that has been selected in the batch pane.

3.2.10 PreDocumentProfileChangeEvent

The PreDocumentProfileChangeEvent class is used in events that occur when a user is about to change a document profile.

Property Type Description
oldDocumentType DocumentType The previous document type or document profile before change.
newDocumentType DocumentType The currently selected document type or document profile.
canceled Boolean If set to true, the change will be reverted back in the document type or profile drop-down.

3.2.11 DocumentProfileChangedEvent

The DocumentProfileChangedEvent class is used in events that occur when a user has changed a document profile.

Property Type Description
documentType DocumentType The currently selected document type or document profile.

3.2.12 DownloadItemEvent

The DownloadItemEvent class is used in events that occur when batch items are downloaded from the server.

Property Type Description
captureItem CaptureItem After a batch is opened, indicates the current item being downloaded from the server.

3.2.13 FieldEvent

The FieldEvent class is used in events that occur when a user enters a field, exits a field, or types into a field.

Property Type Description
cancel Boolean If set to True, cancels the event.
field DataField The field this event is acting upon.
keyEvent KeyEvent The keyboard event used to generate this event.
traversalDirection Integer Indicates which direction the field focus is moving.

TRAVERSAL Constants:
TRAVERSAL_UNDETERMINED = 0
TRAVERSAL_FORWARD = 1
TRAVERSAL_BACKWARD = 2
TRAVERSAL_FORWARD_COMPONENT = 3
TRAVERSAL_BACKWARD_COMPONENT = 4

3.2.14 ImageCaptureEvent

The ImageCaptureEvent class is used in events that occur when the user is capturing an image.

Property Type Description
cancel boolean If set to True, the capture operation will be canceled.
imageCount Integer Indicates how many images have been captured.
imageFileName String Indicates the file name of image saved locally.
xdpi Integer For images, indicates the horizontal dots per inch.
ydpi Integer For images, indicates the vertical dots per inch.
brightness Integer The brightness value used to capture the image.
contrast Integer The contrast value used to capture the image.
logicalBreak boolean If set to True, indicates the start of a document.
sourceFiles List<File> When using the Import Source, contains the list of files being imported.
sourceFileName String When using the Import Source, contains the name of the source file being imported.
image BufferedImage For images files, contains a BufferedImage object.
source ImageCaptureEngine The ImageCaptureEngine that created this event.
imageFormat ImageCaptureEngine.ImageFormat Indicates the format that images will be saved as Available Formats: tiffG4, tiffJpegGray, tiffJpegColor, jpegGray, and jpegColor.
printerString String [ ] The imprinter or endorser strings printed on a page during capture.

3.2.15 InitializeFieldsEvent

The InitializeFieldsEvent class is used in events that occur before the fieldedit control is initialized on the client. You can use this class to modify or remove the DataFields from the list.

Property Type Description
dataFields List <DataField> The list of DataFields that will be displayed to the user.

3.2.16 PageCreatedEvent

The PageCreatedEvent class is used when a page is created.

Property Type Description
page CaptureDocumentPage The page that was created.

3.2.17 PageDeleteEvent

The PageDeleteEvent class is used when a page is being deleted.

Property Type Description
pages List<CaptureDocumentPage> The list of pages being deleted. You can modify this list to remove pages that you do not want to delete.
canceled boolean If set to True, no pages will be deleted.

3.2.18 RegionSelectedEvent

The RegionSelectedEvent class is used in events that occur when a user selects a region of the image in the viewer.

Property Type Description
mouseEvent MouseEvent The MouseEvent used to select the region within the image.
selectionRectangle Rectangle The rectangle selected within the image.
image BufferedImage The BufferedImage containing the selected portion of the image.

3.2.19 ReleaseBatchEvent

The ReleaseBatchEvent class is used in events that occur when a batch is about to get released or unlocked.

Property Type Description
batches List<CaptureBatch> The list of batches that are about to be released.
processorID String The unique identifier of the processor to which the batches will get released.
jobID String The unique identifier of the processor job.
canceled boolean If the flag is set to True, the release will be canceled.
releaseProcessName String The name of the process used to release the batch.

3.2.20 UploadItemEvent

The UploadItemEvent class is used in events that occur when batch items are uploaded to the server.

Property Type Description
captureItem CaptureItem After a batch is released, indicates the current item being uploaded to the server.

3.3 Capture Client Core Classes

This section describes the following Capture Client Core classes:

3.3.1 AttachmentType

The AttachmentType class contains all properties of an attachment type.

Property Type Description
ID String The internal identifier for the attachment type.
name String The name for the attachment type.
description String The description for the attachment type.
required Boolean Indicates if the attachment type is required.

3.3.2 AttachmentTypes

The AttachmentTypes class is a map of attachment types. It is of type LinkedHashMap<String, AttachmentType> and the map key is the attachment type ID. Use the LinkedHashMap methods to retrieve the attachment types from instances of this class.

See the Java API documentation for more information on the LinkedHashMap class and its methods.

3.3.3 BarcodeInfo

The BarcodeInfo class contains all the properties associated with a bar code detected by a scanner.

Property Type Description
type Integer The type of the bar code.

Valid bar code types are:
TWBT_3OF9 - 0
TWBT_2OF5INTERLEAVED - 1
TWBT_2OF5NONINTERLEAVED - 2
TWBT_CODE93 - 3
TWBT_CODE128 - 4
TWBT_UCC128 - 5
TWBT_CODABAR - 6
TWBT_UPCA - 7
TWBT_UPCE - 8
TWBT_EAN8 - 9
TWBT_EAN13 - 10
TWBT_POSTNET - 11
TWBT_PDF417 - 12
TWBT_2OF5INDUSTRIAL - 13
TWBT_2OF5MATRIX - 14
TWBT_2OF5DATALOGIC - 15
TWBT_2OF5IATA - 16
TWBT_3OF9FULLASCII - 17
TWBT_CODABARWITHSTARTSTOP - 18
TWBT_MAXICODE - 19
text String The textual value of the bar code.
x Integer The horizontal location (in pixels) of the bar code on the page. This value may be null if the scanner does not supply this information.
y Integer The vertical location (in pixels) of the bar code on the page. This value may be null if the scanner does not supply this information.
confidence Integer The degree of certainty in the accuracy of the bar code information. The value ranges from 0 (no confidence) to 100 (supreme confidence) or may be null or (-)1 if the scanner does not supply this information.
rotation Integer The orientation of the bar code.

Valid orientations are:
TWBCOR_ROT0 (Normal reading orientation) - 0
TWBCOR_ROT90 (Rotated 90 degrees clockwise) - 1
TWBCOR_ROT180 (Rotated 180 degrees clockwise) - 2
TWBCOR_ROT270 (Rotated 270 degrees clockwise) - 3
TWBCOR_ROTX (The orientation is not known) - 4
This value may be null if the scanner does not supply this information.

3.3.4 CaptureAttachment

The CaptureAttachment class contains all properties of an attachment.

Property Type Description
attachmentType AttachmentType The type of attachment.
id String The internal identifier for the attachment.
pages CaptureDocumentPages The pages contained in the attachment.
parentDocument CaptureDocument The parent document owning this attachment.
title String The title of the attachment.

The following table describes the syntax for persist() method:

Syntax Description
persist() throws BatchLockException, CaptureException Saves the attachment and related document pages to the server.

3.3.5 CaptureAttachments

The CaptureAttachments class is a collection of attachments and is of type Vector<CaptureAttachment>. Use the Vector methods to retrieve attachments from instances of this class.

See the Java API documentation for more information on the Vector class and its methods.

3.3.6 CaptureBatch

The CaptureBatch class contains all properties and operations for a batch.

Property Type Description
batchId String The internal identifier for the batch.
batchName String The name of the batch.
batchPath String The local path where information for this batch is stored.
createdBy String The user that created the batch.
createdDate Date The date that the batch was created.
currentPriority Integer The priority assigned to the batch.
currentStatus CaptureBatchStatus The status assigned to the batch.
documents [CaptureDocuments](#339-capturedocuments The documents contained in the batch.
items CaptureItems The items associated with the batch.
jobID String ID of the processor job. This property is populated just before the batch is released.
lastModifiedDate Date The date that the batch was last modified.
note String The note assigned to the batch.
processorID String ID of the processor to which the batch will get released. This property is populated just before the batch is released.
workspace CaptureWorkspace The workspace used to create the batch.

The following table describes the syntax for persist() method:

Syntax Description
persist() throws BatchLockException, CaptureException Saves the batch record to the server.

3.3.7 CaptureBatchStatus

The CaptureBatchStatus class contains the properties of a batch status.

Property Type Description
value String The description of the status.
id String The internal identifier of the status.

3.3.8 CaptureDataType

The CaptureDataType is an enumeration that defines the data types for metadata field definitions. The following are valid Capture data types:

3.3.9 CaptureDocument

The CaptureDocument class contains all properties of a document.

Property Type Description
documentType DocumentType The document profile assigned to the document.
fields CaptureFields The metadata assigned to the document.
id String The internal identifier for the document.
pages CaptureDocumentPages The pages contained in the document.
parentBatch CaptureBatch The batch that contains this document.
title String The title of the document.
attachments CaptureAttachments The attachments associated with this document.

The following table describes the syntax for persist() method:

Syntax Description
persist() throws BatchLockException, CaptureException Saves the document, related document pages, and metadata to the server.

3.3.10 CaptureDocumentPage

The CaptureDocumentPage class contains the properties of a document page.

Property Type Description
imageFilenameKey String The local filename for this page.
item CaptureItem The item associated with the page.
pageID String The internal identifier for the page.
pageNumber Integer The number of the page within the document.
parentDocument CaptureDocument The document that contains this page.

3.3.11 CaptureDocumentPages

The CaptureDocumentPages class is a collection of document pages and is of type Vector<CaptureDocumentPage>. Use the Vector methods to retrieve document pages from instances of this class.

See the Java API documentation for more information on the Vector class and its methods.

3.3.12 CaptureDocuments

The CaptureDocuments class is a collection of documents and is of type Vector<CaptureDocument>. Use the Vector methods to retrieve documents from instances of this class.

See the Java API documentation for more information on the Vector class and its methods.

3.3.13 CaptureErrorManager

The CaptureErrorManager class manages what error messages are logged.

Property Type Description
logLevel Level The minimum level used to log messages.

The following table describes the syntax for logMessage() method:

Syntax Description
logMessage(Level level, String message)

logMessage(Level level, String message, Throwable errorException)
Logs a message with the specified log level.

or

Logs a message and error with the specified log level.

The following table describes the parameters for logMessage() method:

Parameter Type Description
level Level The severity level for this log entry.
message String The message you wish to log.
errorException Throwable If logging an error, the exception that is the cause of the error.

3.3.14 CaptureField

The CaptureField class contains the properties of a document metadata field.

Property Type Description
displayValue String The value to display for this field.
fieldName String The name of the field.
length Integer The maximum length of the field.
required boolean If True, this field is required to have a value.
value String The value for this field.

The following table describes the syntax for setDate() method:

Syntax Description
setDate(Date date) Sets the value of the metadata field to a date.

The following table describes the parameters for setDate() method:

Parameter Type Description
date Date The date value to be set.

3.3.15 CaptureFields

The CaptureFields class is a map of metadata field definitions. It is of type LinkedHashMap<String, CaptureField> and the map key is the field name. Use the LinkedHashMap methods to retrieve the fields from instances of this class.

See the Java API documentation for more information on the LinkedHashMap class and its methods.

3.3.16 CaptureItem

The CaptureItem class contains properties of an item (single image or non-image file) associated with a document page.

Property Type Description
filename String The name of the file for this item.
parentBatch CaptureBatch The batch containing this item.
sourceFilename String If this item was imported, contains the name of the file it was imported from.
sourceFormat String Non-image documents contains the format of the document, which is typically the file extension.
patchCode Integer The patch code for this item.
barcodes List<String> The bar codes for this item.
micrValue String The scanner’s MICR text for this item.
endorsement String The scanner’s endorsement text for this item.

The following table describes the syntax for persist() method:

Syntax Description
persist() throws BatchLockException, CaptureException Saves the item to the server.

3.3.17 CaptureItems

The CaptureItems class is a map of Capture items. It is of type TreeMap<String, CaptureItem> and the map key is the item filename. Use the TreeMap methods to retrieve the items from instances of this class.

See the Java API documentation for more information on the TreeMap class and its methods.

3.3.18 CaptureOperation

This is an enumeration that defines the capture operation being performed on the batch. The following are valid Capture operation values:

3.3.19 CaptureStateManager

The CaptureStateManager class contains properties related to the current state of the client. The instance of this class is available to all scripting events through the Capture property.

Property Type Description
activeAttachment CaptureAttachment The active document attachment.
activeAttachmentPage CaptureDocumentPage The active document attachment page.
activeAttachmentType AttachmentType The active document attachment type.
activeBatch CaptureBatch The active batch.
activeDocument CaptureDocument The active document.
activeDocumentPage CaptureDocumentPage The active document page.
activeDocumentType DocumentType The active document profile.
activeProfile ClientProfile The active client profile.
applicationUserPath String The path the client uses for its application data.
batchesPath String The path the client uses to cache batch data.
captureSystemId String The internal identifier of the Capture system that the client is connected to.
computerName String The name of the computer the client is running on.
currentUser String The user currently logged into the client.
errorManager CaptureErrorManager The Error Manager object used for logging information.

3.3.20 CaptureWorkspace

The CaptureWorkspace class contains all properties and operations for a workspace.

Property Type Description
id String The internal identifier associated with the workspace.
fieldDefinitions FieldDefinitions The metadata defined for this workspace.
name String The name of the workspace.
statuses List<CaptureBatchStatus> A list of batch statuses available to this workspace.

The following table describes the syntax for getDBLookupProfile() method:

Syntax Description
public DBLookupProfile getDBLookupProfile(String profileId) throws CaptureException Retrieves the database lookup profile for the given database lookup profile ID.

The following table describes the parameter for getDBLookupProfile() method:

Parameter Type Description
profileId String The identifier of the database lookup profile.

3.3.21 ClientProfile

The ClientProfile class contains the properties of a client profile as defined in the Capture Workspace Console.

Property Type Description
alwaysDisplayHitList boolean If True, after a database lookup is executed, the results are displayed regardless of the number of results returned.
applyBrightness boolean If True, applies the brightness and contrast settings to the selected Capture source.
batchFilterDaysOldFrom Integer A batch filter setting that specifies the minimum days old a batch can be.
batchFilterDaysOldTo Integer A batch filter setting that specifies the maximum days old a batch can be.
batchFilterPrimarySortField String The batch property used for the primary sort of the batches tree.
batchFilterPrimarySortOrder SortOrder The primary sort order for the batches tree.
batchFilterSecondarySortField String The batch property used for the secondary sort of the batches tree.
batchFilterSecondarySortOrder SortOrder The secondary sort order for the batches tree.
batchFilterState Integer The batch states to include in the batch filter.
batchPrefix String The batch prefix to use for batches created using this profile.
batchVisibility BatchVisibility A batch filter setting that specifies when a user sees the batch in the batches tree.
blankByteThreshold long If the number of bytes in the file size of an image is less than the blankByteThreshold, the page is considered to be a blank page.
brightness Integer The brightness to apply to the selected Capture source.
captureType CaptureType Indicates whether the profile is capture-only, capture and index, or index-only.
contrast Integer The contrast to apply to the selected Capture source.
dBLookupMaxRecords Integer The maximum number of records to return from a database lookup.
dBLookupProfileId String The unique identifier of the database lookup profile used by this profile.
defaultColor ColorType The default color type used during capture.
defaultDpi Integer The default DPI to use during capture.
defaultPriority Integer A batch created from this profile will be assigned this priority.
defaultStatusId String A batch created from this profile will be assigned this status.
description String The description for the profile.
documentCreationType DocumentCreationType Specifies how many pages are created per document at capture time.
documentTypes DocumentTypes An object containing the document profiles that this profile can assign to a batch.
id String The identifier associated with this profile.
maxPages Integer The non-image file preview page limit.
name String The name of the profile.
nonImageAction NonImageAction The action to take for non-image files.
nonImageDpi int For client profiles having a nonImageAction property of type CONVERT, this property contains the image DPI for non-image files.
nonImageFormat String For client profiles having a nonImageAction property of type CONVERT, this property contains the image format for non-image files. This value will be either TIFF_BW or JPEG.
nonImageJpegQuality int For client profiles having a nonImageAction property of typeCONVERT and a nonImageFormat value of JPEG, this property contains the JPEG image quality for non-image files.
picklistRelationshipProfile String The dependent choice list used by this profile.
prefixes List<String> The batch prefixes used in the batch filter.
preventDefaultColorOverride boolean If True, the color cannot be overridden.
preventDefaultDpiOverride boolean If True, the dpi cannot be overridden.
priorities List<Integer> The batch priorities used in the batch filter.
sepByteThreshold Integer If the number of bytes in the file size of an image is less than the sepByteThreshold, the page is considered to be a separator sheet.
statuses List<String> The batch statuses used in the batch filter.
supportedDocumentTypes List<String> A list of document profile identifiers which represent the document profiles that this profile can assign to a batch.
workspaceId String The unique identifier of the workspace in which this profile is associated.
workspaceName String The name of the workspace in which this profile is associated.
releaseProcesses ClientReleaseProcesses A list of the available client release processes.

The following table describes the enumeration and values for the ClientProfile class:

Enumeration Value
AutoPopulateType NONE, SCANDATE, INDEXDATE, DEFAULTVALUE, BATCHNAME, USERID, COMPUTERNAME, CLIENTPROFILENAME, BATCHSTATUS, BATCHPRIORITY
BatchVisibility USER_AND_COMPUTER, USER, ALL
DocumentCreationType ONE_PAGE, TWO_PAGES, VARIABLE_PAGES, PROMPT_USER
CaptureType CAPTURE_ONLY, CAPTURE_AND_INDEX, INDEX_ONLY
NonImageAction DISALLOW, ALLOW, CONVERT
SortOrder ASCENDING, DESCENDING
ColorType NotSpecified, BlackAndWhite, Gray, Color

3.3.22 ClientReleaseProcess

The ClientReleaseProcess class contains all properties of a client release process.

Property Type Description
name String The name of the release process.
description String The description of the release process.
processorID String The processor ID of the release process.
jobID String The processor job ID of the release process.
defaultRelease boolean Indicates if this is the default release process.

3.3.23 ClientReleaseProcesses

The ClientReleaseProcesses class is a list of client release processes. It is of type ArrayList<ClientReleaseProcess>. Use the ArrayList methods to retrieve the client release processes from instances of this class.

See the Java API documentation for more information on the ArrayList class and its methods.

3.3.24 ClientUI

The ClientUI class allows the user to invoke user interface related actions and can be accessed through client scripts.

Property Type Description
batchEditForm BatchEditForm An instance of the current batch edit form.

This class includes the following methods:

releaseBatch()

The following table describes the syntax for releaseBatch() method:

Syntax Description
public void releaseBatch(List<CaptureBatch> batches, String processorID, String jobID) Unlocks or releases a list of batches for further processing.

The following table describes the parameters for releaseBatch() method:

Parameter Type Description
batches List<CaptureBatch> The list of batches to be released.
processorID String The unique identifier of the processor to which the batches will get released.
jobID String The unique identifier of the processor job.

setActiveMetadataFieldByName()

The following table describes the syntax for setActiveMetadataFieldByName() method:

Syntax Description
public void setActiveMetadataFieldByName(String fieldName) Moves the focus in the metadata pane to the metadata field specified by the field name.

The following table describes the parameter for setActiveMetadataFieldByName() method:

Parameter Type Description
fieldName String The name of the metadata field to which the focus is to be moved.

setActiveMetadataFieldByID()

The following table describes the syntax for setActiveMetadataFieldByID() method:

Syntax Description
public void setActiveMetadataFieldByID(String fieldID) Moves the focus in the metadata pane to the metadata field name specified by the field ID.

The following table describes the parameter for setActiveMetadataFieldByID() method:

Parameter Type Description
fieldID String The unique identifier of the metadata field to which the focus is to be moved.

execDBSearch()

The following table describes the syntax for execDBSearch() method:

Syntax Description
public void execDBSearch(String metadataName, String metadataValue, Boolean alwaysDisplayHitList) Performs a database lookup for the given metadata field name and value. This method then updates the metadata fields in the metadata pane with the results.

The following table describes the parameters for execDBSearch() method:

Parameter Type Description
metadataName String The name of the metadata field that is to be looked up.
metadataValue String The value that is used to perform the lookup.
alwaysDisplayHitList Boolean If set to True, displays the lookup results irrespective of the number of results.

execDBSearch()

The following table describes the syntax for execDBSearch() method:

Syntax Description
public void execDBSearch(String metadataName, String metadataValue, Boolean alwaysDisplayHitList, Boolean exactSearch, Integer maximumRecords) Performs a database lookup for the given metadata field name and value. This method then updates the metadata fields in the metadata pane with the results.

The following table describes the parameters for execDBSearch() method:

Parameter Type Description
metadataName String The name of the metadata field that is to be looked up.
metadataValue String The value that is used to perform the lookup.
alwaysDisplayHitList Boolean If set to True, displays the lookup results irrespective of the number of results.
exactSearch Boolean If set to True, the result must exactly match the value being searched. If set toFalse, partial matches are also returned.
maximumRecords Integer Indicates the maximum number of records the search returns.

selectDocument()

The following table describes the syntax for selectDocument() method:

Syntax Description
public void selectDocument(CaptureDocument document) Selects the given document in the batches tree.

The following table describes the parameters for selectDocument() method:

Parameter Type Description
document CaptureDocument The document to select.

refreshDocumentMetadata()

The following table describes the syntax for refreshDocumentMetadata() method:

Syntax Description
public void refreshDocumentMetadata() Reloads the metadata from the current document and displays it in the metadata pane.

3.3.25 DBLookupProfile

The DBLookupProfile class represents a profile for database lookup. This class includes the following method:

execDBLookup()

The following table describes the syntax for execDBLookup() method:

Syntax Description
Database Lookup without sorting

DBLookupResult execDBLookup(String searchID, String fieldID, String value, boolean exactMatch, Integer maxRows) throws CaptureException

Database Lookup with sorting

DBLookupResult execDBLookup(String searchID, String fieldID, String value, Boolean exactMatch, String primarySortField, Integer primarySortOrder, String secondarySortField, Integer secondarySortOrder, Integer maxRows) throws CaptureException
Executes a database lookup with or without sorting.

Sort Constants:
SORT_ASC = 0
SORT_DESC = 1

The following table describes the parameters for the execDBLookup() method:

Parameter Type Description
searchID String The unique identifier of the database search defined for the database lookup profile.
fieldID String The unique identifier of the metadata field being searched.
value String The value being searched upon.
exactMatch Boolean If True, the value must be an exact match.
primarySortField String The field identifier used for the primary sort.
primarySortOrder Integer The sort order of the primary sort.
secondarySortField String The field identifier used for the secondary sort.
secondarySortOrder Integer The sort order of the secondary sort.
maxRows Integer The maximum number of rows to be returned.

3.3.26 DBLookupResult

The DBLookupResult class represents the result of a database lookup.

Property Type Description
searchFieldInfoList List<DbSearchFieldInfo> A list of search field information describing the results returned by the database lookup.
searchResultRows List<DbSearchResultRow> A list of search result rows returned by the database lookup.

3.3.27 DbSearchResultRow

The DbSearchResultRow class represents one row result returned from a database lookup.

Property Type Description
results List<String> A list of string values associated with one search result. The values in the list will be in the same order in which the return fields are defined.

3.3.28 DbSearchFieldInfo

The DbSearchFieldInfo class represents the field information describing the results of a database lookup.

Property Type Description
captureIndexDefID String The metadata field identifier.
dbColumnName String The name of the database column.
dbColumnType Integer The type of the database column.
captureFieldType Integer The data type of the metadata field.

3.3.29 DocumentType

The DocumentType class represents a document profile. A document profile dictates what metadata fields are available to documents created from this type.

Property Type Description
fieldDefinitions FieldDefinitions The metadata applicable to the document profile.
id String The internal identifier associated with the document profile.
name String The name for the document profile.
description String The description for the document profile.
attachmentTypes AttachmentTypes The attachment types available to the document profile.

3.3.30 DocumentTypes

The DocumentTypes class is a map of document profiles. It is of type TreeMap<String, DocumentType> and the map key is the document profile ID. You can use the TreeMap methods to retrieve the document profiles from instances of this class.

See the Java API documentation for more information on the TreeMap class and its methods.

3.3.31 FieldDefinition

The FieldDefinition class represents a metadata field’s definition.

Property Type Description
autoPopulateType ClientProfile.AutoPopulateType Specifies how the field should be auto-populated.
dataType CaptureDataType The data type of this field.
autoPopulateDefault String The default value for this field.
displayable boolean Indicates whether this field will be displayed in the client.
length Integer The maximum length for this field.
id String The internal identifier for this field.
name String The name of this field.
inputMask String The input mask.
locked boolean Set to True, if the field is locked.
maxValue Float The maximum value for this field.
minValue Float The minimum value for this field.
pickListCaseInsensitive boolean If True, the choice list is case insensitive.
pickListID String The unique identifier of the choice list associated with this field.
pickListParentFieldID String The unique identifier of the choice list parent field.
pickListSourceID String The source identifier of the dependent choice list for this field.
profileDisplayFormat String The format used when displaying the field.
required boolean Indicates whether this field is required to have a value.
validationExpression String A regular expression used to validate the values entered for this field.

3.3.32 FieldDefinitions

The FieldDefinitions class is a map of metadata field definitions. It is of type LinkedHashMap<String, FieldDefinition> and the map key is the metadata field definition ID. You can use the LinkedHashMap methods to retrieve the metadata field definitions from instances of this class.

See the Java API documentation for more information on the LinkedHashMap class and its methods.

3.3.33 ImageCaptureEngine

The ImageCaptureEngine class contains all the properties and operations associated with image capture.

Property Type Description
activeSource ImageCaptureSource The active source of the Image Capture Engine from which to capture images.
activeDriver ImageCaptureDriver The active driver of the Image Capture Engine from which to capture images.

3.3.34 MicrInfo

The MicrInfo class contains all the properties associated with the magnetic data detected by a scanner.

Property Type Description
string String The textual information read from the MICR data.

3.3.35 Source

The Source class is a low-level class used to interact with a TWAIN scanner.

This class includes the following methods:

getCurrentPrinter()

The following table describes the syntax for getCurrentPrinter() method:

Syntax Description
public int getCurrentPrinter() throws InvalidStateException, OperationException; Returns the current imprinter or endorser. See the setPrinter(int printer) method for valid values.

getPrinterIndex()

The following table describes the syntax for getPrinterIndex() method:

Syntax Description
public int getPrinterIndex() throws OperationException, InvalidStateException; Returns the counter value of the current imprinter or endorser.

getPrinterMode()

The following table describes the syntax for getPrinterMode() method:

Syntax Description
public int getPrinterMode() throws OperationException, InvalidStateException; Returns the mode of the current imprinter or endorser. See the method setPrinterMode(int printerMode) for the meaning of the return value.

getPrinterString()

The following table describes the syntax for getPrinterString() method:

Syntax Description
public String[] getPrinterString() throws OperationException, InvalidStateException; Returns the string or format of the current imprinter or endorser.

getPrinterSuffix()

The following table describes the syntax for getPrinterSuffix() method:

Syntax Description
public String getPrinterSuffix() throws OperationException, InvalidStateException; Returns the suffix string of the current imprinter or endorser.

getSupportedPrinters()

The following table describes the syntax for getSupportedPrinters() method:

Syntax Description
public int[] getSupportedPrinters() throws InvalidStateException, OperationException; Returns an array of the supported imprinters or endorsers. See the setPrinter(int printer) method for the meaning of the return values.

isPrinterEnabled()

The following table describes the syntax for isPrinterEnabled() method:

Syntax Description
public boolean isPrinterEnabled() throws OperationException, InvalidStateException; Returns whether the current imprinter or endorser is enabled.

isBarcodeDetectionEnabled()

The following table describes the syntax for isBarcodeDetectionEnabled() method:

Syntax Description
public boolean isBarcodeDetectionEnabled() throws OperationException, InvalidStateException; Returns whether bar code detection is enabled for the scanner.

getBarcodeMaxRetries()

The following table describes the syntax for getBarcodeMaxRetries() method:

Syntax Description
public int getBarcodeMaxRetries() throws OperationException, InvalidStateException; Returns the number of times a search will be retried if no bar codes are found.

getBarcodeMaxSearchPriorities()

The following table describes the syntax for getBarcodeMaxSearchPriorities() method:

Syntax Description
public int getBarcodeMaxSearchPriorities() throws OperationException, InvalidStateException; Returns the maximum number of supported bar code search priorities.

getBarcodeSearchMode()

The following table describes the syntax for getBarcodeSearchMode() method:

Syntax Description
public int getBarcodeSearchMode() throws OperationException, InvalidStateException; Returns the orientation or orientation priority used for bar code searching.
Possible return values are:
TWBD_HORZ - 0
TWBD_VERT - 1
TWBD_HORZVERT - 2
TWBD_VERTHORZ - 3

getBarcodeTimeout()

The following table describes the syntax for getBarcodeTimeout() method:

Syntax Description
public int getBarcodeTimeout() throws OperationException, InvalidStateException; Returns the maximum amount of time to spend searching for bar codes on a page.

getBarcodeSearchPriorities()

The following table describes the syntax for getBarcodeSearchPriorities() method:

Syntax Description
public int[] getBarcodeSearchPriorities() throws OperationException, InvalidStateException; Returns a prioritized array of bar code types dictating the order in which they will be sought.

Valid bar code types are: TWBT_3OF9, TWBT_2OF5INTERLEAVED, TWBT_2OF5NONINTERLEAVED, TWBT_CODE93, TWBT_CODE128, TWBT_UCC128, TWBT_CODABAR, TWBT_UPCA, TWBT_UPCE, TWBT_EAN8, TWBT_EAN13, TWBT_POSTNET, TWBT_PDF417, TWBT_2OF5INDUSTRIAL, TWBT_2OF5MATRIX, TWBT_2OF5DATALOGIC, TWBT_2OF5IATA, TWBT_3OF9FULLASCII, TWBT_CODABARWITHSTARTSTOP, TWBT_MAXICODE.

For definitions of valid bar code types, see BarcodeInfo.

getSupportedBarcodeTypes()

The following table describes the syntax for getSupportedBarcodeTypes() method:

Syntax Description
public int[] getSupportedBarcodeTypes() throws OperationException, InvalidStateException; Returns an array of the bar code types supported by the scanner.

/Valid bar code types are: TWBT_3OF9, TWBT_2OF5INTERLEAVED, TWBT_2OF5NONINTERLEAVED, TWBT_CODE93, TWBT_CODE128, TWBT_UCC128, TWBT_CODABAR, TWBT_UPCA, TWBT_UPCE, TWBT_EAN8, TWBT_EAN13, TWBT_POSTNET, TWBT_PDF417, TWBT_2OF5INDUSTRIAL, TWBT_2OF5MATRIX, TWBT_2OF5DATALOGIC, TWBT_2OF5IATA, TWBT_3OF9FULLASCII, TWBT_CODABARWITHSTARTSTOP, TWBT_MAXICODE.

For definitions of valid bar code types, see BarcodeInfo.

getBarcodesDetected()

The following table describes the syntax for getBarcodesDetected() method:

Syntax Description
public BarcodeInfo[] getBarcodesDetected(); Returns an array of BarcodeInfo objects describing the bar codes found on the current page by the scanner.

isPatchCodeDetectionEnabled()

The following table describes the syntax for isPatchCodeDetectionEnabled() method:

Syntax Description
public boolean isPatchCodeDetectionEnabled() throws OperationException, InvalidStateException; Returns whether the patch code detection is enabled for the scanner.

getPatchCodeMaxRetries()

The following table describes the syntax for getPatchCodeMaxRetries() method:

Syntax Description
public int getPatchCodeMaxRetries() throws OperationException, InvalidStateException; Returns the number of times a search will be retried if no patch codes are found.

getPatchCodeMaxSearchPriorities()

The following table describes the syntax for getPatchCodeMaxSearchPriorities() method:

Syntax Description
public int getPatchCodeMaxSearchPriorities() throws OperationException, InvalidStateException; Returns the maximum number of supported patch code search priorities.

getPatchCodeSearchMode()

The following table describes the syntax for getPatchCodeSearchMode() method:

Syntax Description
public int getPatchCodeSearchMode() throws OperationException, InvalidStateException; Returns the orientation or orientation priority used for patch code searching.

Possible return values are: TWBD_HORZ, TWBD_VERT, TWBD_HORZVERT, TWBD_VERTHORZ.

For definitions of possible return values, see getBarcodeSearchMode().

getPatchCodeTimeout()

The following table describes the syntax for getPatchCodeTimeout() method:

Syntax Description
public int getPatchCodeTimeout() throws OperationException, InvalidStateException; Returns the maximum amount of time to spend searching for patch codes on a page.

getPatchCodeSearchPriorities()

The following table describes the syntax for getPatchCodeSearchPriorities() method:

Syntax Description
public int[] getPatchCodeSearchPriorities() throws OperationException, InvalidStateException; Returns a prioritized array of patch code types dictating the order in which they will be sought.

Valid patch code types are:
TWPCH_PATCH1 - 0
TWPCH_PATCH2 - 1
TWPCH_PATCH3 - 2
TWPCH_PATCH4 - 3
TWPCH_PATCH6 - 4
TWPCH_PATCHT - 5

getSupportedPatchCodeTypes()

The following table describes the syntax for getSupportedPatchCodeTypes() method:

Syntax Description
public int[] getSupportedPatchCodeTypes() throws OperationException, InvalidStateException; Returns an array of the patch code types supported by the scanner.

Valid patch code types are: TWPCH_PATCH1, TWPCH_PATCH2, TWPCH_PATCH3, TWPCH_PATCH4, TWPCH_PATCH6, TWPCH_PATCHT

For definitions of valid patch code types, see getPatchCodeSearchPriorities().

getPatchCodesDetected()

The following table describes the syntax for getPatchCodesDetected() method:

Syntax Description
public int[] getPatchCodesDetected(); Returns an array containing the first patch code type found on the current page by the scanner. The return value may be null or an empty array if no patch codes were detected.

Valid patch code types are: TWPCH_PATCH1, TWPCH_PATCH2, TWPCH_PATCH3, TWPCH_PATCH4, TWPCH_PATCH6, TWPCH_PATCHT

For definitions of valid patch code types, see getPatchCodeSearchPriorities().

isMicrEnabled()

The following table describes the syntax for isMicrEnabled() method:

Syntax Description
public boolean isMicrEnabled() throws OperationException, InvalidStateException; Returns whether MICR detection is enabled for the scanner.

getMicrDetected()

The following table describes the syntax for getMicrDetected() method:

Syntax Description
public MicrInfo getMicrDetected(); Returns a MicrInfo object describing the magnetic data found on the current page by the scanner.

setPrinter(int printer)

The following table describes the syntax for setPrinter(int printer) method:

Syntax Description
public void setPrinter(int printer) throws InvalidStateException, OperationException; Sets the current imprinter or endorser. Valid values are:

0 - Top Pre-Imprinter
1 - Top Post-Imprinter
2 - Bottom Pre-Imprinter
3 - Bottom Post-Imprinter
4 - Top Pre-Endorser
5 - Top Post-Endorser
6 - Bottom Pre-Endorser
7 - Bottom Post-Endorser

setPrinterIndex(int printerIndex)

The following table describes the syntax for setPrinterIndex(int printerIndex) method:

Syntax Description
public void setPrinterIndex(int printerIndex) throws InvalidStateException, OperationException Sets the counter value of the current imprinter or endorser.

setPrinterMode(int printerMode)

The following table describes the syntax for setPrinterMode(int printerMode) method:

Syntax Description
public void setPrinterMode(int printerMode) throws InvalidStateException, OperationException; Sets the mode of the current imprinter or endorser. Valid values are:

0 - Single string
1 - Multi-line string
2 - Compound string

setPrinterString(String printerString)

The following table describes the syntax for setPrinterString(String printerString) method:

Syntax Description
public void setPrinterString(String printerString) throws InvalidStateException, OperationException; Sets the string or format of a single line to be printed to the current imprinter or endorser.

setPrinterString(String[ ] printerString)

The following table describes the syntax for setPrinterString(String[ ] printerString) method:

Syntax Description
public void setPrinterString(String[] printerString) throws InvalidStateException, OperationException; Sets the format of one or more lines (if capable) to be printed to the current imprinter or endorser.

setPrinterSuffix(String printerSuffix)

The following table describes the syntax for setPrinterSuffix(String printerSuffix) method:

Syntax Description
public void setPrinterSuffix(String printerSuffix) throws InvalidStateException, OperationException; Sets the suffix for the current imprinter or endorser. (Compound string mode only).

setBarcodeDetectionEnabled(boolean enabled)

The following table describes the syntax for setBarcodeDetectionEnabled(boolean enabled) method:

Syntax Description
public void setBarcodeDetectionEnabled(boolean enabled) throws OperationException, InvalidStateException; Enables or disables bar code detection for the scanner.

setBarcodeMaxRetries(int maxRetries)

The following table describes the syntax for setBarcodeMaxRetries(int maxRetries) method:

Syntax Description
public void setBarcodeMaxRetries(int maxRetries) throws InvalidStateException, OperationException; Restricts the number of times a search will be retried if no bar codes are found.

setBarcodeMaxSearchPriorities(int maxSearchPriorities)

The following table describes the syntax for setBarcodeMaxSearchPriorities(int maxSearchPriorities) method:

Syntax Description
public void setBarcodeMaxSearchPriorities(int maxSearchPriorities) throws InvalidStateException, OperationException; Specifies the maximum number of supported bar code search priorities.

setBarcodeSearchMode(int searchMode)

The following table describes the syntax for setBarcodeSearchMode(int searchMode) method:

Syntax Description
public void setBarcodeSearchMode(int searchMode) throws InvalidStateException, OperationException; Restricts bar code searching to certain orientations, or prioritizes one orientation over another.

Valid values are: TWBD_HORZ, TWBD_VERT, TWBD_HORZVERT, TWBD_VERTHORZ

For definitions of valid values, see getBarcodeSearchMode().

setBarcodeTimeout(int timeout)

The following table describes the syntax for setBarcodeTimeout(int timeout) method:

Syntax Description
public void setBarcodeTimeout(int timeout) throws InvalidStateException, OperationException; Restricts the total time spent on searching for bar codes on a page.

setBarcodeSearchPriorities(int[] value)

The following table describes the syntax for setBarcodeSearchPriorities(int[] value) method:

Syntax Description
public void setBarcodeSearchPriorities(int[] value) throws OperationException, InvalidStateException; Sets a prioritized array of bar code types dictating the order in which they will be sought.
Valid bar code types are: TWBT_3OF9,
TWBT_2OF5INTERLEAVED,
TWBT_2OF5NONINTERLEAVED,
TWBT_CODE93,
TWBT_CODE128,
TWBT_UCC128,
TWBT_CODABAR,
TWBT_UPCA,
TWBT_UPCE,
TWBT_EAN8,
TWBT_EAN13,
TWBT_POSTNET,
TWBT_PDF417,
TWBT_2OF5INDUSTRIAL,
TWBT_2OF5MATRIX,
TWBT_2OF5DATALOGIC,
TWBT_2OF5IATA,
TWBT_3OF9FULLASCII,
TWBT_CODABARWITHSTARTSTOP,
TWBT_MAXICODE
For definitions of valid bar code types, see BarcodeInfo.

setPatchCodeDetectionEnabled(boolean enabled)

The following table describes the syntax for setPatchCodeDetectionEnabled(boolean enabled) method:

Syntax Description
public void setPatchCodeDetectionEnabled(boolean enabled) throws OperationException, InvalidStateException; Enables or disables patch code detection for the scanner.

setPatchCodeMaxRetries(int maxRetries)

The following table describes the syntax for setPatchCodeMaxRetries(int maxRetries) method:

Syntax Description
public void setPatchCodeMaxRetries(int maxRetries) throws InvalidStateException, OperationException; Restricts the number of times a search will be retried if no patch codes are found.

setPatchCodeMaxSearchPriorities(int maxSearchPriorities)

The following table describes the syntax for setPatchCodeMaxSearchPriorities(int maxSearchPriorities) method:

Syntax Description
public void setPatchCodeMaxSearchPriorities(int maxSearchPriorities) throws InvalidStateException, OperationException; Specifies the maximum number of supported patch code search priorities.

setPatchCodeSearchMode(int searchMode)

The following table describes the syntax for setPatchCodeSearchMode(int searchMode) method:

Syntax Description
public void setPatchCodeSearchMode(int searchMode) throws InvalidStateException, OperationException; Restricts patch code searching to certain orientations, or prioritizes one orientation over another.
Valid values are: TWBD_HORZ, TWBD_VERT, TWBD_HORZVERT, TWBD_VERTHORZ
For definitions of valid values, see getBarcodeSearchMode().

setPatchCodeTimeout(int timeout)

The following table describes the syntax for setPatchCodeTimeout(int timeout) method:

Syntax Description
public void setPatchCodeTimeout(int timeout) throws InvalidStateException, OperationException; Restricts the total time spent on searching for patch codes on a page.

setPatchCodeSearchPriorities(int[] value)

The following table describes the syntax for setPatchCodeSearchPriorities(int[] value) method:

Syntax Description
public void setPatchCodeSearchPriorities(int[] value) throws OperationException, InvalidStateException; Sets a prioritized array of patch code types dictating the order in which they will be sought.
Valid patch code types are: TWPCH_PATCH1, TWPCH_PATCH2, TWPCH_PATCH3, TWPCH_PATCH4, TWPCH_PATCH6, TWPCH_PATCHT
For definitions of valid patch code types, see getPatchCodeSearchPriorities().

setMicrEnabled(boolean enabled)

The following table describes the syntax for setMicrEnabled(boolean enabled) method:

Syntax Description
public void setMicrEnabled(boolean enabled) throws OperationException, InvalidStateException; Enables or disables MICR detection for the scanner.

3.3.36 TWAINSource

The TWAINSource class is an instance of ImageCaptureSource, and it represents the source used by TWAIN scanning.

Property Type Description
deviceSource Source The low-level object used to interact with a TWAIN scanner.

3.4 Capture Client FieldEdit Classes

The FieldEdit class is the user interface component for entering metadata values. This section describes the following Capture Client FieldEdit classes:

3.4.1 DataField

The DataField class represents the data for a single field of the FieldEdit component and is the base class for the various field types.

Property Type Description
caption String The field caption.
fieldName String The field name.
displayFormat Format The display format for the field.
inputMask String The input mask.
fieldLock boolean If True, the field is locked.
maxLength Long The maximum length of the field.
required boolean If True, this field is required to be entered.
uncommittedText String The current text in the field.

3.4.2 DateField

The DataField class extends from DataField and represents a date field.

Property Type Description
value Date The value, represented by a Date object.

3.4.3 FloatField

This FloatField class extends from DataField and represents a float field.

Property Type Description
value Float The value, represented by a Float object.

3.4.4 IntegerField

The IntegerField class extends from DataField and represents an integer field.

Property Type Description
value Integer The value, represented by an Integer object.

3.4.5 PicklistEntry

The PicklistEntry class is used in picklist-type fields to determine the display and commit values. This class includes the following methods:

getCommitValue()

The following table describes the syntax for getCommitValue() method:

Syntax Description
public String getCommitValue() Returns the commit value of the choice list entry.

getDisplayValue()

The following table describes the syntax for getDisplayValue() method:

Syntax Description
public String getDisplayValue() Returns the display value of the choice list entry.

3.4.6 PicklistField

The PicklistField class extends from DataField and represents a Pick-list (Choice List) field.

Property Type Description
pickListCaseSensitive boolean If True, the contents of this list are sensitive to case.
pickListEntries List<PicklistEntry> The list of entries in the choice list.
value PicklistEntry The current value of the choice list.

3.4.7 TextField

This TextField class extends from DataField and represents an alphanumeric field.

Property Type Description
value String The alphanumeric value of the field.

3.5 Sample Client Scripts

The section describes the following sample client scripts:

3.5.1 Sample Client Script 1

This sample script customizes client behavior in the following ways:

Note that this script also writes out a line (printIn) to the java console for each script event, for verification or debugging purposes.


function ScriptStart() {
    java.lang.System.out.println("ScriptStart");
}

function PreBatchScan(event) { // BatchScanEvent
    java.lang.System.out.println("PreBatchScan");
}
 
function BatchScanBegin(event) { // BatchScanEvent
    java.lang.System.out.println("BatchScanBegin");
}
 
function BatchScanComplete(event) { // BatchScanEvent
    java.lang.System.out.println("BatchScanComplete");
    java.lang.System.out.println(event.getBatch().getBatchName() + " finished Scanning.");
}
 
function BatchSelected(event) { // BatchSelectedEvent
    java.lang.System.out.println("BatchSelected: " + event.getBatch().getBatchName());
}
 
function PreBatchDelete(event) { // BatchDeleteEvent
    java.lang.System.out.println("PreBatchDelete");
}
 
function CaptureImage(event) { // ImageCaptureEvent
    java.lang.System.out.println("CaptureImage");
}
 
function DocumentCreated(event) { // CaptureDocument
    java.lang.System.out.println("DocumentCreated");
}
 
function DocumentSelected(event) { // DocumentSelectedEvent
    java.lang.System.out.println("DocumentSelected: " + event.getDocument().getTitle());
}
 
function FieldGotFocus(event) { // FieldEvent
    java.lang.System.out.println("FieldGotFocus");
}
 
function FieldLostFocus(event) { // FieldEvent
    var dataField;
    java.lang.System.out.println("FieldLostFocus");
    dataField = event.getField();
    if (dataField.getUncommittedText().equalsIgnoreCase("test")) {
        event.setCancel(true);
        java.lang.System.out.println("invalid value. script will not allow leaving focus.");
    }
}
 
function FieldProcessKey(event) { // FieldEvent
    var keyEvent;
    // java.lang.System.out.println("FieldProcessKey");
    keyEvent = event.getKeyEvent();
    if (keyEvent.getID() == java.awt.event.KeyEvent.KEY_TYPED) {
        //java.lang.System.out.println(keyEvent.getKeyChar());
        if (new java.lang.Character(keyEvent.getKeyChar()).equals(new java.lang.Character('*'))) {
            java.lang.System.out.println("Asterisk not allowed in any field.");
            keyEvent.consume();
        }
    }
}
 
function PostCaptureImage(event) { // ImageCaptureEvent
    java.lang.System.out.println("PostCaptureImage");
}
 
function PreCaptureImage(event) { // ImageCaptureEvent
    java.lang.System.out.println("PreCaptureImage");
}
 
 
function PreUploadItem(event) { // UploadItemEvent
    java.lang.System.out.println("PreUploadItem: " + event.getCaptureItem().getFilename());
}
 
function PostUploadItem(event) { // UploadItemEvent
    java.lang.System.out.println("PostUploadItem: " + event.getCaptureItem().getFilename());
}
    
function DBSearchComplete(searchEvent) { // DBSearchEvent
    java.lang.System.out.println("DBSearchComplete.");
}
 
function DBSearchResults(searchEvent) { // DBSearchEvent
    var results;
    var resultRow;
    var searchParameters;
 
    java.lang.System.out.println("DBSearchResult");
 
    results = searchEvent.getRowResults();
    java.lang.System.out.println("Found " + results.size() + " results.");
}
 
function DBSearchStart(searchEvent) {  // DBSearchEvent
    java.lang.System.out.println("DBSearchStart");
    java.lang.System.out.println("Metadata value being sought: " + searchEvent.getMetadataValue());
}
 
function DocumentRemoved(event) { // DocumentRemovedEvent
    java.lang.System.out.println("DocumentRemoved");
}
 
function PostDownloadItem(event) { // DownloadItemEvent
    java.lang.System.out.println("PostDownloadItem: " + event.getCaptureItem().getFilename());
}
 
function PreDownloadItem(event) { // DownloadItemEvent
    java.lang.System.out.println("PreDownloadItem: " + event.getCaptureItem().getFilename());
}
 
function RegionSelected(event) { // RegionSelectedEvent
    java.lang.System.out.println("RegionSelected");
    var rect = event.getSelectionRectangle();
    java.lang.System.out.println("Rectangle (X,Y): (" + rect.getX() + "," + rect.getY() + 
        "); (W,H): (" + rect.getWidth() + "," + rect.getHeight() + ")");
}
 
function PreReleaseBatch(event) { // ReleaseBatchEvent
    // Skips the postProcess setting specified in the Capture profile and only unlocks the batch.
    event.setProcessorID(null);
    event.setJobID(null);
}

3.5.2 Sample Client Script 2

This sample script customizes client behavior in the following ways:

function BatchScanBegin(event) { // BatchScanEvent
    // Check if there are files being imported.
    var sourceFilesList = event.getSourceFiles();
    if (sourceFilesList != null) {
        // Create a list to hold the filtered results.
        var filteredList = new java.util.ArrayList();
        
        // Loop through each of the files.
        var iterator = sourceFilesList.iterator();
        while (iterator.hasNext()) {
            // If the file name ends with ".TIF", add it to the list.
            var file = iterator.next();
            var filename = file.getName().toUpperCase();
            if (filename.endsWith(".TIF")) {
                filteredList.add(file);
            }
        }
        
        // Replace the original list with the filtered list.
        event.setSourceFiles(filteredList);
    }
}
 
function DBSearchResults(searchEvent) { // DBSearchEvent
    var results;
    var resultRow;
    var searchParameters;
 
    // Return only the first search result.
    results = searchEvent.getRowResults();
    if (results.size() > 0) {
        resultRow = results.get(0);
        results.clear();
        results.add(resultRow);
        // Do not display the list of results to the user.
        searchEvent.setDisplayHitlist(false);
    }
}

3.5.3 Sample Client Script 3

This sample script customizes client behavior in the following ways:

function PreReleaseBatch(event) {
    // Metadata fields to copy to remaining documents
    var fieldsToCopy = new Array("Account Name", "Account Number");
    
    // Loop through each batch being released
    var batches = event.getBatches();
    for (var batchIdx = 0; batchIdx < batches.size(); batchIdx++) {
        var batch = batches.get(batchIdx);
        var documents = batch.getDocuments();
        if (documents.size() == 0)
            continue;
        // Get the first document from which we'll be copying
        var firstDocument = documents.get(0);
        var captureFields = [];
        // Create an array of the first document's fields
        var fieldDefs = batch.getWorkspace().getFieldDefinitions();
        for (var fieldIdx = 0; fieldIdx < fieldsToCopy.length; fieldIdx++) {
            var fieldID = fieldDefs.findByName(fieldsToCopy[fieldIdx]).getId();
            captureFields[fieldIdx] = firstDocument.getFields().get(fieldID);
        }
        // Loop through the remaining documents in the batch
        for (var documentIdx = 1; documentIdx < documents.size(); documentIdx++) {
            var destDocument = documents.get(documentIdx);
            var fields = destDocument.getFields();
            // Copy the source document's field values to the destination document
            for (var fieldIdx = 0; fieldIdx < captureFields.length; fieldIdx++) {
                var sourceField = captureFields[fieldIdx];
                // If the field in the source document was never set, skip it.
                if (sourceField == null)
                    continue;
                // Look up the field in the document
                var destField = fields.get(sourceField.getFieldName());
                // If it doesn't exist yet, create it
                if (destField == null)
                    destField = fields.add(sourceField.getFieldName());
                // If the value hasn't been set yet, set it
                if ((destField.getValue() == null) || (destField.getValue().isEmpty())) {
                    destField.setValue(sourceField.getValue());
                    destField.setDisplayValue(sourceField.getDisplayValue());
                }
            }
            // Save the document.
            destDocument.persist();
        }
    }
}