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.net.URI;
12
import java.util.HashMap;
13
import java.util.Map;
14
import java.util.UUID;
15

    
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
 * @date 15.07.2016
26
 *
27
 */
28
public abstract class SpecimenImportConfiguratorBase<STATE extends SpecimenImportStateBase, InputStream>  extends ImportConfiguratorBase<STATE, InputStream> {
29

    
30
    /**
31
     * @param transformer
32
     */
33
    public SpecimenImportConfiguratorBase(IInputTransformer transformer) {
34
        super(transformer);
35

    
36
    }
37

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

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

    
48
    private boolean addMediaAsMediaSpecimen = false;
49
    private boolean reuseExistingMetaData = true;
50

    
51
    private static String sourceReferenceTitle = null;
52

    
53
    private String taxonReference = null;
54
    private boolean addIndividualsAssociationsSuchAsSpecimenAndObservations = true;
55
    private boolean reuseExistingDescriptiveGroups = false;
56

    
57

    
58
    private String defaultAuthor="";
59
    private boolean allowReuseOtherClassifications =true;
60

    
61
    private boolean deduplicateReferences = false;
62
    private boolean deduplicateClassifications = false;
63

    
64
    private boolean moveNewTaxaToDefaultClassification = true;
65

    
66
    private boolean mapUnitIdToCatalogNumber = true;
67
    private boolean mapUnitIdToAccessionNumber = false;
68
    private boolean mapUnitIdToBarcode = false;
69

    
70
    private boolean overwriteExistingSpecimens = false;
71

    
72
    private SpecimenOrObservationType type;
73

    
74

    
75
    /**
76
     * @return the type
77
     */
78
    public SpecimenOrObservationType getType() {
79
        return type;
80
    }
81

    
82
    /**
83
     * @param type the type to set
84
     */
85
    public void setType(SpecimenOrObservationType type) {
86
        this.type = type;
87
    }
88

    
89
    private final SpecimenUserInteraction specimenUserInteraction = new SpecimenUserInteraction();
90

    
91
    protected Map<String,UUID> namedAreaDecisions = new HashMap<String,UUID>();
92

    
93
    private URI reportUri;
94

    
95

    
96
    public boolean isIgnoreImportOfExistingSpecimen() {
97
        return ignoreImportOfExistingSpecimen;
98
    }
99

    
100
    public void setIgnoreImportOfExistingSpecimen(boolean ignoreImportOfExistingSpecimen) {
101
        this.ignoreImportOfExistingSpecimen = ignoreImportOfExistingSpecimen;
102
    }
103

    
104
    public Map<String, Team> getTitleCacheTeam() {
105
        return titleCacheTeam;
106
    }
107

    
108
    public void setTitleCacheTeam(Map<String, Team> titleCacheTeam) {
109
        this.titleCacheTeam = titleCacheTeam;
110
    }
111

    
112
    public Map<String, Person> getTitleCachePerson() {
113
        return titleCachePerson;
114
    }
115

    
116
    public void setTitleCachePerson(Map<String, Person> titleCachePerson) {
117
        this.titleCachePerson = titleCachePerson;
118
    }
119

    
120
    public OccurenceQuery getQuery() {
121
        return query;
122
    }
123

    
124
    public void setQuery(OccurenceQuery query) {
125
        this.query = query;
126
    }
127

    
128

    
129

    
130

    
131

    
132
    public String getTaxonReference() {
133
        return taxonReference;
134
    }
135

    
136
    public void setTaxonReference(String taxonReference) {
137
        this.taxonReference = taxonReference;
138
    }
139

    
140
    public boolean isAddIndividualsAssociationsSuchAsSpecimenAndObservations() {
141
        return addIndividualsAssociationsSuchAsSpecimenAndObservations;
142
    }
143

    
144
    public void setAddIndividualsAssociationsSuchAsSpecimenAndObservations(
145
            boolean addIndividualsAssociationsSuchAsSpecimenAndObservations) {
146
        this.addIndividualsAssociationsSuchAsSpecimenAndObservations = addIndividualsAssociationsSuchAsSpecimenAndObservations;
147
    }
148

    
149
    public boolean isReuseExistingDescriptiveGroups() {
150
        return reuseExistingDescriptiveGroups;
151
    }
152

    
153
    public void setReuseExistingDescriptiveGroups(boolean reuseExistingDescriptiveGroups) {
154
        this.reuseExistingDescriptiveGroups = reuseExistingDescriptiveGroups;
155
    }
156

    
157
    public String getDefaultAuthor() {
158
        return defaultAuthor;
159
    }
160

    
161
    public void setDefaultAuthor(String defaultAuthor) {
162
        this.defaultAuthor = defaultAuthor;
163
    }
164

    
165
    public boolean isAllowReuseOtherClassifications() {
166
        return allowReuseOtherClassifications;
167
    }
168

    
169
    public void setAllowReuseOtherClassifications(boolean allowReuseOtherClassifications) {
170
        this.allowReuseOtherClassifications = allowReuseOtherClassifications;
171
    }
172

    
173
    public boolean isDeduplicateReferences() {
174
        return deduplicateReferences;
175
    }
176

    
177
    public void setDeduplicateReferences(boolean deduplicateReferences) {
178
        this.deduplicateReferences = deduplicateReferences;
179
    }
180

    
181
    public boolean isDeduplicateClassifications() {
182
        return deduplicateClassifications;
183
    }
184

    
185
    public void setDeduplicateClassifications(boolean deduplicateClassifications) {
186
        this.deduplicateClassifications = deduplicateClassifications;
187
    }
188

    
189
    public boolean isMoveNewTaxaToDefaultClassification() {
190
        return moveNewTaxaToDefaultClassification;
191
    }
192

    
193
    public void setMoveNewTaxaToDefaultClassification(boolean moveNewTaxaToDefaultClassification) {
194
        this.moveNewTaxaToDefaultClassification = moveNewTaxaToDefaultClassification;
195
    }
196

    
197
    public boolean isMapUnitIdToCatalogNumber() {
198
        return mapUnitIdToCatalogNumber;
199
    }
200

    
201
    public void setMapUnitIdToCatalogNumber(boolean mapUnitIdToCatalogNumber) {
202
        this.mapUnitIdToCatalogNumber = mapUnitIdToCatalogNumber;
203
    }
204

    
205
    public boolean isMapUnitIdToAccessionNumber() {
206
        return mapUnitIdToAccessionNumber;
207
    }
208

    
209
    public void setMapUnitIdToAccessionNumber(boolean mapUnitIdToAccessionNumber) {
210
        this.mapUnitIdToAccessionNumber = mapUnitIdToAccessionNumber;
211
    }
212

    
213
    public boolean isMapUnitIdToBarcode() {
214
        return mapUnitIdToBarcode;
215
    }
216

    
217
    public void setMapUnitIdToBarcode(boolean mapUnitIdToBarcode) {
218
        this.mapUnitIdToBarcode = mapUnitIdToBarcode;
219
    }
220

    
221
    public Map<String, UUID> getNamedAreaDecisions() {
222
        return namedAreaDecisions;
223
    }
224

    
225

    
226
    public void setNamedAreaDecisions(Map<String,UUID> namedAreaDecisions) {
227
        this.namedAreaDecisions = namedAreaDecisions;
228
    }
229

    
230
    public void putNamedAreaDecision(String areaStr,UUID uuid){
231
        this.namedAreaDecisions.put(areaStr,uuid);
232
    }
233

    
234
    public UUID getNamedAreaDecision(String areaStr){
235
        return namedAreaDecisions.get(areaStr);
236
    }
237

    
238
    public Map<UUID, UUID> getTaxonToDescriptionMap() {
239
        return taxonToDescriptionMap;
240
    }
241

    
242

    
243

    
244
    public SpecimenUserInteraction getSpecimenUserInteraction() {
245
        return specimenUserInteraction;
246
    }
247

    
248
    public void setReuseExistingTaxaWhenPossible(boolean reuseExistingTaxaWhenPossible) {
249
        this.reuseExistingTaxaWhenPossible = reuseExistingTaxaWhenPossible;
250
    }
251

    
252
    public void setIgnoreAuthorship(boolean ignoreAuthorship) {
253
        this.ignoreAuthorship = ignoreAuthorship;
254
    }
255

    
256
    public void setRemoveCountryFromLocalityText(boolean removeCountryFromLocalityText) {
257
        this.removeCountryFromLocalityText = removeCountryFromLocalityText;
258
    }
259

    
260
    public void setAddMediaAsMediaSpecimen(boolean addMediaAsMediaSpecimen) {
261
        this.addMediaAsMediaSpecimen = addMediaAsMediaSpecimen;
262
    }
263

    
264
    public void setOverwriteExistingSpecimens(boolean overwriteExistingSpecimens) {
265
        this.overwriteExistingSpecimens = overwriteExistingSpecimens;
266
    }
267

    
268
    public boolean isOverwriteExistingSpecimens(){
269
        return overwriteExistingSpecimens;
270
    }
271

    
272

    
273

    
274

    
275
    /**
276
     * @return
277
     */
278
    public boolean isReuseExistingTaxaWhenPossible() {
279

    
280
        return reuseExistingTaxaWhenPossible;
281
    }
282

    
283
    /**
284
     * @param titleCacheTeam
285
     */
286
    public void setTeams(Map<String, Team> titleCacheTeam) {
287
       this.titleCacheTeam  = titleCacheTeam;
288

    
289
    }
290

    
291
    public Team getTeam(String titleCache){
292
        return titleCacheTeam.get(titleCache);
293
    }
294

    
295
    public Map<String, Team> getTeams(){
296
        return titleCacheTeam;
297
    }
298
    /**
299
     * @param titleCachePerson
300
     */
301
    public void setPersons(Map<String, Person> titleCachePerson) {
302
        this.titleCachePerson = titleCachePerson;
303
    }
304

    
305
    public Map<String, Person> getPersons(){
306
        return titleCachePerson;
307
    }
308

    
309
    public Person getPerson(String titleCache){
310
        return titleCachePerson.get(titleCache);
311
    }
312

    
313
    public boolean isAddMediaAsMediaSpecimen(){
314
        return addMediaAsMediaSpecimen;
315
    }
316

    
317
    public void addMediaAsMediaSpecimen(boolean addMediaAsMediaSpecimen){
318
       this.addMediaAsMediaSpecimen = addMediaAsMediaSpecimen;
319
    }
320

    
321

    
322
    /**
323
     * @return
324
     */
325
    public boolean isIgnoreAuthorship() {
326
        return ignoreAuthorship;
327
    }
328

    
329
    /**
330
     * @return
331
     */
332
    public boolean isRemoveCountryFromLocalityText() {
333
        return removeCountryFromLocalityText;
334
    }
335

    
336
    public OccurenceQuery getOccurenceQuery(){
337
        return query;
338
    }
339

    
340
    public void setOccurenceQuery(OccurenceQuery query){
341
        this.query = query;
342
    }
343

    
344

    
345

    
346
    /**
347
     * @return the reuseExistingMetaData
348
     */
349
    public boolean isReuseExistingMetaData() {
350
        return reuseExistingMetaData;
351
    }
352

    
353
    /**
354
     * @param reuseExistingMetaData the reuseExistingMetaData to set
355
     */
356
    public void setReuseExistingMetaData(boolean reuseExistingMetaData) {
357
        this.reuseExistingMetaData = reuseExistingMetaData;
358
    }
359

    
360
    public void setReportUri(URI reportUri) {
361
        this.reportUri = reportUri;
362
    }
363

    
364
    public URI getReportUri() {
365
        return reportUri;
366
    }
367

    
368
    @Override
369
    public String getSourceReferenceTitle(){
370
        return this.sourceReferenceTitle;
371
    }
372

    
373
    @Override
374
    public void setSourceReferenceTitle(String name){
375
        this.sourceReferenceTitle=name;
376
    }
377

    
378
    @Override
379
    public boolean isValid(){
380
        return true;
381
    }
382

    
383

    
384

    
385
}
(3-3/7)