Project

General

Profile

Download (10.3 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2016 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.io.specimen;
10

    
11
import java.util.HashMap;
12
import java.util.Map;
13
import java.util.UUID;
14

    
15
import eu.etaxonomy.cdm.common.URI;
16
import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
17
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
18
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
19
import eu.etaxonomy.cdm.model.agent.Person;
20
import eu.etaxonomy.cdm.model.agent.Team;
21
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
22

    
23
/**
24
 * @author k.luther
25
 * @since 15.07.2016
26
 */
27
public abstract class SpecimenImportConfiguratorBase<CONFIG extends SpecimenImportConfiguratorBase, STATE extends SpecimenImportStateBase<CONFIG,STATE>, InputStream>
28
        extends ImportConfiguratorBase<STATE, InputStream> {
29

    
30
    private static final long serialVersionUID = 4741134251527063988L;
31

    
32
    public SpecimenImportConfiguratorBase(IInputTransformer transformer) {
33
        super(transformer);
34
    }
35

    
36
    private boolean ignoreImportOfExistingSpecimen = true;
37
    private boolean reuseExistingTaxaWhenPossible = true;
38
    private final Map<UUID, UUID> taxonToDescriptionMap = new HashMap<>();
39

    
40
    private Map<String, Team> titleCacheTeam;
41
    private Map<String, Person> titleCachePerson;
42
    private boolean ignoreAuthorship = false;
43
    private boolean removeCountryFromLocalityText = false;
44
    protected OccurenceQuery query ;
45

    
46
    private boolean addMediaAsMediaSpecimen = false;
47
    private boolean reuseExistingMetaData = true;
48

    
49
    private String sourceReferenceTitle = null;
50

    
51
    private String taxonReference = null;
52
    private boolean addIndividualsAssociationsSuchAsSpecimenAndObservations = true;
53
    private boolean reuseExistingDescriptiveGroups = false;
54

    
55

    
56
    private String defaultAuthor="";
57
    private boolean allowReuseOtherClassifications =true;
58

    
59
    private boolean deduplicateReferences = false;
60
    private boolean deduplicateClassifications = false;
61

    
62
    private boolean moveNewTaxaToDefaultClassification = true;
63

    
64
    private boolean mapUnitIdToCatalogNumber = true;
65
    private boolean mapUnitIdToAccessionNumber = false;
66
    private boolean mapUnitIdToBarcode = false;
67

    
68
    private boolean overwriteExistingSpecimens = false;
69
    private boolean downloadSequenceData = false;
70

    
71
    private SpecimenOrObservationType type;
72

    
73
    private final SpecimenUserInteraction specimenUserInteraction = new SpecimenUserInteraction();
74

    
75
    protected Map<String,UUID> namedAreaDecisions = new HashMap<>();
76

    
77
    private URI reportUri;
78

    
79
    public SpecimenOrObservationType getType() {
80
        return type;
81
    }
82

    
83
    public void setType(SpecimenOrObservationType type) {
84
        this.type = type;
85
    }
86

    
87
    public boolean isIgnoreImportOfExistingSpecimen() {
88
        return ignoreImportOfExistingSpecimen;
89
    }
90

    
91
    public void setIgnoreImportOfExistingSpecimen(boolean ignoreImportOfExistingSpecimen) {
92
        this.ignoreImportOfExistingSpecimen = ignoreImportOfExistingSpecimen;
93
    }
94

    
95
    public Map<String, Team> getTitleCacheTeam() {
96
        return titleCacheTeam;
97
    }
98

    
99
    public void setTitleCacheTeam(Map<String, Team> titleCacheTeam) {
100
        this.titleCacheTeam = titleCacheTeam;
101
    }
102

    
103
    public Map<String, Person> getTitleCachePerson() {
104
        return titleCachePerson;
105
    }
106

    
107
    public void setTitleCachePerson(Map<String, Person> titleCachePerson) {
108
        this.titleCachePerson = titleCachePerson;
109
    }
110

    
111
    public OccurenceQuery getQuery() {
112
        return query;
113
    }
114

    
115
    public void setQuery(OccurenceQuery query) {
116
        this.query = query;
117
    }
118

    
119
    public String getTaxonReference() {
120
        return taxonReference;
121
    }
122

    
123
    public void setTaxonReference(String taxonReference) {
124
        this.taxonReference = taxonReference;
125
    }
126

    
127
    public boolean isAddIndividualsAssociationsSuchAsSpecimenAndObservations() {
128
        return addIndividualsAssociationsSuchAsSpecimenAndObservations;
129
    }
130

    
131
    public void setAddIndividualsAssociationsSuchAsSpecimenAndObservations(
132
            boolean addIndividualsAssociationsSuchAsSpecimenAndObservations) {
133
        this.addIndividualsAssociationsSuchAsSpecimenAndObservations = addIndividualsAssociationsSuchAsSpecimenAndObservations;
134
    }
135

    
136
    public boolean isReuseExistingDescriptiveGroups() {
137
        return reuseExistingDescriptiveGroups;
138
    }
139

    
140
    public void setReuseExistingDescriptiveGroups(boolean reuseExistingDescriptiveGroups) {
141
        this.reuseExistingDescriptiveGroups = reuseExistingDescriptiveGroups;
142
    }
143

    
144
    public String getDefaultAuthor() {
145
        return defaultAuthor;
146
    }
147

    
148
    public void setDefaultAuthor(String defaultAuthor) {
149
        this.defaultAuthor = defaultAuthor;
150
    }
151

    
152
    public boolean isAllowReuseOtherClassifications() {
153
        return allowReuseOtherClassifications;
154
    }
155

    
156
    public void setAllowReuseOtherClassifications(boolean allowReuseOtherClassifications) {
157
        this.allowReuseOtherClassifications = allowReuseOtherClassifications;
158
    }
159

    
160
    public boolean isDeduplicateReferences() {
161
        return deduplicateReferences;
162
    }
163

    
164
    public void setDeduplicateReferences(boolean deduplicateReferences) {
165
        this.deduplicateReferences = deduplicateReferences;
166
    }
167

    
168
    public boolean isDeduplicateClassifications() {
169
        return deduplicateClassifications;
170
    }
171

    
172
    public void setDeduplicateClassifications(boolean deduplicateClassifications) {
173
        this.deduplicateClassifications = deduplicateClassifications;
174
    }
175

    
176
    public boolean isMoveNewTaxaToDefaultClassification() {
177
        return moveNewTaxaToDefaultClassification;
178
    }
179

    
180
    public void setMoveNewTaxaToDefaultClassification(boolean moveNewTaxaToDefaultClassification) {
181
        this.moveNewTaxaToDefaultClassification = moveNewTaxaToDefaultClassification;
182
    }
183

    
184
    public boolean isMapUnitIdToCatalogNumber() {
185
        return mapUnitIdToCatalogNumber;
186
    }
187

    
188
    public void setMapUnitIdToCatalogNumber(boolean mapUnitIdToCatalogNumber) {
189
        this.mapUnitIdToCatalogNumber = mapUnitIdToCatalogNumber;
190
    }
191

    
192
    public boolean isMapUnitIdToAccessionNumber() {
193
        return mapUnitIdToAccessionNumber;
194
    }
195

    
196
    public void setMapUnitIdToAccessionNumber(boolean mapUnitIdToAccessionNumber) {
197
        this.mapUnitIdToAccessionNumber = mapUnitIdToAccessionNumber;
198
    }
199

    
200
    public boolean isMapUnitIdToBarcode() {
201
        return mapUnitIdToBarcode;
202
    }
203

    
204
    public void setMapUnitIdToBarcode(boolean mapUnitIdToBarcode) {
205
        this.mapUnitIdToBarcode = mapUnitIdToBarcode;
206
    }
207

    
208
    public Map<String, UUID> getNamedAreaDecisions() {
209
        return namedAreaDecisions;
210
    }
211

    
212

    
213
    public void setNamedAreaDecisions(Map<String,UUID> namedAreaDecisions) {
214
        this.namedAreaDecisions = namedAreaDecisions;
215
    }
216

    
217
    public void putNamedAreaDecision(String areaStr,UUID uuid){
218
        this.namedAreaDecisions.put(areaStr,uuid);
219
    }
220

    
221
    public UUID getNamedAreaDecision(String areaStr){
222
        return namedAreaDecisions.get(areaStr);
223
    }
224

    
225
    public Map<UUID, UUID> getTaxonToDescriptionMap() {
226
        return taxonToDescriptionMap;
227
    }
228

    
229

    
230

    
231
    public SpecimenUserInteraction getSpecimenUserInteraction() {
232
        return specimenUserInteraction;
233
    }
234

    
235
    public void setReuseExistingTaxaWhenPossible(boolean reuseExistingTaxaWhenPossible) {
236
        this.reuseExistingTaxaWhenPossible = reuseExistingTaxaWhenPossible;
237
    }
238

    
239
    public void setIgnoreAuthorship(boolean ignoreAuthorship) {
240
        this.ignoreAuthorship = ignoreAuthorship;
241
    }
242

    
243
    public void setRemoveCountryFromLocalityText(boolean removeCountryFromLocalityText) {
244
        this.removeCountryFromLocalityText = removeCountryFromLocalityText;
245
    }
246

    
247
    public void setAddMediaAsMediaSpecimen(boolean addMediaAsMediaSpecimen) {
248
        this.addMediaAsMediaSpecimen = addMediaAsMediaSpecimen;
249
    }
250

    
251
    public void setOverwriteExistingSpecimens(boolean overwriteExistingSpecimens) {
252
        this.overwriteExistingSpecimens = overwriteExistingSpecimens;
253
    }
254

    
255
    public boolean isOverwriteExistingSpecimens(){
256
        return overwriteExistingSpecimens;
257
    }
258

    
259
    public boolean isReuseExistingTaxaWhenPossible() {
260
        return reuseExistingTaxaWhenPossible;
261
    }
262

    
263
    public void setTeams(Map<String, Team> titleCacheTeam) {
264
       this.titleCacheTeam  = titleCacheTeam;
265
    }
266

    
267
    public Team getTeam(String titleCache){
268
        return titleCacheTeam.get(titleCache);
269
    }
270

    
271
    public Map<String, Team> getTeams(){
272
        return titleCacheTeam;
273
    }
274

    
275
    public void setPersons(Map<String, Person> titleCachePerson) {
276
        this.titleCachePerson = titleCachePerson;
277
    }
278

    
279
    public Map<String, Person> getPersons(){
280
        return titleCachePerson;
281
    }
282

    
283
    public Person getPerson(String titleCache){
284
        return titleCachePerson.get(titleCache);
285
    }
286

    
287
    public boolean isAddMediaAsMediaSpecimen(){
288
        return addMediaAsMediaSpecimen;
289
    }
290

    
291
    public void addMediaAsMediaSpecimen(boolean addMediaAsMediaSpecimen){
292
       this.addMediaAsMediaSpecimen = addMediaAsMediaSpecimen;
293
    }
294

    
295
    public boolean isIgnoreAuthorship() {
296
        return ignoreAuthorship;
297
    }
298

    
299
    public boolean isRemoveCountryFromLocalityText() {
300
        return removeCountryFromLocalityText;
301
    }
302

    
303
    public OccurenceQuery getOccurenceQuery(){
304
        return query;
305
    }
306

    
307
    public void setOccurenceQuery(OccurenceQuery query){
308
        this.query = query;
309
    }
310

    
311
    public boolean isReuseExistingMetaData() {
312
        return reuseExistingMetaData;
313
    }
314

    
315
    public void setReuseExistingMetaData(boolean reuseExistingMetaData) {
316
        this.reuseExistingMetaData = reuseExistingMetaData;
317
    }
318

    
319
    public void setReportUri(URI reportUri) {
320
        this.reportUri = reportUri;
321
    }
322

    
323
    public URI getReportUri() {
324
        return reportUri;
325
    }
326

    
327
    @Override
328
    public String getSourceReferenceTitle(){
329
        return this.sourceReferenceTitle;
330
    }
331

    
332
    @Override
333
    public void setSourceReferenceTitle(String name){
334
        this.sourceReferenceTitle=name;
335
    }
336

    
337
    @Override
338
    public boolean isValid(){
339
        return true;
340
    }
341

    
342
    public boolean isDownloadSequenceData() {
343
        return downloadSequenceData;
344
    }
345

    
346
    public void setDownloadSequenceData(boolean downloadSequenceData) {
347
        this.downloadSequenceData = downloadSequenceData;
348
    }
349
}
(3-3/7)