public PsiExchangeImpl(IntactContext intactContext) { this.intactContext = intactContext; this.corePersister = intactContext.getCorePersister(); this.xmlForm = PsimiXmlForm.FORM_COMPACT; this.psiVersion = PsimiXmlVersion.VERSION_254; }
@Deprecated public CorePersister getCorePersister() { return IntactContext.getCurrentInstance().getCorePersister(); } }
@Deprecated public CorePersister getCorePersister() { return IntactContext.getCurrentInstance().getCorePersister(); } }
public CorePersister getCorePersister() { return getIntactContext().getCorePersister(); }
public CorePersister getCorePersister() { return getIntactContext().getCorePersister(); }
@Transactional(propagation = Propagation.REQUIRED) public void updateChildrenHavingMissingParent(String child, String parent) { CvObjectDao<CvDagObject> cvDao = IntactContext.getCurrentInstance().getDaoFactory().getCvObjectDao(CvDagObject.class); CvDagObject reloadedChild = cvDao.getByAc(child); CvDagObject reloadedParent = cvDao.getByAc(parent); if (reloadedChild != null){ reloadedChild.addParent(reloadedParent); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(reloadedChild); } else { log.warn("Cv object " + child + " cannot be updated because does not exist anymore"); } }
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(usedInClass);
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(aliasType);
/** * Add the dataset annotation for each experiment in the list * @param publications : the publications */ private void addDatasetToExperimentsAndPublication(List<Publication> publications) throws IOException, DatasetException { for (Publication p : publications){ if (!processedPublications.contains(p.getAc()) && isPublicationEligibleForDataset(p)){ processedPublications.add(p.getAc()); String pubId = p.getShortLabel(); // if publication has not been processed, we add the dataset to the publication if (this.listOfpublicationUpdated.add(pubId)){ Annotation annotation = createNewDataset(); log.info("Add dataset to " + p.getAc() + ": " + p.getShortLabel()); p.addAnnotation(annotation); for (Experiment exp : p.getExperiments()){ Annotation annotation2 = createNewDataset(); log.info("Add dataset to " + exp.getAc() + ": " + exp.getShortLabel()); exp.addAnnotation(annotation2); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(exp); } IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(p); } } } }
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(importedParent); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvChild); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(dagObject); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvChild); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvChild);
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(importedParent); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvChild); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(dagObject); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(dagObject); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvChild); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvChild);
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate( synonymType ); System.out.println( "CvAliasType( 'synonym', 'MI:1041' ) was persisted." );
public static CvObjectXref createSecondaryXref(CvDagObject term, String database, String identifier) { DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory(); CvObjectXref cvXref; CvXrefQualifier secondary = factory.getCvObjectDao(CvXrefQualifier.class).getByPsiMiRef(CvXrefQualifier.SECONDARY_AC_MI_REF); CvDatabase db = factory.getCvObjectDao(CvDatabase.class).getByPsiMiRef(database); if (secondary == null){ secondary = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvXrefQualifier.class, CvXrefQualifier.SECONDARY_AC_MI_REF, CvXrefQualifier.SECONDARY_AC); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(secondary); } if (db == null){ db = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvDatabase.class, database, database); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(db); } // create identity xref cvXref = XrefUtils.createIdentityXref(term, identifier, secondary, db); term.addXref(cvXref); return cvXref; }
public static CvObjectXref createIdentityXref(CvDagObject term, String database, String identifier) { DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory(); CvObjectXref cvXref; CvXrefQualifier identity = factory.getCvObjectDao(CvXrefQualifier.class).getByPsiMiRef(CvXrefQualifier.IDENTITY_MI_REF); CvDatabase db = factory.getCvObjectDao(CvDatabase.class).getByPsiMiRef(database); if (identity == null){ identity = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvXrefQualifier.class, CvXrefQualifier.IDENTITY_MI_REF, CvXrefQualifier.IDENTITY); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(identity); } if (db == null){ db = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvDatabase.class, database, database); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(db); } // create identity xref cvXref = XrefUtils.createIdentityXref(term, identifier, identity, db); term.addXref(cvXref); return cvXref; }
public static Annotation hideTerm(CvObject c, String message){ DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory(); CvTopic topicFromDb = factory.getCvObjectDao(CvTopic.class).getByShortLabel(CvTopic.HIDDEN); if (topicFromDb == null){ topicFromDb = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvTopic.class, null, CvTopic.HIDDEN); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(topicFromDb); } Annotation newAnnotation = new Annotation(topicFromDb, message); c.addAnnotation(newAnnotation); return newAnnotation; }
@Transactional(propagation = Propagation.SUPPORTS) public CvDagObject createCvObjectFrom(IntactOntologyTermI ontologyTerm, IntactOntologyAccess ontologyAccess, Class<? extends CvDagObject> termClass, boolean hideParents, CvUpdateContext updateContext) throws IllegalAccessException, InstantiationException, CvUpdateException { String accession = ontologyTerm.getTermAccession(); CvDagObject cvObject = termClass.newInstance(); importUpdateContext.clear(); importUpdateContext.setCvTerm(cvObject); importUpdateContext.setIdentifier(accession); importUpdateContext.setOntologyAccess(ontologyAccess); importUpdateContext.setOntologyTerm(ontologyTerm); cvUpdater.updateTerm(importUpdateContext); // parents should not be obsolete. An obsolete term does not have parents children anymore if (hideParents){ CvUpdateUtils.hideTerm(cvObject, "term not used"); } // fire evt CvUpdateManager manager = updateContext.getManager(); CreatedTermEvent evt = new CreatedTermEvent(this, ontologyTerm.getTermAccession(), cvObject.getShortLabel(), cvObject.getAc(), hideParents, "Created child term"); manager.fireOnCreatedTerm(evt); // create object IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvObject); return cvObject; }
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate( bs );
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(secondary); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(term); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(termFromDb);
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(identity); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvDatabase);
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(identity); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvDatabase);