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 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 ); } }