Revision a7c0fe0a
Added by Patrick Plitzner over 8 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateSearchCompositeController.java | ||
---|---|---|
80 | 80 |
config.setSpecimenType(specimenType.equals(SpecimenOrObservationType.Unknown)?null:specimenType);//unknown := all types |
81 | 81 |
config.setTitleSearchString(queryString); |
82 | 82 |
if(selectedTaxon!=null){ |
83 |
config.setRetrieveIndirectlyAssociatedSpecimens(true); |
|
84 | 83 |
config.setSpecimenType(null); |
85 | 84 |
} |
86 | 85 |
|
... | ... | |
107 | 106 |
Collection<TaxonBase<?>> associatedTaxa = CdmStore.getService(IOccurrenceService.class).listAssociatedTaxa(specimenOrObservationBase, null, null, null, null); |
108 | 107 |
if(!associatedTaxa.isEmpty()){ |
109 | 108 |
specimenWithAssociations.add(specimenOrObservationBase); |
109 |
specimenWithAssociations.addAll(CdmStore.getService(IOccurrenceService.class).getFieldUnits(specimenOrObservationBase.getUuid())); |
|
110 | 110 |
} |
111 | 111 |
} |
112 | 112 |
} |
113 | 113 |
if(selectionIndex==DerivateSearchComposite.UNASSIGNED_SPECIMENS){ |
114 |
for (SpecimenOrObservationBase<?> specimenOrObservationBase : specimenWithAssociations) { |
|
115 |
derivativeEditor.removeHierarchy(specimenOrObservationBase); |
|
116 |
} |
|
117 |
derivativeEditor.updateRootEntities(); |
|
114 |
occurrences.removeAll(specimenWithAssociations); |
|
118 | 115 |
} |
119 |
else{ |
|
120 |
if(selectionIndex==DerivateSearchComposite.ASSIGNED_SPECIMENS){ |
|
121 |
occurrences = new ArrayList<SpecimenOrObservationBase>(specimenWithAssociations); |
|
122 |
} |
|
123 |
List<UUID> derivateUuids = new ArrayList<UUID>(); |
|
124 |
for (SpecimenOrObservationBase specimenOrObservationBase : occurrences) { |
|
125 |
derivateUuids.add(specimenOrObservationBase.getUuid()); |
|
126 |
} |
|
127 |
derivativeEditor.updateRootEntities(derivateUuids); |
|
116 |
else if(selectionIndex==DerivateSearchComposite.ASSIGNED_SPECIMENS){ |
|
117 |
occurrences = new ArrayList<SpecimenOrObservationBase>(specimenWithAssociations); |
|
118 |
} |
|
119 |
List<UUID> derivateUuids = new ArrayList<UUID>(); |
|
120 |
for (SpecimenOrObservationBase specimenOrObservationBase : occurrences) { |
|
121 |
derivateUuids.add(specimenOrObservationBase.getUuid()); |
|
128 | 122 |
} |
123 |
derivativeEditor.updateRootEntities(derivateUuids); |
|
129 | 124 |
} |
130 | 125 |
|
131 | 126 |
@Override |
Also available in: Unified diff
Fix taxon assignment filter