import java.util.UUID;
import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.api.utility.DescriptionUtility;
import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.Marker;
import eu.etaxonomy.cdm.model.common.MarkerType;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Distribution;
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.description.FeatureTree;
-import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
-import eu.etaxonomy.cdm.model.description.Scope;
+import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.persistence.dao.IBeanInitializer;
+import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.cdm.persistence.query.OrderHint;
public interface IDescriptionService extends IIdentifiableEntityService<DescriptionBase> {
*
* @see #pageMarkedTaxonDescriptions(Taxon, Set, Set, Set, Integer, Integer, List)
*/
- public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+ public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
/**
* Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager containing TaxonDescription instances
*/
- public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+ public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
/**
* @see {@link #pageTaxonDescriptions(Taxon, Set, Set, Integer, Integer, List)}
* @param propertyPaths
* @return
*/
- public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+ public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
* @param propertyPaths
* @return
*/
- public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+ public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
/**
* Returns all {@link Media} attached to a taxon via TaxonDescription.elements.media.
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager containing TaxonDescription instances
*/
- public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase presence, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
+ public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTerm presence, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
/**
* Returns a Paged List of DescriptionElementBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
public <T extends DescriptionElementBase> Pager<T> pageDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
- public DistributionTree getOrderedDistributions(Set<TaxonDescription> taxonDescriptions, Set<NamedAreaLevel> levels, List<String> propertyPaths);
+ /**
+ * @param taxonDescriptions
+ * @param subAreaPreference
+ * enables the <b>Sub area preference rule</b> if set to true,
+ * see {@link DescriptionUtility#filterDistributions(Collection,
+ * boolean, boolean}
+
+ * @param statusOrderPreference
+ * enables the <b>Status order preference rule</b> if set to
+ * true, see {@link
+ * DescriptionUtility#filterDistributions(Collection, boolean,
+ * boolean}
+ * @param hideMarkedAreas
+ * distributions where the area has a {@link Marker} with one of
+ * the specified {@link MarkerType}s will be skipped, see
+ * {@link DescriptionUtility#filterDistributions(Collection, boolean, boolean, Set)}
+ * @param omitLevels
+ * A Set NamedArea levels to omit - optional
+ * @param propertyPaths
+ * the initialization strategy
+ *
+ * @return
+ * @deprecated use {@link IEditGeoService#composeDistributionInfoFor()} instead
+ */
+ @Deprecated
+ public DistributionTree getOrderedDistributions(
+ Set<TaxonDescription> taxonDescriptions,
+ boolean subAreaPreference,
+ boolean statusOrderPreference,
+ Set<MarkerType> hideMarkedAreas,
+ Set<NamedAreaLevel> omitLevels, List<String> propertyPaths);
/**
* Generate a string representation of the structured <code>description</code> supplied in natural language
*/
public void moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements, DescriptionBase targetDescription, boolean isPaste);
+ /**
+ * Pager method to get all {@link NamedAreas} instances which are currently used
+ * by {@link Distribution} elements.
+ *
+ * @param pageSize
+ * The maximum number of description elements returned
+ * @param pageNumber
+ * The offset (in pageSize chunks) from the start of the result
+ * set (0 - based)
+ * @param propertyPaths
+ * Properties to initialize in the returned entities, following
+ * the syntax described in
+ * {@link IBeanInitializer#initialize(Object, List)}
+ * @return a Pager for all NamedAreas instances which are currently in use.
+ *
+ */
+ public Pager<TermDto> pageNamedAreasInUse(boolean includeAllParents, Integer pageSize,
+ Integer pageNumber);
+
+ UUID deleteDescription(DescriptionBase description);
+
}
\ No newline at end of file