/** * This reviewer decides to review the publication. * * @param publication the publication to use * @param reason an optional comment */ @LifecycleTransition(statusChange = false) public void changeReviewer(Publication publication, User newReviewer, String reason) { addLifecycleEvent(publication, CvLifecycleEventType.REVIEWER_CHANGED, reason); User previousReviewer = publication.getCurrentReviewer(); publication.setCurrentReviewer( newReviewer ); // Notify listeners for ( LifecycleEventListener listener : getListeners() ) { listener.fireReviewerChanged( publication, previousReviewer, newReviewer ); } }
/** * This reviewer decides to review the publication. * * @param publication the publication to use * @param reason an optional comment */ @LifecycleTransition(statusChange = false) public void changeReviewer(Publication publication, User newReviewer, String reason) { addLifecycleEvent(publication, CvLifecycleEventType.REVIEWER_CHANGED, reason); User previousReviewer = publication.getCurrentReviewer(); publication.setCurrentReviewer( newReviewer ); // Notify listeners for ( LifecycleEventListener listener : getListeners() ) { listener.fireReviewerChanged( publication, previousReviewer, newReviewer ); } }
private void synchronizePublication( Publication publication, boolean synchronizeAnnotatedAttributes ) { if (IntactCore.isInitializedAndDirty(publication.getExperiments())){ Collection<Experiment> experiments = synchronizeCollection(publication.getExperiments()); publication.getExperiments().clear(); publication.getExperiments().addAll(experiments); } publication.setStatus( synchronize( publication.getStatus() ) ); publication.setCurrentOwner( synchronizeUser(publication.getCurrentOwner()) ); publication.setCurrentReviewer( synchronizeUser(publication.getCurrentReviewer()) ); final List<LifecycleEvent> events = publication.getLifecycleEvents(); if (IntactCore.isInitializedAndDirty( events )){ Collection<LifecycleEvent> synchedEvents = new ArrayList<LifecycleEvent>( events.size() ); for ( LifecycleEvent event : events ) { synchedEvents.add( synchronizeEvent(event) ); } events.clear(); events.addAll( synchedEvents ); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( publication ); } }
private void synchronizePublication( Publication publication, boolean synchronizeAnnotatedAttributes ) { if (IntactCore.isInitializedAndDirty(publication.getExperiments())){ Collection<Experiment> experiments = synchronizeCollection(publication.getExperiments()); publication.getExperiments().clear(); publication.getExperiments().addAll(experiments); } publication.setStatus( synchronize( publication.getStatus() ) ); publication.setCurrentOwner( synchronizeUser(publication.getCurrentOwner()) ); publication.setCurrentReviewer( synchronizeUser(publication.getCurrentReviewer()) ); final List<LifecycleEvent> events = publication.getLifecycleEvents(); if (IntactCore.isInitializedAndDirty( events )){ Collection<LifecycleEvent> synchedEvents = new ArrayList<LifecycleEvent>( events.size() ); for ( LifecycleEvent event : events ) { synchedEvents.add( synchronizeEvent(event) ); } events.clear(); events.addAll( synchedEvents ); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( publication ); } }
/** * The curator decides the publication can now be checked. Needs to know the outcome of the sanity check * in order to do the transition to the right status. * * @param publication the publication * @param message mechanism of creation of the publication */ @LifecycleTransition(fromStatus = CvPublicationStatusType.CURATION_IN_PROGRESS, toStatus = CvPublicationStatusType.READY_FOR_CHECKING) public void readyForChecking(Publication publication, String message, boolean successfulSanityCheck) { // TODO instead of a boolean, it could be a SanityCheckReport kind of object if (successfulSanityCheck) { // TODO assign a reviewer changeStatus(publication, CvPublicationStatusType.READY_FOR_CHECKING, CvLifecycleEventType.READY_FOR_CHECKING, message); if (publication.getCurrentReviewer() == null) { correctionAssigner.assignReviewer(publication); } // notify listeners for ( LifecycleEventListener listener : getListeners() ) { listener.fireReadyForChecking( publication ); } } else { addLifecycleEvent(publication, CvLifecycleEventType.SANITY_CHECK_FAILED, message); // TODO the message should be the ID of the sanity check } } }
/** * The curator decides the publication can now be checked. Needs to know the outcome of the sanity check * in order to do the transition to the right status. * * @param publication the publication * @param message mechanism of creation of the publication */ @LifecycleTransition(fromStatus = CvPublicationStatusType.CURATION_IN_PROGRESS, toStatus = CvPublicationStatusType.READY_FOR_CHECKING) public void readyForChecking(Publication publication, String message, boolean successfulSanityCheck) { // TODO instead of a boolean, it could be a SanityCheckReport kind of object if (successfulSanityCheck) { // TODO assign a reviewer changeStatus(publication, CvPublicationStatusType.READY_FOR_CHECKING, CvLifecycleEventType.READY_FOR_CHECKING, message); if (publication.getCurrentReviewer() == null) { correctionAssigner.assignReviewer(publication); } // notify listeners for ( LifecycleEventListener listener : getListeners() ) { listener.fireReadyForChecking( publication ); } } else { addLifecycleEvent(publication, CvLifecycleEventType.SANITY_CHECK_FAILED, message); // TODO the message should be the ID of the sanity check } } }
public Publication clonePublication(Publication publication) throws IntactClonerException { if (publication == null) return null; Publication clone = new Publication(); clonerManager.addClone(publication, clone); if (isCollectionClonable(publication.getExperiments())) { Collection<Experiment> experiments = IntactCore.ensureInitializedExperiments(publication); for (Experiment e : experiments) { clone.addExperiment(clone(e)); } } if (isCollectionClonable(publication.getLifecycleEvents())) { Collection<LifecycleEvent> events = IntactCore.ensureInitializedLifecycleEvents(publication); for (LifecycleEvent event : events) { clone.addLifecycleEvent(clone(event)); } } clone.setStatus(clone(publication.getStatus())); clone.setCurrentOwner(clone(publication.getCurrentOwner())); clone.setCurrentReviewer(clone(publication.getCurrentReviewer())); return clone; }
public Publication clonePublication(Publication publication) throws IntactClonerException { if (publication == null) return null; Publication clone = new Publication(); clonerManager.addClone(publication, clone); if (isCollectionClonable(publication.getExperiments())) { Collection<Experiment> experiments = IntactCore.ensureInitializedExperiments(publication); for (Experiment e : experiments) { clone.addExperiment(clone(e)); } } if (isCollectionClonable(publication.getLifecycleEvents())) { Collection<LifecycleEvent> events = IntactCore.ensureInitializedLifecycleEvents(publication); for (LifecycleEvent event : events) { clone.addLifecycleEvent(clone(event)); } } clone.setStatus(clone(publication.getStatus())); clone.setCurrentOwner(clone(publication.getCurrentOwner())); clone.setCurrentReviewer(clone(publication.getCurrentReviewer())); return clone; }