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
.specimen
.excel
.in
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
18 import eu
.etaxonomy
.cdm
.io
.common
.IImportConfigurator
;
19 import eu
.etaxonomy
.cdm
.io
.common
.ImportConfiguratorBase
;
20 import eu
.etaxonomy
.cdm
.io
.common
.mapping
.IInputTransformer
;
21 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
22 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceFactory
;
29 public class SpecimenSynthesysExcelImportConfigurator
extends ImportConfiguratorBase
<SpecimenSynthesysExcelImportState
, URI
> implements IImportConfigurator
{
30 private static final Logger logger
= Logger
.getLogger(SpecimenSynthesysExcelImportConfigurator
.class);
31 private boolean doParsing
= false;
32 private boolean reuseMetadata
= false;
33 private boolean reuseTaxon
= false;
34 private String taxonReference
= null;
38 private static IInputTransformer defaultTransformer
= null;
41 @SuppressWarnings("unchecked")
42 protected void makeIoClassList(){
43 ioClassList
= new Class
[]{
44 SpecimenSythesysExcelImport
.class,
48 public static SpecimenSynthesysExcelImportConfigurator
NewInstance(URI uri
, ICdmDataSource destination
){
49 return new SpecimenSynthesysExcelImportConfigurator(uri
, destination
);
54 * @param berlinModelSource
55 * @param sourceReference
58 private SpecimenSynthesysExcelImportConfigurator(URI uri
, ICdmDataSource destination
) {
59 super(defaultTransformer
);
61 setDestination(destination
);
67 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
69 public SpecimenSynthesysExcelImportState
getNewState() {
70 return new SpecimenSynthesysExcelImportState(this);
75 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
78 public Reference
getSourceReference() {
80 if (this.sourceReference
== null){
81 logger
.warn("getSource Reference not yet fully implemented");
82 sourceReference
= ReferenceFactory
.newDatabase();
83 sourceReference
.setTitleCache("Specimen import", true);
85 return sourceReference
;
88 public void setTaxonReference(String taxonReference
) {
89 this.taxonReference
= taxonReference
;
92 public Reference
getTaxonReference() {
94 if (this.taxonReference
== null){
95 logger
.info("getTaxonReference not yet fully implemented");
97 return sourceReference
;
102 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
104 public String
getSourceNameString() {
105 if (this.getSource() == null){
108 return this.getSource().toString();
112 public void setDoAutomaticParsing(boolean doParsing
){
113 this.doParsing
=doParsing
;
116 public boolean getDoAutomaticParsing(){
117 return this.doParsing
;
120 public void setReUseExistingMetadata(boolean reuseMetadata
){
121 this.reuseMetadata
= reuseMetadata
;
124 public boolean getReUseExistingMetadata(){
125 return this.reuseMetadata
;
128 public void setReUseTaxon(boolean reuseTaxon
){
129 this.reuseTaxon
= reuseTaxon
;
132 public boolean getDoReUseTaxon(){
133 return this.reuseTaxon
;