public Task(SourceDocument aSourceDocument, JCas aJCas) { notNull(aSourceDocument); project = aSourceDocument.getProject(); sourceDocument = aSourceDocument; jCas = aJCas; user = null; }
@Override public File getDocumentFolder(SourceDocument aDocument) throws IOException { Validate.notNull(aDocument, "Source document must be specified"); File sourceDocFolder = new File(repositoryProperties.getPath(), "/" + PROJECT_FOLDER + "/" + aDocument.getProject().getId() + "/" + DOCUMENT_FOLDER + "/" + aDocument.getId() + "/" + SOURCE_FOLDER); FileUtils.forceMkdir(sourceDocFolder); return sourceDocFolder; }
@Override public long getProject(DocumentStateChangedEvent aEvent) { return aEvent.getDocument().getProject().getId(); }
@Override public long getProject(BeforeDocumentRemovedEvent aEvent) { return aEvent.getDocument().getProject().getId(); } }
@Override public long getProject(ActiveLearningSuggestionOfferedEvent aEvent) { return aEvent.getDocument().getProject().getId(); }
@Override public long getProject(SpanCreatedEvent aEvent) { return aEvent.getDocument().getProject().getId(); }
@Override public long getProject(AnnotationStateChangeEvent aEvent) { return aEvent.getDocument().getProject().getId(); }
@Override public long getProject(ActiveLearningSuggestionOfferedEvent aEvent) { return aEvent.getDocument().getProject().getId(); }
@Override public long getProject(SpanCreatedEvent aEvent) { return aEvent.getDocument().getProject().getId(); }
@Override public long getProject(DocumentOpenedEvent aEvent) { return aEvent.getDocument().getProject().getId(); } }
@TransactionalEventListener(phase = TransactionPhase.BEFORE_COMMIT) public void onDocumentStateChangeEvent(DocumentStateChangedEvent aEvent) { projectService.recalculateProjectState(aEvent.getDocument().getProject()); }
@TransactionalEventListener(phase = TransactionPhase.BEFORE_COMMIT) public void onAfterDocumentCreatedEvent(AfterDocumentCreatedEvent aEvent) { projectService.recalculateProjectState(aEvent.getDocument().getProject()); }
@Override public void analyzeAndRepair(SourceDocument aDocument, String aUsername, CAS aCas) { analyzeAndRepair(aDocument.getProject(), aDocument.getName(), aDocument.getId(), aUsername, aCas); }
@Override public void analyzeAndRepair(SourceDocument aDocument, String aUsername, CAS aCas) { analyzeAndRepair(aDocument.getProject(), aDocument.getName(), aDocument.getId(), aUsername, aCas); }
public DocumentStateChangeMessage(DocumentStateChangedEvent aEvent) { projectId = aEvent.getDocument().getProject().getId(); projectName = aEvent.getDocument().getProject().getName(); documentId = aEvent.getDocument().getId(); documentName = aEvent.getDocument().getName(); documentState = AeroRemoteApiController.sourceDocumentStateToString(aEvent.getNewState()); documentPreviousState = AeroRemoteApiController .sourceDocumentStateToString(aEvent.getPreviousState()); }
public DocumentStateChangeMessage(DocumentStateChangedEvent aEvent) { projectId = aEvent.getDocument().getProject().getId(); projectName = aEvent.getDocument().getProject().getName(); documentId = aEvent.getDocument().getId(); documentName = aEvent.getDocument().getName(); documentState = AeroRemoteApiController.sourceDocumentStateToString(aEvent.getNewState()); documentPreviousState = AeroRemoteApiController .sourceDocumentStateToString(aEvent.getPreviousState()); }
public AnnotationStateChangeMessage(AnnotationStateChangeEvent aEvent) { projectId = aEvent.getDocument().getProject().getId(); projectName = aEvent.getDocument().getProject().getName(); documentId = aEvent.getDocument().getId(); documentName = aEvent.getDocument().getName(); annotationUser = aEvent.getAnnotationDocument().getUser(); annotationState = AeroRemoteApiController .annotationDocumentStateToString(aEvent.getNewState()); annotationPreviousState = AeroRemoteApiController .annotationDocumentStateToString(aEvent.getPreviousState()); }
public AnnotationStateChangeMessage(AnnotationStateChangeEvent aEvent) { projectId = aEvent.getDocument().getProject().getId(); projectName = aEvent.getDocument().getProject().getName(); documentId = aEvent.getDocument().getId(); documentName = aEvent.getDocument().getName(); annotationUser = aEvent.getAnnotationDocument().getUser(); annotationState = AeroRemoteApiController .annotationDocumentStateToString(aEvent.getNewState()); annotationPreviousState = AeroRemoteApiController .annotationDocumentStateToString(aEvent.getPreviousState()); }
@Override protected void onConfigure() { super.onConfigure(); setEnabled(state.getDocument() != null && !documentService .getSourceDocument(state.getDocument().getProject(), state.getDocument().getName()) .getState().equals(SourceDocumentState.CURATION_FINISHED)); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = CurationPage.this.getModelObject(); setEnabled(state.getProject() != null && state.getDocument() != null && !documentService .getSourceDocument(state.getDocument().getProject(), state.getDocument().getName()) .getState().equals(SourceDocumentState.CURATION_FINISHED)); } });