1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.mycore.orcid;
20
21 import java.io.IOException;
22
23 import org.jdom2.JDOMException;
24 import org.mycore.orcid.works.MCRWorksFetcher;
25 import org.mycore.orcid.works.MCRWorksPublisher;
26 import org.mycore.orcid.works.MCRWorksSection;
27 import org.xml.sax.SAXException;
28
29 import jakarta.ws.rs.client.WebTarget;
30
31
32
33
34
35
36 public class MCRORCIDProfile {
37
38 private String orcid;
39
40
41 private WebTarget target;
42
43 private MCRWorksSection worksSection;
44
45 private MCRWorksPublisher publisher = new MCRWorksPublisher(this);
46
47 private MCRWorksFetcher fetcher = new MCRWorksFetcher(this);
48
49
50 private String accessToken;
51
52 public MCRORCIDProfile(String orcid) {
53 this.orcid = orcid;
54 this.target = MCRORCIDClient.instance().getBaseTarget().path(orcid);
55 }
56
57 public String getORCID() {
58 return orcid;
59 }
60
61 public MCRWorksPublisher getPublisher() {
62 return publisher;
63 }
64
65 public MCRWorksFetcher getFetcher() {
66 return fetcher;
67 }
68
69
70 public WebTarget getWebTarget() {
71 return target;
72 }
73
74
75 public void setAccessToken(String token) {
76 this.accessToken = token;
77 }
78
79
80 public String getAccessToken() {
81 return accessToken;
82 }
83
84
85 public synchronized MCRWorksSection getWorksSection() throws JDOMException, IOException, SAXException {
86 if (worksSection == null) {
87 worksSection = new MCRWorksSection(this);
88 }
89 return worksSection;
90 }
91 }