2 * Copyright (C) 2016 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.cdm
.io
.specimen
;
12 import java
.util
.HashMap
;
14 import java
.util
.UUID
;
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
;
28 public abstract class SpecimenImportConfiguratorBase
<CONFIG
extends SpecimenImportConfiguratorBase
, STATE
extends SpecimenImportStateBase
<CONFIG
,STATE
>, InputStream
>
29 extends ImportConfiguratorBase
<STATE
, InputStream
> {
31 private static final long serialVersionUID
= 4741134251527063988L;
36 public SpecimenImportConfiguratorBase(IInputTransformer transformer
) {
41 private boolean ignoreImportOfExistingSpecimen
= true;
42 private boolean reuseExistingTaxaWhenPossible
= true;
43 private final Map
<UUID
, UUID
> taxonToDescriptionMap
= new HashMap
<UUID
, UUID
>();
45 private Map
<String
, Team
> titleCacheTeam
;
46 private Map
<String
, Person
> titleCachePerson
;
47 private boolean ignoreAuthorship
= false;
48 private boolean removeCountryFromLocalityText
= false;
49 protected OccurenceQuery query
;
51 private boolean addMediaAsMediaSpecimen
= false;
52 private boolean reuseExistingMetaData
= true;
54 private String sourceReferenceTitle
= null;
56 private String taxonReference
= null;
57 private boolean addIndividualsAssociationsSuchAsSpecimenAndObservations
= true;
58 private boolean reuseExistingDescriptiveGroups
= false;
61 private String defaultAuthor
="";
62 private boolean allowReuseOtherClassifications
=true;
64 private boolean deduplicateReferences
= false;
65 private boolean deduplicateClassifications
= false;
67 private boolean moveNewTaxaToDefaultClassification
= true;
69 private boolean mapUnitIdToCatalogNumber
= true;
70 private boolean mapUnitIdToAccessionNumber
= false;
71 private boolean mapUnitIdToBarcode
= false;
73 private boolean overwriteExistingSpecimens
= false;
74 private boolean downloadSequenceData
= false;
76 private SpecimenOrObservationType type
;
82 public SpecimenOrObservationType
getType() {
87 * @param type the type to set
89 public void setType(SpecimenOrObservationType type
) {
93 private final SpecimenUserInteraction specimenUserInteraction
= new SpecimenUserInteraction();
95 protected Map
<String
,UUID
> namedAreaDecisions
= new HashMap
<String
,UUID
>();
97 private URI reportUri
;
100 public boolean isIgnoreImportOfExistingSpecimen() {
101 return ignoreImportOfExistingSpecimen
;
104 public void setIgnoreImportOfExistingSpecimen(boolean ignoreImportOfExistingSpecimen
) {
105 this.ignoreImportOfExistingSpecimen
= ignoreImportOfExistingSpecimen
;
108 public Map
<String
, Team
> getTitleCacheTeam() {
109 return titleCacheTeam
;
112 public void setTitleCacheTeam(Map
<String
, Team
> titleCacheTeam
) {
113 this.titleCacheTeam
= titleCacheTeam
;
116 public Map
<String
, Person
> getTitleCachePerson() {
117 return titleCachePerson
;
120 public void setTitleCachePerson(Map
<String
, Person
> titleCachePerson
) {
121 this.titleCachePerson
= titleCachePerson
;
124 public OccurenceQuery
getQuery() {
128 public void setQuery(OccurenceQuery query
) {
136 public String
getTaxonReference() {
137 return taxonReference
;
140 public void setTaxonReference(String taxonReference
) {
141 this.taxonReference
= taxonReference
;
144 public boolean isAddIndividualsAssociationsSuchAsSpecimenAndObservations() {
145 return addIndividualsAssociationsSuchAsSpecimenAndObservations
;
148 public void setAddIndividualsAssociationsSuchAsSpecimenAndObservations(
149 boolean addIndividualsAssociationsSuchAsSpecimenAndObservations
) {
150 this.addIndividualsAssociationsSuchAsSpecimenAndObservations
= addIndividualsAssociationsSuchAsSpecimenAndObservations
;
153 public boolean isReuseExistingDescriptiveGroups() {
154 return reuseExistingDescriptiveGroups
;
157 public void setReuseExistingDescriptiveGroups(boolean reuseExistingDescriptiveGroups
) {
158 this.reuseExistingDescriptiveGroups
= reuseExistingDescriptiveGroups
;
161 public String
getDefaultAuthor() {
162 return defaultAuthor
;
165 public void setDefaultAuthor(String defaultAuthor
) {
166 this.defaultAuthor
= defaultAuthor
;
169 public boolean isAllowReuseOtherClassifications() {
170 return allowReuseOtherClassifications
;
173 public void setAllowReuseOtherClassifications(boolean allowReuseOtherClassifications
) {
174 this.allowReuseOtherClassifications
= allowReuseOtherClassifications
;
177 public boolean isDeduplicateReferences() {
178 return deduplicateReferences
;
181 public void setDeduplicateReferences(boolean deduplicateReferences
) {
182 this.deduplicateReferences
= deduplicateReferences
;
185 public boolean isDeduplicateClassifications() {
186 return deduplicateClassifications
;
189 public void setDeduplicateClassifications(boolean deduplicateClassifications
) {
190 this.deduplicateClassifications
= deduplicateClassifications
;
193 public boolean isMoveNewTaxaToDefaultClassification() {
194 return moveNewTaxaToDefaultClassification
;
197 public void setMoveNewTaxaToDefaultClassification(boolean moveNewTaxaToDefaultClassification
) {
198 this.moveNewTaxaToDefaultClassification
= moveNewTaxaToDefaultClassification
;
201 public boolean isMapUnitIdToCatalogNumber() {
202 return mapUnitIdToCatalogNumber
;
205 public void setMapUnitIdToCatalogNumber(boolean mapUnitIdToCatalogNumber
) {
206 this.mapUnitIdToCatalogNumber
= mapUnitIdToCatalogNumber
;
209 public boolean isMapUnitIdToAccessionNumber() {
210 return mapUnitIdToAccessionNumber
;
213 public void setMapUnitIdToAccessionNumber(boolean mapUnitIdToAccessionNumber
) {
214 this.mapUnitIdToAccessionNumber
= mapUnitIdToAccessionNumber
;
217 public boolean isMapUnitIdToBarcode() {
218 return mapUnitIdToBarcode
;
221 public void setMapUnitIdToBarcode(boolean mapUnitIdToBarcode
) {
222 this.mapUnitIdToBarcode
= mapUnitIdToBarcode
;
225 public Map
<String
, UUID
> getNamedAreaDecisions() {
226 return namedAreaDecisions
;
230 public void setNamedAreaDecisions(Map
<String
,UUID
> namedAreaDecisions
) {
231 this.namedAreaDecisions
= namedAreaDecisions
;
234 public void putNamedAreaDecision(String areaStr
,UUID uuid
){
235 this.namedAreaDecisions
.put(areaStr
,uuid
);
238 public UUID
getNamedAreaDecision(String areaStr
){
239 return namedAreaDecisions
.get(areaStr
);
242 public Map
<UUID
, UUID
> getTaxonToDescriptionMap() {
243 return taxonToDescriptionMap
;
248 public SpecimenUserInteraction
getSpecimenUserInteraction() {
249 return specimenUserInteraction
;
252 public void setReuseExistingTaxaWhenPossible(boolean reuseExistingTaxaWhenPossible
) {
253 this.reuseExistingTaxaWhenPossible
= reuseExistingTaxaWhenPossible
;
256 public void setIgnoreAuthorship(boolean ignoreAuthorship
) {
257 this.ignoreAuthorship
= ignoreAuthorship
;
260 public void setRemoveCountryFromLocalityText(boolean removeCountryFromLocalityText
) {
261 this.removeCountryFromLocalityText
= removeCountryFromLocalityText
;
264 public void setAddMediaAsMediaSpecimen(boolean addMediaAsMediaSpecimen
) {
265 this.addMediaAsMediaSpecimen
= addMediaAsMediaSpecimen
;
268 public void setOverwriteExistingSpecimens(boolean overwriteExistingSpecimens
) {
269 this.overwriteExistingSpecimens
= overwriteExistingSpecimens
;
272 public boolean isOverwriteExistingSpecimens(){
273 return overwriteExistingSpecimens
;
282 public boolean isReuseExistingTaxaWhenPossible() {
284 return reuseExistingTaxaWhenPossible
;
288 * @param titleCacheTeam
290 public void setTeams(Map
<String
, Team
> titleCacheTeam
) {
291 this.titleCacheTeam
= titleCacheTeam
;
295 public Team
getTeam(String titleCache
){
296 return titleCacheTeam
.get(titleCache
);
299 public Map
<String
, Team
> getTeams(){
300 return titleCacheTeam
;
303 * @param titleCachePerson
305 public void setPersons(Map
<String
, Person
> titleCachePerson
) {
306 this.titleCachePerson
= titleCachePerson
;
309 public Map
<String
, Person
> getPersons(){
310 return titleCachePerson
;
313 public Person
getPerson(String titleCache
){
314 return titleCachePerson
.get(titleCache
);
317 public boolean isAddMediaAsMediaSpecimen(){
318 return addMediaAsMediaSpecimen
;
321 public void addMediaAsMediaSpecimen(boolean addMediaAsMediaSpecimen
){
322 this.addMediaAsMediaSpecimen
= addMediaAsMediaSpecimen
;
329 public boolean isIgnoreAuthorship() {
330 return ignoreAuthorship
;
336 public boolean isRemoveCountryFromLocalityText() {
337 return removeCountryFromLocalityText
;
340 public OccurenceQuery
getOccurenceQuery(){
344 public void setOccurenceQuery(OccurenceQuery query
){
351 * @return the reuseExistingMetaData
353 public boolean isReuseExistingMetaData() {
354 return reuseExistingMetaData
;
358 * @param reuseExistingMetaData the reuseExistingMetaData to set
360 public void setReuseExistingMetaData(boolean reuseExistingMetaData
) {
361 this.reuseExistingMetaData
= reuseExistingMetaData
;
364 public void setReportUri(URI reportUri
) {
365 this.reportUri
= reportUri
;
368 public URI
getReportUri() {
373 public String
getSourceReferenceTitle(){
374 return this.sourceReferenceTitle
;
378 public void setSourceReferenceTitle(String name
){
379 this.sourceReferenceTitle
=name
;
383 public boolean isValid(){
387 public boolean isDownloadSequenceData() {
388 return downloadSequenceData
;
391 public void setDownloadSequenceData(boolean downloadSequenceData
) {
392 this.downloadSequenceData
= downloadSequenceData
;