• No results found

Customizing Data Validation and Field Lookup

In document Front Office Server 3.0 (Page 37-41)

For the Web Client and MFPs, any data entered for index fields is validated for an appropriate data type and data length.

Additionally, for the Web Client and an HP MFP, you can customize validation and a variety of field lookup options for Kofax Front Office Server as follows:

can additionally define whether users will have to select a value from the list or whether they can also type a value which is not in the list.

„ Form validation: All the field values of a form and their interdependencies can be validated.

Customizing with a Kofax Capture Validation Script

You can create or edit a Visual Basic .NET validation script in Kofax Capture to validate data provided for index fields in Kofax Front Office Server Web Client or an HP MFP. The data is validated for index fields for documents in a particular Kofax Capture document class. Validation occurs when the user exits the index fields.

The validation script implemented in Kofax Capture is used for both Kofax Capture and Kofax Front Office Server. The validation script determines in which context it was called (Kofax Capture or Kofax Front Office Server), and in which context for Kofax Front Office Server it was called (the Web Client or an HP MFP).

This method of customizing data validation can be used instead of, and not in conjunction with, creating a validation class for Kofax Front Office Server (as described in Customizing with a Validation Class for Kofax Front Office Server (Deprecated)).

Note This feature requires Kofax Capture 9, or Kofax Capture 8 with Service Pack 5.

X To create a new or edit an existing VB.NET validation script, go to the Kofax Capture Administration module. Then, on the Scripts menu, select Document Validation. (For additional information, see the Kofax Capture user documentation.)

Figure 16. Kofax Capture Document Validation Script Window When preparing the validation script, note the following:

„ For the scripting language, be sure VB.NET is selected.

„ The VB.NET project for the validation script contains the following:

„ A class that inherits from Kofax.AscentCapture.Scripting.DocumentValidationScript

„ Members for each field in the document class, tagged with an attribute indicating the field name it represents

„ Create or edit the validation script using a sample validation script, and the API reference and Readme.

Links are provided to the sample validation script, API reference, and README in Data Validation and Lookup Customization for Developer Resources.

Figure 17. Data Validation and Lookup Customization for Developer Resources

„ To implement Kofax Front Office Server-specific functionality, add a reference to Kofax.KFSLib.KFSValidation.dll, the assembly that contains classes necessary to handle Kofax Front Office Server behavior. The file is located in the \Bin\KFS folder, where Kofax Capture is installed.

This reference must maintain the Copy Local property, to ensure that other validation stations can perform properly if the appropriate version of Kofax Capture is not installed.

„ Add the attribute KFSIndexFieldAttribute to each field, specifying the following parameters:

„ Validate (true or false)

„ ReadOnly (true or false)

„ Optionally, use a static property in the ValidationContext class that indicates if the script is called through Kofax Front Office Server or Kofax Capture validation.

„ Be aware that only FieldPostProcessing is called from within Kofax Front Office Server.

FieldPreProcessing is ignored.

„ Optionally, implement a single event handler from one of the following:

„ DocumentPreProcessing: Called each time a new document is opened

„ DocumentPostProcessing: Called when a document is closed

„ When FatalErrorException or RejectAndSkipDocumentException is encountered in your validation script, the exception is handled the same as ValidationErrorException.

„ Unique to Kofax Front Office Server, a utility method is provided that allows you to specify value lists for a given field. Currently, dynamic value lists are supported for Kofax Front Office Server only, and not Kofax Capture.

„ Validation will not perform as desired if a batch field and document index field have the same name.

Customizing with a Validation Class for Kofax Front Office Server (Deprecated)

You can create a validation class, using a Java-based API, to validate data provided for index fields in the Web Client or an HP MFP.

This method of customizing data validation can be used instead of, and not in conjunction with, creating a validation script in Kofax Capture (as described in Customizing with a Kofax Capture Validation Script).

Note This feature is deprecated for Kofax Front Office Server 3.0.

X To create a validation class

1 Create a validation class using the Data Validation SDK, located in the

\OtherResources\DeveloperResources\DataValidation folder.

The corresponding methods are:

„ For field validation, implement validateField. To define which fields to validate, implement getFieldsToValidate.

„ For form validation, implement validateForm.

Tip If you want to use only one of these validation methods, modify the one you do not need so that the validation method will always return null.

For more information about how to develop and deploy your data validation class, refer to the readme and Javadoc that is part of the SDK.

2 To enable validation for the Web Client, open the \KFS\Config\KFSportal.properties file, in a text editor. Then, for the validation.class element, specify the fully-qualified name of the validation class.

For example, if the name of the validation class is FormValidation and the package is com.company, the file will contain the following:

validation.class=com.company.FormValidation

3 To enable validation for an HP MFP, open the \KFS\Config\mfp.validation.properties file, in a text editor. Then, for the validation.class element, specify the fully-qualified name of the validation class.

For example, if the name of the validation class is FormValidation and the package is com.company, the file will contain the following:

validation.class=com.company.FormValidation

4 Save and close the file. For the changes to take effect, stop and restart Kofax Front Office Server.

Note For later changes to take effect, it is sufficient to save and close the file.

When preparing a validation class, note the following, particularly if you want to continue using a validation class that was prepared for a previous version of Kofax Front Office Server:

„ The backend ID is identified as “KofaxCapture” and the form type is the actual name of the form type in Kofax Capture.

Update any validation class, where the backend ID is the fully-qualified package name and the form type is “[Batch Class] || [Form Type]”, to conform to the revised values.

„ Batch fields are no longer prefixed with “Batch Field -”.

Update any validation class that uses that naming convention.

„ Be aware that validation will not perform as desired if a batch field and document index field have the same name.

In document Front Office Server 3.0 (Page 37-41)

Related documents