public static AnnotationDocumentState transition(AnnotationDocumentStateTransition aTransition) throws IllegalArgumentException { if (aTransition.equals(NEW_TO_ANNOTATION_IN_PROGRESS)) { return AnnotationDocumentState.IN_PROGRESS; } else if (aTransition.equals(ANNOTATION_IN_PROGRESS_TO_ANNOTATION_FINISHED)) { return AnnotationDocumentState.FINISHED; } else if (aTransition.equals(ANNOTATION_FINISHED_TO_ANNOTATION_IN_PROGRESS)) { return AnnotationDocumentState.IN_PROGRESS; } else if (aTransition.equals(NEW_TO_IGNORE)) { return AnnotationDocumentState.IGNORE; } else if (aTransition.equals(IGNORE_TO_NEW)) { return AnnotationDocumentState.NEW; } else { throw new IllegalArgumentException(); } }
@Override @Transactional public AnnotationDocumentState transitionAnnotationDocumentState(AnnotationDocument aDocument, AnnotationDocumentStateTransition aTransition) { return setAnnotationDocumentState(aDocument, AnnotationDocumentStateTransition.transition(aTransition)); }
@Override @Transactional public AnnotationDocumentState transitionAnnotationDocumentState(AnnotationDocument aDocument, AnnotationDocumentStateTransition aTransition) { return setAnnotationDocumentState(aDocument, AnnotationDocumentStateTransition.transition(aTransition)); }
public static AnnotationDocumentState transition(AnnotationDocumentStateTransition aTransition) throws IllegalArgumentException { if (aTransition.equals(NEW_TO_ANNOTATION_IN_PROGRESS)) { return AnnotationDocumentState.IN_PROGRESS; } else if (aTransition.equals(ANNOTATION_IN_PROGRESS_TO_ANNOTATION_FINISHED)) { return AnnotationDocumentState.FINISHED; } else if (aTransition.equals(ANNOTATION_FINISHED_TO_ANNOTATION_IN_PROGRESS)) { return AnnotationDocumentState.IN_PROGRESS; } else if (aTransition.equals(NEW_TO_IGNORE)) { return AnnotationDocumentState.IGNORE; } else if (aTransition.equals(IGNORE_TO_NEW)) { return AnnotationDocumentState.NEW; } else { throw new IllegalArgumentException(); } }
/** * change the state of an annotation document. used to re-open closed documents * * @param aSourceDocument * @param aUser * @param aAnnotationDocumentStateTransition */ private void changeAnnotationDocumentState(SourceDocument aSourceDocument, User aUser, AnnotationDocumentStateTransition aAnnotationDocumentStateTransition) { AnnotationDocument annotationDocument = repository.getAnnotationDocument( aSourceDocument, aUser); annotationDocument.setState(AnnotationDocumentStateTransition .transition(aAnnotationDocumentStateTransition)); try { repository.createAnnotationDocument(annotationDocument); } catch (IOException e) { LOG.info("Unable to get the LOG file"); } }
public static AnnotationDocumentState transition(AnnotationDocumentStateTransition aTransition) throws IllegalArgumentException { if (aTransition.equals(NEW_TO_ANNOTATION_IN_PROGRESS)) { return AnnotationDocumentState.IN_PROGRESS; } else if (aTransition.equals(ANNOTATION_IN_PROGRESS_TO_ANNOTATION_FINISHED)) { return AnnotationDocumentState.FINISHED; } else if (aTransition.equals(ANNOTATION_FINISHED_TO_ANNOTATION_IN_PROGRESS)) { return AnnotationDocumentState.IN_PROGRESS; } else if (aTransition.equals(NEW_TO_IGNORE)) { return AnnotationDocumentState.IGNORE; } else if (aTransition.equals(IGNORE_TO_NEW)) { return AnnotationDocumentState.NEW; } else { throw new IllegalArgumentException(); } }
annotationDocument.setUser(user.getUsername()); annotationDocument.setState(AnnotationDocumentStateTransition .transition(NEW_TO_ANNOTATION_IN_PROGRESS)); try { repository.createAnnotationDocument(annotationDocument);