@PrePersist public void synchronizeShortLabel() { if( IntactContext.currentInstanceExists() ) { if( IntactContext.getCurrentInstance().getConfig().isAutoUpdateExperimentLabel() ) { String shortLabel = getShortLabel(); String newShortLabel = shortLabel; try { newShortLabel = ExperimentUtils.syncShortLabelWithDb(shortLabel, ExperimentUtils.getPubmedId( this )); } catch (Exception e) { log.error("Exception synchronizing the label, probably due to an invalid format: "+newShortLabel, e); } if (!shortLabel.equals(newShortLabel)) { if (log.isDebugEnabled()) log.debug("Experiment with label '"+shortLabel+"' renamed '"+newShortLabel+"'" ); setShortLabel(newShortLabel); } } } else { log.warn( "There is no IntAct Context initialized, skipping experiment shortlabel synchronization." ); } }
@PrePersist public void synchronizeShortLabel() { if( IntactContext.currentInstanceExists() ) { if( IntactContext.getCurrentInstance().getConfig().isAutoUpdateExperimentLabel() ) { String shortLabel = getShortLabel(); String newShortLabel = shortLabel; try { newShortLabel = ExperimentUtils.syncShortLabelWithDb(shortLabel, ExperimentUtils.getPubmedId( this )); } catch (Exception e) { log.error("Exception synchronizing the label, probably due to an invalid format: "+newShortLabel, e); } if (!shortLabel.equals(newShortLabel)) { if (log.isDebugEnabled()) log.debug("Experiment with label '"+shortLabel+"' renamed '"+newShortLabel+"'" ); setShortLabel(newShortLabel); } } } else { log.warn( "There is no IntAct Context initialized, skipping experiment shortlabel synchronization." ); } }
final String syncedPubmedId = ExperimentUtils.getPubmedId(synced); final String candidatePubmedId = ExperimentUtils.getPubmedId(candidate);
public Collection<GeneralMessage> check(Experiment experiment) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); if(ExperimentUtils.isOnHold(experiment)){ messages.add(new GeneralMessage( MessageDefinition.EXPERIMENT_ON_HOLD, experiment)); } else { // TODO this can be removed when all the experiments have a Publication object in the DB String pubmedId = ExperimentUtils.getPubmedId(experiment); if (pubmedId != null) { final List<Experiment> experimentsSamePubmed = IntactContext.getCurrentInstance().getDataContext().getDaoFactory() .getExperimentDao().getByPubId(pubmedId); for (Experiment experimentSamePubmed : experimentsSamePubmed) { if (ExperimentUtils.isOnHold(experimentSamePubmed)) { messages.add(new GeneralMessage( MessageDefinition.EXPERIMENT_ON_HOLD, experiment)); } } } } return messages; } }
final String expPubId = getPubmedId(exp);
final String expPubId = getPubmedId(exp);