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
.redlist
;
12 import org
.apache
.log4j
.Logger
;
14 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
15 import eu
.etaxonomy
.cdm
.io
.common
.IImportConfigurator
;
16 import eu
.etaxonomy
.cdm
.io
.common
.ImportConfiguratorBase
;
17 import eu
.etaxonomy
.cdm
.io
.common
.ImportStateBase
;
18 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
19 import eu
.etaxonomy
.cdm
.io
.common
.mapping
.IInputTransformer
;
20 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalCode
;
21 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
22 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceFactory
;
30 public class RoteListeDbImportConfigurator
extends ImportConfiguratorBase
<RoteListeDbImportState
, Source
> implements IImportConfigurator
{
31 @SuppressWarnings("unused")
32 private static Logger logger
= Logger
.getLogger(RoteListeDbImportConfigurator
.class);
34 public static RoteListeDbImportConfigurator
NewInstance(Source ermsSource
, ICdmDataSource destination
){
35 return new RoteListeDbImportConfigurator(ermsSource
, destination
);
38 /* Max number of records to be saved with one service call */
39 private int recordsPerTransaction
= 1000; //defaultValue
41 private DO_REFERENCES doReferences
= DO_REFERENCES
.ALL
;
42 private boolean doTaxa
= true;
45 private static IInputTransformer defaultTransformer
= new RoteListeDbTransformer();
47 protected void makeIoClassList(){
48 ioClassList
= new Class
[]{
49 RoteListeDbTaxonImport
.class,
55 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
57 public ImportStateBase
getNewState() {
58 return new RoteListeDbImportState(this);
63 private RoteListeDbImportConfigurator(Source source
, ICdmDataSource destination
) {
64 super(defaultTransformer
);
65 setNomenclaturalCode(NomenclaturalCode
.ICZN
); //default for ERMS
67 setDestination(destination
);
71 public Source
getSource() {
72 return (Source
)super.getSource();
74 public void setSource(Source berlinModelSource
) {
75 super.setSource(berlinModelSource
);
79 * @see eu.etaxonomy.cdm.io.tcsrdf.IImportConfigurator#getSourceReference()
81 public Reference
getSourceReference() {
82 if (sourceReference
== null){
83 sourceReference
= ReferenceFactory
.newDatabase();
84 if (getSource() != null){
85 sourceReference
.setTitleCache(getSource().getDatabase(), true);
88 return sourceReference
;
92 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
94 public String
getSourceNameString() {
95 if (this.getSource() == null){
98 return this.getSource().getDatabase();
103 * @return the limitSave
105 public int getRecordsPerTransaction() {
106 return recordsPerTransaction
;
110 * @param limitSave the limitSave to set
112 public void setRecordsPerTransaction(int recordsPerTransaction
) {
113 this.recordsPerTransaction
= recordsPerTransaction
;
116 public DO_REFERENCES
getDoReferences() {
119 public void setDoReferences(DO_REFERENCES doReferences
) {
120 this.doReferences
= doReferences
;
123 public boolean isDoTaxa() {
126 public void setDoTaxa(boolean doTaxa
) {
127 this.doTaxa
= doTaxa
;