2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.io
.common
;
12 import java
.util
.UUID
;
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
;
26 public interface IImportConfigurator
extends IIoConfigurator
{
28 public static enum CHECK
{
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
40 public static enum DO_REFERENCES
{
47 public boolean isValid();
50 * Factory method. Creates a new state for the import type and adds this coniguration to it.
53 public <STATE
extends ImportStateBase
> STATE
getNewState();
55 /* ****************** GETTER/SETTER **************************/
56 public boolean isDeleteAll();
58 public void setDeleteAll(boolean deleteAll
);
60 public boolean isDoAuthors();
62 public void setDoAuthors(boolean doAuthors
);
65 * @return the doReferences
67 public DO_REFERENCES
getDoReferences();
70 * @param doReferences the doReferences to set
72 public void setDoReferences(DO_REFERENCES doReferences
);
75 * @return the doReferences
77 public CHECK
getCheck();
80 * @param doReferences the doReferences to set
82 public void setCheck(CHECK check
);
87 public EDITOR
getEditor();
90 * @param editor sets the way how editing (created, updated) information is handled
92 public void setEditor(EDITOR editor
);
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
100 public boolean isIgnoreNull();
102 * @param ignoreNull the ignoreNull to set
104 public void setIgnoreNull(boolean ignoreNull
);
106 public boolean isDoTaxonNames();
108 public void setDoTaxonNames(boolean doTaxonNames
);
110 public boolean isDoRelNames();
112 public void setDoRelNames(boolean doRelNames
);
114 public boolean isDoNameStatus();
116 public void setDoNameStatus(boolean doNameStatus
);
118 public boolean isDoNameFacts();
120 public void setDoNameFacts(boolean doNameFacts
);
122 public boolean isDoTypes();
124 public void setDoTypes(boolean doTypes
);
126 public boolean isDoTaxa();
128 public void setDoTaxa(boolean doTaxa
);
130 public boolean isDoRelTaxa();
132 public void setDoRelTaxa(boolean doRelTaxa
);
134 public boolean isDoFacts();
136 public void setDoFacts(boolean doFacts
);
138 public boolean isDoMarker();
140 public void setDoMarker(boolean doMarker
);
142 public void setDoUser(boolean doUser
);
144 public boolean isDoUser();
148 * @return the doOccurrence
150 public boolean isDoOccurrence();
153 * @param doOccurrence the doOccurrence to set
155 public void setDoOccurrence(boolean doOccurrence
);
158 * The destination data source for the import
159 * Don't use when using a spring data source
162 public ICdmDataSource
getDestination();
164 public void setDestination(ICdmDataSource destination
);
166 public DbSchemaValidation
getDbSchemaValidation();
168 public void setDbSchemaValidation(
169 DbSchemaValidation dbSchemaValidation
);
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
181 public ReferenceBase
getSourceReference();
185 * Any object that represents the Source. The implementing class must cast this to
186 * the correct class type
189 public Object
getSource();
191 //public abstract void setSource(Object url);
193 public void setSourceReference(ReferenceBase sourceReference
);
195 public String
getSourceReferenceTitle();
197 public void setSourceReferenceTitle(String sourceReferenceTitle
);
199 public Person
getCommentator();
201 public void setCommentator(Person commentator
);
203 public NomenclaturalCode
getNomenclaturalCode();
205 public void setNomenclaturalCode(NomenclaturalCode nomenclaturalCode
);
207 public Class
<ICdmIO
>[] getIoClassList();
209 // public String[] getIoBeans();
210 // public void setIoBeans(String[] ioBeans);
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.
217 // public CdmApplicationController getCdmAppController();
218 // public CdmApplicationController getCdmAppController(boolean createNew, boolean omitTermLoading);
220 public Object
getSourceSecId();
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.
230 public UUID
getTaxonomicTreeUuid();
231 public void setTaxonomicTreeUuid(UUID treeUuid
);
234 * If one wants do define the uuid of the accepted taxa (except for missaplied names) this can be
238 public UUID
getSecUuid();
239 public void setSecUuid(UUID secUuid
);
243 * Returns the transformer used during import
246 public IInputTransformer
getTransformer();
249 * Sets the transformer used during import
252 public void setTransformer(IInputTransformer transformer
);