Project

General

Profile

« Previous | Next » 

Revision 09da8d56

Added by Andreas Müller almost 2 years ago

cleanup

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightClassificationExport.java
256 256
                    state.getNodeChildrenMap().put(root.getUuid(), childNodes);
257 257

  
258 258
                    // add root to node map
259

  
260 259
                }
261 260
                TaxonNodeDto rootDto = new TaxonNodeDto(root);
262 261
                UUID parentUuid = root.getParent() != null ? root.getParent().getUuid()
......
268 267
                    List<TaxonNodeDto> rootList = new ArrayList<>();
269 268
                    rootList.add(rootDto);
270 269
                    state.getNodeChildrenMap().put(parentUuid, rootList);
271

  
272 270
                }
273 271
                if (root.hasTaxon()) {
274 272
                    handleTaxon(state, root);
275

  
276 273
                }
277 274
            } catch (Exception e) {
278 275
                state.getResult().addException(e, "An unexpected error occurred when handling taxonNode "
......
297 294
                Taxon taxon = CdmBase.deproxy(taxonNode.getTaxon());
298 295

  
299 296
                try {
297
                    //accepted name
300 298
                    TaxonName name = taxon.getName();
301 299
                    handleName(state, name, taxon, true);
300

  
301
                    //homotypic group / synonyms
302 302
                    HomotypicalGroup homotypicGroup = taxon.getHomotypicGroup();
303 303
                    int index = 0;
304 304
                    int homotypicGroupIndex = 0;
......
318 318
                        homotypicGroupIndex++;
319 319
                    }
320 320

  
321
                    //pro parte synonyms
321 322
                    index = 0;
322 323
                    for (Taxon tax : taxon.getAllProParteSynonyms()) {
323 324
                        handleProPartePartialMisapplied(state, tax, taxon, true, false, index);
324 325
                        index++;
325 326
                    }
326 327

  
327

  
328
                    //misapplications
328 329
                    for (Taxon tax : taxon.getAllMisappliedNames()) {
329 330
                        handleProPartePartialMisapplied(state, tax, taxon, false, true, index);
330 331
                        index++;
331 332
                    }
332 333

  
334
                    //taxon table
333 335
                    CdmLightExportTable table = CdmLightExportTable.TAXON;
334 336
                    String[] csvLine = new String[table.getSize()];
335 337

  
......
357 359
                            taxonNode.getClassification());
358 360
                    csvLine[table.getIndex(CdmLightExportTable.CLASSIFICATION_TITLE)] = taxonNode.getClassification()
359 361
                            .getTitleCache();
360

  
361 362
                    csvLine[table.getIndex(CdmLightExportTable.PUBLISHED)] = taxon.isPublish() ? "1" : "0";
363

  
364
                    //taxon node
362 365
                    csvLine[table.getIndex(CdmLightExportTable.EXCLUDED)] = taxonNode.isExcluded() ? "1" : "0";
366
                    csvLine[table.getIndex(CdmLightExportTable.UNPLACED)] = taxonNode.isUnplaced() ? "1" : "0";
367
                    csvLine[table.getIndex(CdmLightExportTable.DOUBTFUL)] = taxonNode.isDoubtful() ? "1" : "0";
363 368
                    Map<Language, LanguageString> notesMap = taxonNode.getStatusNote();
364 369
                    String statusNotes = "";
365 370
                    if (!notesMap.isEmpty() && notesMap.size() == 1) {
......
373 378
                    }
374 379
                    csvLine[table.getIndex(CdmLightExportTable.STATUS_NOTES)] = statusNotes;
375 380

  
376
                    csvLine[table.getIndex(CdmLightExportTable.UNPLACED)] = taxonNode.isUnplaced() ? "1" : "0";
377
                    csvLine[table.getIndex(CdmLightExportTable.DOUBTFUL)] = taxonNode.isDoubtful() ? "1" : "0";
381
                    //process taxon line
378 382
                    state.getProcessor().put(table, taxon, csvLine);
383

  
384
                    //descriptions
379 385
                    handleDescriptions(state, taxon);
380 386
                } catch (Exception e) {
381 387
                    state.getResult().addException(e,
......
383 389
                    state.getResult().setState(ExportResultState.INCOMPLETE_WITH_ERROR);
384 390
                }
385 391
            }
386

  
387 392
        } catch (Exception e) {
388 393
            state.getResult().addException(e, "An unexpected error occurred when handling the taxon node of "
389 394
                    + cdmBaseStr(taxonNode.getTaxon()) + ", titleCache:"+ taxonNode.getTaxon().getTitleCache()+": " + e.getMessage());

Also available in: Unified diff