@Override public JCas getEditorCas() throws IOException { AnnotatorState state = getModelObject(); if (state.getDocument() == null) { throw new IllegalStateException("Please open a document first!"); } // If we have a timestamp, then use it to detect if there was a concurrent access verifyAndUpdateDocumentTimestamp(state, documentService .getAnnotationCasTimestamp(state.getDocument(), state.getUser().getUsername())); return documentService.readAnnotationCas(state.getDocument(), state.getUser().getUsername()); }
@Override protected JCas getEditorCas() throws IOException { AnnotatorState state = getModelObject(); if (state.getDocument() == null) { throw new IllegalStateException("Please open a document first!"); } // If we have a timestamp, then use it to detect if there was a concurrent access verifyAndUpdateDocumentTimestamp(state, documentService .getAnnotationCasTimestamp(state.getDocument(), state.getUser().getUsername())); return documentService.readAnnotationCas(getModelObject().getDocument(), state.getUser().getUsername()); }
@Override protected JCas getEditorCas() throws IOException { AnnotatorState state = getModelObject(); if (state.getDocument() == null) { throw new IllegalStateException("Please open a document first!"); } // If we have a timestamp, then use it to detect if there was a concurrent access verifyAndUpdateDocumentTimestamp(state, documentService .getAnnotationCasTimestamp(state.getDocument(), state.getUser().getUsername())); return documentService.readAnnotationCas(getModelObject().getDocument(), state.getUser().getUsername()); }
@Override protected JCas getEditorCas() throws IOException { AnnotatorState state = getModelObject(); if (state.getDocument() == null) { throw new IllegalStateException("Please open a document first!"); } // If we have a timestamp, then use it to detect if there was a concurrent access verifyAndUpdateDocumentTimestamp(state, documentService .getAnnotationCasTimestamp(state.getDocument(), state.getUser().getUsername())); return documentService.readAnnotationCas(getModelObject().getDocument(), state.getUser().getUsername()); }
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()); } } }
Optional<Long> diskTimestamp = documentService.getAnnotationCasTimestamp(sourceDoc, username); if (diskTimestamp.isPresent()) {
Optional<Long> diskTimestamp = documentService.getAnnotationCasTimestamp(sourceDoc, username); if (diskTimestamp.isPresent()) {
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())); } }
.getAnnotationCasTimestamp(state.getDocument(), state.getUser().getUsername()));
.getAnnotationCasTimestamp(state.getDocument(), state.getUser().getUsername()));
.getAnnotationCasTimestamp(state.getDocument(), state.getUser().getUsername()));
.getAnnotationCasTimestamp(state.getDocument(), state.getUser().getUsername()));