protected CvObjectXref createIdentityXref( CvObject parent, String id ) { CvObjectXref idXref = null; if (id != null) { if (id.startsWith("MI")) { idXref = XrefUtils.createIdentityXrefPsiMi(parent, id); idXref.prepareParentMi(); } else if (id.startsWith("IA")) { idXref = XrefUtils.createIdentityXref(parent, id, nonMiCvDatabase); } else if (id.startsWith("MOD")) { idXref = XrefUtils.createIdentityXref(parent, id, psimod); } else { if (log.isWarnEnabled()) log.warn("Uknown prefix for id: "+id+". Will store as a cross reference to database: "+nonMiCvDatabase.getShortLabel()); idXref = XrefUtils.createIdentityXref(parent, id, nonMiCvDatabase); } } return idXref; }
public static <T extends CvObject> T createCvObject(Institution institution, Class<T> cvClass, String primaryId, String shortLabel) { T cv = ClassUtils.newInstance(cvClass); cv.setOwner(institution); cv.setShortLabel(shortLabel); CvObjectXref idXref = XrefUtils.createIdentityXrefPsiMi(cv, primaryId); cv.addXref(idXref); return cv; } }
public static <T extends CvObject> T createCvObject(Institution institution, Class<T> cvClass, String miIdentifier, String shortLabel) { T cv = ClassUtils.newInstance(cvClass); cv.setOwner(institution); cv.setShortLabel(shortLabel); cv.setIdentifier(miIdentifier); if (miIdentifier != null) { CvObjectXref idXref = XrefUtils.createIdentityXrefPsiMi(cv, miIdentifier); cv.addXref(idXref); idXref.prepareParentMi(); } return cv; }
public static <T extends CvObject> T createCvObject(Institution institution, Class<T> cvClass, String miIdentifier, String shortLabel) { T cv = ClassUtils.newInstance(cvClass); cv.setOwner(institution); cv.setShortLabel(shortLabel); cv.setIdentifier(miIdentifier); if (miIdentifier != null) { CvObjectXref idXref = XrefUtils.createIdentityXrefPsiMi(cv, miIdentifier); cv.addXref(idXref); idXref.prepareParentMi(); } return cv; }
InstitutionXref xref = XrefUtils.createIdentityXrefPsiMi(institution, Institution.INTACT_REF); institution.addXref(xref); InstitutionXref xref = XrefUtils.createIdentityXrefPsiMi(institution, Institution.MINT_REF); institution.addXref(xref);