2 * Copyright (C) 2007 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.
10 package eu
.etaxonomy
.cdm
.io
.eflora
.centralAfrica
.ferns
;
12 import java
.lang
.reflect
.Method
;
14 import org
.apache
.log4j
.Logger
;
16 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
17 import eu
.etaxonomy
.cdm
.io
.common
.IImportConfigurator
;
18 import eu
.etaxonomy
.cdm
.io
.common
.ImportConfiguratorBase
;
19 import eu
.etaxonomy
.cdm
.io
.common
.ImportStateBase
;
20 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
21 import eu
.etaxonomy
.cdm
.io
.common
.IImportConfigurator
.DO_REFERENCES
;
22 import eu
.etaxonomy
.cdm
.io
.common
.mapping
.IInputTransformer
;
23 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalCode
;
24 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
25 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceFactory
;
33 public class CentralAfricaFernsImportConfigurator
extends ImportConfiguratorBase
<CentralAfricaFernsImportState
, Source
> implements IImportConfigurator
{
34 @SuppressWarnings("unused")
35 private static Logger logger
= Logger
.getLogger(CentralAfricaFernsImportConfigurator
.class);
37 public static CentralAfricaFernsImportConfigurator
NewInstance(Source ermsSource
, ICdmDataSource destination
){
38 return new CentralAfricaFernsImportConfigurator(ermsSource
, destination
);
41 /* Max number of records to be saved with one service call */
42 private int recordsPerTransaction
= 1000; //defaultValue
45 private Method userTransformationMethod
;
47 private boolean doVernaculars
= true;
48 private boolean doLinks
= true;
49 private boolean doNotes
= true;
50 private boolean doImages
= true;
51 private DO_REFERENCES doReferences
= DO_REFERENCES
.ALL
;
52 private boolean doTaxa
= true;
53 private boolean doRelTaxa
= true;
56 private static IInputTransformer defaultTransformer
= new CentralAfricaFernsTransformer();
58 protected void makeIoClassList(){
59 ioClassList
= new Class
[]{
60 //ErmsGeneralImportValidator.class
61 // CentralAfricaFernsReferenceImport.class ,
62 CentralAfricaFernsTaxonImport
.class,
63 CentralAfricaFernsTaxonRelationImport
.class
69 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
71 public ImportStateBase
getNewState() {
72 return new CentralAfricaFernsImportState(this);
77 private CentralAfricaFernsImportConfigurator(Source source
, ICdmDataSource destination
) {
78 super(defaultTransformer
);
79 setNomenclaturalCode(NomenclaturalCode
.ICZN
); //default for ERMS
81 setDestination(destination
);
85 * @see eu.etaxonomy.cdm.io.tcsrdf.IImportConfigurator#getSourceReference()
87 public Reference
getSourceReference() {
88 if (sourceReference
== null){
89 sourceReference
= ReferenceFactory
.newDatabase();
90 if (getSource() != null){
91 sourceReference
.setTitleCache(getSource().getDatabase(), true);
94 return sourceReference
;
99 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
101 public String
getSourceNameString() {
102 if (this.getSource() == null){
105 return this.getSource().getDatabase();
110 * @return the userTransformationMethod
112 public Method
getUserTransformationMethod() {
113 return userTransformationMethod
;
117 * @param userTransformationMethod the userTransformationMethod to set
119 public void setUserTransformationMethod(Method userTransformationMethod
) {
120 this.userTransformationMethod
= userTransformationMethod
;
125 * @return the limitSave
127 public int getRecordsPerTransaction() {
128 return recordsPerTransaction
;
131 * @param limitSave the limitSave to set
133 public void setRecordsPerTransaction(int recordsPerTransaction
) {
134 this.recordsPerTransaction
= recordsPerTransaction
;
138 * @param doVernaculars the doVernaculars to set
140 public void setDoVernaculars(boolean doVernaculars
) {
141 this.doVernaculars
= doVernaculars
;
144 * @return the doVernaculars
146 public boolean isDoVernaculars() {
147 return doVernaculars
;
153 * @param doLinks the doLinks to set
155 public void setDoLinks(boolean doLinks
) {
156 this.doLinks
= doLinks
;
159 * @return the doLinks
161 public boolean isDoLinks() {
168 * @param doNotes the doNotes to set
170 public void setDoNotes(boolean doNotes
) {
171 this.doNotes
= doNotes
;
174 * @return the doNotes
176 public boolean isDoNotes() {
181 * @param doImages the doImages to set
183 public void setDoImages(boolean doImages
) {
184 this.doImages
= doImages
;
187 * @return the doImages
189 public boolean isDoImages() {
194 public DO_REFERENCES
getDoReferences() {
197 public void setDoReferences(DO_REFERENCES doReferences
) {
198 this.doReferences
= doReferences
;
201 public boolean isDoTaxa() {
204 public void setDoTaxa(boolean doTaxa
) {
205 this.doTaxa
= doTaxa
;
208 public boolean isDoRelTaxa() {
211 public void setDoRelTaxa(boolean doRelTaxa
) {
212 this.doRelTaxa
= doRelTaxa
;