Revision b558cbe6
Added by Patrick Plitzner about 5 years ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/OccurrenceServiceImpl.java | ||
---|---|---|
1611 | 1611 |
return new DefaultPagerImpl<>(config.getPageNumber(), occurrences.size(), config.getPageSize(), occurrences); |
1612 | 1612 |
} |
1613 | 1613 |
|
1614 |
@Override |
|
1615 |
public List<PreservedSpecimenDTO> findByTitlePreservedSpecimenDTO(FindOccurrencesConfigurator config) { |
|
1616 |
Taxon taxon = null; |
|
1617 |
if(config.getAssociatedTaxonUuid()!=null){ |
|
1618 |
TaxonBase<?> taxonBase = taxonService.load(config.getAssociatedTaxonUuid()); |
|
1619 |
if(taxonBase.isInstanceOf(Taxon.class)){ |
|
1620 |
taxon = CdmBase.deproxy(taxonBase, Taxon.class); |
|
1621 |
} |
|
1622 |
} |
|
1623 |
TaxonName taxonName = null; |
|
1624 |
if(config.getAssociatedTaxonNameUuid()!=null){ |
|
1625 |
taxonName = nameService.load(config.getAssociatedTaxonNameUuid()); |
|
1626 |
} |
|
1627 |
List<DerivedUnit> occurrences = new ArrayList<>(); |
|
1628 |
occurrences.addAll(dao.findOccurrences(DerivedUnit.class, |
|
1629 |
config.getTitleSearchString(), config.getSignificantIdentifier(), |
|
1630 |
config.getSpecimenType(), taxon, taxonName, config.getMatchMode(), null, null, |
|
1631 |
config.getOrderHints(), null)); |
|
1632 |
|
|
1633 |
List<PreservedSpecimenDTO> dtos = new ArrayList<>(); |
|
1634 |
occurrences.forEach(derivedUnit->dtos.add(assemblePreservedSpecimenDTO(derivedUnit))); |
|
1635 |
return dtos; |
|
1636 |
} |
|
1637 |
|
|
1614 | 1638 |
@Override |
1615 | 1639 |
public <S extends SpecimenOrObservationBase> Pager<S> findByTitle( |
1616 | 1640 |
IIdentifiableEntityServiceConfigurator<S> config) { |
Also available in: Unified diff
ref #8011 Add service method to find DerivateDtos