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:
Client scripts are JavaScript modules that enable you to customize the behavior of certain client events.
This section describes the following events:
The BatchScanBegin event occurs when scanning into a batch is about to begin.
Syntax | Parameter |
---|---|
public void BatchScanBegin(BatchScanEvent event); |
BatchScanEvent event |
The BatchScanComplete event occurs when scanning into a batch is complete.
Syntax | Parameter |
---|---|
public void BatchScanComplete(BatchScanEvent event); |
BatchScanEvent event |
The BatchSelected event occurs when a batch has been selected.
Syntax | Parameter |
---|---|
public void BatchSelected(BatchSelectedEvent event); |
BatchScanEvent event |
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 |
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 |
The DBSearchResults event occurs as database search results are being processed.
Syntax | Parameter |
---|---|
public void DBSearchResults(DBSearchEvent event); |
DBSearchEvent event |
The DBSearchStart event occurs just before a database search.
Syntax | Parameter |
---|---|
public void DBSearchStart(DBSearchEvent event); |
DBSearchEvent event |
The DocumentCreated event occurs after a document has been created.
Syntax | Parameter |
---|---|
public void DocumentCreated(CaptureDocument document); |
CaptureDocument document |
The DocumentRemoved event occurs after a document has been removed.
Syntax | Parameter |
---|---|
public void DocumentRemoved(DocumentRemovedEvent event); |
DocumentRemovedEvent event |
The DocumentSelected event occurs when a document has been selected.
Syntax | Parameter |
---|---|
public void DocumentSelected(DocumentSelectedEvent event); |
DocumentSelectedEvent event |
The FieldGotFocus event occurs when a metadata field receives the input focus.
Syntax | Parameter |
---|---|
public void FieldGotFocus(FieldEvent event); |
FieldEvent event |
The FieldLostFocus event occurs when a field has lost the input focus.
Syntax | Parameter |
---|---|
public void FieldLostFocus(FieldEvent event); |
FieldEvent event |
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 |
The PreBatchDelete event occurs when a batch is about to be deleted.
Syntax | Parameter |
---|---|
public void PreBatchDelete(BatchDeleteEvent event); |
BatchDeleteEvent event |
The PreCaptureImage event occurs before an image has been captured from the scan source.
Syntax | Parameter |
---|---|
public void PreCaptureImage(ImageCaptureEvent event); |
ImageCaptureEvent event |
The PreDocumentRemove event occurs when one or more documents are about to be deleted.
Syntax | Parameter |
---|---|
public void PreDocumentRemove(PreDocumentRemoveEvent event); | PreDocumentRemoveEvent event |
The PreDownloadItem event occurs when a batch item is about to be downloaded.
Syntax | Parameter |
---|---|
public void PreDownloadItem(DownloadItemEvent event); |
DownloadItemEvent event |
The PrePageDelete event occurs when one or more pages are about to be deleted.
Syntax | Parameter |
---|---|
public void PrePageDelete(PageDeleteEvent event); |
PageDeleteEvent event |
The PreReleaseBatch event occurs when a batch is about to be released.
Syntax | Parameter |
---|---|
public void PreReleaseBatch(ReleaseBatchEvent event); |
ReleaseBatchEvent event |
The PreUploadItem event occurs when a batch item is about to be uploaded.
Syntax | Parameter |
---|---|
public void PreUploadItem(UploadItemEvent event); |
UploadItemEvent event |
The PostCaptureImage event occurs after an image has been captured from the scan source.
Syntax | Parameter |
---|---|
public void PostCaptureImage(ImageCaptureEvent event); |
ImageCaptureEvent event |
The PostDownloadItem event occurs after a batch item has been downloaded.
Syntax | Parameter |
---|---|
public void PostDownloadItem(DownloadItemEvent event); |
DownloadItemEvent event |
The PostUploadItem event occurs after a batch item has been uploaded.
Syntax | Parameter |
---|---|
public void PostUploadItem(UploadItemEvent event); |
UploadItemEvent event |
The RegionSelected event occurs when a region has been selected on a document page.
Syntax | Parameter |
---|---|
public void RegionSelected(RegionSelectedEvent event); |
RegionSelectedEvent event |
The ScriptStart event occurs when scripting is first initialized.
Syntax |
---|
public void ScriptStart(); |
An event class is used to define an event. This section describes the following event classes:
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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:
|
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. |
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. |
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. |
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. |
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. |
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. |
This section describes the following Capture Client Core classes:
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. |
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. |
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
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. |
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. |
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.
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.
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)
|
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. |
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. |
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.
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. |
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.
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
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. |
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. |
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:
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:
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. |
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. |
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. |
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. |
The DBLookupProfile class represents a profile for database lookup. This class includes the following method:
The following table describes the syntax for execDBLookup() method:
Syntax | Description |
---|---|
Database Lookup without sorting
Database Lookup with sorting
|
Executes a database lookup with or without sorting.
Sort Constants:
|
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. |
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. |
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. |
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. |
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. |
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.
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. |
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.
The FieldEdit class is the user interface component for entering metadata values. This section describes the following Capture Client FieldEdit classes:
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. |
The DataField class extends from DataField and represents a date field.
Property | Type | Description |
---|---|---|
value | Date | The value, represented by a Date object. |
This FloatField class extends from DataField and represents a float field.
Property | Type | Description |
---|---|---|
value | Float | The value, represented by a Float object. |
The IntegerField class extends from DataField and represents an integer field.
Property | Type | Description |
---|---|---|
value | Integer | The value, represented by an Integer object. |
The PicklistEntry class is used in picklist-type fields to determine the display and commit values. This class includes the following methods:
The following table describes the syntax for getCommitValue() method:
Syntax | Description |
---|---|
public String getCommitValue() |
Returns the commit value of the choice list entry. |
The following table describes the syntax for getDisplayValue() method:
Syntax | Description |
---|---|
public String getDisplayValue() |
Returns the display value of the choice list entry. |
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. |
This TextField class extends from DataField and represents an alphanumeric field.
Property | Type | Description |
---|---|---|
value | String | The alphanumeric value of the field. |
The section describes the following sample client scripts:
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); }
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); } }