DocumentManager

public final class DocumentManager

The DocumentManager is a high level API on top of the Gini API, which is used via the ApiCommunicator. It provides high level methods to handle document related tasks easily.

Constructors

DocumentManager
Link copied to clipboard
DocumentManager DocumentManager(DocumentTaskManager documentTaskManager)

Functions

createCompositeDocument
Link copied to clipboard
final Document createCompositeDocument(LinkedHashMap<Document, Integer> documentRotationMap, DocumentTaskManager.DocumentType documentType)

Creates a new Gini composite document. The input Map must contain the partial documents as keys. These will be part of the multi-page document. The value for each partial document key is the amount in degrees the document has been rotated by the user.

final Document createCompositeDocument(List<Document> documents, DocumentTaskManager.DocumentType documentType)

Creates a new Gini composite document.

createPartialDocument
Link copied to clipboard
final Document createPartialDocument(ByteArray document, String contentType, String filename, DocumentTaskManager.DocumentType documentType, DocumentMetadata documentMetadata)

Uploads raw data and creates a new Gini partial document.

createPaymentRequest
Link copied to clipboard
final String createPaymentRequest(PaymentRequestInput paymentRequestInput)

A PaymentRequest is used to have on the backend the intent of making a payment for a document with its (modified) extractions and specific payment provider.

deleteDocument
Link copied to clipboard
final Unit deleteDocument(String documentId)

Deletes a Gini document.

deletePartialDocumentAndParents
Link copied to clipboard
final Unit deletePartialDocumentAndParents(String documentId)

Deletes a Gini partial document and all its parent composite documents.

getDocument
Link copied to clipboard
final Document getDocument(Uri uri)
final Document getDocument(String id)

Get the document with the given unique identifier.

getExtractions
Link copied to clipboard
final ExtractionsContainer getExtractions(Document document)

Get the extractions for the given document.

getLayout
Link copied to clipboard
final JSONObject getLayout(Document document)

Gets the layout of a document. The layout of the document describes the textual content of a document with positional information, based on the processed document.

getPageImage
Link copied to clipboard
final ByteArray getPageImage(String documentId, Integer page)

Get the rendered image of a page as byte[]

getPayment
Link copied to clipboard
final Payment getPayment(String id)

Get information about the payment of the PaymentRequest

getPaymentProvider
Link copied to clipboard
final PaymentProvider getPaymentProvider(String id)
getPaymentProviders
Link copied to clipboard
final List<PaymentProvidergetPaymentProviders()

A payment provider is a Gini partner which integrated the GiniPay for Banks SDK into their mobile apps.

getPaymentRequest
Link copied to clipboard
final PaymentRequest getPaymentRequest(String id)
getPaymentRequests
Link copied to clipboard
final List<PaymentRequestgetPaymentRequests()
pollDocument
Link copied to clipboard
final Document pollDocument(Document document)

Continually checks the document status (via the Gini API) until the document is fully processed. To avoid flooding the network, there is a pause of at least the number of seconds that is set in the POLLING_INTERVAL constant of DocumentTaskManager.

reportDocument
Link copied to clipboard
final String reportDocument(Document document, String summary, String description)

Sends an error report for the given document to Gini. If the processing result for a document was not satisfactory (e.g. extractions where empty or incorrect), you can create an error report for a document. This allows Gini to analyze and correct the problem that was found.

resolvePaymentRequest
Link copied to clipboard
final ResolvedPayment resolvePaymentRequest(String requestId, ResolvePaymentInput resolvePaymentInput)

Mark a PaymentRequest as paid.

sendFeedback
Link copied to clipboard
final Document sendFeedback(Document document, Map<String, SpecificExtraction> specificExtractions, Map<String, CompoundExtraction> compoundExtractions)

Sends approved and conceivably corrected extractions for the given document. This is called "submitting feedback on extractions" in the Gini API documentation.