import java.util.UUID;\r
\r
import org.apache.lucene.index.CorruptIndexException;\r
-import org.apache.lucene.queryparser.classic.ParseException;\r
import org.hibernate.search.spatial.impl.Rectangle;\r
+import org.springframework.transaction.annotation.Transactional;\r
\r
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;\r
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;\r
import eu.etaxonomy.cdm.api.service.dto.FieldUnitDTO;\r
import eu.etaxonomy.cdm.api.service.dto.PreservedSpecimenDTO;\r
import eu.etaxonomy.cdm.api.service.pager.Pager;\r
+import eu.etaxonomy.cdm.api.service.search.LuceneParseException;\r
import eu.etaxonomy.cdm.api.service.search.SearchResult;\r
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;\r
-import eu.etaxonomy.cdm.model.common.ICdmBase;\r
import eu.etaxonomy.cdm.model.common.Language;\r
import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
import eu.etaxonomy.cdm.model.molecular.Sequence;\r
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;\r
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;\r
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
+import eu.etaxonomy.cdm.model.name.TaxonName;\r
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;\r
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;\r
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;\r
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;\r
+import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;\r
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;\r
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;\r
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;\r
import eu.etaxonomy.cdm.model.taxon.Taxon;\r
import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;\r
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;\r
+import eu.etaxonomy.cdm.persistence.dto.SpecimenNodeWrapper;\r
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;\r
import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
\r
* properties to be initialized\r
* @return\r
*/\r
- public Pager<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type, TaxonNameBase determinedAs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);\r
+ public Pager<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type, TaxonName determinedAs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);\r
\r
/**\r
* Returns a List of Media that are associated with a given occurence\r
* {@link DerivedUnit}s found in the data base.\r
* @return a list of {@link UuidAndTitleCache}\r
*/\r
- public List<UuidAndTitleCache<DerivedUnit>> getDerivedUnitUuidAndTitleCache();\r
+ public List<UuidAndTitleCache<DerivedUnit>> getDerivedUnitUuidAndTitleCache(Integer limit, String pattern);\r
\r
public DerivedUnitFacade getDerivedUnitFacade(DerivedUnit derivedUnit, List<String> propertyPaths) throws DerivedUnitFacadeNotSupportedException;\r
\r
public <T extends SpecimenOrObservationBase> List<T> listByAssociatedTaxon(Class<T> type, Set<TaxonRelationshipEdge> includeRelationships,\r
Taxon associatedTaxon, Integer maxDepth, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
\r
+ /**\r
+ * The method will search for specimen associated with the taxon nodes.<br>\r
+ * It will search for 3 possible association types: <br>\r
+ * - via IndividualAssociations of the taxon<br>\r
+ * - via TypeDesignations of the taxon name<br>\r
+ * - via Determinations of the taxon or taxon name<br>\r
+ * <br>\r
+ * more are covered in\r
+ * {@link IOccurrenceService#findByTitle(IIdentifiableEntityServiceConfigurator)}\r
+ * @param taxonNodeUuids\r
+ * a list of {@link UUID}s of the taxon nodes\r
+ * @param limit\r
+ * @param start\r
+ * @param orderHints\r
+ * @return a list of {@link SpecimenNodeWrapper} containing the\r
+ * {@link TaxonNode} and the corresponding {@link UuidAndTitleCache}\r
+ * object for the specimen found for this taxon node\r
+ */\r
+ public List<SpecimenNodeWrapper> listUuidAndTitleCacheByAssociatedTaxon(List<UUID> taxonNodeUuids,\r
+ Integer limit, Integer start, List<OrderHint> orderHints);\r
+\r
+\r
/**\r
* Lists all instances of {@link FieldUnit} which are\r
* associated <b>directly or indirectly</b>with the <code>taxon</code> specified\r
/**\r
* Retrieves all {@link FieldUnit}s for the {@link SpecimenOrObservationBase} with the given {@link UUID}.<br>\r
* @param specimenUuid the UUID of the specimen\r
+ * @param propertyPaths the property path\r
* @return either a collection of FieldUnits this specimen was derived from, the FieldUnit itself\r
* if this was a FieldUnit or an empty collection if no FieldUnits were found\r
*/\r
- public Collection<FieldUnit> getFieldUnits(UUID specimenUuid);\r
+ public Collection<FieldUnit> getFieldUnits(UUID specimenUuid, List<String> propertyPaths);\r
\r
/**\r
* @param clazz\r
* @throws ParseException\r
*/\r
Pager<SearchResult<SpecimenOrObservationBase>> findByFullText(Class<? extends SpecimenOrObservationBase> clazz,\r
- String queryString, Rectangle boundingBox, List<Language> languages, boolean highlightFragments, Integer pageSize,\r
- Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException,\r
- IOException, ParseException;\r
+ String queryString, Rectangle boundingBox, List<Language> languages, boolean highlightFragments,\r
+ Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)\r
+ throws IOException, LuceneParseException;\r
/**\r
* See {@link #listByAssociatedTaxon(Class, Set, String, Integer, Integer, Integer, List, List)}\r
*\r
*/\r
public PreservedSpecimenDTO assemblePreservedSpecimenDTO(DerivedUnit derivedUnit);\r
\r
- /**\r
- * Returns a collection of {@link ICdmBase}s that are not persisted via cascading when saving the given specimen (mostly DefinedTerms).\r
- * @param specimen the specimen that is checked for non-cascaded elements.\r
- * @return collection of non-cascaded element associated with the specimen\r
- */\r
- public Collection<ICdmBase> getNonCascadedAssociatedElements(SpecimenOrObservationBase<?> specimen);\r
-\r
/**\r
* Deletes the specified specimen according to the setting in the {@link SpecimenDeleteConfigurator}.<br>\r
* @param specimen the specimen which shoul be deleted\r
*/\r
public List<DerivedUnit> getAllChildDerivatives(UUID specimenUuid);\r
\r
+ /**\r
+ * Returns all {@link FieldUnit}s that are referencing this {@link GatheringEvent}\r
+ * @param gatheringEventUuid the {@link UUID} of the gathering event\r
+ * @return a list of field units referencing the gathering event\r
+ */\r
+ public List<FieldUnit> getFieldUnitsForGatheringEvent(UUID gatheringEventUuid);\r
+\r
+\r
+ /**\r
+ * Returns a list of {@link UuidAndTitleCache} for the specimens found with the\r
+ * given configurator\r
+ * @param config the configurator for the search\r
+ * @return a list of UuidAndTitleCache object\r
+ */\r
+ @Transactional(readOnly = true)\r
+ public Pager<UuidAndTitleCache<SpecimenOrObservationBase>> findByTitleUuidAndTitleCache(\r
+ FindOccurrencesConfigurator config);\r
+\r
}\r