Project

General

Profile

« Previous | Next » 

Revision 7691ed2a

Added by Andreas Müller almost 5 years ago

ref #8257 remove factory method for term node creation in app-import

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/greece/FloraHellenicaTermImport.java
435 435
            hasFeatureTree = true;
436 436
            return;
437 437
        }
438
        FeatureTree result = FeatureTree.NewInstance(state.getConfig().getUuidFeatureTree());
438
        FeatureTree<Feature> result = FeatureTree.NewInstance(state.getConfig().getUuidFeatureTree());
439 439
        result.setTitleCache(state.getConfig().getFeatureTreeTitle(), true);
440
        FeatureNode root = result.getRoot();
441
        FeatureNode newNode;
440
        FeatureNode<Feature> root = result.getRoot();
442 441
        ITermService service = getTermService();
443 442

  
444 443
        UUID uuid = FloraHellenicaTransformer.uuidFloraHellenicaTaxonInfoFeature;
445 444
        Feature newFeature = getFeature(state, uuid, "Taxon info", "Taxon info", null, null);
446
        newNode = FeatureNode.NewInstance(newFeature);
447
        root.addChild(newNode);
445
        root.addChild(newFeature);
448 446

  
449 447
        newFeature = (Feature)service.find(Feature.DISTRIBUTION().getUuid());
450
        newNode = FeatureNode.NewInstance(newFeature);
451
        root.addChild(newNode);
448
        root.addChild(newFeature);
452 449

  
453 450
        newFeature = (Feature)service.find(Feature.STATUS().getUuid());
454
        newNode = FeatureNode.NewInstance(newFeature);
455
        root.addChild(newNode);
451
        root.addChild(newFeature);
456 452
        newFeature.setSupportsCategoricalData(true);
457 453
        TermVocabulary<State> voc = this.getVocabularyService().find(FloraHellenicaTransformer.uuidFloraHellenicaStatusVoc);
458 454
        newFeature.addSupportedCategoricalEnumeration(voc);
......
463 459
        newFeature.setSupportsCategoricalData(true);
464 460
        voc = this.getVocabularyService().find(FloraHellenicaTransformer.uuidFloraHellenicaChorologicalVoc);
465 461
        newFeature.addSupportedCategoricalEnumeration(voc);
466
        newNode = FeatureNode.NewInstance(newFeature);
467
        root.addChild(newNode);
462
        root.addChild(newFeature);
468 463

  
469 464
        newFeature = (Feature)service.find(Feature.LIFEFORM().getUuid());
470
        newNode = FeatureNode.NewInstance(newFeature);
471
        root.addChild(newNode);
465
        root.addChild(newFeature);
472 466
        newFeature.setSupportsCategoricalData(true);
473 467
        voc = this.getVocabularyService().find(FloraHellenicaTransformer.uuidFloraHellenicaLifeformVoc);
474 468
        newFeature.addSupportedCategoricalEnumeration(voc);
475 469

  
476 470
        newFeature = (Feature)service.find(Feature.HABITAT().getUuid());
477
        newNode = FeatureNode.NewInstance(newFeature);
478
        root.addChild(newNode);
471
        root.addChild(newFeature);
479 472
        newFeature.setSupportsCategoricalData(true);
480 473
        voc = this.getVocabularyService().find(FloraHellenicaTransformer.uuidFloraHellenicaHabitatVoc);
481 474
        newFeature.addSupportedCategoricalEnumeration(voc);
482 475

  
483 476

  
484 477
        newFeature = (Feature)service.find(Feature.NOTES().getUuid());
485
        newNode = FeatureNode.NewInstance(newFeature);
486
        root.addChild(newNode);
478
        root.addChild(newFeature);
487 479

  
488 480
        getFeatureTreeService().saveOrUpdate(result);
489 481
        hasFeatureTree = true;

Also available in: Unified diff