1
|
/**
|
2
|
* Copyright (C) 2008 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
|
package eu.etaxonomy.cdm.io.excel.distribution;
|
10
|
|
11
|
import eu.etaxonomy.cdm.common.URI;
|
12
|
|
13
|
import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
|
14
|
|
15
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
16
|
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
|
17
|
import eu.etaxonomy.cdm.io.excel.common.ExcelImportConfiguratorBase;
|
18
|
import eu.etaxonomy.cdm.io.excel.common.ExcelImportState;
|
19
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
20
|
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
|
21
|
|
22
|
/**
|
23
|
* @author a.babadshanjan
|
24
|
* @since 10.11.2008
|
25
|
*/
|
26
|
public class DistributionImportConfigurator extends ExcelImportConfiguratorBase implements IImportConfigurator {
|
27
|
|
28
|
private static final long serialVersionUID = -4283236727158858201L;
|
29
|
private static final Logger logger = LogManager.getLogger(DistributionImportConfigurator.class);
|
30
|
|
31
|
@Override
|
32
|
@SuppressWarnings("unchecked")
|
33
|
protected void makeIoClassList() {
|
34
|
ioClassList = new Class[] {
|
35
|
DistributionImport.class
|
36
|
};
|
37
|
}
|
38
|
|
39
|
public static DistributionImportConfigurator NewInstance(URI uri, ICdmDataSource destination){
|
40
|
return new DistributionImportConfigurator(uri, destination);
|
41
|
}
|
42
|
|
43
|
|
44
|
/**
|
45
|
* @param url
|
46
|
* @param destination
|
47
|
*/
|
48
|
private DistributionImportConfigurator(URI uri, ICdmDataSource destination) {
|
49
|
super(uri, destination);
|
50
|
}
|
51
|
|
52
|
|
53
|
@Override
|
54
|
public ExcelImportState getNewState() {
|
55
|
return new ExcelImportState(this);
|
56
|
}
|
57
|
|
58
|
@Override
|
59
|
public Reference getSourceReference() {
|
60
|
//TODO
|
61
|
if (this.sourceReference == null){
|
62
|
logger.warn("getSource Reference not yet fully implemented");
|
63
|
sourceReference = ReferenceFactory.newDatabase();
|
64
|
sourceReference.setTitleCache("Distribution data import", true);
|
65
|
}
|
66
|
return sourceReference;
|
67
|
}
|
68
|
|
69
|
|
70
|
}
|