Project

General

Profile

Download (6.61 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2009 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.common;
11

    
12
import java.util.UUID;
13

    
14
import eu.etaxonomy.cdm.common.IProgressMonitor;
15
import eu.etaxonomy.cdm.database.DbSchemaValidation;
16
import eu.etaxonomy.cdm.database.ICdmDataSource;
17
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
18
import eu.etaxonomy.cdm.model.agent.Person;
19
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
20
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
21

    
22
/**
23
 * @author a.mueller
24
 * @created 29.01.2009
25
 * @version 1.0
26
 */
27
public interface IImportConfigurator extends IIoConfigurator {
28

    
29
	public static enum CHECK{
30
		CHECK_ONLY,
31
		IMPORT_WITHOUT_CHECK,
32
		CHECK_AND_IMPORT,
33
	}
34
	
35
	public static enum EDITOR{
36
		NO_EDITORS,  //leaves out createdBy and updatedBy information
37
		EDITOR_AS_ANNOTATION,//save createdBy and updatedBy in annotations
38
		EDITOR_AS_EDITOR, //save createdBy and updatedBy in createdBy and updatedBy
39
	}
40
	
41
	public static enum DO_REFERENCES{
42
		NONE,
43
		NOMENCLATURAL,
44
		CONCEPT_REFERENCES,
45
		ALL
46
	}
47
	
48
	public boolean isValid();
49
	
50
	/**
51
	 * Factory method. Creates a new state for the import type and adds this coniguration to it.
52
	 * @return 
53
	 */
54
	public <STATE extends ImportStateBase> STATE getNewState();
55

    
56
	/* ****************** GETTER/SETTER **************************/
57
	public boolean isDeleteAll();
58

    
59
	public void setDeleteAll(boolean deleteAll);
60

    
61
	public boolean isDoAuthors();
62

    
63
	public void setDoAuthors(boolean doAuthors);
64

    
65
	/**
66
	 * @return the doReferences
67
	 */
68
	public DO_REFERENCES getDoReferences();
69

    
70
	/**
71
	 * @param doReferences the doReferences to set
72
	 */
73
	public void setDoReferences(DO_REFERENCES doReferences);
74

    
75
	/**
76
	 * @return the doReferences
77
	 */
78
	public CHECK getCheck();
79

    
80
	/**
81
	 * @param doReferences the doReferences to set
82
	 */
83
	public void setCheck(CHECK check);
84

    
85
	/**
86
	 * @return the editor 
87
	 */
88
	public EDITOR getEditor();
89

    
90
	/**
91
	 * @param editor sets the way how editing (created, updated) information is handled
92
	 */
93
	public void setEditor(EDITOR editor);
94
	
95
	/**
96
	 * If true, no errors occurs if objects are not found that should exist. This may
97
	 * be needed e.g. when only subsets of the data are imported.
98
	 * Default value is <cod>false</code>.
99
	 * @return the ignoreNull
100
	 */
101
	public boolean isIgnoreNull();
102
	/**
103
	 * @param ignoreNull the ignoreNull to set
104
	 */
105
	public void setIgnoreNull(boolean ignoreNull);
106
	
107
	public boolean isDoTaxonNames();
108

    
109
	public void setDoTaxonNames(boolean doTaxonNames);
110

    
111
	public boolean isDoRelNames();
112

    
113
	public void setDoRelNames(boolean doRelNames);
114

    
115
	public boolean isDoNameStatus();
116

    
117
	public void setDoNameStatus(boolean doNameStatus);
118

    
119
	public boolean isDoNameFacts();
120

    
121
	public void setDoNameFacts(boolean doNameFacts);
122

    
123
	public boolean isDoTypes();
124

    
125
	public void setDoTypes(boolean doTypes);
126

    
127
	public boolean isDoTaxa();
128

    
129
	public void setDoTaxa(boolean doTaxa);
130

    
131
	public boolean isDoRelTaxa();
132

    
133
	public void setDoRelTaxa(boolean doRelTaxa);
134

    
135
	public boolean isDoFacts();
136

    
137
	public void setDoFacts(boolean doFacts);
138
	
139
	public boolean isDoMarker();
140
	
141
	public void setDoMarker(boolean doMarker);
142

    
143
	public void setDoUser(boolean doUser);
144
	
145
	public boolean isDoUser();
146

    
147

    
148
	/**
149
	 * @return the doOccurrence
150
	 */
151
	public boolean isDoOccurrence();
152

    
153
	/**
154
	 * @param doOccurrence the doOccurrence to set
155
	 */
156
	public void setDoOccurrence(boolean doOccurrence);
157
	
158
	/**
159
	 * The destination data source for the import 
160
	 * Don't use when using a spring data source
161
	 * @return
162
	 */
163
	public ICdmDataSource getDestination();
164

    
165
	public void setDestination(ICdmDataSource destination);
166

    
167
	public DbSchemaValidation getDbSchemaValidation();
168

    
169
	public void setDbSchemaValidation(
170
			DbSchemaValidation dbSchemaValidation);
171

    
172
	/**
173
	 * The reference that represents the source. E.g. if the import source is a database
174
	 * the returned reference should be of type eu.etaxonomy.cdm.model.reference.Database and 
175
	 * should represent the according database.
176
	 * If the import comes from a file (e.g. XML) the returned value should best represent the 
177
	 * source of this file (e.g. if the source of an XML file is a certain database this database
178
	 * should be mentioned as the source. Otherwise a eu.etaxonomy.cdm.model.reference.Generic 
179
	 * reference with the name of the XML file should be returned value
180
	 * @return
181
	 */
182
	public ReferenceBase getSourceReference();
183

    
184
	
185
	/**
186
	 * Any object that represents the Source. The implementing class must cast this to 
187
	 * the correct class type
188
	 * @return
189
	 */
190
	public Object getSource();
191

    
192
	//public abstract void setSource(Object url);
193

    
194
	public void setSourceReference(ReferenceBase sourceReference);
195

    
196
	public String getSourceReferenceTitle();
197

    
198
	public void setSourceReferenceTitle(String sourceReferenceTitle);
199

    
200
	public Person getCommentator();
201

    
202
	public void setCommentator(Person commentator);
203
	
204
	public NomenclaturalCode getNomenclaturalCode();
205
	
206
	public void setNomenclaturalCode(NomenclaturalCode nomenclaturalCode);
207
	
208
	public Class<ICdmIO>[] getIoClassList();
209
	
210
//	public String[] getIoBeans();
211
//	public void setIoBeans(String[] ioBeans);
212
	
213
	/**
214
	 * Returns a <code>CdmApplicationController</code> created by the values of this configuration.
215
	 * If a controller was already created before the last created controller is returned.
216
	 * @return
217
	 */
218
//	public CdmApplicationController getCdmAppController();
219
//	public CdmApplicationController getCdmAppController(boolean createNew, boolean omitTermLoading);
220
//	
221
	public Object getSourceSecId();
222

    
223
	
224
	
225
 	/**
226
 	 * If this import implicitly represents a taxonomic tree in the destination CDM database
227
 	 * one can define the taxonomic tree's uuid here. The congrete import class must support this
228
 	 * functionality otherwise it will have no effect.
229
 	 * @return
230
 	 */
231
 	public UUID getTaxonomicTreeUuid();
232
	public void setTaxonomicTreeUuid(UUID treeUuid);
233

    
234
	/**
235
 	 * If one wants do define the uuid of the accepted taxa (except for missaplied names) this can be
236
 	 * done here 
237
 	 * @return
238
 	 */
239
 	public UUID getSecUuid();
240
	public void setSecUuid(UUID secUuid);
241
	
242
	
243
	/**
244
	 * Returns the transformer used during import
245
	 * @return
246
	 */
247
	public IInputTransformer getTransformer();
248
	
249
	/**
250
	 * Sets the transformer used during import
251
	 * @param transformer
252
	 */
253
	public void setTransformer(IInputTransformer transformer);
254
	
255
}
(24-24/44)