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 boolean useTransactions
= true;
40 private ReferenceBase
<?
> auctReference
;
42 // @SuppressWarnings("unchecked")
43 // protected void makeIoClassList() {
44 // ioClassList = new Class[] {
45 // FaunaEuropaeaAuthorImport.class,
46 // FaunaEuropaeaNameImport.class,
47 // FaunaEuropaeaRelShipImport.class,
48 // FaunaEuropaeaRefImport.class,
49 // FaunaEuropaeaDistributionImport.class
53 @SuppressWarnings("unchecked")
54 protected void makeIoClassList() {
55 ioClassList
= new Class
[] {
56 // FaunaEuropaeaAuthorImport.class,
57 // FaunaEuropaeaNameImport.class,
58 // FaunaEuropaeaRelShipImport.class,
59 FaunaEuropaeaRelTaxonIncludeImport
.class
60 // FaunaEuropaeaRefImport.class,
61 // FaunaEuropaeaDistributionImport.class
65 public static FaunaEuropaeaImportConfigurator
NewInstance(Source source
, ICdmDataSource destination
){
66 return new FaunaEuropaeaImportConfigurator(source
, destination
);
69 private FaunaEuropaeaImportConfigurator(Source source
, ICdmDataSource destination
) {
71 setDestination(destination
);
72 setNomenclaturalCode(NomenclaturalCode
.ICBN
);
76 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
78 public Source
getSource() {
79 return (Source
)super.getSource();
85 public void setSource(Source dbSource
) {
86 super.setSource(dbSource
);
91 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
94 public ReferenceBase
<?
> getSourceReference() {
96 if (this.sourceReference
== null){
97 logger
.warn("getSource Reference not yet fully implemented");
98 sourceReference
= Database
.NewInstance();
99 sourceReference
.setTitleCache("Fauna Europaea database");
101 return sourceReference
;
106 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
108 public ReferenceBase
<?
> getAuctReference() {
110 if (auctReference
== null){
111 auctReference
= Database
.NewInstance();
112 auctReference
.setTitleCache("auct.");
114 return auctReference
;
118 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
120 public String
getSourceNameString() {
121 if (this.getSource() == null) {
124 return this.getSource().toString();
129 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
131 public FaunaEuropaeaImportState
getNewState() {
132 return new FaunaEuropaeaImportState(this);
136 * @return the doBasionyms
138 public boolean isDoBasionyms() {
143 * @param doBasionyms the doBasionyms to set
145 public void setDoBasionyms(boolean doBasionyms
) {
146 this.doBasionyms
= doBasionyms
;
150 * @return the doTaxonomicallyIncluded
152 public boolean isDoTaxonomicallyIncluded() {
153 return doTaxonomicallyIncluded
;
157 * @param doTaxonomicallyIncluded the doTaxonomicallyIncluded to set
159 public void setDoTaxonomicallyIncluded(boolean doTaxonomicallyIncluded
) {
160 this.doTaxonomicallyIncluded
= doTaxonomicallyIncluded
;
164 * @return the doMisappliedNames
166 public boolean isDoMisappliedNames() {
167 return doMisappliedNames
;
171 * @param doMisappliedNames the doMisappliedNames to set
173 public void setDoMisappliedNames(boolean doMisappliedNames
) {
174 this.doMisappliedNames
= doMisappliedNames
;
178 * @return the doHeterotypicSynonyms
180 public boolean isDoHeterotypicSynonyms() {
181 return doHeterotypicSynonyms
;
185 * @param doHeterotypicSynonyms the doHeterotypicSynonyms to set
187 public void setDoHeterotypicSynonyms(boolean doHeterotypicSynonyms
) {
188 this.doHeterotypicSynonyms
= doHeterotypicSynonyms
;
192 * @return the useTransactions
194 public boolean isUseTransactions() {
195 return useTransactions
;
199 * @param useTransactions the useTransactions to set
201 public void setUseTransactions(boolean useTransactions
) {
202 this.useTransactions
= useTransactions
;
206 * @param auctReference the auctReference to set
208 public void setAuctReference(ReferenceBase
<?
> auctReference
) {
209 this.auctReference
= auctReference
;
213 * @return the limitSave
215 public int getLimitSave() {
220 * @param limitSave the limitSave to set
222 public void setLimitSave(int limitSave
) {
223 this.limitSave
= limitSave
;
227 * @return the maxTaxon
229 public int getMaxTaxon() {
234 * @param maxTaxon the maxTaxon to set
236 public void setMaxTaxon(int maxTaxon
) {
237 this.maxTaxon
= maxTaxon
;