public String getOwner() { return this.delegate.getOwner(); }
public String getPaperAbstract() { return this.delegate.getPaperAbstract(); }
public void addPublication( String identifier, String imexAccession, String status, String owner ) { Publication p = new Publication(); final Identifier id = new Identifier(); id.setAc( identifier ); p.getIdentifier().add(id); p.setImexAccession( ( imexAccession == null ? "N/A" : imexAccession ) ); p.setStatus( status ); p.setOwner( owner ); allPublications.add( p ); }
private static void print( Publication p ) { System.out.println( "-- " + p.getIdentifier().size() + " identifiers ------------------------" ); System.out.println( "Author: " + p.getAuthor() ); System.out.println( "Title: " + p.getTitle() ); System.out.println( "IMEx id: " + p.getImexAccession() ); System.out.println( "Owner: " + p.getOwner() ); System.out.println( "Status: " + p.getStatus() ); System.out.println( "Release date: " + p.getReleaseDate() ); } }
public Publication createPublicationById( String identifier ) throws ImexCentralException { Publication p = new Publication(); final Identifier i = new Identifier(); i.setAc( identifier ); i.setNs("pmid"); p.getIdentifier().add(i); p.setImexAccession( "N/A" ); allPublications.add( p ); return p; }
public List<Publication> getPublicationByOwner( String owner, int first, int max) throws ImexCentralException { try { // create holders for publication and last record Holder<PublicationList> pubList = new Holder<PublicationList>(); Holder<Long> number = new Holder<Long>(); port.getPublicationByOwner( owner, first, max, pubList, number ); if( pubList.value != null) { return pubList.value.getPublication(); } return Collections.EMPTY_LIST; } catch ( IcentralFault f ) { switch( f.getFaultInfo().getFaultCode() ) { case NO_RECORD: // simply no data found, return empty list return Collections.EMPTY_LIST; } throw new ImexCentralException( "Error while getting publications by owner: " + owner, f ); } }
public List<Publication> getPublicationByStatus( String status, int first, int max) throws ImexCentralException { try { // create holders for publication and last record Holder<PublicationList> pubList = new Holder<PublicationList>(); Holder<Long> number = new Holder<Long>(); port.getPublicationByStatus( status, first, max, pubList, number ); if( pubList.value != null) { return pubList.value.getPublication(); } return Collections.EMPTY_LIST; } catch ( IcentralFault f ) { switch( f.getFaultInfo().getFaultCode() ) { case NO_RECORD: // simply no data found, return empty list return Collections.EMPTY_LIST; } throw new ImexCentralException( "Error while getting publications by status: " + status, f ); } }
@Override public Publication updatePublicationIdentifier(String oldIdentifier, String newIdentifier) throws ImexCentralException { Publication existingPub = getPublicationById(newIdentifier); // if the new identifier is already in IMEx central, we don't update anything if (existingPub != null){ ImexCentralFault imexFault = new ImexCentralFault(); imexFault.setFaultCode(3); IcentralFault fault = new IcentralFault("New publication identifier " + newIdentifier + "already used in IMEx central.", imexFault); throw new ImexCentralException( "Impossible to update the identifier of " + oldIdentifier, fault ); } try { return port.updatePublicationIdentifier( buildIdentifier(oldIdentifier ), buildIdentifier(newIdentifier) ); } catch ( IcentralFault f ) { throw new ImexCentralException( "Error while attempting to upate the identifier to '"+ newIdentifier +"' for publication " + oldIdentifier, f ); } }
/** * * @param identifier * @return the publication or null if not found. * @throws ImexCentralException */ public Publication getPublicationById( String identifier ) throws ImexCentralException { try { final Publication pub = port.getPublicationById(buildIdentifier(identifier)); return pub; } catch ( IcentralFault f ) { switch( f.getFaultInfo().getFaultCode() ) { case NO_RECORD: // simply no data found, return null return null; } throw new ImexCentralException("Impossible to find the publication " + identifier, f); } }
public Publication getPublicationByPubmedId( String identifier ) throws ImexCentralException { for ( Publication p : allPublications ) { for (Identifier i : p.getIdentifier()){ if( "pmid".equalsIgnoreCase(i.getNs()) && identifier.equals( i.getAc() ) ) { return p; } } if (p.getImexAccession() != null && p.getImexAccession().equalsIgnoreCase(identifier)){ return p; } } return null; }
public Publication getPublicationById( String identifier ) throws ImexCentralException { for ( Publication p : allPublications ) { for (Identifier i : p.getIdentifier()){ if( identifier.equals( i.getAc() ) ) { return p; } } if (p.getImexAccession() != null && p.getImexAccession().equalsIgnoreCase(identifier)){ return p; } } return null; }
public psidev.psi.mi.jami.model.Publication updatePublicationStatus(String identifier, String source, PublicationStatus status) throws BridgeFailedException { psidev.psi.mi.jami.model.Publication p = fetchByIdentifier(identifier, source); if (p != null && p instanceof ImexPublication){ ((ImexPublication) p).setStatus(status); } else { ImexCentralFault imexFault = new ImexCentralFault(); imexFault.setFaultCode(6); IcentralFault fault = new IcentralFault("No publication record found", imexFault); throw new BridgeFailedException(fault); } return p; }
public Collection<String> getCurators() { if (this.delegate.getAdminUserList() != null){ return this.delegate.getAdminUserList().getUser(); } else if (this.curators == null){ this.curators = new ArrayList<String>(); } return this.curators; }
public List<Source> getSources() { if (this.sources == null){ this.sources = new ArrayList<Source>(); if (this.delegate.getAdminGroupList() != null){ for (String source : this.delegate.getAdminGroupList().getGroup()){ this.sources.add(new DefaultSource(source)); } } } return this.sources; } }
private String showPublication( Publication p ) { StringBuilder sb = new StringBuilder( 128 ); sb.append( "Publication[" ); sb.append( "Identifier: " ).append( p.getIdentifier() ).append( ", " ); sb.append( "Owner: " ).append( p.getOwner() ); sb.append( "]" ); return sb.toString(); }
public Publication createPublicationById( String identifier ) throws ImexCentralException { try { return port.createPublicationById( buildIdentifier( identifier ) ); } catch ( IcentralFault f ) { throw new ImexCentralException( "Error while creating a publication by id: " + identifier, f ); } }
public Publication getPublicationImexAccession( String identifier, boolean aBoolean ) throws ImexCentralException { try { return port.getPublicationImexAccession( buildIdentifier( identifier ), aBoolean ); } catch ( IcentralFault f ) { throw new ImexCentralException("Error while getting an IMEx id by publication by id: " + identifier, f); } }
public void addPublication( String identifier, String imexAccession, String status, String owner ) { Publication p = new Publication(); final Identifier id = new Identifier(); id.setAc( identifier ); p.getIdentifier().add(id); p.setImexAccession( ( imexAccession == null ? "N/A" : imexAccession ) ); p.setStatus( status ); p.setOwner( owner ); allPublications.add( new ImexPublication(p)); }
public psidev.psi.mi.jami.model.Publication updatePublicationIdentifier(String oldIdentifier, String oldSource, String newIdentifier, String source) throws BridgeFailedException { psidev.psi.mi.jami.model.Publication existingPub = fetchByIdentifier(newIdentifier, source); // if the new identifier is already in IMEx central, we don't update anything if (existingPub != null){ ImexCentralFault imexFault = new ImexCentralFault(); imexFault.setFaultCode(3); IcentralFault fault = new IcentralFault("New publication identifier " + newIdentifier + "already used in IMEx central.", imexFault); throw new BridgeFailedException( "Impossible to update the identifier of " + oldIdentifier, fault ); } try { Publication pub = port.updatePublicationIdentifier( buildIdentifier(oldIdentifier, oldSource ), buildIdentifier(newIdentifier, source) ); if (pub != null){ return new ImexPublication(pub); } } catch ( IcentralFault f ) { throw new BridgeFailedException( "Error while attempting to upate the identifier to '"+ newIdentifier +"' for publication " + oldIdentifier, f ); } return null; }
public psidev.psi.mi.jami.model.Publication fetchByIdentifier(String identifier, String source) throws BridgeFailedException { if(identifier == null) throw new IllegalArgumentException("Cannot fetch null identifier"); if(source == null) throw new IllegalArgumentException("Cannot fetch null source. Cane be IMEX, DOI or PUBMED"); try { Publication pub = port.getPublicationById(buildIdentifier(identifier, source)); if (pub != null){ return new ImexPublication(pub); } } catch ( IcentralFault f ) { switch( f.getFaultInfo().getFaultCode() ) { case NO_RECORD: // simply no data found, return null return null; } throw new BridgeFailedException("Impossible to find the publication " + identifier, f); } return null; }