Revision 5f0f426e
Added by Andreas Müller about 10 years ago
cdm-eflora/src/main/java/eu/etaxonomy/cdm/app/eflora/CentralAfricaEricaceaeActivator.java | ||
---|---|---|
59 | 59 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.VALIDATE; |
60 | 60 |
static final URI source = EfloraSources.ericacea_local(); |
61 | 61 |
|
62 |
static final URI specimenSource = EfloraSources.ericacea_specimen_local();
|
|
62 |
static final URI specimenSource = EfloraSources.vittaria_specimen_pesiimport3();
|
|
63 | 63 |
|
64 | 64 |
|
65 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_andreasM3(); |
|
66 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_central_africa_preview(); |
|
65 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_central_africa_preview(); |
|
67 | 66 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_central_africa_production(); |
68 |
static final ICdmDataSource cdmDestination = CdmDestinations.localH2(); |
|
67 |
// static final ICdmDataSource cdmDestination = CdmDestinations.localH2();
|
|
69 | 68 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_local_postgres_CdmTest(); |
70 | 69 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql(); |
71 | 70 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_jaxb(); |
... | ... | |
86 | 85 |
static boolean doPrintKeys = false; |
87 | 86 |
|
88 | 87 |
//taxa |
89 |
private boolean includeEricaceae = true;
|
|
90 |
static final boolean doTaxa = true;
|
|
88 |
private boolean includeEricaceae = false;
|
|
89 |
static final boolean doTaxa = false;
|
|
91 | 90 |
static final boolean doDeduplicate = false; |
92 | 91 |
|
93 | 92 |
|
94 | 93 |
private boolean doNewNamedAreas = false; |
95 | 94 |
private boolean doFeatureTree = false; |
96 | 95 |
|
97 |
private boolean doSpecimen = false;
|
|
96 |
private boolean doSpecimen = true;
|
|
98 | 97 |
private TermMatchMode specimenAreaMatchMode = TermMatchMode.UUID_ABBREVLABEL; |
99 | 98 |
|
100 | 99 |
|
101 | 100 |
private void doImport(ICdmDataSource cdmDestination){ |
102 | 101 |
|
103 |
CdmUpdater su = CdmUpdater.NewInstance(); |
|
104 |
IProgressMonitor monitor = DefaultProgressMonitor.NewInstance(); |
|
102 |
// CdmUpdater su = CdmUpdater.NewInstance();
|
|
103 |
// IProgressMonitor monitor = DefaultProgressMonitor.NewInstance();
|
|
105 | 104 |
// |
106 | 105 |
// try { |
107 | 106 |
// su.updateToCurrentVersion(cdmDestination, monitor); |
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/checklist/CentralAfricaChecklistReferenceImport.java | ||
---|---|---|
80 | 80 |
return strRecordQuery; |
81 | 81 |
} |
82 | 82 |
|
83 |
/* (non-Javadoc) |
|
84 |
* @see eu.etaxonomy.cdm.io.berlinModel.in.IPartitionedIO#getRelatedObjectsForPartition(java.sql.ResultSet) |
|
85 |
*/ |
|
86 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs) { |
|
83 |
|
|
84 |
@Override |
|
85 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, CentralAfricaChecklistImportState state) { |
|
87 | 86 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<Object, Map<String, ? extends CdmBase>>(); |
88 | 87 |
return result; |
89 | 88 |
} |
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/checklist/CentralAfricaChecklistSynonymImport.java | ||
---|---|---|
39 | 39 |
/** |
40 | 40 |
* @author a.mueller |
41 | 41 |
* @created 20.02.2010 |
42 |
* @version 1.0 |
|
43 | 42 |
*/ |
44 | 43 |
@Component |
45 | 44 |
public class CentralAfricaChecklistSynonymImport extends CentralAfricaChecklistImportBase<TaxonBase> implements IMappingImport<TaxonBase, CentralAfricaChecklistImportState>{ |
... | ... | |
48 | 47 |
private NonViralNameParserImpl parser = NonViralNameParserImpl.NewInstance(); |
49 | 48 |
|
50 | 49 |
|
51 |
private DbImportMapping mapping; |
|
50 |
private DbImportMapping<?, ?> mapping;
|
|
52 | 51 |
|
53 | 52 |
//second path is not used anymore, there is now an ErmsTaxonRelationImport class instead |
54 |
private boolean isSecondPath = false; |
|
53 |
// private boolean isSecondPath = false;
|
|
55 | 54 |
|
56 |
private int modCount = 10000; |
|
55 |
// private int modCount = 10000;
|
|
57 | 56 |
private static final String pluralString = "synonyms"; |
58 | 57 |
private static final String dbTableName = "synonyms"; |
59 |
private static final Class cdmTargetClass = TaxonBase.class; |
|
58 |
private static final Class<?> cdmTargetClass = TaxonBase.class;
|
|
60 | 59 |
private static final String strOrderBy = ""; |
61 | 60 |
|
62 | 61 |
public CentralAfricaChecklistSynonymImport(){ |
... | ... | |
101 | 100 |
return strRecordQuery; |
102 | 101 |
} |
103 | 102 |
|
104 |
|
|
105 |
/* (non-Javadoc) |
|
106 |
* @see eu.etaxonomy.cdm.io.berlinModel.in.IPartitionedIO#getRelatedObjectsForPartition(java.sql.ResultSet) |
|
107 |
*/ |
|
108 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs) { |
|
103 |
@Override |
|
104 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, CentralAfricaChecklistImportState state) { |
|
109 | 105 |
String nameSpace; |
110 |
Class cdmClass; |
|
106 |
Class<?> cdmClass;
|
|
111 | 107 |
Set<String> idSet; |
112 | 108 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<Object, Map<String, ? extends CdmBase>>(); |
113 | 109 |
|
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/checklist/CentralAfricaChecklistTaxonImport.java | ||
---|---|---|
139 | 139 |
} |
140 | 140 |
|
141 | 141 |
|
142 |
/* (non-Javadoc) |
|
143 |
* @see eu.etaxonomy.cdm.io.berlinModel.in.IPartitionedIO#getRelatedObjectsForPartition(java.sql.ResultSet) |
|
144 |
*/ |
|
145 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs) { |
|
142 |
@Override |
|
143 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, CentralAfricaChecklistImportState state) { |
|
146 | 144 |
String nameSpace; |
147 |
Class cdmClass; |
|
145 |
Class<?> cdmClass;
|
|
148 | 146 |
Set<String> idSet; |
149 | 147 |
Set<String> referenceIdSet = new HashSet<String>(); |
150 | 148 |
|
... | ... | |
168 | 166 |
return result; |
169 | 167 |
} |
170 | 168 |
|
171 |
|
|
172 |
/* (non-Javadoc) |
|
173 |
* @see eu.etaxonomy.cdm.io.common.mapping.IMappingImport#createObject(java.sql.ResultSet) |
|
174 |
*/ |
|
169 |
@Override |
|
175 | 170 |
public TaxonBase<?> createObject(ResultSet rs, CentralAfricaChecklistImportState state) throws SQLException { |
176 | 171 |
BotanicalName speciesName = BotanicalName.NewInstance(Rank.SPECIES()); |
177 | 172 |
|
... | ... | |
321 | 316 |
// } |
322 | 317 |
|
323 | 318 |
//TODO use Mapper |
324 |
private boolean makeTaxonomicallyIncluded(CentralAfricaChecklistImportState state, Integer treeRefFk, Taxon child, Taxon parent, Reference citation, String microCitation){ |
|
319 |
private boolean makeTaxonomicallyIncluded(CentralAfricaChecklistImportState state, Integer treeRefFk, Taxon child, Taxon parent, Reference<?> citation, String microCitation){
|
|
325 | 320 |
String treeKey; |
326 | 321 |
UUID treeUuid; |
327 | 322 |
if (treeRefFk == null){ |
... | ... | |
351 | 346 |
} |
352 | 347 |
|
353 | 348 |
|
354 |
private Reference makeGenevaReference(CentralAfricaChecklistImportState state) { |
|
355 |
Reference result = ReferenceFactory.newDatabase(); |
|
349 |
private Reference<?> makeGenevaReference(CentralAfricaChecklistImportState state) {
|
|
350 |
Reference<?> result = ReferenceFactory.newDatabase();
|
|
356 | 351 |
result.setTitleCache(state.getConfig().getGenevaReferenceTitle(), true); |
357 | 352 |
result.setUuid(state.getConfig().getUuidGenevaReference()); |
358 | 353 |
return result; |
359 | 354 |
} |
360 | 355 |
|
361 |
/* (non-Javadoc) |
|
362 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#doCheck(eu.etaxonomy.cdm.io.common.IImportConfigurator) |
|
363 |
*/ |
|
364 | 356 |
@Override |
365 | 357 |
protected boolean doCheck(CentralAfricaChecklistImportState state){ |
366 | 358 |
IOValidator<CentralAfricaChecklistImportState> validator = new CentralAfricaChecklistTaxonImportValidator(); |
367 | 359 |
return validator.validate(state); |
368 | 360 |
} |
369 | 361 |
|
370 |
|
|
371 |
/* (non-Javadoc) |
|
372 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#isIgnore(eu.etaxonomy.cdm.io.common.IImportConfigurator) |
|
373 |
*/ |
|
362 |
@Override |
|
374 | 363 |
protected boolean isIgnore(CentralAfricaChecklistImportState state){ |
375 | 364 |
return ! state.getConfig().isDoTaxa(); |
376 | 365 |
} |
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/ferns/CentralAfricaFernsReferenceImport.java | ||
---|---|---|
33 | 33 |
/** |
34 | 34 |
* @author a.mueller |
35 | 35 |
* @created 20.02.2010 |
36 |
* @version 1.0 |
|
37 | 36 |
*/ |
38 | 37 |
@Component |
39 | 38 |
public class CentralAfricaFernsReferenceImport extends CentralAfricaFernsImportBase<Reference> implements IMappingImport<Reference, CentralAfricaFernsImportState>{ |
40 | 39 |
private static final Logger logger = Logger.getLogger(CentralAfricaFernsReferenceImport.class); |
41 | 40 |
|
42 |
private DbImportMapping mapping; |
|
41 |
private DbImportMapping<?,?> mapping;
|
|
43 | 42 |
|
44 | 43 |
|
45 |
private int modCount = 10000; |
|
44 |
// private int modCount = 10000;
|
|
46 | 45 |
private static final String pluralString = "references"; |
47 | 46 |
private static final String dbTableName = "literature"; |
48 |
private static final Class cdmTargetClass = Reference.class; |
|
47 |
private static final Class<?> cdmTargetClass = Reference.class;
|
|
49 | 48 |
|
50 | 49 |
public CentralAfricaFernsReferenceImport(){ |
51 | 50 |
super(pluralString, dbTableName, cdmTargetClass); |
... | ... | |
154 | 153 |
return ref; |
155 | 154 |
} |
156 | 155 |
|
157 |
/* (non-Javadoc) |
|
158 |
* @see eu.etaxonomy.cdm.io.berlinModel.in.IPartitionedIO#getRelatedObjectsForPartition(java.sql.ResultSet) |
|
159 |
*/ |
|
160 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs) { |
|
156 |
|
|
157 |
@Override |
|
158 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, CentralAfricaFernsImportState state) { |
|
161 | 159 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<Object, Map<String, ? extends CdmBase>>(); |
162 | 160 |
return result; //not needed |
163 | 161 |
} |
164 | 162 |
|
165 |
/* (non-Javadoc) |
|
166 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#doCheck(eu.etaxonomy.cdm.io.common.IImportConfigurator) |
|
167 |
*/ |
|
168 | 163 |
@Override |
169 | 164 |
protected boolean doCheck(CentralAfricaFernsImportState state){ |
170 | 165 |
IOValidator<CentralAfricaFernsImportState> validator = new CentralAfricaFernsReferenceImportValidator(); |
171 | 166 |
return validator.validate(state); |
172 | 167 |
} |
173 | 168 |
|
174 |
|
|
175 |
/* (non-Javadoc) |
|
176 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#isIgnore(eu.etaxonomy.cdm.io.common.IImportConfigurator) |
|
177 |
*/ |
|
169 |
@Override |
|
178 | 170 |
protected boolean isIgnore(CentralAfricaFernsImportState state){ |
179 | 171 |
//TODO |
180 | 172 |
return state.getConfig().getDoReferences() != IImportConfigurator.DO_REFERENCES.ALL; |
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/ferns/CentralAfricaFernsTaxonImport.java | ||
---|---|---|
70 | 70 |
/** |
71 | 71 |
* @author a.mueller |
72 | 72 |
* @created 20.02.2010 |
73 |
* @version 1.0 |
|
74 | 73 |
*/ |
75 | 74 |
@Component |
76 | 75 |
public class CentralAfricaFernsTaxonImport extends CentralAfricaFernsImportBase<TaxonBase> implements IMappingImport<TaxonBase, CentralAfricaFernsImportState>{ |
... | ... | |
79 | 78 |
public static final UUID TNS_EXT_UUID = UUID.fromString("41cb0450-ac84-4d73-905e-9c7773c23b05"); |
80 | 79 |
|
81 | 80 |
|
82 |
private DbImportMapping mapping; |
|
81 |
private DbImportMapping<?,?> mapping;
|
|
83 | 82 |
|
84 | 83 |
//second path is not used anymore, there is now an ErmsTaxonRelationImport class instead |
85 |
private boolean isSecondPath = false; |
|
84 |
// private boolean isSecondPath = false;
|
|
86 | 85 |
|
87 | 86 |
private static final String pluralString = "taxa"; |
88 | 87 |
private static final String dbTableName = "[African pteridophytes]"; |
89 |
private static final Class cdmTargetClass = TaxonBase.class; |
|
88 |
private static final Class<?> cdmTargetClass = TaxonBase.class;
|
|
90 | 89 |
|
91 | 90 |
public CentralAfricaFernsTaxonImport(){ |
92 | 91 |
super(pluralString, dbTableName, cdmTargetClass); |
93 | 92 |
} |
94 | 93 |
|
95 |
|
|
96 | 94 |
|
97 |
/* (non-Javadoc) |
|
98 |
* @see eu.etaxonomy.cdm.io.eflora.centralAfrica.ferns.CentralAfricaFernsImportBase#getIdQuery() |
|
99 |
*/ |
|
100 |
@Override |
|
101 | 95 |
protected String getIdQuery() { |
102 | 96 |
String strQuery = " SELECT [Taxon number] FROM " + dbTableName ; |
103 | 97 |
return strQuery; |
104 | 98 |
} |
105 | 99 |
|
106 |
|
|
107 |
/* (non-Javadoc) |
|
108 |
* @see eu.etaxonomy.cdm.io.eflora.centralAfrica.ferns.CentralAfricaFernsImportBase#getMapping() |
|
109 |
*/ |
|
110 |
protected DbImportMapping getMapping() { |
|
100 |
@Override |
|
101 |
protected DbImportMapping<?,?> getMapping() { |
|
111 | 102 |
if (mapping == null){ |
112 | 103 |
mapping = new DbImportMapping(); |
113 | 104 |
|
... | ... | |
167 | 158 |
} |
168 | 159 |
|
169 | 160 |
|
170 |
/* (non-Javadoc) |
|
171 |
* @see eu.etaxonomy.cdm.io.berlinModel.in.IPartitionedIO#getRelatedObjectsForPartition(java.sql.ResultSet) |
|
172 |
*/ |
|
173 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs) { |
|
174 |
String nameSpace; |
|
175 |
Class cdmClass; |
|
176 |
Set<String> idSet; |
|
161 |
@Override |
|
162 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, CentralAfricaFernsImportState state) { |
|
163 |
// String nameSpace; |
|
164 |
// Class<?> cdmClass; |
|
165 |
// Set<String> idSet; |
|
177 | 166 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<Object, Map<String, ? extends CdmBase>>(); |
178 | 167 |
|
179 | 168 |
try{ |
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/ferns/CentralAfricaFernsTaxonRelationImport.java | ||
---|---|---|
44 | 44 |
import eu.etaxonomy.cdm.model.description.PresenceTerm; |
45 | 45 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
46 | 46 |
import eu.etaxonomy.cdm.model.description.TextData; |
47 |
import eu.etaxonomy.cdm.model.location.Country; |
|
47 | 48 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
48 | 49 |
import eu.etaxonomy.cdm.model.location.NamedAreaLevel; |
49 | 50 |
import eu.etaxonomy.cdm.model.location.NamedAreaType; |
50 |
import eu.etaxonomy.cdm.model.location.Country; |
|
51 | 51 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
52 | 52 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
53 | 53 |
import eu.etaxonomy.cdm.model.name.Rank; |
... | ... | |
86 | 86 |
public CentralAfricaFernsTaxonRelationImport(){ |
87 | 87 |
super(pluralString, dbTableName, cdmTargetClass); |
88 | 88 |
} |
89 |
|
|
90 |
|
|
91 | 89 |
|
92 |
/* (non-Javadoc) |
|
93 |
* @see eu.etaxonomy.cdm.io.erms.ErmsImportBase#getIdQuery() |
|
94 |
*/ |
|
90 |
|
|
95 | 91 |
@Override |
96 | 92 |
protected String getIdQuery() { |
97 | 93 |
String strQuery = " SELECT [Taxon number] FROM " + dbTableName;; |
98 | 94 |
return strQuery; |
99 | 95 |
} |
100 | 96 |
|
101 |
|
|
102 |
/* (non-Javadoc) |
|
103 |
* @see eu.etaxonomy.cdm.io.eflora.centralAfrica.ferns.CentralAfricaFernsImportBase#getMapping() |
|
104 |
*/ |
|
105 | 97 |
@Override |
106 | 98 |
protected DbImportMapping<?,?> getMapping() { |
107 | 99 |
if (mapping == null){ |
... | ... | |
161 | 153 |
} |
162 | 154 |
} |
163 | 155 |
|
164 |
/* (non-Javadoc) |
|
165 |
* @see eu.etaxonomy.cdm.io.common.IPartitionedIO#getRelatedObjectsForPartition(java.sql.ResultSet) |
|
166 |
*/ |
|
167 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs) { |
|
156 |
|
|
157 |
@Override |
|
158 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, CentralAfricaFernsImportState state) { |
|
168 | 159 |
String nameSpace; |
169 | 160 |
Class<?> cdmClass; |
170 | 161 |
Set<String> idSet; |
Also available in: Unified diff
Change signature for IPartionedIO.setRelatedObjects in cdm-eflora