117 |
117 |
if(taxonBaseCL!=null){//null check necessary because not all taxa exist in the checklist
|
118 |
118 |
createParentChildNodes(checklistClassification, id, gueltString, taxZusatzString, taxonBaseCL, parentCL);
|
119 |
119 |
}
|
|
120 |
|
|
121 |
if(taxonBaseGL!= null && taxonBaseCL!=null
|
|
122 |
&& taxonBaseGL.getUuid().equals(taxonBaseCL.getUuid())){
|
|
123 |
RedListUtil.logMessage(id, "Same UUID for "+taxonBaseGL+ " (Gesamtliste) and "+taxonBaseCL+" (Checkliste", logger);
|
|
124 |
}
|
|
125 |
if(parentGL!=null && parentCL!=null && parentGL.getUuid().equals(parentCL.getUuid())){
|
|
126 |
RedListUtil.logMessage(id, "Same UUID for "+parentGL+ " (Gesamtliste) and "+parentCL+" (Checkliste", logger);
|
|
127 |
}
|
120 |
128 |
}
|
121 |
129 |
|
122 |
130 |
private void createParentChildNodes(Classification classification, long id, String gueltString,
|
123 |
131 |
String taxZusatzString, TaxonBase taxonBase, Taxon parent) {
|
124 |
|
if(parent==null){
|
125 |
|
RedListUtil.logMessage(id, "parent taxon of "+taxonBase+" is null." , logger);
|
126 |
|
return;
|
127 |
|
}
|
128 |
132 |
if(taxonBase==null){
|
129 |
|
RedListUtil.logMessage(id, "child taxon/synonym of "+parent+" is null." , logger);
|
|
133 |
RedListUtil.logMessage(id, "child taxon/synonym of "+parent+" is null. ("+classification.getTitleCache()+")" , logger);
|
130 |
134 |
return;
|
131 |
135 |
}
|
132 |
136 |
//taxon
|
... | ... | |
134 |
138 |
//misapplied name
|
135 |
139 |
String appendedPhrase = taxonBase.getAppendedPhrase();
|
136 |
140 |
if(appendedPhrase!=null && appendedPhrase.equals(RedListUtil.AUCT)){
|
|
141 |
if(parent==null){
|
|
142 |
RedListUtil.logMessage(id, "parent taxon of misapplied name "+taxonBase+" is null. ("+classification.getTitleCache()+")" , logger);
|
|
143 |
return;
|
|
144 |
}
|
137 |
145 |
parent.addMisappliedName((Taxon) taxonBase, null, null);
|
138 |
146 |
}
|
139 |
147 |
else{
|
... | ... | |
148 |
156 |
}
|
149 |
157 |
//synonym
|
150 |
158 |
else if(taxonBase.isInstanceOf(Synonym.class)){
|
|
159 |
if(parent==null){
|
|
160 |
RedListUtil.logMessage(id, "parent taxon of synonym "+taxonBase+" is null. ("+classification.getTitleCache()+")" , logger);
|
|
161 |
return;
|
|
162 |
}
|
151 |
163 |
//basionym
|
152 |
164 |
if(gueltString.equals(RedListUtil.GUELT_BASIONYM)){
|
153 |
165 |
parent.addHomotypicSynonym((Synonym) taxonBase, null, null);
|
... | ... | |
182 |
194 |
}
|
183 |
195 |
//set sec reference
|
184 |
196 |
taxonBase.setSec(classification.getReference());
|
|
197 |
taxonBase.setTitleCache(null, false);//refresh title cache
|
185 |
198 |
}
|
186 |
199 |
|
187 |
200 |
@Override
|
... | ... | |
219 |
232 |
Classification checklistClassification = Classification.NewInstance("Checkliste");
|
220 |
233 |
checklistClassification.setUuid(RedListUtil.checkListClassificationUuid);
|
221 |
234 |
Reference checklistReference = ReferenceFactory.newGeneric();
|
222 |
|
checklistReference.setUuid(RedListUtil.checkListClassificationUuid);
|
223 |
|
checklistReference.setTitle("Gesamtliste");
|
|
235 |
checklistReference.setUuid(RedListUtil.checkListReferenceUuid);
|
|
236 |
checklistReference.setTitle("Checkliste");
|
224 |
237 |
checklistClassification.setReference(checklistReference);
|
225 |
238 |
getClassificationService().save(checklistClassification);
|
226 |
239 |
}
|
Fix taxon node creation for nodes with no parents