DocumentTaskManager

public class DocumentTaskManager

The DocumentTaskManager 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

DocumentTaskManager
Link copied to clipboard
void DocumentTaskManager(ApiCommunicator apiCommunicator, SessionManager sessionManager, GiniApiType giniApiType, Moshi moshi)

Types

DocumentType
Link copied to clipboard
public enum DocumentType
The available document type hints.

Functions

cancelDocumentPolling
Link copied to clipboard
void cancelDocumentPolling(@NonNull() Document document)
Cancels document polling.
createCompositeDocument
Link copied to clipboard
Task<DocumentcreateCompositeDocument(@NonNull() LinkedHashMap<Document, Integer> documentRotationMap, @Nullable() DocumentTaskManager.DocumentType documentType)
Task<DocumentcreateCompositeDocument(@NonNull() List<Document> documents, @Nullable() DocumentTaskManager.DocumentType documentType)
Creates a new Gini composite document.
createDocument
Link copied to clipboard
Task<DocumentcreateDocument(@NonNull() Array<byte> document, @Nullable() String filename, @Nullable() DocumentTaskManager.DocumentType documentType)
Task<DocumentcreateDocument(@NonNull() Array<byte> document, @Nullable() String filename, @Nullable() DocumentTaskManager.DocumentType documentType, @NonNull() DocumentMetadata documentMetadata)
Uploads raw data and creates a new Gini document.
createPartialDocument
Link copied to clipboard
Task<DocumentcreatePartialDocument(@NonNull() Array<byte> document, @NonNull() String contentType, @Nullable() String filename, @Nullable() DocumentTaskManager.DocumentType documentType)
Task<DocumentcreatePartialDocument(@NonNull() Array<byte> document, @NonNull() String contentType, @Nullable() String filename, @Nullable() DocumentTaskManager.DocumentType documentType, @NonNull() DocumentMetadata documentMetadata)
Uploads raw data and creates a new Gini partial document.
createPaymentRequest
Link copied to clipboard
Task<StringcreatePaymentRequest(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
Task<StringdeleteDocument(@NonNull() String documentId)
Deletes a Gini document.
deletePartialDocumentAndParents
Link copied to clipboard
Task<StringdeletePartialDocumentAndParents(@NonNull() String documentId)
Deletes a Gini partial document and all its parent composite documents.
getAllExtractions
Link copied to clipboard
Task<ExtractionsContainergetAllExtractions(@NonNull() Document document)
Get the extractions for the given document.
getDocument
Link copied to clipboard
Task<DocumentgetDocument(@NonNull() Uri documentUri)
Task<DocumentgetDocument(@NonNull() String documentId)
Get the document with the given unique identifier.
getLayout
Link copied to clipboard
Task<JSONObjectgetLayout(@NonNull() Document document)
Gets the layout of a document.
getPageImage
Link copied to clipboard
Task<Array<byte>> getPageImage(String documentId, int page)
Get the rendered image of a page as byte[]
getPayment
Link copied to clipboard
Task<PaymentgetPayment(String id)
Get information about the payment of the PaymentRequest
getPaymentProvider
Link copied to clipboard
Task<PaymentProvidergetPaymentProvider(String id)
getPaymentProviders
Link copied to clipboard
Task<List<PaymentProvider>> getPaymentProviders()
A payment provider is a Gini partner which integrated the GiniPay for Banks SDK into their mobile apps.
getPaymentRequest
Link copied to clipboard
Task<PaymentRequestgetPaymentRequest(String id)
getPaymentRequests
Link copied to clipboard
Task<List<PaymentRequest>> getPaymentRequests()
logErrorEvent
Link copied to clipboard
Task<VoidlogErrorEvent(ErrorEvent errorEvent)
pollDocument
Link copied to clipboard
Task<DocumentpollDocument(@NonNull() Document document)
Continually checks the document status (via the Gini API) until the document is fully processed.
reportDocument
Link copied to clipboard
Task<StringreportDocument(@NonNull() Document document, @Nullable() String summary, @Nullable() String description)
Sends an error report for the given document to Gini.
resolvePaymentRequest
Link copied to clipboard
Task<ResolvedPaymentresolvePaymentRequest(String requestId, ResolvePaymentInput resolvePaymentInput)
Mark a PaymentRequest as paid.
sendFeedbackForExtractions
Link copied to clipboard
Task<DocumentsendFeedbackForExtractions(@NonNull() Document document, @NonNull() Map<String, SpecificExtraction> extractions)
Task<DocumentsendFeedbackForExtractions(@NonNull() Document document, @NonNull() Map<String, SpecificExtraction> extractions, @NonNull() Map<String, CompoundExtraction> compoundExtractions)
Sends approved and conceivably corrected extractions for the given document.

Properties

DEFAULT_COMPRESSION
Link copied to clipboard
public final static int DEFAULT_COMPRESSION
The default compression rate which is used for JPEG compression in per cent.
mApiCommunicator
Link copied to clipboard
public final ApiCommunicator mApiCommunicator
The ApiCommunicator instance which is used to communicate with the Gini API.
POLLING_INTERVAL
Link copied to clipboard
public static long POLLING_INTERVAL
The time in milliseconds between HTTP requests when a document is polled.