Project

General

Profile

1
/**
2
 *
3
 */
4
package eu.dnetlib.dli.resolver.model;
5

    
6
import eu.dnetlib.pid.resolver.model.ObjectProvenance;
7
import org.apache.commons.lang3.StringEscapeUtils;
8

    
9
// TODO: Auto-generated Javadoc
10

    
11
/**
12
 * The Class DLIProvenance.
13
 *
14
 * @author sandro
15
 */
16
public class DLIObjectProvenance extends ObjectProvenance {
17

    
18

    
19
	/**
20
	 * The publisher.
21
	 */
22
	private String publisher;
23

    
24
	/**
25
	 * The publisher identifier can be null
26
	 */
27
	private String publisherId;
28

    
29
	/**
30
	 * The provision mode.
31
	 */
32
	private String provisionMode;
33

    
34
	/**
35
	 * The completion status.
36
	 */
37
	private String completionStatus;
38

    
39
	/**
40
	 * The visible.
41
	 */
42
	private boolean visible;
43

    
44
	/**
45
	 * The datasource contribution.
46
	 */
47
	private String datasourceContribution;
48

    
49
	/**
50
	 * The collection date.
51
	 */
52
	private String collectionDate;
53

    
54
	/**
55
	 * Instantiates a new DLI provenance.
56
	 *
57
	 * @param datasource       the datasource
58
	 * @param provisionMode    the provision mode
59
	 * @param completionStatus the completion status
60
	 * @param contribution     the contribution
61
	 */
62
    public DLIObjectProvenance(final String datasource, final String provisionMode, final String completionStatus, final String contribution,
63
                               final String collectionDate, final boolean visible) {
64
		super();
65
		this.datasource = datasource;
66
		this.provisionMode = provisionMode;
67
		this.completionStatus = completionStatus;
68
		this.datasourceContribution = contribution;
69
		this.collectionDate = collectionDate;
70
		this.visible = visible;
71
	}
72

    
73
    public DLIObjectProvenance(final String datasource, final String provisionMode, final String completionStatus, final String contribution,
74
                               final String collectionDate, final boolean visible, final String datasourceId, final String publisher, final String publisherId) {
75
		this(datasource, provisionMode, completionStatus, contribution, collectionDate, visible);
76
		this.publisher = publisher;
77
		this.publisherId = publisherId;
78
		this.datasourceId = datasourceId;
79
	}
80

    
81
	/**
82
	 * Instantiates a new DLI provenance.
83
	 */
84
    public DLIObjectProvenance() {
85

    
86
	}
87

    
88
	/**
89
	 * Get the Publisher identifier
90
	 *
91
	 * @return the publisher
92
	 */
93
	public String getPublisherId() {
94
		return publisherId;
95
	}
96

    
97
	/**
98
	 * Set the Publisher identifier
99
	 *
100
	 * @param publisherId
101
	 */
102
	public void setPublisherId(String publisherId) {
103
		this.publisherId = publisherId;
104
	}
105

    
106
	/**
107
	 * Get the Publisher
108
	 *
109
	 * @return the publisher
110
	 */
111
	public String getPublisher() {
112
		return publisher;
113
	}
114

    
115
	/**
116
	 * Set the Publisher
117
	 *
118
	 * @param publisher
119
	 */
120
	public void setPublisher(String publisher) {
121
		this.publisher = publisher;
122
	}
123

    
124
	public String getEscapedPublisher() {
125
		return StringEscapeUtils.escapeXml11(this.publisher);
126
	}
127

    
128

    
129

    
130

    
131
	/**
132
	 * Gets the provision mode.
133
	 *
134
	 * @return the provision mode
135
	 */
136
	public String getProvisionMode() {
137
		return provisionMode;
138
	}
139

    
140
	/**
141
	 * Sets the provision mode.
142
	 *
143
	 * @param provisionMode the new provision mode
144
	 */
145
	public void setProvisionMode(final String provisionMode) {
146
		this.provisionMode = provisionMode;
147
	}
148

    
149
	/**
150
	 * Gets the completion status.
151
	 *
152
	 * @return the completion status
153
	 */
154
	public String getCompletionStatus() {
155
		return completionStatus;
156
	}
157

    
158
	/**
159
	 * Sets the completion status.
160
	 *
161
	 * @param completionStatus the new completion status
162
	 */
163
	public void setCompletionStatus(final String completionStatus) {
164
		this.completionStatus = completionStatus;
165
	}
166

    
167
	/**
168
	/**
169
	 * Gets the datasource contribution.
170
	 *
171
	 * @return the datasource contribution
172
	 */
173
	public String getDatasourceContribution() {
174
		return datasourceContribution;
175
	}
176

    
177
	/**
178
	 * Sets the datasource contribution.
179
	 *
180
	 * @param datasourceContribution the new datasource contribution
181
	 */
182
	public void setDatasourceContribution(final String datasourceContribution) {
183
		this.datasourceContribution = datasourceContribution;
184
	}
185

    
186
	/**
187
	 * Gets the escaped xml datasource contribution.
188
	 *
189
	 * @return the escaped xml datasource contribution
190
	 */
191
	public String getEscapedXMLDatasourceContribution() {
192
		return datasourceContribution.replaceAll("\"", "");
193
	}
194

    
195
	public boolean isShowPublisher() {
196
		return publisher != null || publisherId != null;
197
	}
198

    
199
	public boolean isShowDatasource() {
200
		return datasource != null || datasourceId != null;
201
	}
202

    
203
	public boolean isResolved() {
204
		return "resolved".equals(provisionMode);
205
	}
206

    
207

    
208
	/**
209
	 * Gets the collection date.
210
	 *
211
	 * @return the collection date
212
	 */
213
	public String getCollectionDate() {
214
		return collectionDate;
215
	}
216

    
217
	/**
218
	 * Sets the collection date.
219
	 *
220
	 * @param collectionDate the new collection date
221
	 */
222
	public void setCollectionDate(final String collectionDate) {
223
		this.collectionDate = collectionDate;
224
	}
225

    
226
	public boolean isVisible() {
227
		return visible;
228
	}
229

    
230
	public void setVisible(final boolean visible) {
231
		this.visible = visible;
232
	}
233

    
234
}
(2-2/6)