newest development for specimen import
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / specimen / excel / in / SpecimenSynthesysExcelImportConfigurator.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.cdm.io.specimen.excel.in;
11
12
13 import java.net.URI;
14
15 import org.apache.log4j.Logger;
16
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;
23
24 /**
25 * @author p.kelbert
26 * @created 29.10.2008
27 * @version 1.0
28 */
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;
35
36
37 //TODO
38 private static IInputTransformer defaultTransformer = null;
39
40
41 @SuppressWarnings("unchecked")
42 protected void makeIoClassList(){
43 ioClassList = new Class[]{
44 SpecimenSythesysExcelImport.class,
45 };
46 };
47
48 public static SpecimenSynthesysExcelImportConfigurator NewInstance(URI uri, ICdmDataSource destination){
49 return new SpecimenSynthesysExcelImportConfigurator(uri, destination);
50 }
51
52
53 /**
54 * @param berlinModelSource
55 * @param sourceReference
56 * @param destination
57 */
58 private SpecimenSynthesysExcelImportConfigurator(URI uri, ICdmDataSource destination) {
59 super(defaultTransformer);
60 setSource(uri);
61 setDestination(destination);
62 }
63
64
65
66 /* (non-Javadoc)
67 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
68 */
69 public SpecimenSynthesysExcelImportState getNewState() {
70 return new SpecimenSynthesysExcelImportState(this);
71 }
72
73
74 /* (non-Javadoc)
75 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
76 */
77 @Override
78 public Reference getSourceReference() {
79 //TODO
80 if (this.sourceReference == null){
81 logger.warn("getSource Reference not yet fully implemented");
82 sourceReference = ReferenceFactory.newDatabase();
83 sourceReference.setTitleCache("Specimen import", true);
84 }
85 return sourceReference;
86 }
87
88 public void setTaxonReference(String taxonReference) {
89 this.taxonReference = taxonReference;
90 }
91
92 public Reference getTaxonReference() {
93 //TODO
94 if (this.taxonReference == null){
95 logger.info("getTaxonReference not yet fully implemented");
96 }
97 return sourceReference;
98 }
99
100
101 /* (non-Javadoc)
102 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
103 */
104 public String getSourceNameString() {
105 if (this.getSource() == null){
106 return null;
107 }else{
108 return this.getSource().toString();
109 }
110 }
111
112 public void setDoAutomaticParsing(boolean doParsing){
113 this.doParsing=doParsing;
114 }
115
116 public boolean getDoAutomaticParsing(){
117 return this.doParsing;
118 }
119
120 public void setReUseExistingMetadata(boolean reuseMetadata){
121 this.reuseMetadata = reuseMetadata;
122 }
123
124 public boolean getReUseExistingMetadata(){
125 return this.reuseMetadata;
126 }
127
128 public void setReUseTaxon(boolean reuseTaxon){
129 this.reuseTaxon = reuseTaxon;
130 }
131
132 public boolean getDoReUseTaxon(){
133 return this.reuseTaxon;
134 }
135
136
137
138 }