Project

General

Profile

Download (3.63 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 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

    
10
package eu.etaxonomy.cdm.io.abcd206;
11

    
12

    
13
import org.apache.log4j.Logger;
14

    
15
import eu.etaxonomy.cdm.database.ICdmDataSource;
16
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
17
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
18
import eu.etaxonomy.cdm.model.reference.Database;
19
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
20

    
21
/**
22
 * @author p.kelbert
23
 * @created 20.10.2008
24
 * @version 1.0
25
 */
26
public class SpecimenImportConfigurator extends ImportConfiguratorBase<SpecimenImportState> implements IImportConfigurator {
27
	private static final Logger logger = Logger.getLogger(SpecimenImportConfigurator.class);
28
	private boolean doParsing = false;
29
	private boolean reuseMetadata = false;
30
	private boolean reuseTaxon = false;
31
	private String taxonReference = null;
32

    
33
		
34

    
35
	@SuppressWarnings("unchecked")
36
	protected void makeIoClassList(){
37
		System.out.println("makeIOClassList");
38
		ioClassList = new Class[]{
39
			AbcdIO.class,
40
		};
41
	};
42
	
43
	public static SpecimenImportConfigurator NewInstance(String url,
44
			ICdmDataSource destination){
45
		return new SpecimenImportConfigurator(url, destination);
46
	}
47
	
48
	
49
	/**
50
	 * @param berlinModelSource
51
	 * @param sourceReference
52
	 * @param destination
53
	 */
54
	private SpecimenImportConfigurator(String url, ICdmDataSource destination) {
55
		super();
56
		setSource(url);
57
		setDestination(destination);
58
	}
59
	
60

    
61
	
62
	
63
//	/* (non-Javadoc)
64
//	 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
65
//	 */
66
//	public String getSource() {
67
//		return (String)super.getSource();
68
//	}
69
	
70
	/* (non-Javadoc)
71
	 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
72
	 */
73
	public SpecimenImportState getNewState() {
74
		return new SpecimenImportState(this);
75
	}
76

    
77
	public String getSource(){
78
		return (String)super.getSource();
79
	}
80
	
81
	/**
82
	 * @param file
83
	 */
84
	public void setSource(String file) {
85
		super.setSource(file);
86
	}
87
	
88

    
89

    
90
	/* (non-Javadoc)
91
	 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
92
	 */
93
	@Override
94
	public ReferenceBase getSourceReference() {
95
		//TODO
96
		if (this.sourceReference == null){
97
			logger.warn("getSource Reference not yet fully implemented");
98
			sourceReference = Database.NewInstance();
99
			sourceReference.setTitleCache("ABCD specimen import");
100
		}
101
		return sourceReference;
102
	}
103
	
104
	public void setTaxonReference(String taxonReference) {
105
		this.taxonReference = taxonReference;
106
	}
107
	
108
	public ReferenceBase getTaxonReference() {
109
		//TODO
110
		if (this.taxonReference == null){
111
			logger.info("getTaxonReference not yet fully implemented");
112
		}
113
		return sourceReference;
114
	}
115

    
116

    
117
	/* (non-Javadoc)
118
	 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
119
	 */
120
	public String getSourceNameString() {
121
		if (this.getSource() == null){
122
			return null;
123
		}else{
124
			return (String)this.getSource();
125
		}
126
	}
127
	
128
	public void setDoAutomaticParsing(boolean doParsing){
129
		this.doParsing=doParsing;
130
	}
131
	
132
	public boolean getDoAutomaticParsing(){
133
		return this.doParsing;
134
	}
135
	
136
	public void setReUseExistingMetadata(boolean reuseMetadata){
137
		this.reuseMetadata = reuseMetadata;
138
	}
139
	
140
	public boolean getReUseExistingMetadata(){
141
		return this.reuseMetadata;
142
	}
143
	
144
	public void setReUseTaxon(boolean reuseTaxon){
145
		this.reuseTaxon = reuseTaxon;
146
	}
147
	
148
	public boolean getDoReUseTaxon(){
149
		return this.reuseTaxon;
150
	}
151
	
152
	
153
}
(2-2/6)