getRelatedObject with included deproxy
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / common / IImportConfigurator.java
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.database.DbSchemaValidation;
15 import eu.etaxonomy.cdm.database.ICdmDataSource;
16 import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
17 import eu.etaxonomy.cdm.model.agent.Person;
18 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
19 import eu.etaxonomy.cdm.model.reference.ReferenceBase;
20
21 /**
22 * @author a.mueller
23 * @created 29.01.2009
24 * @version 1.0
25 */
26 public interface IImportConfigurator extends IIoConfigurator {
27
28 public static enum CHECK{
29 CHECK_ONLY,
30 IMPORT_WITHOUT_CHECK,
31 CHECK_AND_IMPORT,
32 }
33
34 public static enum EDITOR{
35 NO_EDITORS, //leaves out createdBy and updatedBy information
36 EDITOR_AS_ANNOTATION,//save createdBy and updatedBy in annotations
37 EDITOR_AS_EDITOR, //save createdBy and updatedBy in createdBy and updatedBy
38 }
39
40 public static enum DO_REFERENCES{
41 NONE,
42 NOMENCLATURAL,
43 CONCEPT_REFERENCES,
44 ALL
45 }
46
47 public boolean isValid();
48
49 /**
50 * Factory method. Creates a new state for the import type and adds this coniguration to it.
51 * @return
52 */
53 public <STATE extends ImportStateBase> STATE getNewState();
54
55 /* ****************** GETTER/SETTER **************************/
56 public boolean isDeleteAll();
57
58 public void setDeleteAll(boolean deleteAll);
59
60 public boolean isDoAuthors();
61
62 public void setDoAuthors(boolean doAuthors);
63
64 /**
65 * @return the doReferences
66 */
67 public DO_REFERENCES getDoReferences();
68
69 /**
70 * @param doReferences the doReferences to set
71 */
72 public void setDoReferences(DO_REFERENCES doReferences);
73
74 /**
75 * @return the doReferences
76 */
77 public CHECK getCheck();
78
79 /**
80 * @param doReferences the doReferences to set
81 */
82 public void setCheck(CHECK check);
83
84 /**
85 * @return the editor
86 */
87 public EDITOR getEditor();
88
89 /**
90 * @param editor sets the way how editing (created, updated) information is handled
91 */
92 public void setEditor(EDITOR editor);
93
94 /**
95 * If true, no errors occurs if objects are not found that should exist. This may
96 * be needed e.g. when only subsets of the data are imported.
97 * Default value is <cod>false</code>.
98 * @return the ignoreNull
99 */
100 public boolean isIgnoreNull();
101 /**
102 * @param ignoreNull the ignoreNull to set
103 */
104 public void setIgnoreNull(boolean ignoreNull);
105
106 public boolean isDoTaxonNames();
107
108 public void setDoTaxonNames(boolean doTaxonNames);
109
110 public boolean isDoRelNames();
111
112 public void setDoRelNames(boolean doRelNames);
113
114 public boolean isDoNameStatus();
115
116 public void setDoNameStatus(boolean doNameStatus);
117
118 public boolean isDoNameFacts();
119
120 public void setDoNameFacts(boolean doNameFacts);
121
122 public boolean isDoTypes();
123
124 public void setDoTypes(boolean doTypes);
125
126 public boolean isDoTaxa();
127
128 public void setDoTaxa(boolean doTaxa);
129
130 public boolean isDoRelTaxa();
131
132 public void setDoRelTaxa(boolean doRelTaxa);
133
134 public boolean isDoFacts();
135
136 public void setDoFacts(boolean doFacts);
137
138 public boolean isDoMarker();
139
140 public void setDoMarker(boolean doMarker);
141
142 public void setDoUser(boolean doUser);
143
144 public boolean isDoUser();
145
146
147 /**
148 * @return the doOccurrence
149 */
150 public boolean isDoOccurrence();
151
152 /**
153 * @param doOccurrence the doOccurrence to set
154 */
155 public void setDoOccurrence(boolean doOccurrence);
156
157 /**
158 * The destination data source for the import
159 * Don't use when using a spring data source
160 * @return
161 */
162 public ICdmDataSource getDestination();
163
164 public void setDestination(ICdmDataSource destination);
165
166 public DbSchemaValidation getDbSchemaValidation();
167
168 public void setDbSchemaValidation(
169 DbSchemaValidation dbSchemaValidation);
170
171 /**
172 * The reference that represents the source. E.g. if the import source is a database
173 * the returned reference should be of type eu.etaxonomy.cdm.model.reference.Database and
174 * should represent the according database.
175 * If the import comes from a file (e.g. XML) the returned value should best represent the
176 * source of this file (e.g. if the source of an XML file is a certain database this database
177 * should be mentioned as the source. Otherwise a eu.etaxonomy.cdm.model.reference.Generic
178 * reference with the name of the XML file should be returned value
179 * @return
180 */
181 public ReferenceBase getSourceReference();
182
183
184 /**
185 * Any object that represents the Source. The implementing class must cast this to
186 * the correct class type
187 * @return
188 */
189 public Object getSource();
190
191 //public abstract void setSource(Object url);
192
193 public void setSourceReference(ReferenceBase sourceReference);
194
195 public String getSourceReferenceTitle();
196
197 public void setSourceReferenceTitle(String sourceReferenceTitle);
198
199 public Person getCommentator();
200
201 public void setCommentator(Person commentator);
202
203 public NomenclaturalCode getNomenclaturalCode();
204
205 public void setNomenclaturalCode(NomenclaturalCode nomenclaturalCode);
206
207 public Class<ICdmIO>[] getIoClassList();
208
209 // public String[] getIoBeans();
210 // public void setIoBeans(String[] ioBeans);
211
212 /**
213 * Returns a <code>CdmApplicationController</code> created by the values of this configuration.
214 * If a controller was already created before the last created controller is returned.
215 * @return
216 */
217 // public CdmApplicationController getCdmAppController();
218 // public CdmApplicationController getCdmAppController(boolean createNew, boolean omitTermLoading);
219 //
220 public Object getSourceSecId();
221
222
223
224 /**
225 * If this import implicitly represents a taxonomic tree in the destination CDM database
226 * one can define the taxonomic tree's uuid here. The congrete import class must support this
227 * functionality otherwise it will have no effect.
228 * @return
229 */
230 public UUID getTaxonomicTreeUuid();
231 public void setTaxonomicTreeUuid(UUID treeUuid);
232
233 /**
234 * If one wants do define the uuid of the accepted taxa (except for missaplied names) this can be
235 * done here
236 * @return
237 */
238 public UUID getSecUuid();
239 public void setSecUuid(UUID secUuid);
240
241
242 /**
243 * Returns the transformer used during import
244 * @return
245 */
246 public IInputTransformer getTransformer();
247
248 /**
249 * Sets the transformer used during import
250 * @param transformer
251 */
252 public void setTransformer(IInputTransformer transformer);
253
254 }