1
|
package eu.etaxonomy.cdm.io.excel.taxa;
|
2
|
|
3
|
|
4
|
import org.apache.log4j.Logger;
|
5
|
|
6
|
import eu.etaxonomy.cdm.database.DbSchemaValidation;
|
7
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
8
|
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
|
9
|
import eu.etaxonomy.cdm.io.excel.common.ExcelImportConfiguratorBase;
|
10
|
import eu.etaxonomy.cdm.model.reference.Database;
|
11
|
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
12
|
|
13
|
public class NormalExplicitImportConfigurator extends ExcelImportConfiguratorBase implements IImportConfigurator {
|
14
|
|
15
|
private static final Logger logger = Logger.getLogger(NormalExplicitImportConfigurator.class);
|
16
|
|
17
|
// @SuppressWarnings("unchecked")
|
18
|
protected void makeIoClassList() {
|
19
|
ioClassList = new Class[] {
|
20
|
NormalExplicitImport.class
|
21
|
};
|
22
|
};
|
23
|
|
24
|
public static NormalExplicitImportConfigurator NewInstance(String url,
|
25
|
ICdmDataSource destination){
|
26
|
return new NormalExplicitImportConfigurator(url, destination);
|
27
|
}
|
28
|
|
29
|
|
30
|
/**
|
31
|
* @param url
|
32
|
* @param destination
|
33
|
*/
|
34
|
private NormalExplicitImportConfigurator(String url, ICdmDataSource destination) {
|
35
|
super(url, destination);
|
36
|
setSource(url);
|
37
|
setDestination(destination);
|
38
|
setDbSchemaValidation(DbSchemaValidation.CREATE);
|
39
|
}
|
40
|
|
41
|
|
42
|
/* (non-Javadoc)
|
43
|
* @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
|
44
|
*/
|
45
|
public String getSource() {
|
46
|
return (String)super.getSource();
|
47
|
}
|
48
|
|
49
|
|
50
|
/**
|
51
|
* @param file
|
52
|
*/
|
53
|
public void setSource(String fileName) {
|
54
|
super.setSource(fileName);
|
55
|
}
|
56
|
|
57
|
|
58
|
/* (non-Javadoc)
|
59
|
* @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
|
60
|
*/
|
61
|
@Override
|
62
|
public ReferenceBase getSourceReference() {
|
63
|
//TODO
|
64
|
if (this.sourceReference == null){
|
65
|
logger.warn("getSource Reference not yet fully implemented");
|
66
|
sourceReference = Database.NewInstance();
|
67
|
sourceReference.setTitleCache("Distribution data import");
|
68
|
}
|
69
|
return sourceReference;
|
70
|
}
|
71
|
|
72
|
|
73
|
/* (non-Javadoc)
|
74
|
* @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
|
75
|
*/
|
76
|
public String getSourceNameString() {
|
77
|
if (this.getSource() == null){
|
78
|
return null;
|
79
|
}else{
|
80
|
return this.getSource();
|
81
|
}
|
82
|
}
|
83
|
|
84
|
}
|