bug #7313
closed
eu.etaxonomy.cdm.dataInserter.RegistrationRequiredDataInserter add all terms to vocabulary
Added by Andreas Kohlbecker about 6 years ago.
Updated almost 6 years ago.
Description
Im eu.etaxonomy.cdm.dataInserter.RegistrationRequiredDataInserter
werden KindOfUnitTerms angelegt:
if(repo.getTermService().find(KindOfUnitTerms.SPECIMEN().getUuid()) == null){
repo.getTermService().save(KindOfUnitTerms.SPECIMEN());
}
if(repo.getTermService().find(KindOfUnitTerms.PUBLISHED_IMAGE().getUuid()) == null){
repo.getTermService().save(KindOfUnitTerms.PUBLISHED_IMAGE());
}
if(repo.getTermService().find(KindOfUnitTerms.UNPUBLISHED_IMAGE().getUuid()) == null){
repo.getTermService().save(KindOfUnitTerms.UNPUBLISHED_IMAGE());
}
if(repo.getTermService().find(KindOfUnitTerms.CULTURE_METABOLIC_INACTIVE().getUuid()) == null){
repo.getTermService().save(KindOfUnitTerms.CULTURE_METABOLIC_INACTIVE());
}
Die müssen in ein Vocab.
a.mueller:
Ja, das sollte man dann in den Inserter mit aufnehmen.
Möglichst die UUID von dem voc aus Phycobank nehmen, damit immer die selbe verwendet wird.
- Description updated (diff)
The original description was referring to terms which have been created during IAPT import, which has already be run and which will never be used again. So the only terms that still need to be associated with Vocabularies are are the KindOfUnitTerms (See new issue description)
- Priority changed from New to Priority14
- Status changed from New to In Progress
- Priority changed from Priority14 to Highest
- Status changed from In Progress to Resolved
- % Done changed from 0 to 50
- Assignee changed from Andreas Kohlbecker to Andreas Müller
- Status changed from Resolved to Feedback
- Assignee changed from Andreas Müller to Andreas Kohlbecker
This should work.
Personally I would first load/save the voc and then check the terms and add each term which is not yet attached to a vocabulary. This avoids saving a term without a voc at any time (maybe in future it will be forced). However, this is minor.
We could also remove "txStatus.flush();" before commit as it is redundant.
Final note: the static terms are often used only to retrieve the uuid. Why not making the static uuids public them self (while the static terms are probably not really needed). But this is also minor code styling.
Andreas Müller wrote:
This should work.
Personally I would first load/save the voc and then check the terms and add each term which is not yet attached to a vocabulary. This avoids saving a term without a voc at any time (maybe in future it will be forced). However, this is minor.
Agreed and code modified.
We could also remove "txStatus.flush();" before commit as it is redundant.
Agreed and removed this line.
Final note: the static terms are often used only to retrieve the uuid. Why not making the static uuids public them self (while the static terms are probably not really needed). But this is also minor code styling.
The way terms are used is anyway a bit error prone and should be changed in the registration code. I will open another ticket for this.
- Copied to bug #7519: Avoid static terms added
- Status changed from Feedback to Closed
- % Done changed from 50 to 100
new ticket #7519 or remaining clean up.
I think wen can close this issue now. If you don't agree, Andreas, please reopen.
- Subject changed from eu.etaxonomy.cdm.dataInserter.RegistrationRequiredDataInserter add all term to vocabulary to eu.etaxonomy.cdm.dataInserter.RegistrationRequiredDataInserter add all terms to vocabulary
- Related to bug #8995: Guarantee a term always has a vocabulary added
Also available in: Atom
PDF