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 public String getDetails(AnnotationStateChangeEvent aEvent) { try { StateChangeDetails details = new StateChangeDetails(); details.setState(Objects.toString(aEvent.getNewState(), null)); details.setPreviousState(Objects.toString(aEvent.getPreviousState(), null)); return JSONUtil.toJsonString(details); } catch (IOException e) { log.error("Unable to log event [{}]", aEvent, e); return "<ERROR>"; } } }
@Override public long getDocument(AnnotationStateChangeEvent aEvent) { return aEvent.getDocument().getId(); }
@Override @Transactional public AnnotationDocumentState setAnnotationDocumentState(AnnotationDocument aDocument, AnnotationDocumentState aState) { AnnotationDocumentState oldState = aDocument.getState(); aDocument.setState(aState); createAnnotationDocument(aDocument); if (!Objects.equals(oldState, aDocument.getState())) { applicationEventPublisher .publishEvent(new AnnotationStateChangeEvent(this, aDocument, oldState)); } return oldState; }
@Override public String getAnnotator(AnnotationStateChangeEvent aEvent) { return aEvent.getAnnotationDocument().getUser(); }
@Override public String getDetails(AnnotationStateChangeEvent aEvent) { try { StateChangeDetails details = new StateChangeDetails(); details.setState(Objects.toString(aEvent.getNewState(), null)); details.setPreviousState(Objects.toString(aEvent.getPreviousState(), null)); return JSONUtil.toJsonString(details); } catch (IOException e) { log.error("Unable to log event [{}]", aEvent, e); return "<ERROR>"; } } }
@Override public long getDocument(AnnotationStateChangeEvent aEvent) { return aEvent.getDocument().getId(); }
@Override @Transactional public AnnotationDocumentState setAnnotationDocumentState(AnnotationDocument aDocument, AnnotationDocumentState aState) { AnnotationDocumentState oldState = aDocument.getState(); aDocument.setState(aState); createAnnotationDocument(aDocument); if (!Objects.equals(oldState, aDocument.getState())) { applicationEventPublisher .publishEvent(new AnnotationStateChangeEvent(this, aDocument, oldState)); } return oldState; }
@Override public String getAnnotator(AnnotationStateChangeEvent aEvent) { return aEvent.getAnnotationDocument().getUser(); }
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 public long getProject(AnnotationStateChangeEvent aEvent) { return aEvent.getDocument().getProject().getId(); }
new DocumentStateChangedEvent(this, doc, SourceDocumentState.NEW)); applicationEventPublisher.publishEvent( new AnnotationStateChangeEvent(this, ann, AnnotationDocumentState.IN_PROGRESS));
@Override public long getProject(AnnotationStateChangeEvent aEvent) { return aEvent.getDocument().getProject().getId(); }