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 int maxTaxon
= 306000;
39 private ReferenceBase
<?
> auctReference
;
41 // @SuppressWarnings("unchecked")
42 // protected void makeIoClassList() {
43 // ioClassList = new Class[] {
44 // FaunaEuropaeaAuthorImport.class,
45 // FaunaEuropaeaTaxonNameImport.class,
46 // FaunaEuropaeaRelTaxonIncludeImport.class,
47 // FaunaEuropaeaRelMisappNamesImport.class,
48 // FaunaEuropaeaRefImport.class,
49 // FaunaEuropaeaDistributionImport.class
53 @SuppressWarnings("unchecked")
54 protected void makeIoClassList() {
55 ioClassList
= new Class
[] {
56 // FaunaEuropaeaAuthorImport.class,
57 // FaunaEuropaeaTaxonNameImport.class,
58 FaunaEuropaeaRelTaxonIncludeImport
.class
59 // FaunaEuropaeaRefImport.class,
60 // FaunaEuropaeaDistributionImport.class
64 public static FaunaEuropaeaImportConfigurator
NewInstance(Source source
, ICdmDataSource destination
){
65 return new FaunaEuropaeaImportConfigurator(source
, destination
);
68 private FaunaEuropaeaImportConfigurator(Source source
, ICdmDataSource destination
) {
70 setDestination(destination
);
71 setNomenclaturalCode(NomenclaturalCode
.ICBN
);
75 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
77 public Source
getSource() {
78 return (Source
)super.getSource();
84 public void setSource(Source dbSource
) {
85 super.setSource(dbSource
);
90 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
93 public ReferenceBase
<?
> getSourceReference() {
95 if (this.sourceReference
== null){
96 logger
.warn("getSource Reference not yet fully implemented");
97 sourceReference
= Database
.NewInstance();
98 sourceReference
.setTitleCache("Fauna Europaea database");
100 return sourceReference
;
105 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
107 public ReferenceBase
<?
> getAuctReference() {
109 if (auctReference
== null){
110 auctReference
= Database
.NewInstance();
111 auctReference
.setTitleCache("auct.");
113 return auctReference
;
117 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
119 public String
getSourceNameString() {
120 if (this.getSource() == null) {
123 return this.getSource().toString();
128 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
130 public FaunaEuropaeaImportState
getNewState() {
131 return new FaunaEuropaeaImportState(this);
135 * @return the doBasionyms
137 public boolean isDoBasionyms() {
142 * @param doBasionyms the doBasionyms to set
144 public void setDoBasionyms(boolean doBasionyms
) {
145 this.doBasionyms
= doBasionyms
;
149 * @return the doTaxonomicallyIncluded
151 public boolean isDoTaxonomicallyIncluded() {
152 return doTaxonomicallyIncluded
;
156 * @param doTaxonomicallyIncluded the doTaxonomicallyIncluded to set
158 public void setDoTaxonomicallyIncluded(boolean doTaxonomicallyIncluded
) {
159 this.doTaxonomicallyIncluded
= doTaxonomicallyIncluded
;
163 * @return the doMisappliedNames
165 public boolean isDoMisappliedNames() {
166 return doMisappliedNames
;
170 * @param doMisappliedNames the doMisappliedNames to set
172 public void setDoMisappliedNames(boolean doMisappliedNames
) {
173 this.doMisappliedNames
= doMisappliedNames
;
177 * @return the doHeterotypicSynonyms
179 public boolean isDoHeterotypicSynonyms() {
180 return doHeterotypicSynonyms
;
184 * @param doHeterotypicSynonyms the doHeterotypicSynonyms to set
186 public void setDoHeterotypicSynonyms(boolean doHeterotypicSynonyms
) {
187 this.doHeterotypicSynonyms
= doHeterotypicSynonyms
;
191 * @param auctReference the auctReference to set
193 public void setAuctReference(ReferenceBase
<?
> auctReference
) {
194 this.auctReference
= auctReference
;
198 * @return the limitSave
200 public int getLimitSave() {
205 * @param limitSave the limitSave to set
207 public void setLimitSave(int limitSave
) {
208 this.limitSave
= limitSave
;
212 * @return the maxTaxon
214 public int getMaxTaxon() {
219 * @param maxTaxon the maxTaxon to set
221 public void setMaxTaxon(int maxTaxon
) {
222 this.maxTaxon
= maxTaxon
;