Commit 7d9c85326755e2cf312e6d575b418dabf54e8451

Authored by Paulo Graça
1 parent cd7f7f727e

Get works by multiple putcodes

src/main/java/org/um/dsi/gavea/orcid/client/OrcidOAuthClient.java
... ... @@ -10,6 +10,7 @@ import javax.ws.rs.core.MultivaluedMap;
10 10 import javax.ws.rs.core.Response;
11 11 import javax.ws.rs.core.UriBuilder;
12 12  
  13 +import org.jvnet.jaxb2_commons.lang.StringUtils;
13 14 import org.slf4j.Logger;
14 15 import org.slf4j.LoggerFactory;
15 16 import org.um.dsi.gavea.orcid.client.constants.OrcidConstants;
... ... @@ -784,6 +785,20 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
784 785 }
785 786 }
786 787  
  788 + public Bulk readWorks(final OrcidAccessToken token, final List<String> putCodes) throws OrcidClientException {
  789 + Response response = null;
  790 + try {
  791 + response = get(OrcidConstants.ENDPOINT_WORKS, token, StringUtils.join(putCodes.iterator(), ","));
  792 +
  793 + return response.readEntity(Bulk.class);
  794 + } finally {
  795 + if (response != null)
  796 + response.close();
  797 + }
  798 + }
  799 +
  800 +
  801 +
787 802 public WorkSummary readWorkSummary(final OrcidAccessToken token, final String putCode) throws OrcidClientException {
788 803 Response response = null;
789 804 try {
... ...