Revision fd411b34
Added by Andreas Müller about 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/merging/FaunaEuErmsMergeActivator.java | ||
---|---|---|
30 | 30 |
import eu.etaxonomy.cdm.model.description.Distribution; |
31 | 31 |
import eu.etaxonomy.cdm.model.description.Feature; |
32 | 32 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
33 |
import eu.etaxonomy.cdm.model.name.IZoologicalName; |
|
34 | 33 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
35 | 34 |
import eu.etaxonomy.cdm.model.name.Rank; |
36 | 35 |
import eu.etaxonomy.cdm.model.reference.Reference; |
... | ... | |
139 | 138 |
// which information should be used can be found in last row -> needs to be done manually |
140 | 139 |
if (Integer.parseInt(row.get(18)) == 1){ |
141 | 140 |
//isFaunaEu = 1 -> copy the author of Fauna Europaea to Erms |
142 |
if (((IZoologicalName)taxonFaunaEu.getName()).getBasionymAuthorship()!= null){
|
|
143 |
((IZoologicalName)taxonErms.getName()).setBasionymAuthorship(((IZoologicalName)taxonFaunaEu.getName()).getBasionymAuthorship());
|
|
141 |
if (taxonFaunaEu.getName().getBasionymAuthorship()!= null){
|
|
142 |
taxonErms.getName().setBasionymAuthorship(taxonFaunaEu.getName().getBasionymAuthorship());
|
|
144 | 143 |
} |
145 |
if (((IZoologicalName)taxonFaunaEu.getName()).getCombinationAuthorship()!= null){
|
|
146 |
((IZoologicalName)taxonErms.getName()).setCombinationAuthorship(((IZoologicalName)taxonFaunaEu.getName()).getCombinationAuthorship());
|
|
144 |
if (taxonFaunaEu.getName().getCombinationAuthorship()!= null){
|
|
145 |
taxonErms.getName().setCombinationAuthorship(taxonFaunaEu.getName().getCombinationAuthorship());
|
|
147 | 146 |
} |
148 |
((IZoologicalName)taxonErms.getName()).generateAuthorship();
|
|
147 |
taxonErms.getName().generateAuthorship();
|
|
149 | 148 |
taxaToSave.add(taxonErms); |
150 | 149 |
}else{ |
151 |
if (((IZoologicalName)taxonErms.getName()).getBasionymAuthorship()!= null){
|
|
152 |
((IZoologicalName)taxonFaunaEu.getName()).setBasionymAuthorship(((IZoologicalName)taxonErms.getName()).getBasionymAuthorship());
|
|
150 |
if (taxonErms.getName().getBasionymAuthorship()!= null){
|
|
151 |
taxonFaunaEu.getName().setBasionymAuthorship(taxonErms.getName().getBasionymAuthorship());
|
|
153 | 152 |
} |
154 |
if (((IZoologicalName)taxonErms.getName()).getCombinationAuthorship()!= null){
|
|
155 |
((IZoologicalName)taxonFaunaEu.getName()).setCombinationAuthorship(((IZoologicalName)taxonErms.getName()).getCombinationAuthorship());
|
|
153 |
if (taxonErms.getName().getCombinationAuthorship()!= null){
|
|
154 |
taxonFaunaEu.getName().setCombinationAuthorship(taxonErms.getName().getCombinationAuthorship());
|
|
156 | 155 |
} |
157 |
((IZoologicalName)taxonFaunaEu.getName()).generateAuthorship();
|
|
156 |
taxonFaunaEu.getName().generateAuthorship();
|
|
158 | 157 |
taxaToSave.add(taxonFaunaEu); |
159 | 158 |
} |
160 | 159 |
} |
... | ... | |
180 | 179 |
mergeErmsAccFaunaEuSyn(accErmsSynFaunaEu); |
181 | 180 |
|
182 | 181 |
//find all taxa accepted in faunaEu, but synonyms in Erms and the same rank |
183 |
List<List<String>> synErmsAccFaunaEu = new ArrayList<List<String>>();
|
|
182 |
List<List<String>> synErmsAccFaunaEu = new ArrayList<>(); |
|
184 | 183 |
for (List<String> rowList: diffStatus){ |
185 | 184 |
if ((rowList.get(5).equals("accepted")) && (rowList.get(rankFaunaEu).equals(rowList.get(rankErms)))){ |
186 | 185 |
//both conditions are true |
... | ... | |
188 | 187 |
} |
189 | 188 |
} |
190 | 189 |
mergeErmsSynFaunaEuAcc(synErmsAccFaunaEu); |
191 |
|
|
192 |
|
|
193 | 190 |
} |
194 | 191 |
|
195 | 192 |
private void mergeSameStatus(){ |
... | ... | |
450 | 447 |
}else { |
451 | 448 |
acceptedErmsTaxon = (Taxon)erms; |
452 | 449 |
} |
453 |
TaxonNode node = ((Taxon)acceptedErmsTaxon).getTaxonNode(ermsClassification);
|
|
450 |
TaxonNode node = acceptedErmsTaxon.getTaxonNode(ermsClassification);
|
|
454 | 451 |
for (TaxonNode child:((Taxon)faunaEu).getTaxonNode(faunaEuClassification).getChildNodes()) { |
455 | 452 |
//add pesi reference as reference?? |
456 | 453 |
node.addChildNode(child, null, null); |
Also available in: Unified diff
ref #1447 remove unncessary casts and cleanup