Revision b0b44252
Added by Andreas Müller almost 6 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportClassification.java | ||
---|---|---|
29 | 29 |
import eu.etaxonomy.cdm.io.common.ResultSetPartitioner; |
30 | 30 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
31 | 31 |
import eu.etaxonomy.cdm.model.common.Language; |
32 |
import eu.etaxonomy.cdm.model.common.TimePeriod; |
|
32 |
import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;
|
|
33 | 33 |
import eu.etaxonomy.cdm.model.reference.Reference; |
34 | 34 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
35 | 35 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
... | ... | |
40 | 40 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
41 | 41 |
|
42 | 42 |
/** |
43 |
* |
|
44 | 43 |
* @author pplitzner |
45 | 44 |
* @since Mar 1, 2016 |
46 |
* |
|
47 | 45 |
*/ |
48 | 46 |
|
49 | 47 |
@Component |
... | ... | |
236 | 234 |
private void addTaxonToClassification(Classification classification, String classificationNamespace, String relationString, final TaxonBase<?> gesamtListeTaxon, long id, RedListGefaesspflanzenImportState state){ |
237 | 235 |
Taxon taxon = HibernateProxyHelper.deproxy(state.getRelatedObject(classificationNamespace, String.valueOf(id), TaxonBase.class), Taxon.class); |
238 | 236 |
//add concept relation to gesamtliste/checkliste |
239 |
if(taxon!=null && CdmUtils.isNotBlank(relationString) && !relationString.equals(".")){
|
|
237 |
if(taxon!=null && isNotBlank(relationString) && !relationString.equals(".")){ |
|
240 | 238 |
//if the related concept in gesamtliste/checkliste is a synonym then we |
241 | 239 |
//create a relation to the accepted taxon |
242 | 240 |
Taxon acceptedGesamtListeTaxon = getAcceptedTaxon(gesamtListeTaxon); |
... | ... | |
286 | 284 |
classification.addParentChild(parent, (Taxon)taxonBase, null, null); |
287 | 285 |
} |
288 | 286 |
|
289 |
if(CdmUtils.isNotBlank(taxZusatzString)){
|
|
287 |
if(isNotBlank(taxZusatzString)){ |
|
290 | 288 |
if(taxZusatzString.trim().equals("p. p.")){ |
291 | 289 |
RedListUtil.logMessage(id, "pro parte for accepted taxon "+taxonBase, logger); |
292 | 290 |
} |
... | ... | |
306 | 304 |
//regular synonym |
307 | 305 |
else{ |
308 | 306 |
Synonym synonym = (Synonym) taxonBase; |
309 |
parent.addSynonym((Synonym) taxonBase, SynonymType.HETEROTYPIC_SYNONYM_OF());
|
|
307 |
parent.addSynonym(synonym, SynonymType.HETEROTYPIC_SYNONYM_OF());
|
|
310 | 308 |
|
311 | 309 |
//TAX_ZUSATZ |
312 |
if(CdmUtils.isNotBlank(taxZusatzString)){
|
|
310 |
if(isNotBlank(taxZusatzString)){ |
|
313 | 311 |
if(taxZusatzString.trim().equals("p. p.")){ |
314 | 312 |
synonym.setProParte(true); |
315 | 313 |
} |
... | ... | |
378 | 376 |
reference.setUuid(referenceUuid); |
379 | 377 |
classification.setReference(reference); |
380 | 378 |
if(yearPublished!=null){ |
381 |
reference.setDatePublished(TimePeriod.NewInstance(yearPublished));
|
|
379 |
reference.setDatePublished(VerbatimTimePeriod.NewVerbatimInstance(yearPublished));
|
|
382 | 380 |
} |
383 | 381 |
return getClassificationService().save(classification); |
384 | 382 |
} |
Also available in: Unified diff
ref #6752 stricter use of verbatimDate in cdmlib-app