protected void updateShortLabel(Experiment experiment) { String shortLabel = experiment.getShortLabel(); String newShortLabel = ExperimentUtils.syncShortLabelWithDb(shortLabel); if (!shortLabel.equals(newShortLabel)) { if (log.isDebugEnabled()) log.debug("Experiment with label '"+shortLabel+"' renamed '"+newShortLabel+"'" ); experiment.setShortLabel(newShortLabel); } }
public Experiment createExperimentRandom(String shortLabel, int interactionNumber) { Experiment exp = createExperimentEmpty(randomExperimentLabel()); exp.setShortLabel(shortLabel); for (int i=0; i<interactionNumber; i++) { Interaction interaction = createInteractionRandomBinary(); interaction.setExperiments(new ArrayList<Experiment>(Arrays.asList(exp))); exp.addInteraction(interaction); } return exp; }
public Experiment createExperimentRandom(String shortLabel, int interactionNumber) { Experiment exp = createExperimentEmpty(randomExperimentLabel()); exp.setShortLabel(shortLabel); for (int i=0; i<interactionNumber; i++) { Interaction interaction = createInteractionRandomBinary(); interaction.setExperiments(new ArrayList<Experiment>(Arrays.asList(exp))); exp.addInteraction(interaction); } return exp; }
@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." ); } }
if ( ! experiment.getShortLabel().equals( experimentShortlabel ) ) { String oldLabel = experiment.getShortLabel(); experiment.setShortLabel( experimentShortlabel ); printStream.println( "shortlabel updated." ); updated = true;
shortLabel = IntactConverterUtils.createExperimentTempShortLabel(); experiment.setShortLabel(shortLabel);