Project

General

Profile

Download (3.99 KB) Statistics
| Branch: | 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.globis;
11

    
12
import java.lang.reflect.Method;
13

    
14
import org.apache.log4j.Logger;
15

    
16
import eu.etaxonomy.cdm.database.ICdmDataSource;
17
import eu.etaxonomy.cdm.io.common.DbImportConfiguratorBase;
18
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
19
import eu.etaxonomy.cdm.io.common.Source;
20
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
21
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
22

    
23

    
24
/**
25
 * @author a.mueller
26
 * @created 20.03.2008
27
 * @version 1.0
28
 */
29
public class GlobisImportConfigurator extends DbImportConfiguratorBase<GlobisImportState> implements IImportConfigurator{
30
	@SuppressWarnings("unused")
31
	private static Logger logger = Logger.getLogger(GlobisImportConfigurator.class);
32

    
33
	public static GlobisImportConfigurator NewInstance(Source ermsSource, ICdmDataSource destination){
34
			return new GlobisImportConfigurator(ermsSource, destination);
35
	}
36

    
37
	/* Max number of records to be saved with one service call */
38
	private int recordsPerTransaction = 2000;  //defaultValue
39

    
40
	//TODO needed ??
41
	private Method userTransformationMethod;
42
	
43
	private boolean doImages = true;
44
	private boolean doCurrentTaxa = true;
45
	private boolean doSpecTaxa = true;
46
	private boolean doCommonNames = true;
47
	
48
	private boolean doReadMediaData = true;
49
	
50
	private DO_REFERENCES doReferences = DO_REFERENCES.ALL;
51

    
52
	private String imageBaseUrl = "http://globis-images.insects-online.de/images/";
53
	
54
	private static IInputTransformer defaultTransformer = new GlobisTransformer();
55
	
56
	protected void makeIoClassList(){
57
		ioClassList = new Class[]{
58
				//ErmsGeneralImportValidator.class
59
				 GlobisReferenceImport.class
60
	//			, ErmsReferenceImport.class
61
				, GlobisCurrentSpeciesImport.class
62
				, GlobisSpecTaxImport.class
63
				, GlobisCommonNameImport.class
64
				, GlobisImageImport.class
65
		};	
66
	}
67
	
68

    
69
	/* (non-Javadoc)
70
	 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
71
	 */
72
	public GlobisImportState getNewState() {
73
		return new GlobisImportState(this);
74
	}
75

    
76

    
77

    
78
	private GlobisImportConfigurator(Source source, ICdmDataSource destination) {
79
	   super(source, destination, NomenclaturalCode.ICZN, defaultTransformer);//default for Globis
80
	}
81
	
82
	/**
83
	 * @return the limitSave
84
	 */
85
	public int getRecordsPerTransaction() {
86
		return recordsPerTransaction;
87
	}
88
	/**
89
	 * @param limitSave the limitSave to set
90
	 */
91
	public void setRecordsPerTransaction(int recordsPerTransaction) {
92
		this.recordsPerTransaction = recordsPerTransaction;
93
	}
94

    
95

    
96
	/**
97
	 * @param doImages the doImages to set
98
	 */
99
	public void setDoImages(boolean doImages) {
100
		this.doImages = doImages;
101
	}
102
	/**
103
	 * @return the doImages
104
	 */
105
	public boolean isDoImages() {
106
		return doImages;
107
	}
108
	
109
	public DO_REFERENCES getDoReferences() {
110
		return doReferences;
111
	}
112
	public void setDoReferences(DO_REFERENCES doReferences) {
113
		this.doReferences = doReferences;
114
	}
115

    
116

    
117
	public void setDoCurrentTaxa(boolean doCurrentTaxa) {
118
		this.doCurrentTaxa = doCurrentTaxa;
119
	}
120

    
121

    
122
	public boolean isDoCurrentTaxa() {
123
		return doCurrentTaxa;
124
	}
125

    
126

    
127
	public void setDoSpecTaxa(boolean doSpecTaxa) {
128
		this.doSpecTaxa = doSpecTaxa;
129
	}
130

    
131

    
132
	public boolean isDoSpecTaxa() {
133
		return doSpecTaxa;
134
	}
135

    
136

    
137
	public void setDoCommonNames(boolean doCommonNames) {
138
		this.doCommonNames = doCommonNames;
139
	}
140

    
141

    
142
	public boolean isDoCommonNames() {
143
		return doCommonNames;
144
	}
145

    
146

    
147
	public void setImageBaseUrl(String imageBaseUrl) {
148
		this.imageBaseUrl = imageBaseUrl;
149
	}
150

    
151

    
152
	public String getImageBaseUrl() {
153
		return imageBaseUrl;
154
	}
155

    
156

    
157
	public void setDoReadMediaData(boolean doReadMediaData) {
158
		this.doReadMediaData = doReadMediaData;
159
	}
160

    
161

    
162
	public boolean isDoReadMediaData() {
163
		return doReadMediaData;
164
	}
165

    
166
}
(5-5/9)