Project

General

Profile

Download (2.01 KB) Statistics
| Branch: | Tag: | Revision:
1
 package eu.etaxonomy.cdm.io.synthesys;
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
	
14

    
15
		
16
	@SuppressWarnings("unchecked")
17
	protected void makeIoClassList(){
18
		ioClassList = new Class[]{
19
			SynthesysIO.class,
20
		};
21
	};
22
	
23
	public static SpecimenImportConfigurator NewInstance(String url,
24
			ICdmDataSource destination){
25
		return new SpecimenImportConfigurator(url, destination);
26
	}
27
	
28
	
29
	/**
30
	 * @param berlinModelSource
31
	 * @param sourceReference
32
	 * @param destination
33
	 */
34
	private SpecimenImportConfigurator(String url, ICdmDataSource destination) {
35
		super();
36
		setSource(url);
37
		setDestination(destination);
38
	}
39
	
40

    
41
	/* (non-Javadoc)
42
	 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
43
	 */
44
	public String getSource() {
45
		return (String)super.getSource();
46
	}
47
	
48
	/**
49
	 * @param file
50
	 */
51
	public void setSource(String file) {
52
		super.setSource(file);
53
	}
54
	
55

    
56

    
57
	/* (non-Javadoc)
58
	 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
59
	 */
60
	@Override
61
	public ReferenceBase getSourceReference() {
62
		//TODO
63
		if (this.sourceReference == null){
64
			logger.warn("getSource Reference not yet fully implemented");
65
			sourceReference = Database.NewInstance();
66
			sourceReference.setTitleCache("ABCD specimen import");
67
		}
68
		return sourceReference;
69
	}
70

    
71

    
72
	/* (non-Javadoc)
73
	 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
74
	 */
75
	public String getSourceNameString() {
76
		if (this.getSource() == null){
77
			return null;
78
		}else{
79
			return this.getSource();
80
		}
81
	}
82
	
83
	
84
	
85
}
(1-1/5)