DocumentManager

public abstract class DocumentManager<DR extends DocumentRepository<E>, E extends ExtractionsContainer>

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

Constructors

Link copied to clipboard
public DocumentManager<DR, E> DocumentManager<DR extends DocumentRepository<E>>(DR documentRepository)

Types

Link copied to clipboard

Functions

Link copied to clipboard

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.

Creates a new Gini composite document.

Link copied to clipboard
public final Resource<Document> createPartialDocument(ByteArray document, String contentType, String filename, DocumentManager.DocumentType documentType, DocumentMetadata documentMetadata)

Uploads raw data and creates a new Gini partial document.

Link copied to clipboard
public final Resource<Unit> deleteDocument(String documentId)

Deletes a Gini document.

Link copied to clipboard

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

Link copied to clipboard
public final Resource<E> getAllExtractions(Document document)

Get all extractions (specific and compound) for the given document.

Link copied to clipboard

Poll the document and get all extractions (specific and compound) once processing has completed.

Link copied to clipboard
public final Resource<Document> getDocument(Uri uri)
public final Resource<Document> getDocument(String id)

Get the document with the given unique identifier.

Link copied to clipboard
public final Resource<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.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
public final Resource<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 DocumentRepository.POLLING_INTERVAL and a timeout of DocumentRepository.POLLING_TIMEOUT.

Link copied to clipboard
public final Resource<Unit> sendFeedbackForExtractions(Document document, Map<String, SpecificExtraction> specificExtractions)
public final Resource<Unit> sendFeedbackForExtractions(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.

Inheritors

Link copied to clipboard