@Override public String convertToString(Institution obj) { if (obj == null) return null; return obj.getShortLabel(); }
@Override public String convertToString(Institution obj) { if (obj == null) return null; return obj.getShortLabel(); }
public String toString() { return "Institution: "+getShortLabel(); } } // end Institution
public String toString() { return "Institution: "+getShortLabel(); } } // end Institution
public Institution get(Institution institution) { final String key = institution.getShortLabel(); return institutionsToBePersisted.get(key); }
public boolean contains(Institution institution) { final String key = institution.getShortLabel(); return institutionsToBePersisted.containsKey(key); }
public void setInstitution(Institution institution) { this.institution = institution; if (institution != null){ try { this.institutionPrimaryId = calculateInstitutionPrimaryId(institution); } catch (Throwable e) { log.error("Problem calculating primaryId for institution: "+institution.getShortLabel()); } } }
public AbstractIntactPsiConverter(Institution institution, boolean checkInitializedCollections) { this.institution = institution; this.checkInitializedCollections = checkInitializedCollections; if (institution != null){ try { this.institutionPrimaryId = calculateInstitutionPrimaryId(institution); } catch (Throwable e) { log.error("Problem calculating primaryId for institution: "+institution.getShortLabel()); } } }
public AbstractIntactPsiConverter(Institution institution) { this.institution = institution; if (institution != null){ try { this.institutionPrimaryId = calculateInstitutionPrimaryId(institution); } catch (Throwable e) { log.error("Problem calculating primaryId for institution: "+institution.getShortLabel()); } } }
public void addToPersist(Institution institution) { if ( !contains( institution ) ) { institutionsToBePersisted.put( institution.getShortLabel(), institution ); } }
@Override public String toString() { String result; Iterator i; result = "AC: " + this.getAc() + " Owner: " + this.getOwner().getShortLabel() + " Label: " + this.getShortLabel() + "["; if ( null != this.getXrefs() ) { i = this.getXrefs().iterator(); while ( i.hasNext() ) { result = result + i.next(); } } return result + "]"; }
@Override public String toString() { String result; Iterator i; result = "AC: " + this.getAc() + " Owner: " + this.getOwner().getShortLabel() + " Label: " + this.getShortLabel() + "["; if ( null != this.getXrefs() ) { i = this.getXrefs().iterator(); while ( i.hasNext() ) { result = result + i.next(); } } return result + "]"; }
protected void indexComplexSource(InteractionImpl complex, SolrInputDocument solrDocument) throws Exception { if (complex.getOwner() != null){ Institution owner = complex.getOwner(); // short name solrDocument.addField ( ComplexFieldNames.SOURCE, owner.getShortLabel ( ) ) ; // facet field solrDocument.addField ( ComplexFieldNames.SOURCE_F, owner.getShortLabel() ) ; // full name solrDocument.addField ( ComplexFieldNames.SOURCE, owner.getFullName ( ) ) ; } }
@Override public String toString() { String result; Iterator i; result = "AC: " + this.getAc() + " Owner: " + this.getOwner().getShortLabel() + " Label: " + this.getShortLabel() + "["; if ( null != this.getXrefs() ) { i = this.getXrefs().iterator(); while ( i.hasNext() ) { result = result + i.next(); } } return result + "]"; }
public static void setInstitution(User user, Institution institution) { user.addOrUpdatePreference(Preference.KEY_INSTITUTION_AC, institution.getAc()); user.addOrUpdatePreference(Preference.KEY_INSTITUTION_NAME, institution.getShortLabel()); }
public static void setInstitution(User user, Institution institution) { user.addOrUpdatePreference(Preference.KEY_INSTITUTION_AC, institution.getAc()); user.addOrUpdatePreference(Preference.KEY_INSTITUTION_NAME, institution.getShortLabel()); }
protected void indexInteractorAC(Interactor interactor, SolrInputDocument solrDocument){ // search fields solrDocument.addField(ComplexFieldNames.INTERACTOR_ID, interactor.getAc()) ; // index source of complex id if ( interactor.getOwner() != null ) { solrDocument.addField ( ComplexFieldNames.INTERACTOR_ID, interactor.getOwner().getShortLabel() ) ; solrDocument.addField ( ComplexFieldNames.INTERACTOR_ID, interactor.getOwner().getShortLabel() + ":" + interactor.getAc() ) ; } }
/******************************************/ protected void indexComplexAC(InteractionImpl complex, SolrInputDocument solrDocument) throws Exception { // stored field solrDocument.addField(ComplexFieldNames.COMPLEX_AC, complex.getAc()); // search fields solrDocument.addField ( ComplexFieldNames.COMPLEX_ID, complex.getAc ( ) ) ; // index source of complex id if ( complex.getOwner ( ) != null ) { solrDocument.addField ( ComplexFieldNames.COMPLEX_ID, complex.getOwner ( ).getShortLabel() ) ; solrDocument.addField ( ComplexFieldNames.COMPLEX_ID, complex.getOwner ( ).getShortLabel() + ":" + complex.getAc ( ) ) ; } }
private static void persistInstitution(IntactContext context) throws IntactTransactionException { Institution institution = context.getConfig().getInstitution(); if (institution == null) { throw new NullPointerException("Institution is null. Set an institution to the RuntimeConfig first"); } // remove ac, it should not have one at this point to be persisted correctly if (institution.getAc() != null) institution.setAc(null); log.debug("Persisting institution: " + institution.getShortLabel()); DaoFactory daoFactory = getDefaultDaoFactory(context); daoFactory.beginTransaction(); daoFactory.getInstitutionDao().persist(institution); context.getDataContext().commitTransaction(); }
@Override protected Institution fetchFromDataSource(Institution intactObject) { InstitutionXref idXref = null; for (InstitutionXref xref : intactObject.getXrefs()) { if (CvObjectUtils.getPsiMiIdentityXref(xref.getCvDatabase()).getPrimaryId() .equals(CvDatabase.PSI_MI_MI_REF)) { idXref = xref; } } if (idXref != null) { return IntactContext.getCurrentInstance().getDataContext().getDaoFactory() .getInstitutionDao().getByXref(idXref.getPrimaryId()); } return IntactContext.getCurrentInstance().getDataContext().getDaoFactory() .getInstitutionDao().getByShortLabel(intactObject.getShortLabel()); }