ABCD return value and urlFileString
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / abcd206 / SpecimenImportConfigurator.java
1 package eu.etaxonomy.cdm.io.abcd206;
2
3
4 import org.apache.log4j.Logger;
5 import eu.etaxonomy.cdm.database.ICdmDataSource;
6 import eu.etaxonomy.cdm.io.common.IImportConfigurator;
7 import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
8 import eu.etaxonomy.cdm.model.reference.Database;
9 import eu.etaxonomy.cdm.model.reference.ReferenceBase;
10
11 public class SpecimenImportConfigurator extends ImportConfiguratorBase implements IImportConfigurator {
12 private static final Logger logger = Logger.getLogger(SpecimenImportConfigurator.class);
13 private boolean doParsing = false;
14 private boolean reuseMetadata = false;
15 private boolean reuseTaxon = false;
16 private String taxonReference = null;
17
18
19
20 @SuppressWarnings("unchecked")
21 protected void makeIoClassList(){
22 System.out.println("makeIOClassList");
23 ioClassList = new Class[]{
24 AbcdIO.class,
25 };
26 };
27
28 public static SpecimenImportConfigurator NewInstance(String url,
29 ICdmDataSource destination){
30 return new SpecimenImportConfigurator(url, destination);
31 }
32
33
34 /**
35 * @param berlinModelSource
36 * @param sourceReference
37 * @param destination
38 */
39 private SpecimenImportConfigurator(String url, ICdmDataSource destination) {
40 super();
41 setSource(url);
42 setDestination(destination);
43 }
44
45
46 // /* (non-Javadoc)
47 // * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
48 // */
49 // public String getSource() {
50 // return (String)super.getSource();
51 // }
52
53 public String getSource(){
54 return (String)super.getSource();
55 }
56
57 /**
58 * @param file
59 */
60 public void setSource(String file) {
61 super.setSource(file);
62 }
63
64
65
66 /* (non-Javadoc)
67 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
68 */
69 @Override
70 public ReferenceBase getSourceReference() {
71 //TODO
72 if (this.sourceReference == null){
73 logger.warn("getSource Reference not yet fully implemented");
74 sourceReference = Database.NewInstance();
75 sourceReference.setTitleCache("ABCD specimen import");
76 }
77 return sourceReference;
78 }
79
80 public void setTaxonReference(String taxonReference) {
81 this.taxonReference = taxonReference;
82 }
83
84 public ReferenceBase getTaxonReference() {
85 //TODO
86 if (this.taxonReference == null){
87 logger.info("getTaxonReference not yet fully implemented");
88 }
89 return sourceReference;
90 }
91
92
93 /* (non-Javadoc)
94 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
95 */
96 public String getSourceNameString() {
97 if (this.getSource() == null){
98 return null;
99 }else{
100 return (String)this.getSource();
101 }
102 }
103
104 public void setDoAutomaticParsing(boolean doParsing){
105 this.doParsing=doParsing;
106 }
107
108 public boolean getDoAutomaticParsing(){
109 return this.doParsing;
110 }
111
112 public void setReUseExistingMetadata(boolean reuseMetadata){
113 this.reuseMetadata = reuseMetadata;
114 }
115
116 public boolean getReUseExistingMetadata(){
117 return this.reuseMetadata;
118 }
119
120 public void setReUseTaxon(boolean reuseTaxon){
121 this.reuseTaxon = reuseTaxon;
122 }
123
124 public boolean getDoReUseTaxon(){
125 return this.reuseTaxon;
126 }
127
128
129 }