Revision 7d882578
Added by Andreas Müller about 7 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/caryo/CaryoTaxonImport.java | ||
---|---|---|
31 | 31 |
import eu.etaxonomy.cdm.model.common.Language; |
32 | 32 |
import eu.etaxonomy.cdm.model.common.OriginalSourceType; |
33 | 33 |
import eu.etaxonomy.cdm.model.common.TimePeriod; |
34 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
|
34 |
import eu.etaxonomy.cdm.model.name.IBotanicalName;
|
|
35 | 35 |
import eu.etaxonomy.cdm.model.name.NameTypeDesignation; |
36 | 36 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus; |
37 | 37 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType; |
38 | 38 |
import eu.etaxonomy.cdm.model.name.Rank; |
39 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
39 | 40 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
40 | 41 |
import eu.etaxonomy.cdm.model.reference.IArticle; |
41 | 42 |
import eu.etaxonomy.cdm.model.reference.IBook; |
... | ... | |
160 | 161 |
// ,[OriginalCitation] |
161 | 162 |
|
162 | 163 |
|
163 |
BotanicalName name = TaxonNameFactory.NewBotanicalInstance(Rank.GENUS()); |
|
164 |
IBotanicalName name = TaxonNameFactory.NewBotanicalInstance(Rank.GENUS());
|
|
164 | 165 |
name.setGenusOrUninomial(genus); |
165 | 166 |
makeAuthors(name, autoren, id); |
166 | 167 |
INomenclaturalReference nomRef = makeNomRef(state, rs, id); |
... | ... | |
197 | 198 |
|
198 | 199 |
private void handleBasionym(CaryoImportState state, ResultSet rs, Taxon taxon, String basioStr, Integer id) { |
199 | 200 |
if (StringUtils.isNotBlank(basioStr)){ |
200 |
BotanicalName name = (BotanicalName) taxon.getName();
|
|
201 |
BotanicalName basionym = TaxonNameFactory.PARSED_BOTANICAL_REFERENCE(basioStr);
|
|
201 |
IBotanicalName name = taxon.getName();
|
|
202 |
TaxonNameBase<?,?> basionym = TaxonNameFactory.PARSED_BOTANICAL_REFERENCE(basioStr);
|
|
202 | 203 |
if (basionym.hasProblem()){ |
203 | 204 |
logger.warn("Problem when parsing basionym ("+id+"): " + basioStr); |
204 | 205 |
} |
... | ... | |
219 | 220 |
if (StringUtils.isBlank(type) || "to be designated".equalsIgnoreCase(type)){ |
220 | 221 |
return; |
221 | 222 |
}else{ |
222 |
BotanicalName name = (BotanicalName)taxon.getName();
|
|
223 |
BotanicalName typeName = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIES());
|
|
223 |
IBotanicalName name = taxon.getName();
|
|
224 |
TaxonNameBase<?,?> typeName = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIES());
|
|
224 | 225 |
if ("not designated".equalsIgnoreCase(type)){ |
225 | 226 |
desig.setNotDesignated(true); |
226 | 227 |
}else{ |
... | ... | |
270 | 271 |
|
271 | 272 |
|
272 | 273 |
|
273 |
private String makeTypeNomStatus(BotanicalName typeName, String type) { |
|
274 |
private String makeTypeNomStatus(IBotanicalName typeName, String type) {
|
|
274 | 275 |
if (type.endsWith(", nom. illeg.")){ |
275 | 276 |
type = type.replaceAll(", nom. illeg.", ""); |
276 | 277 |
typeName.addStatus(NomenclaturalStatus.NewInstance(NomenclaturalStatusType.ILLEGITIMATE())); |
... | ... | |
281 | 282 |
|
282 | 283 |
|
283 | 284 |
|
284 |
private void makeStatus(BotanicalName name, String nomStatusStr, Integer id) throws SQLException { |
|
285 |
private void makeStatus(IBotanicalName name, String nomStatusStr, Integer id) throws SQLException {
|
|
285 | 286 |
// ,[NomenclaturalStatus] |
286 | 287 |
|
287 | 288 |
if (StringUtils.isNotBlank(nomStatusStr)){ |
... | ... | |
455 | 456 |
|
456 | 457 |
|
457 | 458 |
|
458 |
private void makeAuthors(BotanicalName name, String autoren, Integer id) { |
|
459 |
private void makeAuthors(IBotanicalName name, String autoren, Integer id) {
|
|
459 | 460 |
String[] parsedAuthorTeams = getParsedAuthors(autoren); |
460 | 461 |
name.setBasionymAuthorship(getTeam(parsedAuthorTeams[0], id)); |
461 | 462 |
name.setExBasionymAuthorship(getTeam(parsedAuthorTeams[1], id)); |
... | ... | |
749 | 750 |
String family = rs.getString("family"); |
750 | 751 |
if (familyMap.get(family) == null ){ |
751 | 752 |
|
752 |
BotanicalName name = TaxonNameFactory.NewBotanicalInstance(Rank.FAMILY()); |
|
753 |
IBotanicalName name = TaxonNameFactory.NewBotanicalInstance(Rank.FAMILY());
|
|
753 | 754 |
name.setGenusOrUninomial(family); |
754 | 755 |
Taxon taxon = Taxon.NewInstance(name, state.getTransactionalSourceReference()); |
755 | 756 |
classification.addChildTaxon(taxon, null, null); |
Also available in: Unified diff
ref #6362, ref #6365 remove occurrences of NonViralName, BotanicalName and ZoologicalName in cdmlib-app