Basic import of MediaObjects
[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 /**
54 * @param file
55 */
56 public void setSource(String file) {
57 super.setSource(file);
58 }
59
60
61
62 /* (non-Javadoc)
63 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
64 */
65 @Override
66 public ReferenceBase getSourceReference() {
67 //TODO
68 if (this.sourceReference == null){
69 logger.warn("getSource Reference not yet fully implemented");
70 sourceReference = Database.NewInstance();
71 sourceReference.setTitleCache("ABCD specimen import");
72 }
73 return sourceReference;
74 }
75
76 public void setTaxonReference(String taxonReference) {
77 this.taxonReference = taxonReference;
78 }
79
80 public ReferenceBase getTaxonReference() {
81 //TODO
82 if (this.taxonReference == null){
83 logger.info("getTaxonReference not yet fully implemented");
84 }
85 return sourceReference;
86 }
87
88
89 /* (non-Javadoc)
90 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
91 */
92 public String getSourceNameString() {
93 if (this.getSource() == null){
94 return null;
95 }else{
96 return this.getSource();
97 }
98 }
99
100 public void setDoAutomaticParsing(boolean doParsing){
101 this.doParsing=doParsing;
102 }
103
104 public boolean getDoAutomaticParsing(){
105 return this.doParsing;
106 }
107
108 public void setReUseExistingMetadata(boolean reuseMetadata){
109 this.reuseMetadata = reuseMetadata;
110 }
111
112 public boolean getReUseExistingMetadata(){
113 return this.reuseMetadata;
114 }
115
116 public void setReUseTaxon(boolean reuseTaxon){
117 this.reuseTaxon = reuseTaxon;
118 }
119
120 public boolean getDoReUseTaxon(){
121 return this.reuseTaxon;
122 }
123
124
125 }