354 |
354 |
|
355 |
355 |
boolean isType = false;
|
356 |
356 |
//type designation extension
|
357 |
|
if(typeDesignations.get(derivedUnit)!=null){
|
|
357 |
if(typeDesignations.get(derivedUnit)!=null && !typeDesignations.get(derivedUnit).isEmpty()){
|
358 |
358 |
isType = true;
|
359 |
359 |
}
|
360 |
360 |
if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.FieldUnit){
|
... | ... | |
434 |
434 |
return multiLinkSingleReads;
|
435 |
435 |
}
|
436 |
436 |
|
437 |
|
public void initCache(List<SpecimenOrObservationBase> derivates) {
|
|
437 |
public void initCache(Collection<SpecimenOrObservationBase<?>> rootElements) {
|
438 |
438 |
DerivateLabelProvider.multiLinkSingleReads = new HashSet<SingleRead>();
|
439 |
439 |
DerivateLabelProvider.typeDesignations = new HashMap<DerivedUnit, Collection<SpecimenTypeDesignation>>();
|
440 |
440 |
for(Entry<SingleRead, Collection<Sequence>> entry:CdmStore.getService(ISequenceService.class).getSingleReadSequencesMap().entrySet()){
|
... | ... | |
442 |
442 |
multiLinkSingleReads.add(entry.getKey());
|
443 |
443 |
}
|
444 |
444 |
}
|
445 |
|
Collection<DerivedUnit> derivedUnits = new ArrayList<DerivedUnit>();
|
446 |
|
for (SpecimenOrObservationBase specimenOrObservationBase : derivates) {
|
447 |
|
if(specimenOrObservationBase.isInstanceOf(DerivedUnit.class)){
|
448 |
|
derivedUnits.add(HibernateProxyHelper.deproxy(specimenOrObservationBase, DerivedUnit.class));
|
|
445 |
if(rootElements!=null){
|
|
446 |
Collection<DerivedUnit> derivedUnits = new ArrayList<DerivedUnit>();
|
|
447 |
for (SpecimenOrObservationBase specimenOrObservationBase : rootElements) {
|
|
448 |
derivedUnits.addAll(CdmStore.getService(IOccurrenceService.class).getAllChildDerivatives(specimenOrObservationBase.getUuid()));
|
|
449 |
if(specimenOrObservationBase.isInstanceOf(DerivedUnit.class)){
|
|
450 |
derivedUnits.add(HibernateProxyHelper.deproxy(specimenOrObservationBase, DerivedUnit.class));
|
|
451 |
}
|
449 |
452 |
}
|
|
453 |
typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(derivedUnits, null, null, null, null);
|
450 |
454 |
}
|
451 |
|
typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(derivedUnits, null, null, null, null);
|
452 |
455 |
}
|
453 |
456 |
|
454 |
457 |
}
|
Refactoring type designation gathering according to model change