Revision fe0647c6
Added by Patrick Plitzner almost 8 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForTaxonNode.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import eu.etaxonomy.cdm.api.service.IOccurrenceService; |
12 | 12 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
13 |
import eu.etaxonomy.cdm.api.service.config.FindOccurrencesConfigurator; |
|
13 | 14 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
14 | 15 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
15 | 16 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
... | ... | |
28 | 29 |
|
29 | 30 |
@Override |
30 | 31 |
protected void open(ExecutionEvent event, TaxonNode entity) { |
31 |
List<SpecimenOrObservationBase> specimens = CdmStore.getService(IOccurrenceService.class).listByAssociatedTaxon(SpecimenOrObservationBase.class, null, entity.getTaxon(), null, null, null, null, null); |
|
32 |
FindOccurrencesConfigurator config = new FindOccurrencesConfigurator(); |
|
33 |
UUID taxonUuid = entity.getTaxon().getUuid(); |
|
34 |
config.setAssociatedTaxonUuid(taxonUuid); |
|
35 |
List<SpecimenOrObservationBase> specimens = CdmStore.getService(IOccurrenceService.class).findByTitle(config).getRecords(); |
|
32 | 36 |
Collection<UUID> specimenUuids = new ArrayList<UUID>(); |
33 | 37 |
for (SpecimenOrObservationBase specimenOrObservationBase : specimens) { |
34 | 38 |
specimenUuids.add(specimenOrObservationBase.getUuid()); |
35 | 39 |
} |
36 | 40 |
try { |
37 |
EditorUtil.open(new DerivateViewEditorInput(specimenUuids)); |
|
41 |
EditorUtil.open(new DerivateViewEditorInput(specimenUuids, taxonUuid));
|
|
38 | 42 |
} catch (PartInitException e) { |
39 | 43 |
MessagingUtils.error(OpenDerivateViewHandler.class, "Derivative Editor could not be opened", e); |
40 | 44 |
} |
Also available in: Unified diff
Set taxon filter when opening derivativwe editor from taxon navigator
#5514