Revision d80db3aa
Added by Andreas Müller almost 5 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/data/FullCoverageDataGenerator.java | ||
---|---|---|
103 | 103 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus; |
104 | 104 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType; |
105 | 105 |
import eu.etaxonomy.cdm.model.name.Rank; |
106 |
import eu.etaxonomy.cdm.model.name.Registration; |
|
106 | 107 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation; |
107 | 108 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus; |
108 | 109 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
... | ... | |
126 | 127 |
import eu.etaxonomy.cdm.model.taxon.SynonymType; |
127 | 128 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
128 | 129 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
130 |
import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation; |
|
129 | 131 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; |
130 | 132 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
131 | 133 |
import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser; |
... | ... | |
150 | 152 |
|
151 | 153 |
|
152 | 154 |
public void fillWithData(Session session){ |
153 |
List<CdmBase> cdmBases = new ArrayList<CdmBase>();
|
|
155 |
List<CdmBase> cdmBases = new ArrayList<>(); |
|
154 | 156 |
|
155 | 157 |
createAgents(cdmBases); |
156 | 158 |
|
... | ... | |
422 | 424 |
cdmBases.add(leaveLengthNode); |
423 | 425 |
|
424 | 426 |
|
427 |
//DescriptiveDataSet |
|
425 | 428 |
DescriptiveDataSet descriptiveDataSet = DescriptiveDataSet.NewInstance(); |
426 | 429 |
descriptiveDataSet.addDescription(taxonDescription); |
427 | 430 |
descriptiveDataSet.setLabel("My Descriptive Dataset"); |
428 | 431 |
descriptiveDataSet.getDescriptiveSystem(); |
429 | 432 |
handleAnnotatableEntity(descriptiveDataSet); |
433 |
descriptiveDataSet.addGeoFilterArea(Country.GERMANY()); |
|
434 |
Classification classification = Classification.NewInstance("DescriptiveDataSet subtree classification"); |
|
435 |
Taxon subTreeTaxon = getTaxon(); |
|
436 |
TaxonNode subtree = classification.addChildTaxon(subTreeTaxon, null, null); |
|
437 |
descriptiveDataSet.addTaxonSubtree(subtree); |
|
438 |
|
|
439 |
cdmBases.add(classification); |
|
440 |
cdmBases.add(subtree); |
|
430 | 441 |
|
431 | 442 |
|
432 | 443 |
//polytomous keys |
... | ... | |
647 | 658 |
classification.addGeoScope(Country.GERMANY()); |
648 | 659 |
classification.putDescription(Language.ENGLISH(), "An interesting classification"); |
649 | 660 |
|
650 |
|
|
651 | 661 |
TaxonNode node = classification.addChildTaxon(taxon, sec,"22"); |
652 | 662 |
handleIdentifiableEntity(classification); |
653 | 663 |
handleAnnotatableEntity(node); |
664 |
node.putExcludedNote(Language.DEFAULT(), "Excluded note"); |
|
665 |
DefinedTerm agentRelationType = DefinedTerm.NewTaxonNodeAgentRelationTypeInstance(null, "agentRelation", "ar"); |
|
666 |
Person agent = Person.NewTitledInstance("Related agent"); |
|
667 |
TaxonNodeAgentRelation agentRelation = node.addAgentRelation(agentRelationType, agent); |
|
668 |
handleAnnotatableEntity(agentRelation); |
|
654 | 669 |
|
655 | 670 |
Taxon childTaxon = Taxon.NewInstance(synName, sec); |
656 | 671 |
node.addChildTaxon(childTaxon, sec, "44"); |
... | ... | |
661 | 676 |
cdmBases.add(concept); |
662 | 677 |
cdmBases.add(childTaxon); |
663 | 678 |
cdmBases.add(classification); |
679 |
cdmBases.add(agentRelationType); |
|
664 | 680 |
|
665 | 681 |
|
666 | 682 |
} |
... | ... | |
863 | 879 |
viralName.setAcronym("acronym"); |
864 | 880 |
handleIdentifiableEntity(viralName); |
865 | 881 |
|
866 |
|
|
882 |
//Registration |
|
883 |
Registration registration = Registration.NewInstance("registration identifier", |
|
884 |
"specificIdentifier", speciesZooName, null); |
|
885 |
registration.addTypeDesignation(specimenDesig); |
|
886 |
registration.setRegistrationDate(DateTime.now()); |
|
887 |
Registration blockingRegistration = Registration.NewInstance(); |
|
888 |
registration.addBlockedBy(blockingRegistration); |
|
889 |
registration.setInstitution(Institution.NewInstance()); |
|
890 |
User submitter = User.NewInstance("submitter", "12345"); |
|
891 |
registration.setSubmitter(submitter); |
|
892 |
|
|
893 |
cdmBases.add(submitter); |
|
867 | 894 |
cdmBases.add(bacName); |
868 | 895 |
cdmBases.add(botName); |
869 | 896 |
cdmBases.add(viralName); |
870 | 897 |
cdmBases.add(zooName); |
898 |
cdmBases.add(botName2); |
|
871 | 899 |
} |
872 | 900 |
|
873 | 901 |
private void handleEventBase(EventBase event){ |
Also available in: Unified diff
Adapt FullCoverageDataGenerator to model 4.7 updates