2 * Copyright (C) 2008 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
.faunaEuropaea
;
11 import org
.apache
.log4j
.Logger
;
12 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
13 import eu
.etaxonomy
.cdm
.io
.berlinModel
.in
.BerlinModelImportConfigurator
;
14 import eu
.etaxonomy
.cdm
.io
.common
.IImportConfigurator
;
15 import eu
.etaxonomy
.cdm
.io
.common
.ImportConfiguratorBase
;
16 import eu
.etaxonomy
.cdm
.io
.common
.ImportStateBase
;
17 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
18 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalCode
;
19 import eu
.etaxonomy
.cdm
.model
.reference
.Database
;
20 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
23 * @author a.babadshanjan
27 public class FaunaEuropaeaImportConfigurator
extends ImportConfiguratorBase
<FaunaEuropaeaImportState
> implements IImportConfigurator
{
29 private static final Logger logger
= Logger
.getLogger(FaunaEuropaeaImportConfigurator
.class);
31 private boolean doBasionyms
= true;
32 private boolean doTaxonomicallyIncluded
= true;
33 private boolean doMisappliedNames
= true;
34 private boolean doHeterotypicSynonyms
= true;
36 /* Max number of taxa to be saved with one service call */
37 private int limitSave
= 1000;
38 private ReferenceBase
<?
> auctReference
;
40 @SuppressWarnings("unchecked")
41 protected void makeIoClassList() {
42 ioClassList
= new Class
[] {
43 // FaunaEuropaeaAuthorImport.class,
44 FaunaEuropaeaTaxonNameImport
.class,
45 FaunaEuropaeaRelTaxonIncludeImport
.class,
46 FaunaEuropaeaRefImport
.class,
47 FaunaEuropaeaDistributionImport
.class
51 public static FaunaEuropaeaImportConfigurator
NewInstance(Source source
, ICdmDataSource destination
){
52 return new FaunaEuropaeaImportConfigurator(source
, destination
);
55 private FaunaEuropaeaImportConfigurator(Source source
, ICdmDataSource destination
) {
57 setDestination(destination
);
58 setNomenclaturalCode(NomenclaturalCode
.ICBN
);
62 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
64 public Source
getSource() {
65 return (Source
)super.getSource();
71 public void setSource(Source dbSource
) {
72 super.setSource(dbSource
);
77 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
80 public ReferenceBase
<?
> getSourceReference() {
82 if (this.sourceReference
== null){
83 logger
.warn("getSource Reference not yet fully implemented");
84 sourceReference
= Database
.NewInstance();
85 sourceReference
.setTitleCache("Fauna Europaea database");
87 return sourceReference
;
92 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
94 public ReferenceBase
<?
> getAuctReference() {
96 if (auctReference
== null){
97 auctReference
= Database
.NewInstance();
98 auctReference
.setTitleCache("auct.");
100 return auctReference
;
104 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
106 public String
getSourceNameString() {
107 if (this.getSource() == null) {
110 return this.getSource().toString();
115 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
117 public FaunaEuropaeaImportState
getNewState() {
118 return new FaunaEuropaeaImportState(this);
122 * @return the doBasionyms
124 public boolean isDoBasionyms() {
129 * @param doBasionyms the doBasionyms to set
131 public void setDoBasionyms(boolean doBasionyms
) {
132 this.doBasionyms
= doBasionyms
;
136 * @return the doTaxonomicallyIncluded
138 public boolean isDoTaxonomicallyIncluded() {
139 return doTaxonomicallyIncluded
;
143 * @param doTaxonomicallyIncluded the doTaxonomicallyIncluded to set
145 public void setDoTaxonomicallyIncluded(boolean doTaxonomicallyIncluded
) {
146 this.doTaxonomicallyIncluded
= doTaxonomicallyIncluded
;
150 * @return the doMisappliedNames
152 public boolean isDoMisappliedNames() {
153 return doMisappliedNames
;
157 * @param doMisappliedNames the doMisappliedNames to set
159 public void setDoMisappliedNames(boolean doMisappliedNames
) {
160 this.doMisappliedNames
= doMisappliedNames
;
164 * @return the doHeterotypicSynonyms
166 public boolean isDoHeterotypicSynonyms() {
167 return doHeterotypicSynonyms
;
171 * @param doHeterotypicSynonyms the doHeterotypicSynonyms to set
173 public void setDoHeterotypicSynonyms(boolean doHeterotypicSynonyms
) {
174 this.doHeterotypicSynonyms
= doHeterotypicSynonyms
;
178 * @param auctReference the auctReference to set
180 public void setAuctReference(ReferenceBase
<?
> auctReference
) {
181 this.auctReference
= auctReference
;
185 * @return the limitSave
187 public int getLimitSave() {
192 * @param limitSave the limitSave to set
194 public void setLimitSave(int limitSave
) {
195 this.limitSave
= limitSave
;