public Collection<GeneralMessage> check(Experiment experiment) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); if(ExperimentUtils.isToBeReviewed(experiment)){ messages.add(new GeneralMessage( MessageDefinition.EXPERIMENT_TO_BE_REVIEWED, experiment)); } return messages; }
public Collection<GeneralMessage> check( Experiment experiment ) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); if ( startingDateSuperCuration.before( experiment.getCreated() ) ) { if ( !ExperimentUtils.isAccepted( experiment ) ) { if ( ExperimentUtils.isToBeReviewed( experiment ) ) { // no 'accepted' and no 'to-be-reviewed' messages.add( new GeneralMessage( MessageDefinition.EXPERIMENT_TO_BE_REVIEWED, experiment ) ); } else { // no 'accepted' and has 'to-be-reviewed' messages.add( new GeneralMessage( MessageDefinition.EXPERIMENT_NOT_SUPER_CURATED, experiment ) ); } } } return messages; } }
public static boolean isToBeReviewed(Publication publication) { if (publication == null) { throw new NullPointerException("You must give a non null publication"); } for (Annotation a : publication.getAnnotations()) { if (a.getCvTopic() != null && CvTopic.TO_BE_REVIEWED.equals(a.getCvTopic().getShortLabel())) { return true; } } for (Experiment experiment : publication.getExperiments()) { if (ExperimentUtils.isToBeReviewed(experiment)) { return true; } } return false; }
public static boolean isToBeReviewed(Publication publication) { if (publication == null) { throw new NullPointerException("You must give a non null publication"); } for (Annotation a : publication.getAnnotations()) { if (a.getCvTopic() != null && CvTopic.TO_BE_REVIEWED.equals(a.getCvTopic().getShortLabel())) { return true; } } for (Experiment experiment : publication.getExperiments()) { if (ExperimentUtils.isToBeReviewed(experiment)) { return true; } } return false; }