Revision 417a8287
Added by Katja Luther over 6 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightClassificationExport.java | ||
---|---|---|
16 | 16 |
import java.util.List; |
17 | 17 |
import java.util.Map; |
18 | 18 |
import java.util.Set; |
19 |
import java.util.UUID; |
|
20 | 19 |
|
21 | 20 |
import org.apache.commons.lang3.StringUtils; |
22 | 21 |
import org.springframework.stereotype.Component; |
... | ... | |
147 | 146 |
|
148 | 147 |
TaxonNode node = partitioner.next(); |
149 | 148 |
while (node != null){ |
150 |
handleTaxonNode(state, node.getUuid());
|
|
149 |
handleTaxonNode(state, node); |
|
151 | 150 |
node = partitioner.next(); |
152 | 151 |
} |
153 | 152 |
|
... | ... | |
167 | 166 |
* @param state |
168 | 167 |
* @param classificationUuid |
169 | 168 |
*/ |
170 |
private void handleTaxonNode(CdmLightExportState state, UUID taxonNodeUuid) {
|
|
169 |
private void handleTaxonNode(CdmLightExportState state, TaxonNode taxonNode) {
|
|
171 | 170 |
try { |
172 |
TaxonNode taxonNode = getTaxonNodeService().find(taxonNodeUuid); |
|
171 |
// TaxonNode taxonNode = getTaxonNodeService().find(taxonNodeUuid);
|
|
173 | 172 |
|
174 | 173 |
if (taxonNode == null){ |
175 |
String message = String.format("TaxonNode for given taxon node UUID not found. No data imported for %s", taxonNodeUuid.toString());
|
|
174 |
String message = "TaxonNode for given taxon node UUID not found. ";
|
|
176 | 175 |
//TODO |
177 | 176 |
state.getResult().addWarning(message); |
178 | 177 |
}else{ |
... | ... | |
180 | 179 |
if (root.hasTaxon()){ |
181 | 180 |
handleTaxon(state, root); |
182 | 181 |
}else{ |
183 |
for (TaxonNode child : root.getChildNodes()){ |
|
184 |
handleTaxon(state, child); |
|
185 |
//TODO progress monitor |
|
186 |
} |
|
182 |
// for (TaxonNode child : root.getChildNodes()){
|
|
183 |
// handleTaxon(state, child);
|
|
184 |
// //TODO progress monitor
|
|
185 |
// }
|
|
187 | 186 |
} |
188 | 187 |
} |
189 | 188 |
} catch (Exception e) { |
190 | 189 |
state.getResult().addException(e, "An unexpected error occurred when handling classification " + |
191 |
taxonNodeUuid + ": " + e.getMessage() + e.getStackTrace());
|
|
190 |
taxonNode.getUuid() + ": " + e.getMessage() + e.getStackTrace());
|
|
192 | 191 |
} |
193 | 192 |
} |
194 | 193 |
|
Also available in: Unified diff
move initialize to constructor and small changes in cdmlightexport