public void createPublication( Publication publication ) throws ImexCentralException { try { port.createPublication( new Holder( publication ) ); } catch ( IcentralFault f ) { throw new ImexCentralException( "Error while creating a publication: " + showPublication(publication), f); } }
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 Publication updatePublicationAdminGroup( String identifier, Operation operation, String group ) throws ImexCentralException { try { return port.updatePublicationAdminGroup( buildIdentifier(identifier ), operation.toString(), group ); } catch ( IcentralFault f ) { throw new ImexCentralException( "Error while attempting to upate the admin group to '"+ group +"' for publication " + identifier, f ); } }
public Publication updatePublicationAdminUser( String identifier, Operation operation, String user ) throws ImexCentralException { try { return port.updatePublicationAdminUser( buildIdentifier(identifier ), operation.toString(), user ); } catch ( IcentralFault f ) { throw new ImexCentralException( "Error while attempting to upate the admin user to '"+ user +"' for publication " + identifier, f ); } }
/** * * @param identifier * @param status * @return an updated publication, null if not found. * @throws ImexCentralException */ public Publication updatePublicationStatus( String identifier, PublicationStatus status) throws ImexCentralException { try { return port.updatePublicationStatus( buildIdentifier( identifier ), status.toString(), null ); } catch ( IcentralFault f ) { throw new ImexCentralException( "Error while attempting to update a publication status: " + identifier + "/" + 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 ); } }
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; }
public List<psidev.psi.mi.jami.model.Publication> fetchPublicationsByStatus(String status, int first, int max) throws BridgeFailedException { 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) { List<Publication> pubs = pubList.value.getPublication(); List<psidev.psi.mi.jami.model.Publication> publications = new ArrayList<psidev.psi.mi.jami.model.Publication>(pubs.size()); for (Publication pub : pubs){ if (pub != null){ publications.add(new ImexPublication(pub)); } } return publications; } 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 BridgeFailedException( "Error while getting publications by status: " + status, f ); } }
public List<psidev.psi.mi.jami.model.Publication> fetchPublicationsByOwner(String owner, int first, int max) throws BridgeFailedException { 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) { List<Publication> pubs = pubList.value.getPublication(); List<psidev.psi.mi.jami.model.Publication> publications = new ArrayList<psidev.psi.mi.jami.model.Publication>(pubs.size()); for (Publication pub : pubs){ if (pub != null){ publications.add(new ImexPublication(pub)); } } return publications; } 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 BridgeFailedException( "Error while getting publications by owner: " + owner, f ); } }
public psidev.psi.mi.jami.model.Publication updatePublicationAdminGroup( String identifier, String source, Operation operation, String group ) throws BridgeFailedException { try { Publication pub = port.updatePublicationAdminGroup( buildIdentifier(identifier, source ), operation.toString(), group ); if (pub != null){ return new ImexPublication(pub); } } catch ( IcentralFault f ) { throw new BridgeFailedException( "Error while attempting to upate the admin group to '"+ group +"' for publication " + identifier, f ); } return null; }
public psidev.psi.mi.jami.model.Publication updatePublicationAdminUser( String identifier, String source, Operation operation, String user ) throws BridgeFailedException { try { Publication pub = port.updatePublicationAdminUser( buildIdentifier(identifier, source ), operation.toString(), user ); if (pub != null){ return new ImexPublication(pub); } } catch ( IcentralFault f ) { throw new BridgeFailedException( "Error while attempting to upate the admin user to '"+ user +"' for publication " + identifier, f ); } return null; }
/** * * @param identifier * @param status * @return an updated publication, null if not found. * @throws psidev.psi.mi.jami.bridges.exception.BridgeFailedException */ public psidev.psi.mi.jami.model.Publication updatePublicationStatus( String identifier, String source, PublicationStatus status) throws BridgeFailedException { try { Publication pub = port.updatePublicationStatus( buildIdentifier( identifier, source ), status.toString(), null ); if (pub != null){ return new ImexPublication(pub); } } catch ( IcentralFault f ) { throw new BridgeFailedException( "Error while attempting to update a publication status: " + identifier + "/" + status, f ); } return null; }
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; }
/** * * @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 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 ); } }
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 psidev.psi.mi.jami.model.Publication createPublicationById( String identifier, String source ) throws BridgeFailedException { try { Publication pub = port.createPublicationById( buildIdentifier( identifier, source ) ); if (pub != null){ return new ImexPublication(pub); } } catch ( IcentralFault f ) { throw new BridgeFailedException( "Error while creating a publication by id: " + identifier, f ); } return null; }
public psidev.psi.mi.jami.model.Publication fetchPublicationImexAccession(String identifier, String source, boolean aBoolean) throws BridgeFailedException { try { Publication pub = port.getPublicationImexAccession( buildIdentifier( identifier, source ), aBoolean ); if (pub != null){ return new ImexPublication(pub); } } catch ( IcentralFault f ) { throw new BridgeFailedException("Error while getting an IMEx id by publication by id: " + identifier, f); } return null; }
port.createPublication( new Holder( publication ) ); } catch ( IcentralFault f ) { throw new BridgeFailedException( "Error while creating a publication: " + publication, f);