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.redlist.gefaesspflanzen;
|
11
|
|
12
|
import java.sql.ResultSet;
|
13
|
import java.sql.SQLException;
|
14
|
import java.util.Arrays;
|
15
|
import java.util.HashMap;
|
16
|
import java.util.HashSet;
|
17
|
import java.util.Map;
|
18
|
import java.util.Set;
|
19
|
import java.util.UUID;
|
20
|
|
21
|
import org.apache.log4j.Logger;
|
22
|
import org.springframework.stereotype.Component;
|
23
|
|
24
|
import eu.etaxonomy.cdm.common.CdmUtils;
|
25
|
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
|
26
|
import eu.etaxonomy.cdm.io.common.DbImportBase;
|
27
|
import eu.etaxonomy.cdm.io.common.IPartitionedIO;
|
28
|
import eu.etaxonomy.cdm.io.common.ResultSetPartitioner;
|
29
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
30
|
import eu.etaxonomy.cdm.model.common.Language;
|
31
|
import eu.etaxonomy.cdm.model.common.TimePeriod;
|
32
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
33
|
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
|
34
|
import eu.etaxonomy.cdm.model.taxon.Classification;
|
35
|
import eu.etaxonomy.cdm.model.taxon.Synonym;
|
36
|
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
|
37
|
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
|
38
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
39
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
40
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
|
41
|
|
42
|
/**
|
43
|
*
|
44
|
* @author pplitzner
|
45
|
* @date Mar 1, 2016
|
46
|
*
|
47
|
*/
|
48
|
|
49
|
@Component
|
50
|
@SuppressWarnings("serial")
|
51
|
public class RedListGefaesspflanzenImportClassification extends DbImportBase<RedListGefaesspflanzenImportState, RedListGefaesspflanzenImportConfigurator> {
|
52
|
|
53
|
private static final Logger logger = Logger.getLogger(RedListGefaesspflanzenImportClassification.class);
|
54
|
|
55
|
private static final String tableName = "Rote Liste Gefäßpflanzen";
|
56
|
|
57
|
private static final String pluralString = "classifications";
|
58
|
|
59
|
public RedListGefaesspflanzenImportClassification() {
|
60
|
super(tableName, pluralString);
|
61
|
}
|
62
|
|
63
|
@Override
|
64
|
protected String getIdQuery(RedListGefaesspflanzenImportState state) {
|
65
|
return "SELECT NAMNR "
|
66
|
+ "FROM V_TAXATLAS_D20_EXPORT t "
|
67
|
+ " ORDER BY NAMNR";
|
68
|
}
|
69
|
|
70
|
@Override
|
71
|
protected String getRecordQuery(RedListGefaesspflanzenImportConfigurator config) {
|
72
|
String result = "select e.*, f.FAMILIE "
|
73
|
+ "from V_TAXATLAS_D20_EXPORT e, GATTUNG_FAMILIE f "
|
74
|
+ "where e.EPI1 = f.GATTUNG and e.NAMNR IN (@IDSET)";
|
75
|
result = result.replace("@IDSET", IPartitionedIO.ID_LIST_TOKEN);
|
76
|
return result;
|
77
|
}
|
78
|
|
79
|
@Override
|
80
|
protected void doInvoke(RedListGefaesspflanzenImportState state) {
|
81
|
Classification gesamtListe = makeClassification("Gesamtliste", state.getConfig().getClassificationUuid(), "Gesamtliste", null, RedListUtil.gesamtListeReferenceUuid, state);
|
82
|
Classification checkliste = makeClassification("Checkliste", RedListUtil.checkListClassificationUuid, "Checkliste", null, RedListUtil.checkListReferenceUuid, state);
|
83
|
makeClassification("E", RedListUtil.uuidClassificationE, "Ehrendorfer", null, RedListUtil.uuidClassificationReferenceE, state);
|
84
|
makeClassification("W", RedListUtil.uuidClassificationW, "Wisskirchen (Standardliste)", 1998, RedListUtil.uuidClassificationReferenceW, state);
|
85
|
makeClassification("K", RedListUtil.uuidClassificationK, "Korneck (Rote Liste)", 1996, RedListUtil.uuidClassificationReferenceK, state);
|
86
|
makeClassification("AW", RedListUtil.uuidClassificationAW, "Atlas (Westdeutschland)", 1988, RedListUtil.uuidClassificationReferenceAW, state);
|
87
|
makeClassification("AO", RedListUtil.uuidClassificationAO, "Atlas (Ostdeutschland)", 1996, RedListUtil.uuidClassificationReferenceAO, state);
|
88
|
makeClassification("R", RedListUtil.uuidClassificationR, "Rothmaler", 2011, RedListUtil.uuidClassificationReferenceR, state);
|
89
|
makeClassification("O", RedListUtil.uuidClassificationO, "Oberdorfer", 2001, RedListUtil.uuidClassificationReferenceO, state);
|
90
|
makeClassification("S", RedListUtil.uuidClassificationS, "Schmeil-Fitschen", 2011, RedListUtil.uuidClassificationReferenceS, state);
|
91
|
importFamilies(gesamtListe, checkliste, state);
|
92
|
super.doInvoke(state);
|
93
|
}
|
94
|
|
95
|
|
96
|
private void importFamilies(Classification gesamtListe, Classification checkliste, RedListGefaesspflanzenImportState state) {
|
97
|
for(UUID uuid:state.getFamilyMap().values()){
|
98
|
Taxon familyGL = HibernateProxyHelper.deproxy(getTaxonService().load(uuid, Arrays.asList(new String[]{"*"})), Taxon.class);
|
99
|
Taxon familyCL = (Taxon) familyGL.clone();
|
100
|
getTaxonService().saveOrUpdate(familyCL);
|
101
|
|
102
|
gesamtListe.addChildTaxon(familyGL, null, null);
|
103
|
familyGL.setSec(gesamtListe.getReference());
|
104
|
familyGL.setTitleCache(null);
|
105
|
|
106
|
checkliste.addChildTaxon(familyCL, null, null);
|
107
|
familyCL.setSec(checkliste.getReference());
|
108
|
familyCL.setTitleCache(null);
|
109
|
|
110
|
getClassificationService().saveOrUpdate(gesamtListe);
|
111
|
getClassificationService().saveOrUpdate(checkliste);
|
112
|
}
|
113
|
}
|
114
|
|
115
|
@Override
|
116
|
public boolean doPartition(ResultSetPartitioner partitioner, RedListGefaesspflanzenImportState state) {
|
117
|
ResultSet rs = partitioner.getResultSet();
|
118
|
Classification gesamtListeClassification = getClassificationService().load(state.getConfig().getClassificationUuid());
|
119
|
Classification checklistClassification = getClassificationService().load(RedListUtil.checkListClassificationUuid);
|
120
|
Classification classificationE = getClassificationService().load(RedListUtil.uuidClassificationE);
|
121
|
Classification classificationW = getClassificationService().load(RedListUtil.uuidClassificationW);
|
122
|
Classification classificationK = getClassificationService().load(RedListUtil.uuidClassificationK);
|
123
|
Classification classificationAW = getClassificationService().load(RedListUtil.uuidClassificationAW);
|
124
|
Classification classificationAO = getClassificationService().load(RedListUtil.uuidClassificationAO);
|
125
|
Classification classificationR = getClassificationService().load(RedListUtil.uuidClassificationR);
|
126
|
Classification classificationO = getClassificationService().load(RedListUtil.uuidClassificationO);
|
127
|
Classification classificationS = getClassificationService().load(RedListUtil.uuidClassificationS);
|
128
|
try {
|
129
|
while (rs.next()){
|
130
|
makeSingleTaxonNode(state, rs, gesamtListeClassification, checklistClassification,
|
131
|
classificationE, classificationW, classificationK, classificationAW
|
132
|
, classificationAO, classificationR, classificationO, classificationS);
|
133
|
|
134
|
}
|
135
|
} catch (SQLException e) {
|
136
|
e.printStackTrace();
|
137
|
}
|
138
|
|
139
|
logger.info("Update classification (1000 nodes)");
|
140
|
getClassificationService().saveOrUpdate(gesamtListeClassification);
|
141
|
getClassificationService().saveOrUpdate(checklistClassification);
|
142
|
return true;
|
143
|
}
|
144
|
|
145
|
private void makeSingleTaxonNode(RedListGefaesspflanzenImportState state, ResultSet rs,
|
146
|
Classification gesamtListeClassification, Classification checklistClassification,
|
147
|
Classification classificationE, Classification classificationW, Classification classificationK,
|
148
|
Classification classificationAW, Classification classificationAO, Classification classificationR,
|
149
|
Classification classificationO, Classification classificationS)
|
150
|
throws SQLException {
|
151
|
long id = rs.getLong(RedListUtil.NAMNR);
|
152
|
String parentId = String.valueOf(rs.getLong(RedListUtil.LOWER));
|
153
|
String gueltString = rs.getString(RedListUtil.GUELT);
|
154
|
String taxZusatzString = rs.getString(RedListUtil.TAX_ZUSATZ);
|
155
|
String familieString = rs.getString(RedListUtil.FAMILIE);
|
156
|
|
157
|
String relationE = rs.getString(RedListUtil.E);
|
158
|
String relationW = rs.getString(RedListUtil.W);
|
159
|
String relationK = rs.getString(RedListUtil.K);
|
160
|
String relationAW = rs.getString(RedListUtil.AW);
|
161
|
String relationAO = rs.getString(RedListUtil.AO);
|
162
|
String relationR = rs.getString(RedListUtil.R);
|
163
|
String relationO = rs.getString(RedListUtil.O);
|
164
|
String relationS = rs.getString(RedListUtil.S);
|
165
|
|
166
|
//Gesamtliste
|
167
|
TaxonBase<?> taxonBaseGL = state.getRelatedObject(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, String.valueOf(id), TaxonBase.class);
|
168
|
TaxonBase<?> parentBaseGL = state.getRelatedObject(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, parentId, TaxonBase.class);
|
169
|
if(parentBaseGL!=null && !parentBaseGL.isInstanceOf(Taxon.class)){
|
170
|
RedListUtil.logMessage(id, parentBaseGL+" is no taxon but is a parent of "+taxonBaseGL+" (Gesamtliste)", logger);
|
171
|
}
|
172
|
Taxon parentGL = (Taxon) state.getRelatedObject(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, parentId, TaxonBase.class);
|
173
|
//add to family if no parent found
|
174
|
if(parentBaseGL==null){
|
175
|
if(!taxonBaseGL.isInstanceOf(Taxon.class)){
|
176
|
RedListUtil.logMessage(id, taxonBaseGL+" has no parent but is not a taxon.", logger);
|
177
|
}
|
178
|
else{
|
179
|
Taxon family = HibernateProxyHelper.deproxy(getTaxonService().load(state.getFamilyMap().get(familieString)), Taxon.class);
|
180
|
gesamtListeClassification.addParentChild(family, HibernateProxyHelper.deproxy(taxonBaseGL, Taxon.class), null, null);
|
181
|
}
|
182
|
}
|
183
|
//add to higher taxon
|
184
|
else{
|
185
|
createParentChildNodes(gesamtListeClassification, id, gueltString, taxZusatzString, taxonBaseGL, parentGL);
|
186
|
}
|
187
|
|
188
|
//Checkliste
|
189
|
TaxonBase<?> taxonBaseCL = state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, String.valueOf(id), TaxonBase.class);
|
190
|
TaxonBase<?> parentBaseCL = state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, parentId, TaxonBase.class);
|
191
|
if(parentBaseCL!=null && !parentBaseCL.isInstanceOf(Taxon.class)){
|
192
|
RedListUtil.logMessage(id, parentBaseCL+" is no taxon but is a parent of "+taxonBaseCL+" (Checkliste)", logger);
|
193
|
}
|
194
|
Taxon parentCL = (Taxon) state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, parentId, TaxonBase.class);
|
195
|
if(taxonBaseCL!=null){//null check necessary because not all taxa exist in the checklist
|
196
|
//add to family if no parent found
|
197
|
if(parentCL==null){
|
198
|
if(!taxonBaseCL.isInstanceOf(Taxon.class)){
|
199
|
RedListUtil.logMessage(id, taxonBaseCL+" has no parent but is not a taxon.", logger);
|
200
|
}
|
201
|
else{
|
202
|
Taxon family = HibernateProxyHelper.deproxy(getTaxonService().load(state.getFamilyMap().get(familieString)), Taxon.class);
|
203
|
checklistClassification.addParentChild(family, HibernateProxyHelper.deproxy(taxonBaseCL, Taxon.class), null, null);
|
204
|
}
|
205
|
}
|
206
|
//add to higher taxon
|
207
|
else{
|
208
|
createParentChildNodes(checklistClassification, id, gueltString, taxZusatzString, taxonBaseCL, parentCL);
|
209
|
}
|
210
|
}
|
211
|
|
212
|
//check uuids
|
213
|
if(taxonBaseGL!= null && taxonBaseCL!=null
|
214
|
&& taxonBaseGL.getUuid().equals(taxonBaseCL.getUuid())){
|
215
|
RedListUtil.logMessage(id, "Same UUID for "+taxonBaseGL+ " (Gesamtliste) and "+taxonBaseCL+" (Checkliste)", logger);
|
216
|
}
|
217
|
if(parentGL!=null && parentCL!=null && parentGL.getUuid().equals(parentCL.getUuid())){
|
218
|
RedListUtil.logMessage(id, "Same UUID for "+parentGL+ " (Gesamtliste) and "+parentCL+" (Checkliste)", logger);
|
219
|
}
|
220
|
|
221
|
//add taxa for concept relationships to E, W, K, AW, AO, R, O, S
|
222
|
addTaxonToClassification(classificationE, RedListUtil.CLASSIFICATION_NAMESPACE_E, relationE, taxonBaseGL, taxonBaseCL, id, state);
|
223
|
addTaxonToClassification(classificationW, RedListUtil.CLASSIFICATION_NAMESPACE_W, relationW, taxonBaseGL, taxonBaseCL, id, state);
|
224
|
addTaxonToClassification(classificationK, RedListUtil.CLASSIFICATION_NAMESPACE_K, relationK, taxonBaseGL, taxonBaseCL, id, state);
|
225
|
addTaxonToClassification(classificationAW, RedListUtil.CLASSIFICATION_NAMESPACE_AW, relationAW, taxonBaseGL, taxonBaseCL, id, state);
|
226
|
addTaxonToClassification(classificationAO, RedListUtil.CLASSIFICATION_NAMESPACE_AO, relationAO, taxonBaseGL, taxonBaseCL, id, state);
|
227
|
addTaxonToClassification(classificationR, RedListUtil.CLASSIFICATION_NAMESPACE_R, relationR, taxonBaseGL, taxonBaseCL, id, state);
|
228
|
addTaxonToClassification(classificationO, RedListUtil.CLASSIFICATION_NAMESPACE_O, relationO, taxonBaseGL, taxonBaseCL, id, state);
|
229
|
addTaxonToClassification(classificationS, RedListUtil.CLASSIFICATION_NAMESPACE_S, relationS, taxonBaseGL, taxonBaseCL, id, state);
|
230
|
}
|
231
|
|
232
|
private void addTaxonToClassification(Classification classification, String classificationNamespace, String relationString, final TaxonBase<?> gesamtListeTaxon, final TaxonBase<?> checklisteTaxon, long id, RedListGefaesspflanzenImportState state){
|
233
|
Taxon taxon = HibernateProxyHelper.deproxy(state.getRelatedObject(classificationNamespace, String.valueOf(id), TaxonBase.class), Taxon.class);
|
234
|
//add concept relation to gesamtliste and checkliste
|
235
|
if(taxon!=null && CdmUtils.isNotBlank(relationString) && !relationString.equals(".")){
|
236
|
//if the related concept in gesamtliste/checkliste is a synonym then we
|
237
|
//create a relation to the accepted taxon
|
238
|
Taxon acceptedGesamtListeTaxon = getAcceptedTaxon(gesamtListeTaxon);
|
239
|
Taxon acceptedChecklistTaxon = getAcceptedTaxon(checklisteTaxon);
|
240
|
String relationSubstring = relationString.substring(relationString.length()-1, relationString.length());
|
241
|
TaxonRelationshipType taxonRelationshipTypeByKey = new RedListGefaesspflanzenTransformer().getTaxonRelationshipTypeByKey(relationSubstring);
|
242
|
if(taxonRelationshipTypeByKey==null){
|
243
|
RedListUtil.logMessage(id, "Could not interpret relationship "+relationString+" for taxon "+gesamtListeTaxon.generateTitle(), logger);
|
244
|
}
|
245
|
//there is no type "included in" so we have to reverse the direction
|
246
|
if(relationSubstring.equals("<")){
|
247
|
if(acceptedGesamtListeTaxon!=null){
|
248
|
acceptedGesamtListeTaxon.addTaxonRelation(taxon, taxonRelationshipTypeByKey, null, null);
|
249
|
}
|
250
|
if(acceptedChecklistTaxon!=null) {
|
251
|
acceptedChecklistTaxon.addTaxonRelation(taxon, taxonRelationshipTypeByKey, null, null);
|
252
|
}
|
253
|
}
|
254
|
else{
|
255
|
if(acceptedGesamtListeTaxon!=null){
|
256
|
taxon.addTaxonRelation(acceptedGesamtListeTaxon, taxonRelationshipTypeByKey, null, null);
|
257
|
}
|
258
|
if(acceptedChecklistTaxon!=null) {
|
259
|
taxon.addTaxonRelation(acceptedChecklistTaxon, taxonRelationshipTypeByKey, null, null);
|
260
|
}
|
261
|
}
|
262
|
|
263
|
taxon.setSec(classification.getReference());
|
264
|
classification.addChildTaxon(taxon, null, null);
|
265
|
//TODO is saving and setting the title cache to null neccessary?
|
266
|
getTaxonService().saveOrUpdate(taxon);
|
267
|
getTaxonService().saveOrUpdate(gesamtListeTaxon);
|
268
|
if(checklisteTaxon!=null){
|
269
|
getTaxonService().saveOrUpdate(checklisteTaxon);
|
270
|
}
|
271
|
taxon.setTitleCache(null);//Reset title cache to see sec ref in title
|
272
|
}
|
273
|
}
|
274
|
|
275
|
private void createParentChildNodes(Classification classification, long id, String gueltString,
|
276
|
String taxZusatzString, TaxonBase<?> taxonBase, Taxon parent) {
|
277
|
if(taxonBase==null){
|
278
|
RedListUtil.logMessage(id, "child taxon/synonym of "+parent+" is null. ("+classification.generateTitle()+")" , logger);
|
279
|
return;
|
280
|
}
|
281
|
//taxon
|
282
|
if(taxonBase.isInstanceOf(Taxon.class)){
|
283
|
//misapplied name
|
284
|
String appendedPhrase = taxonBase.getAppendedPhrase();
|
285
|
if(appendedPhrase!=null && appendedPhrase.equals(RedListUtil.AUCT)){
|
286
|
if(parent==null){
|
287
|
RedListUtil.logMessage(id, "parent taxon of misapplied name "+taxonBase+" is null. ("+classification.getTitleCache()+")" , logger);
|
288
|
return;
|
289
|
}
|
290
|
parent.addMisappliedName((Taxon) taxonBase, null, null);
|
291
|
}
|
292
|
else{
|
293
|
classification.addParentChild(parent, (Taxon)taxonBase, null, null);
|
294
|
}
|
295
|
|
296
|
if(CdmUtils.isNotBlank(taxZusatzString)){
|
297
|
if(taxZusatzString.trim().equals("p. p.")){
|
298
|
RedListUtil.logMessage(id, "pro parte for accepted taxon "+taxonBase, logger);
|
299
|
}
|
300
|
}
|
301
|
}
|
302
|
//synonym
|
303
|
else if(taxonBase.isInstanceOf(Synonym.class)){
|
304
|
if(parent==null){
|
305
|
RedListUtil.logMessage(id, "parent taxon of synonym "+taxonBase+" is null. ("+classification.getTitleCache()+")" , logger);
|
306
|
return;
|
307
|
}
|
308
|
//basionym
|
309
|
if(gueltString.equals(RedListUtil.GUELT_BASIONYM)){
|
310
|
parent.addHomotypicSynonym((Synonym) taxonBase, null, null);
|
311
|
parent.getName().addBasionym(taxonBase.getName());
|
312
|
}
|
313
|
//regular synonym
|
314
|
else{
|
315
|
SynonymRelationship synonymRelationship = parent.addSynonym((Synonym) taxonBase, SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF(), null, null);
|
316
|
|
317
|
//TAX_ZUSATZ
|
318
|
if(CdmUtils.isNotBlank(taxZusatzString)){
|
319
|
if(taxZusatzString.trim().equals("p. p.")){
|
320
|
synonymRelationship.setProParte(true);
|
321
|
}
|
322
|
else if(taxZusatzString.trim().equals("s. l. p. p.")){
|
323
|
synonymRelationship.setProParte(true);
|
324
|
taxonBase.setAppendedPhrase("s. l.");
|
325
|
}
|
326
|
else if(taxZusatzString.trim().equals("s. str. p. p.")){
|
327
|
synonymRelationship.setProParte(true);
|
328
|
taxonBase.setAppendedPhrase("s. str.");
|
329
|
}
|
330
|
else if(taxZusatzString.trim().equals("s. l.")
|
331
|
|| taxZusatzString.trim().equals("s. str.")){
|
332
|
taxonBase.setAppendedPhrase(taxZusatzString);
|
333
|
}
|
334
|
else{
|
335
|
RedListUtil.logMessage(id, "unknown value "+taxZusatzString+" for column "+RedListUtil.TAX_ZUSATZ, logger);
|
336
|
}
|
337
|
}
|
338
|
}
|
339
|
}
|
340
|
//set sec reference
|
341
|
taxonBase.setSec(classification.getReference());
|
342
|
taxonBase.setTitleCache(null, false);//refresh title cache
|
343
|
}
|
344
|
|
345
|
@Override
|
346
|
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs,
|
347
|
RedListGefaesspflanzenImportState state) {
|
348
|
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<>();
|
349
|
|
350
|
Set<String> idSet = new HashSet<String>();
|
351
|
try {
|
352
|
while (rs.next()){
|
353
|
idSet.add(String.valueOf(rs.getLong(RedListUtil.NAMNR)));
|
354
|
idSet.add(String.valueOf(rs.getLong(RedListUtil.LOWER)));
|
355
|
}
|
356
|
} catch (SQLException e) {
|
357
|
e.printStackTrace();
|
358
|
}
|
359
|
result.put(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.TAXON_GESAMTLISTE_NAMESPACE));
|
360
|
result.put(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.TAXON_CHECKLISTE_NAMESPACE));
|
361
|
result.put(RedListUtil.CLASSIFICATION_NAMESPACE_E, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_E));
|
362
|
result.put(RedListUtil.CLASSIFICATION_NAMESPACE_W, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_W));
|
363
|
result.put(RedListUtil.CLASSIFICATION_NAMESPACE_K, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_K));
|
364
|
result.put(RedListUtil.CLASSIFICATION_NAMESPACE_AW, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_AW));
|
365
|
result.put(RedListUtil.CLASSIFICATION_NAMESPACE_AO, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_AO));
|
366
|
result.put(RedListUtil.CLASSIFICATION_NAMESPACE_R, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_R));
|
367
|
result.put(RedListUtil.CLASSIFICATION_NAMESPACE_O, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_O));
|
368
|
result.put(RedListUtil.CLASSIFICATION_NAMESPACE_S, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_S));
|
369
|
return result;
|
370
|
}
|
371
|
|
372
|
private Classification makeClassification(String classificationName, UUID classificationUuid, String referenceName, Integer yearPublished, UUID referenceUuid, RedListGefaesspflanzenImportState state) {
|
373
|
Classification classification = Classification.NewInstance(classificationName, Language.DEFAULT());
|
374
|
classification.setUuid(classificationUuid);
|
375
|
Reference reference = ReferenceFactory.newGeneric();
|
376
|
reference.setTitle(referenceName);
|
377
|
reference.setUuid(referenceUuid);
|
378
|
classification.setReference(reference);
|
379
|
if(yearPublished!=null){
|
380
|
reference.setDatePublished(TimePeriod.NewInstance(yearPublished));
|
381
|
}
|
382
|
return getClassificationService().save(classification);
|
383
|
}
|
384
|
|
385
|
@Override
|
386
|
protected boolean doCheck(RedListGefaesspflanzenImportState state) {
|
387
|
return false;
|
388
|
}
|
389
|
|
390
|
@Override
|
391
|
protected boolean isIgnore(RedListGefaesspflanzenImportState state) {
|
392
|
return false;
|
393
|
}
|
394
|
|
395
|
}
|