Oracle® Fusion Middleware

Developing Scripts for Oracle WebCenter Enterprise Capture

11g Release 1 (11.1.1)

E28275-04

October 2017

Documentation for Oracle WebCenter Enterprise Capture developers that describes how to develop scripts for customizing Capture functionality.

Oracle Fusion Middleware Developing Scripts for Oracle WebCenter Enterprise Capture, 11g Release 1 (11.1.1)

E28275-04

Copyright © 2013, 2017, Oracle and/or its affiliates. All rights reserved.

Primary Author: Sacheth S

Contributor: Oracle WebCenter development, product management, and quality assurance teams

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

Contents

Preface

- Audience

- Documentation Accessibility

- Related Documents

- Conventions

What's New In This Guide

- New and Changed Features for 11g Release 1 (11.1.1.9) - October 2017 Patch

- New and Changed Features for 11g Release 1 (11.1.1.9)

- Other Significant Changes in this Document for 11g Release 1 (11.1.1.9)

1 Introduction to Developing Scripts with Oracle WebCenter Enterprise Capture

- 1.1 Developing Scripts with WebCenter Enterprise Capture

2 Integrating the Client With Other Web Applications

- 2.1 Configuring a Client Integration

- 2.1.1 Example Client Integration Web Address

3 Creating Client Scripts

- 3.1 Client Events

- 3.1.1 BatchScanBegin

- 3.1.2 BatchScanComplete

- 3.1.3 BatchSelected

- 3.1.4 CaptureImage

- 3.1.5 DBSearchComplete

- 3.1.6 DBSearchResults

- 3.1.7 DBSearchStart

- 3.1.8 DocumentCreated

- 3.1.9 DocumentRemoved

- 3.1.10 DocumentSelected

- 3.1.11 FieldGotFocus

- 3.1.12 FieldLostFocus

- 3.1.13 FieldProcessKey

- 3.1.14 PreBatchDelete

- 3.1.15 PreCaptureImage

- 3.1.16 PreDocumentRemove

- 3.1.17 PreDownloadItem

- 3.1.18 PrePageDelete

- 3.1.19 PreReleaseBatch

- 3.1.20 PreUploadItem

- 3.1.21 PostCaptureImage

- 3.1.22 PostDownloadItem

- 3.1.23 PostUploadItem

- 3.1.24 RegionSelected

- 3.1.25 ScriptStart

- 3.2 Event Classes

- 3.2.1 BatchDeleteEvent

- 3.2.2 BatchScanEvent

- 3.2.3 BatchSelectedEvent

- 3.2.4 DBSearchEvent

- 3.2.5 DocumentRemovedEvent

- 3.2.6 DocumentSelectedEvent

- 3.2.7 DownloadItemEvent

- 3.2.8 FieldEvent

- 3.2.9 ImageCaptureEvent

- 3.2.10 PageDeleteEvent

- 3.2.11 PreDocumentRemoveEvent

- 3.2.12 RegionSelectedEvent

- 3.2.13 ReleaseBatchEvent

- 3.2.14 UploadItemEvent

- 3.3 Capture Client Core Classes

- 3.3.1 CaptureBatch

- 3.3.2 CaptureBatchStatus

- 3.3.3 CaptureDataType

- 3.3.4 CaptureDocument

- 3.3.5 CaptureDocumentPage

- 3.3.6 CaptureDocumentPages

- 3.3.7 CaptureDocuments

- 3.3.8 CaptureErrorManager

- 3.3.9 CaptureField

- 3.3.10 CaptureFields

- 3.3.11 CaptureItem

- 3.3.12 CaptureItems

- 3.3.13 CaptureOperation

- 3.3.14 CaptureStateManager

- 3.3.15 CaptureWorkspace

- 3.3.16 ClientProfile

- 3.3.17 ClientUI

- 3.3.18 DBLookupProfile

- 3.3.19 DBLookupResult

- 3.3.20 DbSearchResultRow

- 3.3.21 DbSearchFieldInfo

- 3.3.22 DocumentType

- 3.3.23 DocumentTypes

- 3.3.24 FieldDefinition

- 3.3.25 FieldDefinitions

- 3.4 Capture Client FieldEdit Classes

- 3.4.1 DataField

- 3.4.2 DateField

- 3.4.3 FloatField

- 3.4.4 IntegerField

- 3.4.5 PicklistEntry

- 3.4.6 PicklistField

- 3.4.7 TextField

- 3.5 Sample Client Scripts

- 3.5.1 Sample Client Script 1

- 3.5.2 Sample Client Script 2

4 Creating Recognition Processor Scripts

- 4.1 Recognition Processor Methods

- 4.1.1 initialize

- 4.1.2 processBatch

- 4.1.3 restoreCaptureBatch

- 4.1.4 beginPhase

- 4.1.5 endPhase

- 4.1.6 extractBatchItem

- 4.1.7 barcodesFoundOnItem

- 4.1.8 batchItemAllValidBarcodes

- 4.1.9 determineSeparatorPage

- 4.1.10 batchItemValidBarcode

- 4.1.11 determineDocType

- 4.1.12 beginDatabaseLookup

- 4.1.13 determineIndexValues

- 4.1.14 renameOrigCaptureDocTitle

- 4.1.15 createCaptureDoc

- 4.1.16 postProcess

- 4.1.17 endBatchProcess

- 4.2 Recognition Processor Classes

- 4.2.1 BarcodeDefinition

- 4.2.2 DocumentDefinition

- 4.2.3 PostProcessContext

- 4.2.4 ProcessorDocument

- 4.2.5 ProcessorItem

- 4.2.6 ProcessorSeparatorPage

- 4.2.7 RecognitionJob

- 4.2.8 RecognitionJobField

- 4.2.9 RecognitionProcessorContext

- 4.2.10 SeparatorDefinition

- 4.2.11 SeparatorRuleDefinition

- 4.3 Sample Recognition Processor Script

5 Creating Import Processor Scripts

- 5.1 Import Processor Events

- 5.1.1 preProcess

- 5.1.2 process

- 5.1.3 postProcess

- 5.1.4 preCreateBatch

- 5.1.5 postCreateBatch

- 5.1.6 preCreateDocument

- 5.1.7 postCreateDocument

- 5.1.8 preImportFile

- 5.1.9 postImportFile

- 5.1.10 preRelease

- 5.1.11 postRelease

- 5.1.12 preDatabaseSearch

- 5.1.13 processDatabaseSearchResults

- 5.2 Email Source Events

- 5.2.1 deleteMessage

- 5.2.2 moveMessage

- 5.2.3 newAttachment

- 5.2.4 newMessage

- 5.3 Folder Source Events

- 5.3.1 deleteDocumentFile

- 5.3.2 newFolder

- 5.3.3 renameDocumentFile

- 5.4 List File Source Events

- 5.4.1 deleteListFile

- 5.4.2 newFolder

- 5.4.3 newListFile

- 5.4.4 newListFileLine

- 5.4.5 renameListFile

- 5.5 Import Processor Classes

- 5.5.1 EmailSourceContext

- 5.5.2 FolderSourceContext

- 5.5.3 ImportJob

- 5.5.4 ImportProcessorContext

- 5.5.5 ListFileSourceContext

- 5.6 Sample Import Processor Script

6 Working with Common Capture Classes

- 6.1 Common Capture Classes

- 6.1.1 BatchEntity

- 6.1.2 BatchItemEntity

- 6.1.3 BatchLockEntity

- 6.1.4 BatchStatusEntity

- 6.1.5 CaptureWorkspaceEntity

- 6.1.6 DBSearchResults

- 6.1.7 DBSearchResultRow

- 6.1.8 DBSearchFieldInfo

- 6.1.9 DocumentEntity

- 6.1.10 DocumentPageEntity

- 6.1.11 DocumentTypeEntity

- 6.1.12 IndexDefinitionEntity

- 6.1.13 IndexValue

A Keycodes

Preface

This guide contains information to develop scripts to customize Oracle WebCenter Enterprise Capture components.

Audience

This guide is intended for developers responsible for customizing Oracle WebCenter Enterprise Capture functionality.

Documentation Accessibility

For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support

Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.

Related Documents

For more information, see the following documents in the Oracle WebCenter Enterprise Capture 11g Release 1 (11.1.1) documentation set:

- Oracle Fusion Middleware Administering Oracle WebCenter Enterprise Capture

- Oracle Fusion Middleware Using Oracle WebCenter Enterprise Capture

- Oracle Fusion Middleware Managing Oracle WebCenter Enterprise Capture

Conventions

The following text conventions are used in this document:

Convention

Meaning

boldface

Boldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary.

italic

Italic type indicates book titles, emphasis, or placeholder variables for which you supply particular values.

monospace

Monospace type indicates commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter.

getter/setter pattern

Getter/setter pattern indicates properties that uses this pattern. For example, to access the title property of the Document class from code use the following:
title = document.getTitle();

What's New In This Guide

This section summarizes the new and changed features of Oracle WebCenter Enterprise Capture, other significant changes that are described in this guide, and provides pointers to additional information.

It contains the following topics:

- New and Changed Features for 11g Release 1 (11.1.1.9) - October 2017 Patch

- New and Changed Features for 11g Release 1 (11.1.1.9)

- Other Significant Changes in this Document for 11g Release 1 (11.1.1.9)

New and Changed Features for 11g Release 1 (11.1.1.9) - October 2017 Patch

This section describes the following new and changed features for Oracle WebCenter Enterprise Capture 11g Release 1 (11.1.1.9) patch:

- Added the following Client Events:

- PreDocumentRemove

- PrePageDelete

- Added the following Event Classes:

- PageDeleteEvent

- PreDocumentRemoveEvent

New and Changed Features for 11g Release 1 (11.1.1.9)

This section describes the following new and changed features for Oracle WebCenter Enterprise Capture 11g Release 1 (11.1.1.9):

- Oracle WebCenter Capture was rebranded to Oracle WebCenter Enterprise Capture.

Other Significant Changes in this Document for 11g Release 1 (11.1.1.9)

For 11g Release 1 (11.1.1.9), following are the sections that have been added or changed:

- Revised the organization of the book.

- Added a new chapter to describe the common classes that pertain to the Recognition Processor and the Import Processor. See Section 6.1, "Common Capture Classes."

- Modified the DocumentCreated parameter. See Section 3.1.8, "DocumentCreated" and Section 3.5.1, "Sample Client Script 1."

- Modified the postProcess parameter. See Section 4.1.16, "postProcess."

- Added information on the PreReleaseBatch event. See Section 3.1.19, "PreReleaseBatch" and Section 3.5.1, "Sample Client Script 1."

- Added information on the following classes:

- ReleaseBatchEvent. See Section 3.2.13, "ReleaseBatchEvent."

- ClientProfile. See Section 3.3.16, "ClientProfile."

- ClientUI. See Section 3.3.17, "ClientUI."

- RecognitionProcessorContext. See Section 4.2.9, "RecognitionProcessorContext."

- BatchLockEntity. See Section 6.1.3, "BatchLockEntity."

1 Introduction to Developing Scripts with Oracle WebCenter Enterprise Capture

This chapter provides an introduction to developing scripts for Oracle WebCenter Enterprise Capture.

A script is a custom piece of code consumed by the Capture client or batch processor (Import or Recognition) that allows you to customize functionality beyond existing configuration settings. For example, you might incorporate a script to change the first letter of a name to uppercase or to use a proprietary calculation to validate an account number used in a transaction.

For scripting, Capture uses the JavaScript script engine included with the Java Runtime Environment. Refer to the Oracle Java documentation for more information.

Scripts can be incorporated in the following Capture components:

- Client
Client Scripts are JavaScript modules that enable you to customize the behavior of certain client events. To use one or more scripts in a client profile, a workspace manager selects and orders them in an extension profile.

- Recognition Processor
Recognition Processor scripts allow you to customize the behavior of certain recognition job events.

- Import Processor
Import Processor scripts allow you to customize the behavior of certain import job events.

For more information on incorporating scripts in Capture, see Oracle Fusion Middleware Managing Oracle WebCenter Enterprise Capture.

1.1 Developing Scripts with WebCenter Enterprise Capture

The following are the main steps for developing and incorporating scripts in Capture components:

1. For each Capture component, write the JavaScript using the events and classes. For more information, refer to the following component's chapter:

- Chapter 3, "Creating Client Scripts"

- Chapter 4, "Creating Recognition Processor Scripts"

- Chapter 5, "Creating Import Processor Scripts"

2. On the Advanced tab of a selected workspace in the WebCenter Enterprise Capture Workspace Console, a workspace manager adds the script by identifying its component type and loading the script file.
For more information, see Oracle Fusion Middleware Managing Oracle WebCenter Enterprise Capture.

3. In a client profile or an import or recognition processor job, the workspace manager then selects the script for use.
Note that workspace managers can incorporate multiple client scripts in a client profile and specify the order in which they are executed. For more information, see Oracle Fusion Middleware Managing Oracle WebCenter Enterprise Capture.

2 Integrating the Client With Other Web Applications

This chapter discusses how to configure the client to launch from another web application.

The web application invokes the client through a web address. Parameters such as the workspace, capture source, client profile, document profile, and optional metadata values are passed within the address.

For example, you might add a Scan button to a line of business web application. After completing business application entry fields, the user clicks Scan. The client window displays to the user and Capture immediately begins scanning a document using a specified scanner and settings in the client profile specified in the web address. Once scanned, the document is displayed in the document pane. Metadata fields are automatically populated with user entries, which were passed in the web address. The user reviews the document and completes other metadata fields, then releases the batch, scans additional batches, or closes the browser. Upon close, the user returns to the line of business web application.

2.1 Configuring a Client Integration

To configure an integration between a web application and the Capture client:

1. In the web application, add a launching point, such as a Scan button, from which to activate the client.

2. Configure the web address and its parameters.
Parameters are listed and described in Table 2-1.

See the example integration configuration in Section 2.1.1.

3. If needed, configure Single Sign-on (SSO) to prevent users from having to sign in to Capture before beginning scanning.

Table 2-1 Client Integration URL Parameters

Parameter

Description

CaptureWorkspace

Specifies the workspace to which to capture documents.

ClientProfile

Optionally specifies the client profile with which to capture documents. If you specify a profile, the Client Profile field does not display in the client's batch pane. If no profile is specified, the client uses the client profile that was last used by the user on the system.

CaptureDriver

Specifies the driver to use to capture documents.

- For importing, specify CAPTURE_IMPORT_DRIVER.

- For TWAIN scanning, specify CAPTURE_TWAIN_DRIVER.

If neither driver ID or source name are specified, the last used driver and source are used.

CaptureSource

Specify the source to use to capture documents, based on the selected CaptureDriver.

- For importing, specify Import Source.

- For TWAIN scanning, specify the scanner name. This is the same scanner name as identified in the client's Capture Source options.

If neither driver ID or source name are specified, the client uses the driver and source that were last used by the user on the system.

SignOutOnRelease

Specify whether the business user is signed out of Capture after releasing a batch.

- If you specify false or 0 (default), the user remains signed in after releasing a batch by clicking the Release icon.

- If you specify true or 1, the user is signed out after a batch is released and the SignOutAction is performed, if specified.

SignOutAction

Specifies the action that occurs after the user is signed out.

- If you specify CloseBrowser, the browser is closed and the user returns to the web application.
Note that SignOutAction and CloseBrowser options function in Internet Explorer. In Firefox, they function if the client integration was launched through JavaScript.

- If you specify a URL, the window is redirected to the specified URL.

ShowAllBatches

Specifies if batches display in a list to client users in the batch pane.

- If you specify false or 0 (default), the batch list is initially empty and only shows batches scanned during the session.

- If you specify true or 1, the batch list shows all the batches the user is allowed to see.

DocumentProfile

Specifies the document profile for users to use to index documents.

- If you specify a document profile, the Document Profile field does not display in the client's metadata pane.

- If no profile is specified, the client uses the document profile that was last used by the user on the system.

Other

Any other characters included in the URL are assumed to be a metadata names and values.

2.1.1 Example Client Integration Web Address

Here is an example URL. (Note that this URL should be all on one line.)

http://svr-capture:16400/dc-client/faces/dc-client?CaptureWorkspace=Accounting&ClientProfile=Import%20Invoices&CaptureDriver=CAPTURE_IMPORT_DRIVER&CaptureSource=Import%20Source&SignOutOnRelease=1&SignOutAction=CloseBrowser&Company=MyCompany&Dept=Accounting

This web address configures the client integration as follows:

- CaptureWorkspace=Accounting - Specifies Accounting as the workspace to which to capture documents.

- ClientProfile=Import Invoices - Specifies Import Invoices as the client profile to use.

- CaptureDriver=CAPTURE_IMPORT_DRIVER - Specifies CAPTURE_IMPORT_DRIVER as the capture source for importing and CAPTURE_TWAIN_DRIVER for TWAIN scanning.

- CaptureSource=Import Source - Specifies Import Source as the capture source.

- SignOutOnRelease=1&SignOutAction=CloseBrowser - 1&SignOutAction=CloseBrowser specifies that the user is signed out after releasing a batch and the browser closes.

- Company=MyCompany - Passes a value of MyCompany for the Company metadata field.

- Dept=Accounting - Passes a value of Accounting for the Dept metadata field.

3 Creating Client Scripts

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

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

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 Oracle Fusion Middleware Managing Oracle WebCenter Enterprise Capture.

This chapter includes the following sections:

- Section 3.1, "Client Events"

- Section 3.2, "Event Classes"

- Section 3.3, "Capture Client Core Classes"

- Section 3.4, "Capture Client FieldEdit Classes"

- Section 3.5, "Sample Client Scripts"

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:

- BatchScanBegin

- BatchScanComplete

- BatchSelected

- CaptureImage

- DBSearchComplete

- DBSearchResults

- DBSearchStart

- DocumentCreated

- DocumentRemoved

- DocumentSelected

- FieldGotFocus

- FieldLostFocus

- FieldProcessKey

- PreBatchDelete

- PreCaptureImage

- PreDocumentRemove

- PreDownloadItem

- PrePageDelete

- PreReleaseBatch

- PreUploadItem

- PostCaptureImage

- PostDownloadItem

- PostUploadItem

- RegionSelected

- ScriptStart

3.1.1 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.2 BatchScanComplete

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

Syntax

Parameter

public void BatchScanComplete(BatchScanEvent event);

BatchScanEvent event

3.1.3 BatchSelected

The BatchSelected event occurs when a batch has been selected.

Syntax

Parameter

public void BatchSelected(BatchSelectedEvent event);

BatchScanEvent event

3.1.4 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.5 DBSearchComplete

The DBSearchComplete event occurs when the database search has completed, just before the results are to be processed.

Syntax

Parameter

public void DBSearchComplete(DBSearchEvent event);

DBSearchEvent event

3.1.6 DBSearchResults

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

Syntax

Parameter

public void DBSearchResults(DBSearchEvent event);

DBSearchEvent event

3.1.7 DBSearchStart

The DBSearchStart event occurs just before a database search.

Syntax

Parameter

public void DBSearchStart(DBSearchEvent event);

DBSearchEvent event

3.1.8 DocumentCreated

The DocumentCreated event occurs after a document has been created.

Syntax

Parameter

public void DocumentCreated(CaptureDocument document);

CaptureDocument document

3.1.9 DocumentRemoved

The DocumentRemoved event occurs after a document has been removed.

Syntax

Parameter

public void DocumentRemoved(DocumentRemovedEvent event);

DocumentRemovedEvent event

3.1.10 DocumentSelected

The DocumentSelected event occurs when a document has been selected.

Syntax

Parameter

public void DocumentSelected(DocumentSelectedEvent event);

DocumentSelectedEvent event

3.1.11 FieldGotFocus

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

Syntax

Parameter

public void FieldGotFocus(FieldEvent event);

FieldEvent event

3.1.12 FieldLostFocus

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

Syntax

Parameter

public void FieldLostFocus(FieldEvent event);

FieldEvent event

3.1.13 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.14 PreBatchDelete

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

Syntax

Parameter

public void PreBatchDelete(BatchDeleteEvent event);

BatchDeleteEvent event

3.1.15 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.16 PreDocumentRemove

The PreDocumentRemove event occurs when one or more documents are about to be deleted.

Syntax

Parameter

public void PreDocumentRemove(PreDocumentRemoveEvent event);

PreDocumentRemoveEvent event

3.1.17 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.18 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.19 PreReleaseBatch

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

Syntax

Parameter

public void PreReleaseBatch(ReleaseBatchEvent event);

ReleaseBatchEvent event

3.1.20 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.21 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.22 PostDownloadItem

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

Syntax

Parameter

public void PostDownloadItem(DownloadItemEvent event);

DownloadItemEvent event

3.1.23 PostUploadItem

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

Syntax

Parameter

public void PostUploadItem(UploadItemEvent event);

UploadItemEvent event

3.1.24 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.25 ScriptStart

The ScriptStart event occurs when scripting is first initialized.

Syntax

public void ScriptStart();

3.2 Event Classes

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

- BatchDeleteEvent

- BatchScanEvent

- BatchSelectedEvent

- DBSearchEvent

- DocumentRemovedEvent

- DocumentSelectedEvent

- DownloadItemEvent

- FieldEvent

- ImageCaptureEvent

- PageDeleteEvent

- PreDocumentRemoveEvent

- RegionSelectedEvent

- ReleaseBatchEvent

- UploadItemEvent

3.2.1 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.2 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.

3.2.3 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.4 DBSearchEvent

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

Property

Type

Description

displayHitlist

boolean

If set to True, displays the database lookup results.

exactMatch

boolean

If set to True, the search value must be an exact match.

metadataID

String

ID 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.5 DocumentRemovedEvent

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

Property

Type

Description

document

CaptureDocument

The document being removed from the batch.

3.2.6 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.7 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.8 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.9 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.

3.2.10 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.11 PreDocumentRemoveEvent

The PreDocumentRemoveEvent class is used when one or more documents are being deleted.

Property

Type

Description

selectedDocuments

List<CaptureDocument>

The list of selected documents about to be removed from the batch.

canceled

Boolean

If set to True, no documents will be deleted.

3.2.12 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.13 ReleaseBatchEvent

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

Property

Type

Description

batches

List<CaptureBatch>

The list of batches that are about to be released.

processorID

String

ID of the processor to which the batches will get released.

jobID

String

ID of the processor job.

canceled

boolean

If the flag is set to True, the release will be canceled.

3.2.14 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:

- CaptureBatch

- CaptureBatchStatus

- CaptureDataType

- CaptureDocument

- CaptureDocumentPage

- CaptureDocumentPages

- CaptureDocuments

- CaptureErrorManager

- CaptureField

- CaptureFields

- CaptureItem

- CaptureItems

- CaptureOperation

- CaptureStateManager

- CaptureWorkspace

- ClientProfile

- ClientUI

- DBLookupProfile

- DBLookupResult

- DbSearchResultRow

- DbSearchFieldInfo

- DocumentType

- DocumentTypes

- FieldDefinition

- FieldDefinitions

3.3.1 CaptureBatch

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

Property

Type

Description

batchId

String

The internal ID 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

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.2 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 ID of the status.

3.3.3 CaptureDataType

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

- NUMERIC

- ALPHA

- ALPHANUMERIC

- DATE

- FLOAT

3.3.4 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 ID 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.

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.5 CaptureDocumentPage

The CaptureDocumentPage class contains the properties of a document page.

Property

Type

Description

imageFilenameKey

String

The local filename for this page.

pageID

String

The internal ID for the page.

pageNumber

Integer

The number of the page within the document.

parentDocument

CaptureDocument

The document that contains this page.

3.3.6 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.7 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.8 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.9 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.10 CaptureFields

The CaptureField 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.11 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.

3.3.12 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.13 CaptureOperation

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

- Create

- Append

- Insert

- Replace

3.3.14 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

activeBatch

CaptureBatch

The active batch.

activeDocument

CaptureDocument

The active document.

activeDocumentType

DocumentType

The active document profile.

activePage

CaptureDocumentPage

The active document page.

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 ID 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.15 CaptureWorkspace

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

Property

Type

Description

id

String

The internal ID 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 ID of the database lookup profile.

3.3.16 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.

batchProcessorID

String

The ID of the batch processor to use during post-processing.

batchProcessorJobID

String

The ID of the batch processor's job to use during post-processing.

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 ID 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 ID 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 type CONVERT 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 IDs which represent the document profiles that this profile can assign to a batch.

workspaceId

String

The ID of the workspace in which this profile is associated.

workspaceName

String

The name of the workspace in which this profile is associated.

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.17 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()

- setActiveMetadataFieldByName()

- setActiveMetadataFieldByID()

- execDBSearch()

- execDBSearch()

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

ID of the processor to which the batches will get released.

jobID

String

ID 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 ID 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 to False, partial matches are also returned.

maximumRecords

Integer

Indicates the maximum number of records the search returns.

3.3.18 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 ID of the database search defined for the database lookup profile.

fieldID

String

The ID 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 ID used for the primary sort.

primarySortOrder

Integer

The sort order of the primary sort.

secondarySortField

String

The field ID 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.19 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.20 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.21 DbSearchFieldInfo

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

Property

Type

Description

captureIndexDefID

String

The metadata field ID.

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.22 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 ID associated with the document profile.

name

String

The name for the document profile.

description

String

The description for the document profile.

3.3.23 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.24 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 ID for this field.

name

String

The name of this field.

inputMask

String

The input mask.

locked

boolean

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 ID of the choice list associated with this field.

pickListParentFieldID

String

The ID of the choice list parent field.

pickListSourceID

String

The source ID 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.25 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.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:

- DataField

- FloatField

- IntegerField

- PicklistEntry

- PicklistField

- TextField

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()

- getDisplayValue()

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:

- Sample Client Script 1

- Sample Client Script 2

3.5.1 Sample Client Script 1

This sample script customizes client behavior in the following ways:

- Prevents the client user from leaving a metadata field if the entry contains the word "test".

- Prevents the user from entering an asterisk in any metadata field.

- Outputs event information to the java console, such as coordinates after a user right-mouse-drags a selection on an image.

- Stops releasing the batches to predefined processors and unlocks the batches.

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

importClass(java.awt.event.KeyEvent);

function ScriptStart() {
println("ScriptStart");
}

function BatchScanBegin(event) { // BatchScanEvent
println("BatchScanBegin");
}

function BatchScanComplete(event) { // BatchScanEvent
println("BatchScanComplete");
println(event.getBatch().getBatchName() + " finished Scanning.");
}

function BatchSelected(event) { // BatchSelectedEvent
println("BatchSelected: " + event.getBatch().getBatchName());
}

function PreBatchDelete(event) { // BatchDeleteEvent
println("BatchDelete");
}

function CaptureImage(event) { // ImageCaptureEvent
println("CaptureImage");
}

function DocumentCreated(event) { // CaptureDocument
println("DocumentCreated");
}

function DocumentSelected(event) { // DocumentSelectedEvent
println("DocumentSelected: " + event.getDocument().getTitle());
}

function FieldGotFocus(event) { // FieldEvent
println("FieldGotFocus");
}

function FieldLostFocus(event) { // FieldEvent
var dataField;
println("FieldLostFocus");
dataField = event.getField();
if (dataField.getUncommittedText().equalsIgnoreCase("test")) {
event.setCancel(true);
println("invalid value. script will not allow leaving focus.");
}
}

function FieldProcessKey(event) { // FieldEvent
var keyEvent;
// println("FieldProcessKey");
keyEvent = event.getKeyEvent();
if (keyEvent.getID() == KeyEvent.KEY_TYPED) {
//println(keyEvent.getKeyChar());
if (String.fromCharCode(keyEvent.getKeyChar()) == '*') {
println("Asterisk not allowed in any field.");
keyEvent.consume();
}
}
}

function PostCaptureImage(event) { // ImageCaptureEvent
println("PostCaptureImage");
}

function PreCaptureImage(event) { // ImageCaptureEvent
println("PreCaptureImage");
}

function PreUploadItem(event) { // UploadItemEvent
println("PreUploadItem: " + event.getCaptureItem().getFilename());
}

function PostUploadItem(event) { // UploadItemEvent
println("PostUploadItem: " + event.getCaptureItem().getFilename());
}

function DBSearchComplete(searchEvent) { // DBSearchEvent
println("DBSearchComplete.");
}

function DBSearchResults(searchEvent) { // DBSearchEvent
var results;
var resultRow;
var searchParameters;

println("DBSearchResult");

results = searchEvent.getRowResults();
println("Found " + results.size() + " results.");
}

function DBSearchStart(searchEvent) {  // DBSearchEvent
println("DBSearchStart");
println("Metadata value was " + searchEvent.getMetadataValue());
//searchEvent.setMetadataValue("c");
}

function DocumentRemoved(event) { // DocumentRemovedEvent
println("DocumentRemoved");
}

function ImportFilesSelected(files, cancel) { // ImportFilesSelectedEvent
println("ImportFilesSelected");
}

function PostDownloadItem(event) { // DownloadItemEvent
println("PostDownloadItem: " + event.getCaptureItem().getFilename());
}

function PreDownloadItem(event) { // DownloadItemEvent
println("PreDownloadItem: " + event.getCaptureItem().getFilename());
}

function RegionSelected(event) { // RegionSelectedEvent
var rect;
println("RegionSelected");
rect = event.getSelectionRectangle();
println("Rectangle (X,Y): (" + rect.getX() + "," + rect.getY() + "); (W,H): (" + rect.getWidth() + "," + rect.getHeight() + ")");
}

function PreReleaseBatch(event) { // ReleaseBatchEvent
// Clears the postProcess setting specified in the Capture profile and allows the batches to get unlocked.
event.setProcessorID(null);
event.setJobID(null);
}

3.5.2 Sample Client Script 2

This sample script customizes client behavior in the following ways:

- Uses the BatchScanBegin function to restrict files that can be imported to those with a .TIF extension only.

- Uses the DBSearchResults function to modify the results of a database lookup so that only the first result is used, and prevents the results list from displaying.

importClass(java.util.ArrayList);

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 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);
}
}

4 Creating Recognition Processor Scripts

This chapter describes creating Recognition Processor scripts.

The following are common uses for Recognition Processor scripts:

- Splitting a single bar code value into multiple field values.

- Assigning bar code value(s) to proper fields.

- Using custom logic to determine which pages constitute document separation.

- Performing custom auditing of server activity.

- Canceling the committing of a batch due to invalid data.

Capture enables you to create Recognition Processor scripts to customize recognition processing. For more information, see Oracle Fusion Middleware Managing Oracle WebCenter Enterprise Capture.

This chapter covers the following topics:

- Section 4.1, "Recognition Processor Methods"

- Section 4.2, "Recognition Processor Classes"

- Section 4.3, "Sample Recognition Processor Script"

4.1 Recognition Processor Methods

This section provides a description of the Recognition Processor methods. Methods are executed in the following order in Recognition Processor batch jobs:

1. initialize

2. processBatch

3. restoreCaptureBatch

4. beginPhase

5. endPhase

6. extractBatchItem

7. barcodesFoundOnItem

8. batchItemAllValidBarcodes

9. determineSeparatorPage

10. batchItemValidBarcode

11. determineDocType

12. beginDatabaseLookup

13. determineIndexValues

14. renameOrigCaptureDocTitle

15. createCaptureDoc

16. postProcess

17. endBatchProcess

Note:
Some methods are only executed under certain job configurations.

4.1.1 initialize

This is the very first call the Recognition Processor makes to the script. There is no batch identified yet.

The following are the properties populated in the Recognition Processor class (rpc):

- phaseID: 0

- logger: Logger can be used to log additional entries. This property remains during the entire process, and does not repeat for every method.

- job: current Recognition Job. This property remains during the entire process, and does not repeat for every method.

- workspaceEntity: Current workspace entity. This property remains during the entire process, and does not repeat for every method.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void initialize(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.2 processBatch

The processBatch method is called before the Recognition Processor processes the batch. The following are the properties populated in the rpc:

- phaseID: 0

- ble: At this point, the Recognition Processor has refreshed the document list for the batch. This property will remain during the remainder of the process, and will not repeat for the rest of the methods.

- cancelAction: You can set the flag to true to skip processing of a batch.

- processorBase: This is part of Dynamic Monitoring Service (DMS) using which the user can collect their own set of metrics data into the noun, that this property represents. This property will stay through the remainder of the process and does not repeat for each method.

- DMS_Literals: Resource bundles that are being used by DMS. This property will stay through the remainder of the process and does not repeat for each method.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void processBatch(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.3 restoreCaptureBatch

The restoreCaptureBatch method is invoked when a batch that was processed earlier was aborted due to an error or other reasons during document creation phase. Recognition Processor needs to first clean up the batch to restore the batch to its original state, before initiating processing.

The restoreCaptureBatch method is invoked when all the following conditions are met:

- Batch state indicates that the processor last failed at the document creation phase.

- Batch has not been modified since last process.

- Recognition job has not been modified since last process.

The Recognition Processor makes sure that both batch and job have not been modified since the last process. In such cases, the processor attempts to restore the batch to its original state by removing previous documents created by the recognition process.

The following are the properties populated in the rpc:

- phaseID: 0

- cancelAction: You can set the flag to true to skip restoring of the batch, and the process skips processing this batch.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void restoreCaptureBatch(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.4 beginPhase

The beginPhase method indicates the beginning of a phase. The following are the properties populated in the rpc:

- phaseID: Identification of the phase. There are six different phases (see Section 4.2.9 for details on RecognitionProcessorContext phaseID).

- cancelAction: You can set the flag to true to skip certain phases. For phases that cannot be skipped, this flag is ignored.

- Phases that can be canceled are: bar code recognition, document classification, and indexing.

- Phases that cannot be canceled are: document organization, document creation, and post-processing.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void beginPhase(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.5 endPhase

The endPhase method indicates the end of a phase. The following are the properties populated in the rpc:

- phaseID: Identification of the phase. There are six different phases (see Section 4.2.9 for details on RecognitionProcessorContext phaseID).

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void endPhase(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.6 extractBatchItem

The extractBatchItem method is executed during the bar code recognition phase. The Recognition Processor extracts batch items, one at a time, into a directory right before the processor performs bar code recognition on the page. Then the processor informs you where the items are located.

The following are the properties populated in the rpc:

- phaseID: 1.

- extractPath: The directory where the batch item is located.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void extractBatchItem(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.7 barcodesFoundOnItem

The barcodesFoundOnItem method is invoked after the Recognition Processor processed the batch item, collected and recognized bar codes on this item.

The following are the properties populated in the rpc:

- phaseID: 1.

- batchItem: Current batch item that is used to perform bar code recognition.

- patchCodeRead: Patch code value found on the batch item.

- barCodesRead: A combination of bar codes read on the page and existing bar codes on the batch item.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void barcodesFoundOnItem(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.8 batchItemAllValidBarcodes

The batchItemAllValidBarcodes method is called after the Recognition Processor has finished validating bar codes on a specific batch item.

The following are the properties populated in the rpc:

- phaseID: 2.

- batchItem: Current batch item that is used to perform bar code validation.

- validBarCodes: A list of name or value pairs of the valid bar codes found on the batch item. This list includes all bar codes definitions in the recognition job. You can change the value, but you should not change the name, or add or remove items from the list.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void batchItemAllValidBarcodes(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.9 determineSeparatorPage

The determineSeparatorPage method is called after the Recognition Processor has validated a page as a separator. This method is only invoked if a separator is defined for a recognition job.

The following are the properties populated in the rpc:

- phaseID: 2.

- batchItem: Current batch item that is to determine whether the page is a separator or not.

- validBarCodes: A list of name or value pair of the valid bar codes found on the batch item. This list includes all bar code definitions in the recognition job.

- separator: This object is null unless this batch item is a valid separator. If you want to make changes, you need to either set the separator to null or to a valid object of class ProcessSeparatorPage.

Recognition Processor's hierarchical separator feature processes and organizes documents within a hierarchy of levels. You can change the level determined by the processor. However, if the level does not fit into a recognition job definition, the processor uses either the highest level (level<=0) or lowest level (level>=max defined level).

Level is used for the hierarchy separator page type only. For any other organization type, this value is ignored. Level should always begin with 1.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void determineSeparatorPage(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.10 batchItemValidBarcode

The batchItemValidBarcode method passes in one valid bar code recognized on a specific batch item. This method call will only happen when the batch organization type is bar code on every page, and Optimize Bar Code Recognition is turned on.

When the processor cannot find a bar code on a page, it will try to determine the separator bar code value on the next page. validBarcode is populated with the bar code found on the next page. If bar code is not found, validBarcode is set to null. In such cases, this method is called right after the processor has determined the bar code value.

The following are the properties populated in the rpc:

- phaseID: 2.

- batchItem: Next page batch item that is to determine the separator bar code value.

- validBarcode: Name or value pair for the separator bar code. You can change the value if required.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void batchItemValidBarcode(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.11 determineDocType

The determineDocType method is called after the Recognition Processor has identified a document type as either the default document type or one of the dynamic document type mappings. docTypeID can be null if the processor is unable to identify it.

The following are the properties populated in the rpc:

- phaseID: 3.

- document: Contains the current document information. Some properties are specific to certain organization type. The docTypeID needs to be examined here, and changed if required.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void determineDocType(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.12 beginDatabaseLookup

The beginDatabaseLookup method is called after the Recognition Processor has determined the lookup value, and before the actual execution of the lookup is called.

The following are the properties populated in the rpc:

- phaseID: 4.

- dbLookupValue: You can modify the lookupValue.

- cancelAction: You can cancel lookup.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void beginDatabaseLookup(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.13 determineIndexValues

The determineIndexValues method is called after the Recognition Processor has determined all metadata values for a particular processor document. You can modify the metadata values.

The following are the properties populated in the rpc:

- phaseID: 4.

- document: Contains the current document information. Some properties are specific to certain organization types. The indexValues needs to be examined here, and changed if required.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void determineIndexValues(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.14 renameOrigCaptureDocTitle

The renameOrigCaptureDocTitle method is called before the processor renames the original document as "unindexed". This applies to all batch organization types except the "Do not perform document organization" type.

The following are the properties populated in the rpc:

- phaseID: 5.

- unIndexedDocTitle: You can change the title.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void renameOrigCaptureDocTitle(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.15 createCaptureDoc

Before the processor creates the Capture document, it is possible to customize the document title, document type id, metadata values, and document comments. You can also change the batch items associated with this document, although in the case of the "Do not perform document organization" type, changing batch items does not affect the outcome.

Note:
You must be careful while changing batch items as it may possibly leave orphan items in the batch, that are not associated with any documents.

The following are the properties populated in the rpc:

- phaseID: 5.

- document: Capture document that the processor is about to create.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void createCaptureDoc(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.16 postProcess

The postProcess method is invoked after the Recognition Processor has determined all post-process settings, but before any actual changes take place.

The following is the property populated in the rpc:

- phaseID: 6.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void postProcess(RecognitionProcessorContext rpc, PostProcessContext ppc);

RecognitionProcessorContext rpc
PostProcessContext ppc

4.1.17 endBatchProcess

The endBatchProcess method indicates that the Recognition Processor has finished processing the batch.

The following is the property populated in the rpc:

- phaseID: 0.

The following table describes the syntax and parameter for this method:

Syntax

Parameter

public void endBatchProcess(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.2 Recognition Processor Classes

The Recognition Processor classes can be used to design Recognition Processor scripts. This section describes the following classes:

- BarcodeDefinition

- DocumentDefinition

- PostProcessContext

- ProcessorDocument

- ProcessorItem

- ProcessorSeparatorPage

- RecognitionJob

- RecognitionJobField

- RecognitionProcessorContext

- SeparatorDefinition

- SeparatorRuleDefinition

In addition to the following classes that can be used to design Recognition Processor scripts, there are some common classes that pertain to the Recognition Processor and the Import Processor. For more information on the common classes, see Section 6.1.

4.2.1 BarcodeDefinition

The BarcodeDefinition class contains the constants for the bar code validation rule type. This class represents one bar code definition specified in the third train stop of Recognition Processor Job.

Property

Type

Description

barcodeName

String

Bar code definition name.

validationRule

Integer

Bar code validation rule; valid values are 0-4, as defined in the constants.
The following are the constants for the bar code validation rule type:

- 0 – Does not have a validation rule specified.

- 1 – Uses the bar code length to validate.

- 2 – Uses the mask to validate.

- 3 – Uses a regular expression to validate.

- 4 – Uses a choice list to validate.

validationLength

Integer

Validation length.

validationMask

String

Validation mask.

validationRegularExpression

String

Validation regular expression.

pickListSourceID

String

Validation choice list source ID.

pickListID

String

Validation choice list ID.

4.2.2 DocumentDefinition

When a document profile is set to "Determine dynamically using bar code", you can define "Document Profile and Bar Code Value Mappings". Each mapping is represented by a DocumentDefinition class.

Property

Type

Description

docTypeID

String

Unique identifier of the Document Type.

mappingType

Integer

This sets whether to determine document type based on a literal value or a choice list. The valid values are 0 and 1, as defined in the constants:

- 0 – To compare bar code value detected with a literal value specified.

- 1 – The document type mapping option that determines document type based on values in the choice list.

value

String

Literal string specified.

pickListSourceID

String

Choice list source ID specified.

pickListID

String

Choice list ID specified.

4.2.3 PostProcessContext

The PostProcessContext class represents all the settings needed to apply to a batch after processing is completed. If there is any error during processing, PostProcessContext data is populated from the setting of Post Process train stop of Recognition Processor Job.

Property

Type

Description

renameBatch

String

Name that the batch will be renamed to during post process. If null, the batch will not be renamed.

priority

int

Priority that the batch will be changed to during post process. If the priority is not valid (<0 or >10), the batch priority will remain the same.

status

BatchStatusEntity

Status entity object that the batch will be associated with during post process. If null, the batch status will remain the same.

batchState

int

If there were some errors during the recognition process, the batch state will be preset to 16; otherwise, the batch state will be preset to 1.

emailRecipients

List<String>

A list of email recipients that email notification will be sent to. If empty, email will not be sent.

emailSubject

String

Subject line of the email notification.

emailMessage

String

Main message body of email notification. If empty, email will not be sent.

processorID

String

The processor ID to which the current batch will be released.

processorJobID

String

The processor job ID to which the current batch will be released.

comment

String

Comment that will be assigned to the batch being processed.

errorMessage

String

Error that occurred during the batch processing.

4.2.4 ProcessorDocument

The ProcessorDocument class is a representation of a logical capture document that Recognition Processor has identified. In the last phase, the document creation phase, the recognition process will attempt to create documents to the batch based on a collection of ProcessorDocument.

Property

Type

Description

title

String

Title of the document, which is populated during the document creation phase.

batchItems

List<String>

All batch items associated with this document. This is populated during the document organization phase.

validBarcodes

List<ProcessorItem>

Valid bar codes associated with this document. This is a combination of all valid bar codes found for all batch items associated with this document. This is populated during the document organization phase.

failureStatus

int

Status of the current document:

- 0 – No error

- 1 – Failed to validate bar code. This is the case when the processor finds duplicate bar codes in a document that matches the bar code validation rule, and the job setting is to clear the value.

- 2 – Document exceeded maximum page rule.

- 3 – Unable to determine document type.

- 4 – No database search result found, and job setting is to prevent commit when no record is found.

docTypeID

String

Document type ID associated with the document. If null, the document type has not been determined.

comment

String

Comments for the document. It is usually error detail for 'failureStatus,' which you can customize through script.

captureDocID

String

This is only used in the "Do not perform document organization" type, where the processor does not organize documents, and does not create any Capture documents. This ID is the Capture document ID.

separator

ProcessorSeparatorPage

Separator page of this document. This applies to the "Do not perform document organization" and "multiple page document with separator" organization types.

hierarchySeparators

List<ProcessorSeparatorPage>

Separator pages for this document. This applies to the "multiple pages with hierarchy separator" organization type.

indexValues

List<IndexValue>

List of metadata names and values.

4.2.5 ProcessorItem

The ProcessorItem class is a representation of an item identified by Name and Value properties. This class holds the name or value pair of data. In this case, this class holds a particular bar code's name and value.

Property

Type

Description

name

String

Indicates the bar code name for the ProcessorItem.

value

String

Specifies the value for the ProcessorItem.

4.2.6 ProcessorSeparatorPage

The ProcessorSeparatorPage class represents a separator page that has been identified by Recognition Processor.

Property

Type

Description

include

boolean

Indicates whether this separator page will be deleted after commit.

level

int

This is only used in the hierarchy separator pages organization type. Level always starts with 1.

name

String

Separator page name.

batchItemID

String

The batch item with which this separator page is associated.

validBarcodes

List<ProcessorItem>

Used only in hierarchical separator pages that holds all the valid bar codes for this batch item.

4.2.7 RecognitionJob

The RecognitionJob class represents a Recognition Process Job and contains the constants for the bar code symbologies.

Property

Type

Description

workspaceName

String

Name of the workspace with which this job is associated.

workspaceID

String

ID of the workspace with which this job is associated.

jobID

String

Job ID.

lastModifiedDateTime

Date

Date and time the job was last modified.

lastModifiedUserID

String

ID of the user that last modified the job.

jobName

String

Job name.

description

String

Job description.

scriptID

String

ID of the script with which this job is associated.

barcodes

List<BarcodeDefinition>

List of bar code definitions.

autoDetectBarcodes

Boolean

Determines whether Enable Auto-detect Bar Codes is turned on.

validateCheckSum

Boolean

Determines whether Validate Optional Checksum is turned on.

symbologies

List<Integer>

A list of selected bar code symbologies for recognition: valid values are from 0 - 21, as defined in the constants for bar code symbologies earlier in this section.
The constants for the bar code symbologies are as follows:

- 0 – codabar

- 1 – code 128

- 2 – code 39

- 3 – code 93

- 4 – EAN-13

- 5 – EAN-8

- 6 – interleaved 2/5

- 7 – UCC/EAN 128

- 8 – UPC-A

- 9 – UPC-E

- 10 – Airline(IATA) 2/5

- 11 – Code 32

- 12 – Datalogic 2/5

- 13 – Industrial 2/5

- 14 – ISBN Addon 2

- 15 – ISBN Addon 5

- 16 – Matrix 2/5

- 17 – Postnet/Planet

- 18 – Patch Code

- 19 – Data Matrix

- 20 – PDF417

- 21 – QR code

batchOrganization

Integer

Document organization type; valid values ranges from 0 - 4.
The following are constants for the document organization type:

- 0 – Fixed number of pages per document.

- 1 – (None) Do not perform document organization.

- 2 – Same bar code value on each page.

- 3 – Separator pages

- 4 – Hierarchical separator pages.

documentPageCount

Integer

For the "Fixed number of pages per document" document organization type, this property refers to the maximum number of pages per document.

pagesPerDoc2ReadBarcodes

Integer

For the "None: Do not perform document organization" document organization type, this property refers to the number of pages per document to read bar codes.

maxPageCountPerDoc

Integer

For the "Same bar code value on each page, or Separator pages" document organization type, this property refers to the maximum number of pages per document.

multiPageDocBarcode

BarcodeDefinition

For the "Same bar code value on each page" document organization type, this property refers to the bar code that determines document separation.

optimizeBarcodeDetection

Boolean

For the "Same bar code value on each page" document organization type, this property determines whether to optimize bar code detection.

coverPages

List<SeparatorDefinition>

For the "Separator pages, Hierarchical separator pages, None: Do not perform document organization" document organization type, this property holds the data that defines the separator page. When the hierarchical separator page is used, the list may contain more than one separator page definition, while in the other two scenarios, the list will only contain one separator page definition.

multiBarcodeValuesOption

Integer

Actions to take if more than one value is found for a bar code within a document; valid values are 0-2 as defined in the constants.
The following are actions to take when multiple bar code values are found for a bar code definition:

- 0 – Use the first bar code value found.

- 1 – Use the last bar code value found.

- 2 – Do not use the bar code values.

dynamicDocType

Integer

Options on how the Dynamic Document Profile is determined; valid values are 0-2 as defined in the constants.
The following values show how the document type is dynamically determined:

- 0 – The document type is not dynamically determined.

- 1 – The document type is dynamically determined based on a bar code value.

- 2 – The document type is dynamically determined based on a separator page.

defaultDocTypeID

String

ID for the Default Document Profile.

docTypeBarCode

BarcodeDefinition

When the Document Profile is being dynamically determined using the bar code, this property represents the selected bar code.

docTypeMappings

List<DocumentDefinition>

When the Document Profile is being dynamically determined using the bar code, this mapping represents the Document Profile and Bar Code Value Mappings.

jobFields

List<RecognitionJobField>

Field mappings information.

dblookupUsing

Integer

Type of value the database lookup will be using; valid values are 0-2 as defined in the constants.
The following are values used by database lookup:

- 0 – No database lookup is configured.

- 1 – Use a bar code value to perform database lookup.

- 2 – Use the index field value to perform database lookup.

dblookupBarcodeField

BarcodeDefinition

Bar code definition that is selected for database lookup.

dblookupIndexDefID

String

Metadata field ID that is selected for database lookup.

dblookupProfile

String

Database lookup profile ID.

dblookupSearchField

String

Database lookup search field ID.

dblookupMultipleRecordAction

Integer

Actions to take when more than one record is found during database lookup; valid values are 0-1 as defined in the constants.
The following show actions to take when a database lookup finds multiple records:

- 0 – Use the first record found during database lookup.

- 1 – Do not populate the database lookup result.

dblookupNoMatchAction

Integer

Actions to take when no record is found during database lookup; valid values are 0-1 as defined in the constants.
The following show what action to take when a database lookup finds no match:

- 0 – Permit the batch to be committed even when no database record is found.

- 1 – Do not allow the batch to be committed when no match is found.

renamePrefix

String

Part of post-process setting. When there is no system error, this is the batch prefix to rename, if required.

renameEmail

String

Part of post-process setting. When there is no system error, this is the email address to send email notification to rename, if required.

renameStatus

String

Part of post-process setting. When there is no system error, this is the batch status to change, if required.

renamePriority

Integer

Part of post-process setting. When there is no system error, this is the batch priority to change, if required.

processorID

String

Part of post-process setting. When there is no system error, this is the batch processor ID to which the batch will be released.

processorJobID

String

Part of post-process setting. When there is no system error, this is the batch processor job ID to which the batch will be released.

failureRenamePrefix

String

Part of post-process setting. When there is a system error, this is the batch prefix to rename, if required.

failureRenameEmail

String

Part of post-process setting. When there is a system error, this is the email address to which notification should be sent, if required.

failureRenameStatus

String

Part of post-process setting. When there is a system error, this is the batch status to change, if required.

failureRenamePriority

Integer

Part of post-process setting. When there is a system error, this is the batch priority to change, if required.

failureProcessorID

String

Part of post-process setting. When there is a system error, this is the batch processor ID to which the batch will be released.

failureProcessorJobID

String

Part of post-process setting. When there is a system error, this is the batch processor job ID to which the batch will be released.

online

boolean

Indicates whether this recognition job is active or not.

4.2.8 RecognitionJobField

The RecognitionJobField class represents each field in the "Fields" train stop.

Property

Type

Description

indexDefID

String

Metadata ID to populate with property values.

autoPopulate

Integer

Auto-populate type; valid values are 0-5, as defined in the constants.
The following are the constants for the auto-populate type:

- 0 – Does not auto-populate the index value.

- 1 – Auto-populates the index value with the bar code value.

- 2 – Auto-populates the index value with the batch name.

- 3 – Auto-populates the index value with a default value.

- 4 – Auto-populates the index value with the index date.

- 5 – Auto-populates the index value with the scan date.

populateValue

String

For the bar code type, this represents the bar code definition name; for the default type, this represents a default value.

4.2.9 RecognitionProcessorContext

The RecognitionProcessorContext class is a context object that contains relevant attributes that relates to the recognition processing.

property

Type

Description

logger

Logger

An instance of java.util.logging.Logger that can be used to log additional entries.

job

RecognitionJob

Current job being used.

ble

BatchLockEntity

A lock entity which contains the batch currently being processed.

workspaceEntity

CaptureWorkspaceEntity

Current workspace that is being used.

phaseID

int

An integer that identifies the current phase:

- 0 – pre batch process. In this step, recognition processor performs resource initialization, batch validation, and clean up if required.

- 1 – bar code recognition. In this step, recognition processor goes through all batch items for all documents, extracts batch items one at a time, and performs bar code recognition based on recognition settings.

- 2 – document organization. In this step, recognition processor finds valid bar codes based on barcode definition configuration, and creates logical documents based on document processing settings.

- 3 – document classification. In this step, recognition processor determines property document type for each logical document created in previous step based on Document Profile settings.

- 4 – indexing. In this step, recognition processor performs database lookup based on database lookup configuration, and determines index values for all logical documents based on fields settings.

- 5 – document creation. In this step, recognition processor creates actual capture documents based on the logical documents determined, populates document indexes, and assigns document type. If any warnings or errors occurred during process, document comments are updated.

- 6 – post processing. In this step, recognition processor releases a batch according to post processing configuration. Batch may also get renamed, batch status and priority changed, and email message sent if required.

cancelAction

boolean

In certain calls, the user is allowed to cancel the action (for example, bar code recognition or database lookup).

batchItem

BatchItemEntity

Current batch item being processed. This is specifically used during bar code recognition and bar code validation (part of the document organization phase).

patchCodeRead

Integer

Patch code found on a batch item. This is only used during the bar code recognition phase.

barcodesRead

List<String>

All bar codes associated with a batch item, which includes original bar codes associated with the batch item, and bar codes read through the bar code recognition engine. This is only used during the bar code recognition phase.

validBarcodes

List<ProcessorItem>

List of valid bar codes found for a specific batch item. This only applies to the bar code validation step (part of the document organization phase).
ProcessorDocument also contains a list of valid bar codes, which is associated with a specific document. It is a collection of all valid bar codes found on all batch items associated with the document.

validBarcode

ProcessorItem

Specific to the bar code that determines document separation and optimized bar code recognition setting. If batch organization type is bar code on every page, optimized recognition is turned on, and the barcode on a given page is null (barcode not found), then validBarcode contains the barcode for the following page.

separator

ProcessorSeparatorPage

Specific for organization types that involve a separator page. If the separator is null, then this batch item is not a separator page.

document

ProcessorDocument

Used for the document classification, indexing, and document creation phase. It contains everything you need to know about the document.

dbLookupValue

String

Used only before database lookup is executed. You can change the lookup value.

unIndexedDocTitle

String

Specific to the Document Creation phase. The first capture document holds all batch items for which the recognition processor is unable to determine the document they belong to. This property allows you to customize the first Capture document title. The default title is unindexed; if this value is null, then the first document title will remain unchanged.

extractPath

String

Path to which batch items were extracted. This is specific during the bar code recognition phase. You should not modify this property.

processorBase

Noun

DMS Noun that holds the processor metrics data.

DMS_Literals

ResourceBundle

Resource bundle that is being used by DMS.

4.2.10 SeparatorDefinition

The SeparatorDefinition class represents the definition on what is considered a separator page.

Property

Type

Description

name

String

Name of the separator page.

deleteUponCommit

Boolean

Determines whether to delete the separator page after commit.

operator

Integer

Operator used for rules; valid values are 0 and 1:

- 0 – The OR operator, used in cover page definition rules. For rules separated using this operator, any one rule must match the rule condition.

- 1 – The AND operator, used in cover page definition rules. For rules separated using this operator, all rules must match the rule condition.

docTypeID

String

If the document type is dynamically determined based on a separator page, this is the ID of the document type for this separator page.

rules

List<SeparatorRuleDefinition>

Collection of rules associated with this separator page.

4.2.11 SeparatorRuleDefinition

The SeparatorRuleDefinition class represents one rule that applies to a separator definition.

Property

Type

Description

name

String

Name of the rule.

operator

Integer

Operator used for patch code and bar codes selected; valid values are 0 and 1. For more information, see Section 4.2.10.

patchCode

String

Patch code selected for this rule.

barcodes

List<String>

Bar codes selected for this rule.

4.3 Sample Recognition Processor Script

The steps below are involved in configuring a batch job. You can modify the processing behavior based on the following job configuration steps using the sample script given after the steps:

- Set the job to detect PDF417 bar codes.

- Set the PDF417 bar code on the page to be | delimited, and has 10 fields concatenated together.

- Define three bar code definitions: processorDate, Title, and Amount (with no validation rules).

- Map the three bar code definitions to three index fields.

The Recognition Processor script parses a PDF417 bar code found on a batch item, parses the value, and applies appropriate parsed text to the three bar code definitions.

function batchItemAllValidBarcodes (rpc) {
// Obtain current batch item
var batchItem = rpc.getBatchItem();

// obtain bar code count.
var count = batchItem.getBarcodeCount();

// All barcodes on a batch item.
var allBarcodes;

// bar code of interest.
var barcodeValue;

// after parsed barcode value.
var parsed;

// Obtain bar code value if there is a bar code found.
if (count > 0) {
allBarcodes = batchItem.getBarcodes();
barcodeValue = allBarcodes[0];

// Parse the bar code value by | character.
parsed = barcodeValue.split('\\|');
var len = parsed.length;

// It should get splitted into 10 strings.
if (len == 10) {
// This is the barcode we want, populate valid bar codes.
populateValues(rpc, parsed);
}

}
}

function populateValues(rpc, parsed) {
var valid = rpc.getValidBarcodes();
var i;

for (i=0; i<valid.size(); i++) {
var bar = valid.get(i);

if (bar.getName() == "processDate") {
bar.setValue(parsed[5]);
} else if (bar.getName() == "Title") {
bar.setValue(parsed[6]);
} else if (bar.getName() == "Amount") {
bar.setValue(parsed[4]);
}
}
}

5 Creating Import Processor Scripts

This chapter describes creating Import Processor scripts.

You can develop scripts for the Import Processor to perform a wide variety of functions. Some common tasks include:

- Skipping the importing of certain image files

- Changing Capture batch properties

- Skipping the importing of a batch

- Adding page level metadata values during importing

- After importing, moving images to a different folder

If an Import Job specifies a script to use during processing, the Import Processor Bean will create an instance of the JDK's ScriptRuntime class and initialize it with the script specified in the job. The Import Processor Bean, Import Manager Bean, and import sources all share this scripting runtime.

Capture enables you to create Import Processor scripts to customize the importing process. For more information, see Oracle Fusion Middleware Managing Oracle WebCenter Enterprise Capture.

This chapter contains the following sections:

- Section 5.1, "Import Processor Events"

- Section 5.2, "Email Source Events"

- Section 5.3, "Folder Source Events"

- Section 5.4, "List File Source Events"

- Section 5.5, "Import Processor Classes"

- Section 5.6, "Sample Import Processor Script"

5.1 Import Processor Events

Import Processor scripts are JavaScript modules that enable you to customize the behavior of certain Import Processor events.

This section describes the following Import Processor events:

- preProcess

- process

- postProcess

- preCreateBatch

- postCreateBatch

- preCreateDocument

- postCreateDocument

- preImportFile

- postImportFile

- preRelease

- postRelease

- preDatabaseSearch

- processDatabaseSearchResults

5.1.1 preProcess

The preProcess event occurs prior to the pre-processing of the import source. Initialization code can be performed here.

Syntax

Parameter

public void preProcess(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.2 process

The process event signals the start of the import process.

Syntax

Parameter

public process(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.3 postProcess

The postProcess event occurs after the import source has been processed.

Syntax

Parameter

public void postProcess(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.4 preCreateBatch

The preCreateBatch event occurs immediately after a new batch is started.

Syntax

Parameter

public void preCreateBatch(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.5 postCreateBatch

The postCreateBatch event occurs immediately after a batch is created, but before any documents have been created.

Syntax

Parameter

public void postCreateBatch(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.6 preCreateDocument

The preCreateDocument event occurs prior to a new document being created.

Syntax

Parameter

public void preCreateDocument(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.7 postCreateDocument

The preCreateDocument event occurs after a new document has been created.

Syntax

Parameter

public void postCreateDocument(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.8 preImportFile

The preImportFile event occurs prior to a file being imported.

Syntax

Parameter

public void preImportFile(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.9 postImportFile

The postImportFile event occurs after a file is imported.

Syntax

Parameter

public void postImportFile(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.10 preRelease

The preRelease event occurs prior to a batch being released.

Syntax

Parameter

public void preRelease(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.11 postRelease

The postRelease event occurs after a batch has been released.

Syntax

Parameter

public void postRelease(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.12 preDatabaseSearch

The preDatabaseSearch event occurs prior to a database lookup.

Syntax

Parameter

public void preDatabaseSearch(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.1.13 processDatabaseSearchResults

The processDatabaseSearchResults event occurs after the database lookup has returned the search results.

Syntax

Parameter

public void processDatabaseSearchResults(ImportProcessorContext ctx);

ImportProcessorContext ctx

5.2 Email Source Events

This section describes the following email source events:

- deleteMessage

- moveMessage

- newAttachment

- newMessage

5.2.1 deleteMessage

The deleteMessage event occurs in the email message post-processing step when an email message is about to be deleted.

Syntax

Parameter

public void deleteMessage(ImportProcessorContext ctx, EmailSourceContext emailCtx);

ImportProcessorContext ctx
EmailSourceContext emailCtx

5.2.2 moveMessage

The moveMessage event occurs in the email message post-processing step when an email message is about to be moved to an email folder.

Syntax

Parameter

public void moveMessage(ImportProcessorContext ctx, EmailSourceContext emailCtx);

ImportProcessorContext ctx
EmailSourceContext emailCtx

5.2.3 newAttachment

The newAttachment event occurs when a new email attachment is about to be processed.

Syntax

Parameter

public void newAttachment(ImportProcessorContext ctx, EmailSourceContext emailCtx);

ImportProcessorContext ctx
EmailSourceContext emailCtx

5.2.4 newMessage

The newMessage event occurs when a new email message is about to be processed.

Syntax

Parameter

public void newMessage(ImportProcessorContext ctx, EmailSourceContext emailCtx);

ImportProcessorContext ctx
EmailSourceContext emailCtx

5.3 Folder Source Events

This section describes the following folder source events:

- deleteDocumentFile

- newFolder

- renameDocumentFile

5.3.1 deleteDocumentFile

The deleteDocumentFile event occurs in the folder post-processing step when a file from the folder is about to be deleted.

Syntax

Parameter

public void deleteDocumentFile(ImportProcessorContext ctx, FolderSourceContext folderCtx);

ImportProcessorContext ctx
FolderSourceContext folderCtx

5.3.2 newFolder

The newFolder event occurs when a new folder is about to be processed.

Syntax

Parameter

public void newFolder(ImportProcessorContext ctx, FolderSourceContext folderCtx);

ImportProcessorContext ctx
FolderSourceContext folderCtx

5.3.3 renameDocumentFile

The renameDocumentFile event occurs in the folder post-processing step when a file from the folder is about to be renamed.

Syntax

Parameter

public void renameDocumentFile(ImportProcessorContext ctx, FolderSourceContext folderCtx);

ImportProcessorContext ctx
FolderSourceContext folderCtx

5.4 List File Source Events

This section describes the following list file source events:

- deleteListFile

- newFolder

- newListFile

- newListFileLine

- renameListFile

5.4.1 deleteListFile

The deleteListFile event occurs in the list file post-processing step when a list file is about to be deleted.

Syntax

Parameter

public void deleteListFile(ImportProcessorContext ctx, ListFileSourceContext listFileCtx);

ImportProcessorContext ctx
ListFileSourceContext listFileCtx

5.4.2 newFolder

The newFolder event occurs when a new folder containing list files is about to be processed.

Syntax

Parameter

public void newFolder(ImportProcessorContext ctx, ListFileSourceContext listFileCtx);

ImportProcessorContext ctx
ListFileSourceContext listFileCtx

5.4.3 newListFile

The newListFile event occurs when a new list file is about to be processed.

Syntax

Parameter

public void newListFile(ImportProcessorContext ctx, ListFileSourceContext listFileCtx);

ImportProcessorContext ctx
ListFileSourceContext listFileCtx

5.4.4 newListFileLine

The newListFileLine event occurs when a new line in the list file is about to be processed.

Syntax

Parameter

public void newListFileLine(ImportProcessorContext ctx, ListFileSourceContext listFileCtx);

ImportProcessorContext ctx
ListFileSourceContext listFileCtx

5.4.5 renameListFile

The renameListFile event occurs in the list file post-processing step when a list file is about to be renamed.

Syntax

Parameter

public void renameListFile(ImportProcessorContext ctx, ListFileSourceContext listFileCtx);

ImportProcessorContext ctx
ListFileSourceContext listFileCtx

5.5 Import Processor Classes

In Capture, you can describes an Import Processor event class for every type of event you maintain in the database.

This section describes the following Import Processor classes:

- EmailSourceContext

- FolderSourceContext

- ImportJob

- ImportProcessorContext

- ListFileSourceContext

In addition to the following event classes that can be used to design Import Processor scripts, there are some common classes that pertain to the Recognition Processor and the Import Processor. For more information on the common classes, see Section 6.1.

5.5.1 EmailSourceContext

The EmailSourceContext class contains all classes used in the processing of an email source.

Property

Type

Description

account

String

Name of the email account currently being processed.

folder

Folder

Email folder currently being processed.

message

Message

Email message currently being processed.

attachmentFilename

String

File name of the email message attachment currently being processed.

For more information on the Folder and Message class definitions, see the Javamail API documentation.

5.5.2 FolderSourceContext

The FolderSourceContext class contains all classes used in the processing of a folder source.

Property

Type

Description

folderName

String

Name of the directory currently being processed.

documentFilename

String

Name of the file currently being processed.

renamedDocumentFilename

String

If the post-processing step indicates the file should have a prefix added to it or the extension changed, this property indicates the changed file name.

5.5.3 ImportJob

Import jobs are configured within a Capture Workspace to import batches from import sources such as a file system folder, a delimited list file, or an inbox/folder of an email server.

Property

Type

Description

jobID

String

A value that uniquely identifies the job in the system.

workspaceID

String

Identifier of the workspace to which the job belongs.

jobName

String

A human-readable name for the job.

dbSearchID

String

Identifier of the database search to use when processing the job.

dbSearchFieldID

String

Identifier of the database search field to use when processing the job.

imageDownsample

Integer

Determines how to sample an image:

- 0 – None (retain image format).

- 1 – Down-sample color to 8 bit grayscale.

- 2 – Down-sample color or grayscale to black and white.

jpegQuality

Integer

The JPEG quality ratio 0 to 99.

batchPrefix

String

Batch prefix to use when creating batch names.

defaultBatchStatusID

String

Identifier of the batch status to associate with batches created by this job.

defaultPriority

Integer

Default priority assigned to batches ranging from 0 to 10.

defaultDocumentTypeID

String

Default document profile for documents created by this job.

searchResultOption

Integer

Determines how to handle database lookups that return more than one result.

- 0 – Use the first record.

- 1 – Ignore results (do not populate fields).

scriptID

String

Unique identifier of a script to use for this job.

importFrequency

Integer

A value, specified in seconds, that determines how often a job should be polled for work to process. The following values are possible:

- 0 – Inactive

- 30 – Every 30 seconds

- 60 – Every 1 minute

- 300 – Every 5 minutes

- 900 – Every 15 minutes

- 1800 – Every 30 minutes

- 3600 – Every 1 hour

- -1 – Daily (Specify Time)

hour

Integer

If the importFrequency is set to Daily, this specifies the hour of the day.

minute

Integer

If the importFrequency is set to Daily, this specifies the minute of the day.

lastCheck

Date

Date or time the job was last checked for processing. This will be updated by the Import Job Scheduler after a job is polled for work to process.

fieldMappings

Map<String, FieldMappingInfo>

A set of values that map Capture fields to import source metadata fields.

importSourceClassName

String

Name of the Java class that provides the implementation of the import source for this job.

batchProcessorClassName

String

Name of the class that will be used to process the batch when it is released. If this value is null, the batch lock will be discarded and the batch will be put in a READY state.

batchProcessorJobID

String

A unique identifier for a batch processor job. If this value is null, either the processor does not support jobs or the batch is going to be put in a READY state.

imageFailureAction

Integer

Specifies the action to be taken if an invalid image is encountered:

- 0 – Abort the batch

- 1 – Skip the item

locale

Locale

Specifies the locale of the list file source.

defaultDateFormat

String

Specifies the default date format of dates in the list file source.

description

String

Description of this job.

encoding

String

Specifies the file encoding of the list file source.

isJobOnline

Boolean

Indicates whether this job should be processed.

5.5.4 ImportProcessorContext

The ImportProcessorContext class contains properties relevant to the job being processed. An instance of this class is created before processing is started and is passed to an import source at various stages throughout processing.

Property

Type

Description

cancel

Boolean

When this boolean value is set to True, it will cancel the operation being performed.

cancelDBSearch

Boolean

When this boolean value is set to True, it will cancel the database lookup.

dBSearchResults

DBSearchResults

Contains the results from a database lookup.

sourceName

String

Name of the import source that the current Import Job is configured to use.

logger

Logger

An instance of java.util.logging.Logger that can be used to log additional entries.

importJob

ImportJob

Current Import Job being processed.

batchLock

BatchLockEntity

Contains the batch lock entity for the batch, after a new batch has been created.

importSourceFile

String

Name of the file currently being processed.

documentEntity

DocumentEntity

Document entity associated with the file currently being processed.

documentPageEntity

DocumentPageEntity

Document page entity associated with the file currently being processed.

lastMultiPageTiffNumber

Integer

Contains the current page number of a multi-page TIFF file being processed.

workspaceEntity

CaptureWorkspaceEntity

Workspace entity associated with the current batch.

5.5.5 ListFileSourceContext

The ListFileSourceContext class contains all classes used in the processing of a list file source.

Property

Type

Description

folderName

String

Name of the folder currently being processed.

listFilename

String

Name of the list file currently being processed.

listFileLine

String

Contents of the line currently being processed in the list file.

documentFilename

String

Name of the file currently being processed from the current line in the list file.

renamedListFilename

String

If the post-processing step indicates the list file should have a prefix added to it or the extension changed, this property indicates the changed list file name.

5.6 Sample Import Processor Script

The following sample script sets each document's title to the name of the file being imported. When the documents are later committed, their document title can be mapped to an output field.

importClass(java.io.File);

function preCreateDocument(event) { // ImportProcessorContext
var document;   // DocumentEntity
var sourceFile; // File

sourceFile = new File(event.getImportSourceFile());
document = event.getDocumentEntity();

// Set the document title to be the name of the source file
document.setDocumentTitle(sourceFile.getName());
}

6 Working with Common Capture Classes

This chapter describes the common Capture classes that pertain to the Recognition Processor and the Import Processor.

This is in addition to the classes that you can use to design the Recognition Processor scripts and the Import Processor scripts. For more information on the Recognition Processor and Import Processor classes, see Section 4.2 and Section 5.5.

6.1 Common Capture Classes

The following are the classes that pertain to the Recognition Processor and the Import Processor:

- BatchEntity

- BatchItemEntity

- BatchLockEntity

- BatchStatusEntity

- CaptureWorkspaceEntity

- DBSearchResults

- DBSearchResultRow

- DBSearchFieldInfo

- DocumentEntity

- DocumentPageEntity

- DocumentTypeEntity

- IndexDefinitionEntity

- IndexValue

6.1.1 BatchEntity

The BatchEntity class represents a batch within a Capture Workspace. A batch is a collection of batch items and documents.

Property

Type

Description

itemID

String

The unique batch item identifier.

id

Integer

The unique batch ID.

state

Integer

The current state of the batch, which will be one of the following values:

- 1 – READY

- 2 – LOCKED

- 16 – ERROR

- 32 – PROCESSING

errorMessage

String

An error message related to processing failure.

status

BatchStatusEntity

A reference to a BatchStatusEntity that represents the current status of the batch.

priority

Integer

The current priority value of the batch.

itemCount

Integer

The number of items in the batch.

userID

String

The user id of the user that created the batch.

workstationID

String

The host name of the system that created the batch.

comment

byte[]

A comment or note regarding the batch.

dateTime

Date

The date and time the batch was created.

workspace

CaptureWorkspaceEntity

A reference to the workspace to which the batch belongs.

documents

List<DocumentEntity>

A list of DocumentEntity references that exist in the batch.

items

List<BatchItemEntity>

A list of batch items associated with the batch.

lastModifiedDateTime

Date

The date and time the batch was last modified.

lastModifiedUserID

String

The ID of the user that last modified the batch.

batchName

String

The name of the batch.

6.1.2 BatchItemEntity

The BatchItemEntity class represents a batch item within a batch. BatchItemEntities are associated with DocumentPageEntities that are used to form documents within a batch.

Property

Type

Description

itemID

String

The unique batch item identifier.

sourceFileName

String

The original file name of the item. Useful if the item is an imported file.

sourceFormat

String

For non–image files this is generally the file extension (DOC, XLS, PDF). For image files, the value will be empty.

patchCode

Integer

A patch code value if a patch code was read.

barcodeCount

Integer

The number of barcodes that were read during barcode detection.

linkCount

Integer

The number of documents the item is linked to.

fileLength

Long

The size of the item in bytes.

barcodes

String[]

An array of strings that represent barcode values that were read during barcode recognition.

6.1.3 BatchLockEntity

The BatchLockEntity class represents a lock on a batch. The lock is used to prevent users and processors from accessing the same batch simultaneously.

Property

Type

Description

id

String

The unique batch lock ID.

batch

BatchEntity

A reference to the locked batch.

batchName

String

The name of the batch to which the batch lock is applied.

workspace

CaptureWorkspaceEntity

A reference to the workspace to which the batch belongs.

workspaceName

String

The name of the workspace to which the batch belongs.

lockDate

Date

The date that the batch lock was created.

userID

String

The ID of the user who locked the batch.

computerName

String

The name of the computer used to lock the batch.

processID

String

The process ID used to lock the batch.

6.1.4 BatchStatusEntity

The BatchStatusEntity class defines a batch status within a Capture Workspace. Batch statuses may be associated with batches within a Capture Workspace.

Property

Type

Description

statusID

String

The unique identifier of the status.

value

String

The text value of the status.

workspaceEntity

CaptureWorkspaceEntity

A reference to the workspace where the status is defined.

6.1.5 CaptureWorkspaceEntity

The CaptureWorkspaceEntity class represents a workspace in the Capture system. A workspace defines metadata, document profiles, and batch statuses.

Property

Type

Description

workspaceID

String

The unique workspace identifier.

workspaceName

String

The name of the workspace.

description

String

A description of the workspace.

dateCreated

Date

The date the workspace was created.

dateLastModified

Date

The date the workspace was last modified.

createdBy

String

The user ID of the user that created the workspace.

lastModifiedBy

String

The user ID of the user that last modified the workspace.

indexDefinitions

List<IndexDefinitionEntity>

A list of index definition entities that have been defined in the workspace.

statuses

List<BatchStatusEntity>

A list of batch statuses defined in the workspace.

documentTypes

List<DocumentTypeEntity>

A list of document profiles that have been defined in the workspace.

6.1.6 DBSearchResults

The DBSearchResults class contains information returned from executing a database lookup. It contains a list of the rows returned as well as a list of the search field information describing the columns of the rows.

Property

Type

Description

resultsList

List<DbSearchResultRow>

A list of rows from the database lookup.

fieldInfoList

List<DbSearchFieldInfo>

A list of search field information describing the columns used in the database lookup.

6.1.7 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.

6.1.8 DBSearchFieldInfo

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

Property

Type

Description

captureIndexDefID

String

The metadata field ID.

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.

6.1.9 DocumentEntity

The DocumentEntity class represents a document within a batch. A document consists of a collection of DocumentPageEntity references which refer to BatchItemEntity references.

Property

Type

Description

documentID

String

A value that uniquely identifies the document.

documentTitle

String

The document title.

documentNumber

Integer

The document's position within the batch.

batchEntity

BatchEntity

A reference to the batch to which the document belongs.

documentPages

List<DocumentPageEntity>

A list of document page entity references that make up the document.

documentType

DocumentTypeEntity

A reference to the documentType associated with the document.

indexes

List<IndexValue>

A list of index values for the document.

documentState

Integer

The current state of the document which will be one of the following values:

- 1 (READY) – Document is ready to be committed.

- 2 (ON HOLD) – Document will not be committed by the commit processor.

lastModifiedDateTime

Date

The date and time the document was last modified.

lastModifiedUserID

String

The ID of the user that last modified the document.

6.1.10 DocumentPageEntity

The DocumentPageEntity class represents a page within a document. It refers to a BatchItemEntity within a batch and contains a page number that represents the page's position within the parent document.

Property

Type

Description

docPageID

String

A value that uniquely identifies the document page.

batchItemEntity

BatchItemEntity

A reference to the BatchItemEntity associated with the document page.

documentEntity

DocumentEntity

A reference to the DocumentEntity to which the page belongs.

pageNumber

int

The position of the page within a document.

6.1.11 DocumentTypeEntity

The DocumentTypeEntity class defines a document profile within a Capture Workspace. A DocumentTypeEntity consists of a name, description, and list of index definition fields that pertain to the document profile.

Property

Type

Description

docTypeID

String

The unique identifier of the document profile.

docTypeName

String

The name of the document profile.

description

String

The description of the document type.

workspaceEntity

CaptureWorkspaceEntity

The parent workspace to which the document profile belongs.

fields

List<IndexDefinitionEntity>

A list of IndexFieldDefinitionEntity object references that are associated with the document profile.

6.1.12 IndexDefinitionEntity

The IndexDefinitionEntity represents an index definition defined in a workspace. An index definition defines a metadata field that can be used for input.

Property

Type

Description

indexFieldID

String

The unique identifier of the index definition.

fieldName

String

The name of the field.

workspaceEntity

CaptureWorkspaceEntity

A reference to the parent workspace where the field is defined.

dataType

Integer

The data type of the field.

- 0 – NUMERIC

- 1 – ALPHA NUMERIC

- 3 – DATE

- 4 – FLOAT

maxLength

Integer

The maximum number of characters the field will hold.

minValue

Float

The minimum value allowed.

maxValue

Float

The maximum value allowed.

required

Boolean

True if the field is required to have a value at commit time, false if it is not. The default value is False.

defaultValue

String

A default value for the field.

inputMask

String

The input mask defined for the field.

displayFormat

String

The field's display format.

locked

Boolean

Indicates if the field is locked for input.

autoPopulate

Integer

Includes the following:

- 0 – None

- 1 – Default Value

- 2 – Scan Date

- 3 – Current Date

- 4 – Batch Name

- 5 – User ID

- 6 – Host Name

- 7 – Profile Name

- 8 – Batch Status

- 9 – Batch Priority

- 10 – Document Type

validationExpression

String

The regular expression string used to validate the field value.

6.1.13 IndexValue

The IndexValue class represents the value of an index field for a metadata field in a document. It contains a display value that is presented to the user as well as a fieldValue which will be used at commit time.

Property

Type

Description

fieldID

String

The unique identifier of the IndexDefinitionEntity that is associated with the index value.

fieldValue

String

The value of the field that will be used when the document is committed.

displayValue

String

A value that is presented to the user. This value will not be used at commit time.

A Keycodes

If you need to specify a keycode in a JavaScript, refer to the following location:

http://docs.oracle.com/javase/7/docs/api/java/awt/event/KeyEvent.html

Oracle Legal Notices

Copyright Notice

Copyright © 1994-2018, Oracle and/or its affiliates. All rights reserved.

License Restrictions Warranty/Consequential Damages Disclaimer

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

Warranty Disclaimer

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

Restricted Rights Notice

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

Hazardous Applications Notice

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Trademark Notice

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

Third-Party Content, Products, and Services Disclaimer

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

Pre-General Availability Draft Documentation Notice

If this document is in public or private pre-General Availability status:

This documentation is in pre-General Availability status and is intended for demonstration and preliminary use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of this documentation.

Private Pre-General Availability Draft Documentation Notice

If this document is in private pre-General Availability status:

The information contained in this document is for informational sharing purposes only and should be considered in your capacity as a customer advisory board member or pursuant to your pre-General Availability trial agreement only. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described in this document remains at the sole discretion of Oracle.

This document in any form, software or printed matter, contains proprietary information that is the exclusive property of Oracle. Your access to and use of this confidential material is subject to the terms and conditions of your Oracle Master Agreement, Oracle License and Services Agreement, Oracle PartnerNetwork Agreement, Oracle distribution agreement, or other license agreement which has been executed by you and Oracle and with which you agree to comply. This document and information contained herein may not be disclosed, copied, reproduced, or distributed to anyone outside Oracle without prior written consent of Oracle. This document is not part of your license agreement nor can it be incorporated into any contractual agreement with Oracle or its subsidiaries or affiliates.

Documentation Accessibility

For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support

Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.