Package 

Class DocumentManager

    • Constructor Detail

      • DocumentManager

        DocumentManager(DR documentRepository)
    • Method Detail

      • deletePartialDocumentAndParents

         final Resource<Unit> deletePartialDocumentAndParents(String documentId)

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

        Partial documents can be deleted only, if they don't belong to any composite documents and this method deletes the parents before deleting the partial document.

        Parameters:
        documentId - The id of an existing partial document
      • createCompositeDocument

         final Resource<Document> createCompositeDocument(LinkedHashMap<Document, Integer> documentRotationMap, DocumentManager.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.

        Parameters:
        documentRotationMap - A map of partial documents and their rotation in degrees
        documentType - Optional a document type hint.
      • getDocument

         final Resource<Document> getDocument(String id)

        Get the document with the given unique identifier.

        Parameters:
        id - The unique identifier of the document.
      • getDocument

         final Resource<Document> getDocument(Uri uri)

        Get the document with the given unique identifier.

        Please note that this method may use a slightly corrected URI from which it gets the document (e.g. if the URI's host does not conform to the base URL of the Gini API). Therefore it is not possibly to use this method to get a document from an arbitrary URI.

        Parameters:
        uri - The URI of the document.
      • getLayout

         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.

        Parameters:
        document - The document for which the layouts is requested.
      • getAllExtractions

         final Resource<E> getAllExtractions(Document document)

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

        Parameters:
        document - The Document instance for whose document the extractions are returned.
      • getAllExtractionsWithPolling

         final Resource<E> getAllExtractionsWithPolling(Document document)

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

        Parameters:
        document - The Document instance for whose document the extractions are returned.
      • sendFeedbackForExtractions

         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.

        Parameters:
        document - The document for which the extractions should be updated.
        specificExtractions - A Map where the key is the name of the specific extraction and the value is the SpecificExtraction object.
        compoundExtractions - A Map where the key is the name of the compound extraction and the value is the CompoundExtraction object.
      • sendFeedbackForExtractions

         final Resource<Unit> sendFeedbackForExtractions(Document document, Map<String, SpecificExtraction> specificExtractions)

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

        Parameters:
        document - The document for which the extractions should be updated.
        specificExtractions - A Map where the key is the name of the specific extraction and the value is the SpecificExtraction object.