ActiveAnno

Web-based responsive document annotation tool

View the Project on GitHub MaxMello/ActiveAnno

activeannoservice / document

Package document

Types

Name Summary
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.data class Document
DocumentDAO This DAO provides all methods to interact with the document collection. It hides the collection and controls access to it via the public methods.class DocumentDAO
DocumentID To make code more readable, define the ID of a document as a typealias on Stringtypealias DocumentID = String
ProjectAnnotationData Data class representing all annotation data for a specific project.class ProjectAnnotationData

Properties

Name Summary
KEY_DOCUMENT_TEXT const val KEY_DOCUMENT_TEXT: String

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>
getNewestFinalizedAnnotationResult Get the newest finalized annotation, being treated as the actual final annotation. FinalizedAnnotations can be changed after the fact, so the newest one is always the new truth.fun ProjectAnnotationData.getNewestFinalizedAnnotationResult(): FinalizedAnnotationResult?
updateIndexes Create all indexes in mongoDB. If they already exist, nothing will happen. Every index is sparse, because they are dynamic and depend on user input. Normally, this would not be recommended when designing a database, but because of the highly configurable nature of ActiveAnno, it is done that way.suspend fun updateIndexes(): Unit