Commit ac1b7caac30fad57a20aa1440c719ba36fde131e

Authored by lpedro
1 parent a1e1eca58e
Exists in master and in 1 other branch API_v3.0

C4379

src/main/java/org/um/dsi/gavea/orcid/client/OrcidOAuthClient.java
@@ -17,6 +17,7 @@ import org.um.dsi.gavea.orcid.client.constants.OrcidConstants; @@ -17,6 +17,7 @@ import org.um.dsi.gavea.orcid.client.constants.OrcidConstants;
17 import org.um.dsi.gavea.orcid.client.exception.OrcidClientException; 17 import org.um.dsi.gavea.orcid.client.exception.OrcidClientException;
18 import org.um.dsi.gavea.orcid.client.extend.ScopePathTypeExt; 18 import org.um.dsi.gavea.orcid.client.extend.ScopePathTypeExt;
19 import org.um.dsi.gavea.orcid.model.activities.ActivitiesSummary; 19 import org.um.dsi.gavea.orcid.model.activities.ActivitiesSummary;
  20 +import org.um.dsi.gavea.orcid.model.activities.Fundings;
20 import org.um.dsi.gavea.orcid.model.activities.Works; 21 import org.um.dsi.gavea.orcid.model.activities.Works;
21 import org.um.dsi.gavea.orcid.model.address.Address; 22 import org.um.dsi.gavea.orcid.model.address.Address;
22 import org.um.dsi.gavea.orcid.model.address.Addresses; 23 import org.um.dsi.gavea.orcid.model.address.Addresses;
@@ -198,6 +199,19 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient { @@ -198,6 +199,19 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
198 } 199 }
199 } 200 }
200 201
  202 + /* Activities - Fundings */
  203 + public Fundings readFundingSummary(final OrcidAccessToken token) throws OrcidClientException {
  204 + Response response = null;
  205 + try {
  206 + response = get(OrcidConstants.ENDPOINT_FUNDING, token, null);
  207 +
  208 + return response.readEntity(Fundings.class);
  209 + } finally {
  210 + if (response != null)
  211 + response.close();
  212 + }
  213 + }
  214 +
201 215
202 /* Address */ 216 /* Address */
203 public Addresses readAddresses(final OrcidAccessToken token) throws OrcidClientException { 217 public Addresses readAddresses(final OrcidAccessToken token) throws OrcidClientException {