ActiveAnno

Web-based responsive document annotation tool

View the Project on GitHub MaxMello/ActiveAnno

activeannoservice / document / Document

Document

data class Document

The data class representing a document with some originalDocument, a unique id, optionally a restrictedProjectID (marking the document to belong only to that one project), and the projectAnnotationData holding all the annotations for every project related to the document.

Constructors

Name Summary
<init> The data class representing a document with some originalDocument, a unique id, optionally a restrictedProjectID (marking the document to belong only to that one project), and the projectAnnotationData holding all the annotations for every project related to the document.Document(id: DocumentID = newId<Document>().toString(), storeTimestamp: Long, originalDocument: ObjectNode, restrictedProjectID: String? = null, projectAnnotationData: MutableMap<String, ProjectAnnotationData> = mutableMapOf())

Properties

Name Summary
id Unique, generated ID (mongo ID)val id: DocumentID
originalDocument val originalDocument: ObjectNode
projectAnnotationData val projectAnnotationData: MutableMap<String, ProjectAnnotationData>
restrictedProjectID Optionally, a Document can be restricted to a single Project through this field.val restrictedProjectID: String?
storeTimestamp val storeTimestamp: Long

Functions

Name Summary
equals fun equals(other: Any?): Boolean
hashCode fun hashCode(): Int

Extension Functions

Name Summary
addAnnotationResultForProject suspend fun Document.addAnnotationResultForProject(project: Project, annotationResult: AnnotationResult, checkWebHooks: Boolean, applyPolicy: Boolean, overwriteFinalizedAnnotations: Boolean = false, curationRequest: String? = null, annotationSchema: DenormalizedAnnotationSchema? = null): Unit
addEmptyProjectAnnotationData fun Document.addEmptyProjectAnnotationData(project: Project): Unit
addFinalizedAnnotationResultForProject Extension function to add FinalizedAnnotationResult to a Document and a Project. Might also do logic related to the Project after adding the result.suspend fun Document.addFinalizedAnnotationResultForProject(project: Project, finalizedAnnotationResult: FinalizedAnnotationResult, checkWebHooks: Boolean, applyPolicy: Boolean, overwriteFinalizedAnnotations: Boolean = false, curationRequest: String? = null, annotationSchema: DenormalizedAnnotationSchema? = null): ProjectAnnotationData
addGeneratedAnnotationDataForProject fun Document.addGeneratedAnnotationDataForProject(project: Project, generatedAnnotationData: GeneratedAnnotationData): Unit
applyInputMapping Apply the input mapping to a document, returning a map of string keys to string values of the original document.fun Document.applyInputMapping(inputMapping: InputMapping): Map<String, String>
toSearchResultDocument Convert a Document to a SearchResultDocumentfun Document.toSearchResultDocument(project: Project): SearchResultDocument