Kofax Mobile SDK API Reference
|
The Document object is instantiated as a specific DocumentType. This object is serializable. More...
Public Member Functions | |
Document | clone () |
Performs a field-for-field copy of instances of this class. More... | |
Document (DocumentType documentType) | |
Instantiate a Document object from the specified DocumentType. More... | |
Document (DocumentTypeR documentTypeR) | |
Instantiate a Document object from the specified read-only DocumentType. More... | |
Document (DocumentType documentType, String documentID) | |
Instantiate a Document object from the specified DocumentType and ID. More... | |
Document (DocumentTypeR documentTypeR, String documentID) | |
Instantiate a Document object from the specified read-only DocumentType and ID. More... | |
void | addPage (Page page) throws KmcException |
Adds the specified Page to this Document. More... | |
ErrorInfo | removePage (String pageId) |
Removes the Page that matches the specified pageId from this Document. More... | |
String | getDocumentId () |
Return the application-defined Document ID. More... | |
DocumentType | getDocumentType () |
Gets the DocumentType for this Document. More... | |
List< Field > | getFields () |
Gets the array of Field objects with values extracted from document or entered manually by user. More... | |
List< Page > | getPages () |
Gets the array of Page objects for this Document. More... | |
List< ClassificationResult > | getClassificationAlternatives () |
Gets list of ClassificationResult object alternatives, which may have been returned in an RTTI Transformation response. More... | |
void | setClassificationAlternatives (List< ClassificationResult > classificationAlternatives) |
Sets list of ClassificationResult object alternatives, which may have been returned in an RTTI Transformation response. More... | |
String | getDocumentLevelError () |
Gets the Document level error contained in an RTTI web service response. More... | |
void | setDocumentLevelError (String documentLevelError) |
Sets the Document level error returned by RTTI. More... | |
The Document object is instantiated as a specific DocumentType. This object is serializable.
The object contains zero or more Field objects that contain the document data, and one or more Page objects that contain images.
Initialization
The Document object is the top level class of the logistics data hierarchy. It brings together the DocumentType, FieldType, Field, and Page objects and provides a vehicle for submitting case information and images to a server. An application desiring to use the SDK to submit data to a server must instantiate and populate a Document object. The Document object is instantiated with a DocumentType object, using one of the Document constructors. The DocumentType object contains an array of FieldType objects which are used to instantiate Field objects. These Field objects populate an array within the Document object.
Life Cycle
After instantiation, one or more Page objects can be added to an array maintained in the Document object. Each page object contains an array of one or more images. A method is also provided to remove pages from the Document object. Once a Document object is created with at least one page, and at least one image is included in that page, the document is ready to be sent to a server using FrontOfficeServer or TotalAgilityServer. Once the document has been successfully submitted to the server, it would normally be deleted by setting it to null. However, this should not be done until any underlying image files are deleted from the documents folder. After the object is deleted, its memory allocations are freed.
Serialization
Document objects support serialization in a similar way to Image objects. The Image object documentation provides code examples for serialization and deserialization.
Document | ( | DocumentType | documentType | ) |
Instantiate a Document object from the specified DocumentType.
A random ID is generated and used for the new Document.
documentType | : DocumentType |
Document | ( | DocumentTypeR | documentTypeR | ) |
Instantiate a Document object from the specified read-only DocumentType.
A random ID is generated and used for the new Document.
documentTypeR | : DocumentTypeR |
Document | ( | DocumentType | documentType, |
String | documentID | ||
) |
Instantiate a Document object from the specified DocumentType and ID.
If the specified documentID string is empty, a random ID is generated and used for the new Document.
documentType | : DocumentType |
documentID | : String |
NullPointerException | (documentID parameter cannot be null). |
Document | ( | DocumentTypeR | documentTypeR, |
String | documentID | ||
) |
Instantiate a Document object from the specified read-only DocumentType and ID.
If the specified documentID string is empty, a random ID is generated and used for the new Document.
documentTypeR | : DocumentTypeR |
documentID | : String |
NullPointerException | (documentID parameter cannot be null). |
void addPage | ( | Page | page | ) | throws KmcException |
Document clone | ( | ) |
Performs a field-for-field copy of instances of this class.
List<ClassificationResult> getClassificationAlternatives | ( | ) |
Gets list of ClassificationResult object alternatives, which may have been returned in an RTTI Transformation response.
An RTTI Transformation response may include document classification results, including classification results of lower confidence. This property provides a way for the application to retrieve persisted document classification result alternatives, along with their respective confidence values.
String getDocumentId | ( | ) |
Return the application-defined Document ID.
Returns the unique ID which identifies a particular Document. The application may invent this ID according to its own client application and back-end server architecture. Its usage in AppStats events requires this ID to be a random UUID (also known as a GUID).
String getDocumentLevelError | ( | ) |
Gets the Document level error contained in an RTTI web service response.
An error returned by an RTTI Transformation indicating some issue at the Document level error condition. It may indicate the Document was unconfidently classified based on the class-level classification settings. Or, there could be a server-side KTM rules failure returned in an RTTI web service response.
DocumentType getDocumentType | ( | ) |
Gets the DocumentType for this Document.
List<Field> getFields | ( | ) |
Gets the array of Field objects with values extracted from document or entered manually by user.
List<Page> getPages | ( | ) |
ErrorInfo removePage | ( | String | pageId | ) |
void setClassificationAlternatives | ( | List< ClassificationResult > | classificationAlternatives | ) |
Sets list of ClassificationResult object alternatives, which may have been returned in an RTTI Transformation response.
An RTTI Transformation response may include document classification results, including classification results of lower confidence. This property provides a way for the application to persist document classification result alternatives, along with their respective confidence values.
classificationAlternatives | List of classification result alternatives packaged as ClassificationResult objects. |
void setDocumentLevelError | ( | String | documentLevelError | ) |
Sets the Document level error returned by RTTI.
Allows the application to persist errors returned by an RTTI Transformation indicating some issue at the Document level. It may indicate the Document was unconfidently classified based on the class-level classification settings. Or, there could be a server-side rules failure from KTM returned in an RTTI web service response.
documentLevelError | : String |