Commit 450f5df89dff2260d30e4d36517c592868fa4525

Authored by Pedro Lopes
1 parent 6319c3dd80
Exists in master

Sprint 9-17

pom.xml
1 1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2   - <modelVersion>4.0.0</modelVersion>
  2 + <modelVersion>4.0.0</modelVersion>
3 3  
4   - <groupId>org.um.dsi.gavea</groupId>
5   - <artifactId>degois-orcid-client</artifactId>
6   - <version>2.0-1-SNAPSHOT</version>
7   -
8   - <name>Orcid Client</name>
  4 + <groupId>org.um.dsi.gavea</groupId>
  5 + <artifactId>degois-orcid-client</artifactId>
  6 + <version>2.0</version>
  7 +
  8 + <name>Orcid Client</name>
9 9  
10 10 <properties>
11 11 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12 12 <java.version>1.8</java.version>
13 13 <jersey.version>2.22.1</jersey.version>
14 14 <jaxb2-basics.version>0.9.5</jaxb2-basics.version>
15   - <logback-version>1.1.7</logback-version>
  15 + <logback-version>1.1.9</logback-version>
16 16 <junit.version>4.12</junit.version>
17 17 </properties>
18 18  
... ... @@ -49,13 +49,6 @@
49 49 <groupId>ch.qos.logback</groupId>
50 50 <artifactId>logback-classic</artifactId>
51 51 <version>${logback-version}</version>
52   - <scope>compile</scope>
53   - </dependency>
54   - <dependency>
55   - <groupId>ch.qos.logback</groupId>
56   - <artifactId>logback-core</artifactId>
57   - <version>${logback-version}</version>
58   - <scope>compile</scope>
59 52 </dependency>
60 53 <!-- JUnit -->
61 54 <dependency>
... ... @@ -138,86 +131,7 @@
138 131 <skipTests>true</skipTests>
139 132 </configuration>
140 133 </plugin>
141   - <plugin>
142   - <groupId>org.apache.maven.plugins</groupId>
143   - <artifactId>maven-release-plugin</artifactId>
144   - <version>2.5.1</version>
145   - <dependencies>
146   - <dependency>
147   - <groupId>org.apache.maven.shared</groupId>
148   - <artifactId>maven-invoker</artifactId>
149   - <version>2.2</version>
150   - </dependency>
151   - </dependencies>
152   - </plugin>
153 134 </plugins>
154 135 </build>
155 136  
156   -
157   - <profiles>
158   - <profile>
159   - <id>release-sign-artifacts</id>
160   - <activation>
161   - <property>
162   - <name>performRelease</name>
163   - <value>true</value>
164   - </property>
165   - </activation>
166   - <build>
167   - <plugins>
168   - <plugin>
169   - <groupId>org.apache.maven.plugins</groupId>
170   - <artifactId>maven-gpg-plugin</artifactId>
171   - <version>1.6</version>
172   - <executions>
173   - <execution>
174   - <id>sign-artifacts</id>
175   - <phase>verify</phase>
176   - <goals>
177   - <goal>sign</goal>
178   - </goals>
179   - </execution>
180   - </executions>
181   - </plugin>
182   - </plugins>
183   - </build>
184   - </profile>
185   - </profiles>
186   -
187   - <distributionManagement>
188   - <repository>
189   - <id>central</id>
190   - <name>rcaap-releases</name>
191   - <url>https://rcaap.jfrog.io/rcaap/libs-release-local</url>
192   - </repository>
193   - </distributionManagement>
194   - <url>https://gitlab.fccn.pt/dev-degois/orcid-java-client/wikis/home</url>
195   - <description>Simple, easy to use ORCiD client written in Java. Supports the public and Tier2 API with OAuth. Natural object mapping - The entire ORCiD message schema is represented as a hirearchical graph of POJOs with JAXB support for serialisation. This work is based on Tom Demeranville Orcid Java Client that is available at GitHub</description>
196   - <organization>
197   - <name>FCT|FCCN</name>
198   - <url>http://www.fccn.pt</url>
199   - </organization>
200   - <scm>
201   - <developerConnection>scm:git:git@gitlab.fccn.pt:dev-degois/orcid-java-client.git</developerConnection>
202   - <url>https://gitlab.fccn.pt/dev-degois/orcid-java-client.git</url>
203   - <tag>v2.0</tag>
204   - </scm>
205   -
206   - <licenses>
207   - <license>
208   - <name>MIT License</name>
209   - <url>https://gitlab.fccn.pt/dev-degois/orcid-java-client/raw/master/LICENSE.md</url>
210   - <distribution>repo</distribution>
211   - </license>
212   - </licenses>
213   -
214   - <developers>
215   - <developer>
216   - <name>Development Degóis team</name>
217   - <url>https://gitlab.fccn.pt/groups/dev-degois/members</url>
218   - <roles>
219   - <role>committer</role>
220   - </roles>
221   - </developer>
222   - </developers>
223 137 </project>
224 138 \ No newline at end of file
... ...
src/main/java/org/um/dsi/gavea/orcid/client/OrcidOAuthClient.java
... ... @@ -17,8 +17,11 @@ import org.um.dsi.gavea.orcid.client.constants.OrcidConstants;
17 17 import org.um.dsi.gavea.orcid.client.exception.OrcidClientException;
18 18 import org.um.dsi.gavea.orcid.client.extend.ScopePathTypeExt;
19 19 import org.um.dsi.gavea.orcid.model.activities.ActivitiesSummary;
  20 +import org.um.dsi.gavea.orcid.model.activities.Fundings;
  21 +import org.um.dsi.gavea.orcid.model.activities.Works;
20 22 import org.um.dsi.gavea.orcid.model.address.Address;
21 23 import org.um.dsi.gavea.orcid.model.address.Addresses;
  24 +import org.um.dsi.gavea.orcid.model.bulk.Bulk;
22 25 import org.um.dsi.gavea.orcid.model.common.ScopePathType;
23 26 import org.um.dsi.gavea.orcid.model.education.Education;
24 27 import org.um.dsi.gavea.orcid.model.education.EducationSummary;
... ... @@ -42,30 +45,29 @@ import org.um.dsi.gavea.orcid.model.researcherurl.ResearcherUrl;
42 45 import org.um.dsi.gavea.orcid.model.researcherurl.ResearcherUrls;
43 46 import org.um.dsi.gavea.orcid.model.work.Work;
44 47 import org.um.dsi.gavea.orcid.model.work.WorkSummary;
45   -import org.um.dsi.gavea.orcid.model.bulk.Bulk;
46 48  
47 49  
48 50 public class OrcidOAuthClient extends BaseOrcidOAuthClient {
49 51 private static final long serialVersionUID = -6655680509383446710L;
50 52  
51 53 private static final Logger _log = LoggerFactory.getLogger(OrcidOAuthClient.class);
52   -
  54 +
53 55 public OrcidOAuthClient(String loginUri, String apiUri, String clientId, String clientSecret, String redirectUri) {
54 56 this(null, loginUri, apiUri, clientId, clientSecret, redirectUri);
55 57 }
56   -
  58 +
57 59 public OrcidOAuthClient(String loginUri, String apiUri, String clientId, String clientSecret, String redirectUri, boolean debugMode) {
58 60 this(null, loginUri, apiUri, clientId, clientSecret, redirectUri, debugMode);
59 61 }
60   -
  62 +
61 63 public OrcidOAuthClient(Client restClient, String loginUri, String apiUri, String clientId, String clientSecret, String redirectUri) {
62 64 super(restClient, loginUri, apiUri, clientId, clientSecret, redirectUri);
63 65 }
64   -
  66 +
65 67 public OrcidOAuthClient(Client restClient, String loginUri, String apiUri, String clientId, String clientSecret, String redirectUri, boolean debugMode) {
66 68 super(restClient, loginUri, apiUri, clientId, clientSecret, redirectUri, debugMode);
67 69 }
68   -
  70 +
69 71 /**
70 72 *
71 73 * @param scopes
... ... @@ -100,7 +102,7 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
100 102 public String getAuthorizeUri(final List<ScopePathType> scopes, final String state, final String familyNames, final String givenNames) throws Exception {
101 103 return getAuthorizeUri(scopes, state, null, familyNames, givenNames, null, null, false);
102 104 }
103   -
  105 +
104 106 /**
105 107 *
106 108 * @param scopes
... ... @@ -131,10 +133,10 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
131 133 // Optional params
132 134 if (state != null && !"".equals(state))
133 135 builder.queryParam("state", state);
134   -
  136 +
135 137 if (orcidId != null && !"".equals(orcidId))
136 138 builder.queryParam("orcid", orcidId);
137   -
  139 +
138 140 if (familyNames != null && !"".equals(familyNames))
139 141 builder.queryParam("family_names", familyNames);
140 142  
... ... @@ -153,7 +155,7 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
153 155  
154 156 return builder.toString();
155 157 }
156   -
  158 +
157 159 /**
158 160 *
159 161 * @param authorizationCode
... ... @@ -169,74 +171,73 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
169 171  
170 172 return post(authorizationCode, formData).readEntity(OrcidAccessToken.class);
171 173 }
172   -
173   -
  174 +
  175 +
174 176 /* Activities */
175 177 public ActivitiesSummary readActivitiesSummary(final OrcidAccessToken token) throws OrcidClientException {
176 178 Response response = null;
177 179 try {
178 180 response = get(OrcidConstants.ENDPOINT_ACTIVITIES, token, null);
179   -
  181 +
180 182 return response.readEntity(ActivitiesSummary.class);
181 183 } finally {
182 184 if (response != null)
183 185 response.close();
184 186 }
185 187 }
186   -
  188 +
187 189 /* Activities - Works */
188   - public org.um.dsi.gavea.orcid.model.activities.Works readWorksSummary(final OrcidAccessToken token) throws OrcidClientException {
  190 + public Works readWorksSummary(final OrcidAccessToken token) throws OrcidClientException {
189 191 Response response = null;
190 192 try {
191 193 response = get(OrcidConstants.ENDPOINT_WORKS, token, null);
192   -
193   - return response.readEntity(org.um.dsi.gavea.orcid.model.activities.Works.class);
  194 +
  195 + return response.readEntity(Works.class);
194 196 } finally {
195 197 if (response != null)
196 198 response.close();
197 199 }
198 200 }
199   -
  201 +
200 202 /* Activities - Fundings */
201   - public org.um.dsi.gavea.orcid.model.activities.Fundings readFundingsSummary(final OrcidAccessToken token) throws OrcidClientException {
  203 + public Fundings readFundingsSummary(final OrcidAccessToken token) throws OrcidClientException {
202 204 Response response = null;
203 205 try {
204 206 response = get(OrcidConstants.ENDPOINT_FUNDINGS, token, null);
205   -
206   - return response.readEntity(org.um.dsi.gavea.orcid.model.activities.Fundings.class);
  207 +
  208 + return response.readEntity(Fundings.class);
207 209 } finally {
208 210 if (response != null)
209 211 response.close();
210 212 }
211   - }
212   -
213   -
214   -
  213 + }
  214 +
  215 +
215 216 /* Address */
216 217 public Addresses readAddresses(final OrcidAccessToken token) throws OrcidClientException {
217 218 Response response = null;
218 219 try {
219 220 response = get(OrcidConstants.ENDPOINT_ADDRESS, token, null);
220   -
  221 +
221 222 return response.readEntity(Addresses.class);
222 223 } finally {
223 224 if (response != null)
224 225 response.close();
225 226 }
226 227 }
227   -
  228 +
228 229 public Address readAddress(final OrcidAccessToken token, final String putCode) throws OrcidClientException {
229 230 Response response = null;
230 231 try {
231 232 response = get(OrcidConstants.ENDPOINT_ADDRESS, token, putCode);
232   -
  233 +
233 234 return response.readEntity(Address.class);
234 235 } finally {
235 236 if (response != null)
236 237 response.close();
237 238 }
238 239 }
239   -
  240 +
240 241 public void addAddress(final OrcidAccessToken token, Address address) throws OrcidClientException {
241 242 Response response = null;
242 243 try {
... ... @@ -266,28 +267,28 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
266 267 response.close();
267 268 }
268 269 }
269   -
270   -
  270 +
  271 +
271 272 /* Biography */
272 273 public Biography readBiography(final OrcidAccessToken token) throws OrcidClientException {
273 274 Response response = null;
274 275 try {
275 276 response = get(OrcidConstants.ENDPOINT_BIOGRAPHY, token, null);
276   -
  277 +
277 278 return response.readEntity(Biography.class);
278 279 } finally {
279 280 if (response != null)
280 281 response.close();
281 282 }
282 283 }
283   -
284   -
  284 +
  285 +
285 286 /* Education */
286 287 public Education readEducation(final OrcidAccessToken token, final String putCode) throws OrcidClientException {
287 288 Response response = null;
288 289 try {
289 290 response = get(OrcidConstants.ENDPOINT_EDUCATION, token, putCode);
290   -
  291 +
291 292 return response.readEntity(Education.class);
292 293 } finally {
293 294 if (response != null)
... ... @@ -299,19 +300,19 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
299 300 Response response = null;
300 301 try {
301 302 response = get(OrcidConstants.ENDPOINT_EDUCATION_SUMMARY, token, putCode);
302   -
  303 +
303 304 return response.readEntity(EducationSummary.class);
304 305 } finally {
305 306 if (response != null)
306 307 response.close();
307 308 }
308 309 }
309   -
  310 +
310 311 public String addEducation(final OrcidAccessToken token, final Education education) throws OrcidClientException {
311 312 Response response = null;
312 313 try {
313 314 response = post(OrcidConstants.ENDPOINT_EDUCATION, token, Entity.entity(education, MediaType.APPLICATION_XML_TYPE));
314   -
  315 +
315 316 return retrievePutCode(response);
316 317 } finally {
317 318 if (response != null)
... ... @@ -338,28 +339,28 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
338 339 response.close();
339 340 }
340 341 }
341   -
342   -
  342 +
  343 +
343 344 /* Email */
344 345 public Emails readEmails(final OrcidAccessToken token) throws OrcidClientException {
345 346 Response response = null;
346 347 try {
347 348 response = get(OrcidConstants.ENDPOINT_EMAIL, token, null);
348   -
  349 +
349 350 return response.readEntity(Emails.class);
350 351 } finally {
351 352 if (response != null)
352 353 response.close();
353 354 }
354 355 }
355   -
356   -
  356 +
  357 +
357 358 /* Employment */
358 359 public Employment readEmployment(final OrcidAccessToken token, final String putCode) throws OrcidClientException {
359 360 Response response = null;
360 361 try {
361 362 response = get(OrcidConstants.ENDPOINT_EMPLOYMENT, token, putCode);
362   -
  363 +
363 364 return response.readEntity(Employment.class);
364 365 } finally {
365 366 if (response != null)
... ... @@ -371,19 +372,19 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
371 372 Response response = null;
372 373 try {
373 374 response = get(OrcidConstants.ENDPOINT_EMPLOYMENT_SUMMARY, token, putCode);
374   -
  375 +
375 376 return response.readEntity(EmploymentSummary.class);
376 377 } finally {
377 378 if (response != null)
378 379 response.close();
379 380 }
380 381 }
381   -
  382 +
382 383 public String addEmployment(final OrcidAccessToken token, final Employment employment) throws OrcidClientException {
383 384 Response response = null;
384 385 try {
385 386 response = post(OrcidConstants.ENDPOINT_EMPLOYMENT, token, Entity.entity(employment, MediaType.APPLICATION_XML_TYPE));
386   -
  387 +
387 388 return retrievePutCode(response);
388 389 } finally {
389 390 if (response != null)
... ... @@ -410,14 +411,14 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
410 411 response.close();
411 412 }
412 413 }
413   -
414   -
  414 +
  415 +
415 416 /* External Identifier */
416 417 public ExternalIdentifiers readExternalIdentifiers(final OrcidAccessToken token, final String putCode) throws OrcidClientException {
417 418 Response response = null;
418 419 try {
419 420 response = get(OrcidConstants.ENDPOINT_EXTERNAL_IDENTIFIERS, token, putCode);
420   -
  421 +
421 422 return response.readEntity(ExternalIdentifiers.class);
422 423 } finally {
423 424 if (response != null)
... ... @@ -429,19 +430,19 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
429 430 Response response = null;
430 431 try {
431 432 response = get(OrcidConstants.ENDPOINT_EXTERNAL_IDENTIFIERS, token, putCode);
432   -
  433 +
433 434 return response.readEntity(ExternalIdentifier.class);
434 435 } finally {
435 436 if (response != null)
436 437 response.close();
437 438 }
438 439 }
439   -
  440 +
440 441 public String addExternalIdentifier(final OrcidAccessToken token, final ExternalIdentifier externalIdentifier) throws OrcidClientException {
441 442 Response response = null;
442 443 try {
443 444 response = post(OrcidConstants.ENDPOINT_EXTERNAL_IDENTIFIERS, token, Entity.entity(externalIdentifier, MediaType.APPLICATION_XML_TYPE));
444   -
  445 +
445 446 return retrievePutCode(response);
446 447 } finally {
447 448 if (response != null)
... ... @@ -468,14 +469,14 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
468 469 response.close();
469 470 }
470 471 }
471   -
472   -
  472 +
  473 +
473 474 /* Funding */
474 475 public Funding readFunding(final OrcidAccessToken token, final String putCode) throws OrcidClientException {
475 476 Response response = null;
476 477 try {
477 478 response = get(OrcidConstants.ENDPOINT_FUNDING, token, putCode);
478   -
  479 +
479 480 return response.readEntity(Funding.class);
480 481 } finally {
481 482 if (response != null)
... ... @@ -486,7 +487,7 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
486 487 Response response = null;
487 488 try {
488 489 response = get(OrcidConstants.ENDPOINT_FUNDING_SUMMARY, token, putCode);
489   -
  490 +
490 491 return response.readEntity(FundingSummary.class);
491 492 } finally {
492 493 if (response != null)
... ... @@ -498,7 +499,7 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
498 499 Response response = null;
499 500 try {
500 501 response = post(OrcidConstants.ENDPOINT_FUNDING, token, Entity.entity(funding, MediaType.APPLICATION_XML_TYPE));
501   -
  502 +
502 503 return retrievePutCode(response);
503 504 } finally {
504 505 if (response != null)
... ... @@ -525,14 +526,14 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
525 526 response.close();
526 527 }
527 528 }
528   -
529   -
  529 +
  530 +
530 531 /* Keyword */
531 532 public Keywords readKeywords(final OrcidAccessToken token) throws OrcidClientException {
532 533 Response response = null;
533 534 try {
534 535 response = get(OrcidConstants.ENDPOINT_KEYWORDS, token, null);
535   -
  536 +
536 537 return response.readEntity(Keywords.class);
537 538 } finally {
538 539 if (response != null)
... ... @@ -544,19 +545,19 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
544 545 Response response = null;
545 546 try {
546 547 response = get(OrcidConstants.ENDPOINT_KEYWORDS, token, putCode);
547   -
  548 +
548 549 return response.readEntity(Keyword.class);
549 550 } finally {
550 551 if (response != null)
551 552 response.close();
552 553 }
553 554 }
554   -
  555 +
555 556 public String addKeyword(final OrcidAccessToken token, final Keyword keyword) throws OrcidClientException {
556 557 Response response = null;
557 558 try {
558 559 response = post(OrcidConstants.ENDPOINT_KEYWORDS, token, Entity.entity(keyword, MediaType.APPLICATION_XML_TYPE));
559   -
  560 +
560 561 return retrievePutCode(response);
561 562 } finally {
562 563 if (response != null)
... ... @@ -583,14 +584,14 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
583 584 response.close();
584 585 }
585 586 }
586   -
587   -
  587 +
  588 +
588 589 /* Other Name */
589 590 public OtherNames readOtherNames(final OrcidAccessToken token) throws OrcidClientException {
590 591 Response response = null;
591 592 try {
592 593 response = get(OrcidConstants.ENDPOINT_OTHER_NAMES, token, null);
593   -
  594 +
594 595 return response.readEntity(OtherNames.class);
595 596 } finally {
596 597 if (response != null)
... ... @@ -602,19 +603,19 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
602 603 Response response = null;
603 604 try {
604 605 response = get(OrcidConstants.ENDPOINT_OTHER_NAMES, token, putCode);
605   -
  606 +
606 607 return response.readEntity(OtherName.class);
607 608 } finally {
608 609 if (response != null)
609 610 response.close();
610 611 }
611 612 }
612   -
  613 +
613 614 public String addOtherName(final OrcidAccessToken token, final OtherName otherName) throws OrcidClientException {
614 615 Response response = null;
615 616 try {
616 617 response = post(OrcidConstants.ENDPOINT_OTHER_NAMES, token, Entity.entity(otherName, MediaType.APPLICATION_XML_TYPE));
617   -
  618 +
618 619 return retrievePutCode(response);
619 620 } finally {
620 621 if (response != null)
... ... @@ -641,14 +642,14 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
641 642 response.close();
642 643 }
643 644 }
644   -
645   -
  645 +
  646 +
646 647 /* Peer Review */
647 648 public PeerReview readPeerReview(final OrcidAccessToken token, final String putCode) throws OrcidClientException {
648 649 Response response = null;
649 650 try {
650 651 response = get(OrcidConstants.ENDPOINT_PEERREVIEW, token, putCode);
651   -
  652 +
652 653 return response.readEntity(PeerReview.class);
653 654 } finally {
654 655 if (response != null)
... ... @@ -659,7 +660,7 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
659 660 Response response = null;
660 661 try {
661 662 response = get(OrcidConstants.ENDPOINT_PEERREVIEW_SUMMARY, token, putCode);
662   -
  663 +
663 664 return response.readEntity(PeerReviewSummary.class);
664 665 } finally {
665 666 if (response != null)
... ... @@ -671,7 +672,7 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
671 672 Response response = null;
672 673 try {
673 674 response = post(OrcidConstants.ENDPOINT_PEERREVIEW, token, Entity.entity(peerReview, MediaType.APPLICATION_XML_TYPE));
674   -
  675 +
675 676 return retrievePutCode(response);
676 677 } finally {
677 678 if (response != null)
... ... @@ -698,42 +699,42 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
698 699 response.close();
699 700 }
700 701 }
701   -
702   -
  702 +
  703 +
703 704 /* Person */
704 705 public Person readPerson(final OrcidAccessToken token) throws OrcidClientException {
705 706 Response response = null;
706 707 try {
707 708 response = get(OrcidConstants.ENDPOINT_PERSON, token, null);
708   -
  709 +
709 710 return response.readEntity(Person.class);
710 711 } finally {
711 712 if (response != null)
712 713 response.close();
713 714 }
714 715 }
715   -
716   -
  716 +
  717 +
717 718 /* Personal Details */
718 719 public PersonalDetails readPersonalDetails(final OrcidAccessToken token) throws OrcidClientException {
719 720 Response response = null;
720 721 try {
721 722 response = get(OrcidConstants.ENDPOINT_PERSONAL_DETAILS, token, null);
722   -
  723 +
723 724 return response.readEntity(PersonalDetails.class);
724 725 } finally {
725 726 if (response != null)
726 727 response.close();
727 728 }
728 729 }
729   -
730   -
  730 +
  731 +
731 732 /* Researcher Url */
732 733 public ResearcherUrls readResearcherUrls(final OrcidAccessToken token) throws OrcidClientException {
733 734 Response response = null;
734 735 try {
735 736 response = get(OrcidConstants.ENDPOINT_RESEARCHER_URLS, token, null);
736   -
  737 +
737 738 return response.readEntity(ResearcherUrls.class);
738 739 } finally {
739 740 if (response != null)
... ... @@ -745,19 +746,19 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
745 746 Response response = null;
746 747 try {
747 748 response = get(OrcidConstants.ENDPOINT_RESEARCHER_URLS, token, putCode);
748   -
  749 +
749 750 return response.readEntity(ResearcherUrl.class);
750 751 } finally {
751 752 if (response != null)
752 753 response.close();
753 754 }
754 755 }
755   -
  756 +
756 757 public String addResearcherUrl(final OrcidAccessToken token, final ResearcherUrl researcherUrl) throws OrcidClientException {
757 758 Response response = null;
758 759 try {
759 760 response = post(OrcidConstants.ENDPOINT_RESEARCHER_URLS, token, Entity.entity(researcherUrl, MediaType.APPLICATION_XML_TYPE));
760   -
  761 +
761 762 return retrievePutCode(response);
762 763 } finally {
763 764 if (response != null)
... ... @@ -784,40 +785,40 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
784 785 response.close();
785 786 }
786 787 }
787   -
788   -
  788 +
  789 +
789 790 /* Work */
790 791 public Work readWork(final OrcidAccessToken token, final String putCode) throws OrcidClientException {
791 792 Response response = null;
792 793 try {
793 794 response = get(OrcidConstants.ENDPOINT_WORK, token, putCode);
794   -
  795 +
795 796 return response.readEntity(Work.class);
796 797 } finally {
797 798 if (response != null)
798 799 response.close();
799 800 }
800 801 }
801   -
  802 +
802 803 public Bulk readWorks(final OrcidAccessToken token, final List<String> putCodes) throws OrcidClientException {
803 804 Response response = null;
804 805 try {
805 806 response = get(OrcidConstants.ENDPOINT_WORKS, token, StringUtils.join(putCodes.iterator(), ","));
806   -
  807 +
807 808 return response.readEntity(Bulk.class);
808 809 } finally {
809 810 if (response != null)
810 811 response.close();
811 812 }
812 813 }
813   -
814   -
815   -
  814 +
  815 +
  816 +
816 817 public WorkSummary readWorkSummary(final OrcidAccessToken token, final String putCode) throws OrcidClientException {
817 818 Response response = null;
818 819 try {
819 820 response = get(OrcidConstants.ENDPOINT_WORK_SUMMARY, token, putCode);
820   -
  821 +
821 822 return response.readEntity(WorkSummary.class);
822 823 } finally {
823 824 if (response != null)
... ... @@ -829,14 +830,14 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
829 830 Response response = null;
830 831 try {
831 832 response = post(OrcidConstants.ENDPOINT_WORK, token, Entity.entity(work, MediaType.APPLICATION_XML_TYPE));
832   -
  833 +
833 834 return retrievePutCode(response);
834 835 } finally {
835 836 if (response != null)
836 837 response.close();
837 838 }
838 839 }
839   -
  840 +
840 841 /* Bulks */
841 842 public Bulk addWorks(final OrcidAccessToken token, final Bulk bulk) throws OrcidClientException {
842 843 Response response = null;
... ... @@ -868,8 +869,8 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
868 869 response.close();
869 870 }
870 871 }
871   -
872   -
  872 +
  873 +
873 874 /**
874 875 *
875 876 * @param response
... ... @@ -882,10 +883,10 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
882 883 if (putCode.matches("\\d+"))
883 884 return putCode;
884 885 }
885   -
  886 +
886 887 return null;
887 888 }
888   -
  889 +
889 890 /**
890 891 *
891 892 * @param value
... ...