jSource.setRelease( mSource.getRelease() ); Date mReleaseDate = mSource.getReleaseDate(); if ( mReleaseDate != null ) { GregorianCalendar gregorianCalendar = new GregorianCalendar(); if ( mSource.hasBibref() ) { jSource.setBibref( bibrefConverter.toJaxb( mSource.getBibref() ) ); if ( mSource.hasNames() ) { jSource.setNames( namesConverter.toJaxb( mSource.getNames() ) ); if ( mSource.hasXref() ) { jSource.setXref( xrefConverter.toJaxb( mSource.getXref() ) ); if ( mSource.hasAttributes() ) { if ( jSource.getAttributeList() == null ) { jSource.setAttributeList( new AttributeListType() ); for ( Attribute mAttribute : mSource.getAttributes() ) { jSource.getAttributeList().getAttributes().add( attributeConverter.toJaxb( mAttribute ) );
public static Source createSource(String name, String description, String sourcePublicationId, String miId) { Source source = new Source(); Names names = createNames(name, description); source.setNames(names); if (miId != null) { Xref miRef = createXrefPsiMi(miId); source.setXref(miRef); } if (sourcePublicationId != null) { source.setBibref(createBibrefPubmed(sourcePublicationId)); } return source; }
protected Object psiElementKey(Source psiObject) { String key; if (psiObject.getNames() != null) { key = "source:"+psiObject.getNames().getShortLabel(); } else if (psiObject.getXref() != null) { key = "source:xref:"+psiObject.getXref().getPrimaryRef().getId(); } else if (psiObject.getBibref() != null) { key = "source:bibref:"+psiObject.getBibref().getXref().getPrimaryRef().getId(); } else { throw new PsiConversionException("Could not create key to cache the source: "+psiObject); } return key; } }
if (source.hasNames()) { Names names = source.getNames(); if (names.getShortLabel() != null) { sourceName = names.getShortLabel(); if (source.hasXref()) { Xref xref = source.getXref(); Collection<DbReference> refs = XrefUtils.searchByType(xref, IDENTITY, IDENTITY_REF); creationDate.add(entry.getSource().getReleaseDate()); if (!creationDate.isEmpty()) { binaryInteraction.setCreationDate(creationDate); creationDate.add(entry.getSource().getReleaseDate()); if (!creationDate.isEmpty()) { binaryInteraction.setCreationDate(creationDate);
psidev.psi.mi.xml.model.Source mSource = new psidev.psi.mi.xml.model.Source(); mSource.setRelease( jSource.getRelease() ); GregorianCalendar gregorianCalendar = jReleaseDate.toGregorianCalendar(); Date mReleaseDate = gregorianCalendar.getTime(); mSource.setReleaseDate( mReleaseDate ); mSource.setBibref( bibrefConverter.fromJaxb( jSource.getBibref() ) ); mSource.setNames( namesConverter.fromJaxb( jSource.getNames() ) ); mSource.setXref( xrefConverter.fromJaxb( jSource.getXref() ) ); mSource.getAttributes().add( attributeConverter.fromJaxb( jAttribute ) );
public Entry enrichEntry(Entry entry, EnricherConfig config) { EntryConverter converter = new EntryConverter(); IntactEntry intactEntry = converter.psiToIntact(entry); enricherContext.setConfig(config); intactEntryEnricher.enrich(intactEntry); Entry enrichedEntry = converter.intactToPsi(intactEntry); enrichedEntry.getSource().setReleaseDate(entry.getSource().getReleaseDate()); return enrichedEntry; }
Source source = new Source(); source.setReleaseDate(date); Names names = new Names(); names.setShortLabel(UNKNOWN); source.setNames(names); source.setNames(names); source.setXref(xref);
source.setBibref(bibref); source.setReleaseDate(new Date());
public DateTime getReleaseDate(Entry entry) { DateTime releaseDate = null; Source source = entry.getSource(); if (source != null) { releaseDate = new DateTime(source.getReleaseDate()); } return releaseDate; }
entry.getSource().setReleaseDate(intactObject.getReleasedDate());
psidev.psi.mi.xml.model.Source mSource = new psidev.psi.mi.xml.model.Source(); mSource.setRelease( jSource.getRelease() ); GregorianCalendar gregorianCalendar = jReleaseDate.toGregorianCalendar(); Date mReleaseDate = gregorianCalendar.getTime(); mSource.setReleaseDate( mReleaseDate ); mSource.setBibref( bibrefConverter.fromJaxb( jSource.getBibref() ) ); mSource.setNames( namesConverter.fromJaxb( jSource.getNames() ) ); mSource.setXref( xrefConverter.fromJaxb( jSource.getXref() ) ); mSource.getAttributes().add( attributeConverter.fromJaxb( jAttribute ) );
public Institution psiToIntact(Source psiObject) { Institution institution = super.psiToIntact( psiObject ); setInstitution(institution); if ( !isNewIntactObjectCreated() ) { return institution; } psiStartConversion(psiObject); IntactConverterUtils.populateNames(psiObject.getNames(), institution, aliasConverter); IntactConverterUtils.populateXref(psiObject.getXref(), institution, xrefConverter); if (psiObject.getBibref() != null) { IntactConverterUtils.populateXref(psiObject.getBibref().getXref(), institution, xrefConverter); } IntactConverterUtils.populateAnnotations(psiObject, institution, institution, annotationConverter); setInstitution(institution); psiEndConversion(psiObject); return institution; }
if (source.getReleaseDate() != null) { enrichedSource.setReleaseDate(source.getReleaseDate());
public IntactEntry psiToIntact(Entry psiObject) { psiStartConversion(psiObject); Institution institution = institutionConverter.psiToIntact(psiObject.getSource()); setInstitution(institution); Collection<Interaction> interactions = new ArrayList<Interaction>(); for (psidev.psi.mi.xml.model.Interaction psiInteraction : psiObject.getInteractions()) { Interaction interaction = interactionConverter.psiToIntact(psiInteraction); interactions.add(interaction); } IntactEntry ientry = new IntactEntry(interactions); ientry.setInstitution(getInstitution()); IntactConverterUtils.populateAnnotations(psiObject, ientry, institution, this.annotationConverter); if (psiObject.getSource().getReleaseDate() != null) { ientry.setReleasedDate(psiObject.getSource().getReleaseDate()); } ConversionCache.clear(); psiEndConversion(psiObject); ConverterContext.getInstance().getLocation().resetPosition(); failIfInconsistentConversion(ientry, psiObject); return ientry; }
jSource.setRelease( mSource.getRelease() ); Date mReleaseDate = mSource.getReleaseDate(); if ( mReleaseDate != null ) { GregorianCalendar gregorianCalendar = new GregorianCalendar(); if ( mSource.hasBibref() ) { jSource.setBibref( bibrefConverter.toJaxb( mSource.getBibref() ) ); if ( mSource.hasNames() ) { jSource.setNames( namesConverter.toJaxb( mSource.getNames() ) ); if ( mSource.hasXref() ) { jSource.setXref( xrefConverter.toJaxb( mSource.getXref() ) ); if ( mSource.hasAttributes() ) { if ( jSource.getAttributeList() == null ) { jSource.setAttributeList( new AttributeList() ); for ( Attribute mAttribute : mSource.getAttributes() ) { jSource.getAttributeList().getAttributes().add( attributeConverter.toJaxb( mAttribute ) );
UnificationXref ux = null; if (source.hasNames()) { name = getName(source.getNames()); if(source.hasXref()) { ux = getPrimaryUnificationXref(source.getXref()); if(name==null && ux != null) name = ux.getDb()+"_"+ux.getId(); if(source.hasBibref()) { psidev.psi.mi.xml.model.Xref psiXREF = source.getBibref().getXref(); if (psiXREF != null) { px = publicationXref(psiXREF.getPrimaryRef().getDb(), psiXREF.getPrimaryRef().getId()); if(source.hasReleaseDate()) { ver = source.getRelease(); if(name==null) name = ver; pro.addXref(ux); if(source.hasAttributes()) for(Attribute attr : source.getAttributes()) pro.addComment(attr.toString());