documentService.writeAnnotationCas(annotationCas, document, annotator, false);
documentService.writeAnnotationCas(annotationCas, document, annotator, false);
/** * Reset the document by removing all annotations form the initial CAS and using the result as * the editor CAS. */ @Override protected void actionResetDocument(AjaxRequestTarget aTarget) throws Exception { AnnotatorState state = getModelObject(); JCas editorCas = documentService.createOrReadInitialCas(state.getDocument()); editorCas = BratAnnotatorUtility.clearJcasAnnotations(editorCas); documentService.writeAnnotationCas(editorCas, state.getDocument(), state.getUser(), false); actionLoadDocument(aTarget); }
public void upgradeCasAndSave(SourceDocument aDocument, String aUsername) throws IOException { User user = userRepository.get(aUsername); if (documentService.existsAnnotationDocument(aDocument, user)) { AnnotationDocument annotationDocument = documentService.getAnnotationDocument(aDocument, user); try { CAS cas = documentService.readAnnotationCas(annotationDocument).getCas(); annotationService.upgradeCas(cas, annotationDocument); documentService.writeAnnotationCas(cas.getJCas(), annotationDocument, false); } catch (Exception e) { // no need to catch, it is acceptable that no curation document // exists to be upgraded while there are annotation documents } } }
public void upgradeCasAndSave(SourceDocument aDocument, String aUsername) throws IOException { User user = userRepository.get(aUsername); if (documentService.existsAnnotationDocument(aDocument, user)) { AnnotationDocument annotationDocument = documentService.getAnnotationDocument(aDocument, user); try { CAS cas = documentService.readAnnotationCas(annotationDocument).getCas(); annotationService.upgradeCas(cas, annotationDocument); documentService.writeAnnotationCas(cas.getJCas(), annotationDocument, false); } catch (Exception e) { // no need to catch, it is acceptable that no curation document // exists to be upgraded while there are annotation documents } } }
public void writeEditorCas(JCas aJCas) throws IOException { AnnotatorState state = getModelObject(); if (state.getMode().equals(Mode.ANNOTATION) || state.getMode().equals(Mode.AUTOMATION) || state.getMode().equals(Mode.CORRECTION)) { documentService.writeAnnotationCas(aJCas, state.getDocument(), state.getUser(), true); // Update timestamp in state Optional<Long> diskTimestamp = documentService .getAnnotationCasTimestamp(state.getDocument(), state.getUser().getUsername()); if (diskTimestamp.isPresent()) { state.setAnnotationDocumentTimestamp(diskTimestamp.get()); } } else if (state.getMode().equals(Mode.CURATION)) { curationDocumentService.writeCurationCas(aJCas, state.getDocument(), true); // Update timestamp in state Optional<Long> diskTimestamp = curationDocumentService .getCurationCasTimestamp(state.getDocument()); if (diskTimestamp.isPresent()) { state.setAnnotationDocumentTimestamp(diskTimestamp.get()); } } }
documentService.writeAnnotationCas(jCas, sourceDoc, state.getUser(), true);
documentService.writeAnnotationCas(jCas, sourceDoc, state.getUser(), true);
private void writeEditorCas(AnnotatorState aState, JCas aJCas) throws IOException { if (aState.getMode().equals(Mode.ANNOTATION) || aState.getMode().equals(Mode.AUTOMATION) || aState.getMode().equals(Mode.CORRECTION)) { documentService.writeAnnotationCas(aJCas, aState.getDocument(), aState.getUser(), true); updateDocumentTimestampAfterWrite(aState, documentService.getAnnotationCasTimestamp( aState.getDocument(), aState.getUser().getUsername())); } else if (aState.getMode().equals(Mode.CURATION)) { curationDocumentService.writeCurationCas(aJCas, aState.getDocument(), true); updateDocumentTimestampAfterWrite(aState, curationDocumentService .getCurationCasTimestamp(aState.getDocument())); } }
private void writeEditorCas(AnnotatorState aState, JCas aJCas) throws IOException { if (aState.getMode().equals(Mode.ANNOTATION) || aState.getMode().equals(Mode.AUTOMATION) || aState.getMode().equals(Mode.CORRECTION)) { documentService.writeAnnotationCas(aJCas, aState.getDocument(), aState.getUser(), true); updateDocumentTimestampAfterWrite(aState, documentService.getAnnotationCasTimestamp( aState.getDocument(), aState.getUser().getUsername())); } else if (aState.getMode().equals(Mode.CURATION)) { curationDocumentService.writeCurationCas(aJCas, aState.getDocument(), true); updateDocumentTimestampAfterWrite(aState, curationDocumentService .getCurationCasTimestamp(aState.getDocument())); } }
editorCas = documentService.createOrReadInitialCas(state.getDocument()); editorCas = BratAnnotatorUtility.clearJcasAnnotations(editorCas); documentService.writeAnnotationCas(editorCas, state.getDocument(), user, false); documentService.writeAnnotationCas(editorCas.getCas().getJCas(), annotationDocument.getDocument(), user, false); correctionDocumentService.writeCorrectionCas(correctionCas, state.getDocument());
documentService.writeAnnotationCas(editorCas.getCas().getJCas(), annotationDocument, false);
documentService.writeAnnotationCas(editorCas.getCas().getJCas(), annotationDocument.getDocument(), state.getUser(), false); correctionDocumentService.writeCorrectionCas(correctionCas, state.getDocument());
documentService.writeAnnotationCas(editorCas.getCas().getJCas(), annotationDocument.getDocument(), state.getUser(), false); correctionDocumentService.writeCorrectionCas(correctionCas, state.getDocument());