newest changes for INameService.delete
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IDescriptionService.java
index def5858f2dbb3c4ad1fef6e17ccbc21a3bbc236f..aee1ee08e25a767cbd399b39c7d03eb139937d5c 100644 (file)
@@ -21,12 +21,9 @@ import eu.etaxonomy.cdm.model.common.Annotation;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
-import eu.etaxonomy.cdm.model.common.VersionableEntity;
 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.FeatureNode;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
 import eu.etaxonomy.cdm.model.description.Scope;
@@ -134,18 +131,10 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
         * @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 BeanInitializer#initialize(Object, List)}
         * @return a Pager containing DescriptionElementBase instances
-        */
-       public Pager<DescriptionElementBase> getDescriptionElements(DescriptionBase description,Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
-       
-       /**
         * 
-        * @param taxonDescriptions
-        * @param omitLevels
-        * @return
+        * FIXME candidate for harmonization - rename to pageDescriptionElements
         */
-       public NamedAreaTree getOrderedDistributions(Set<TaxonDescription> taxonDescriptions, 
-                                                                                                Set<NamedAreaLevel> omitLevels);
-               
+       public Pager<DescriptionElementBase> getDescriptionElements(DescriptionBase description,Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
        
        /**
         * Returns description elements of type <TYPE>, belonging to a given description, optionally filtered by one or more features
@@ -184,9 +173,24 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
         * @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 BeanInitializer#initialize(Object, List)}
         * @return a Pager containing TaxonDescription instances
+        * 
+        * FIXME candidate for harmonization - rename to pageTaxonDescriptions
         */
        public Pager<TaxonDescription> getTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
        
+       /**
+        * @see {@link #getTaxonDescriptions(Taxon, Set, Set, Integer, Integer, List)}
+        * 
+        * @param taxon
+        * @param scopes
+        * @param geographicalScope
+        * @param pageSize
+        * @param pageNumber
+        * @param propertyPaths
+        * @return
+        */
+       public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+       
        /**
         * Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to
         * 
@@ -195,6 +199,8 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
         * @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 BeanInitializer#initialize(Object, List)}
         * @return a Pager containing TaxonNameBase instances
+        * 
+        * FIXME candidate for harmonization - rename to pageTaxonNameDescriptions
         */
        public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonNameBase name, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
        
@@ -237,12 +243,14 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
         * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
      * @return a Pager containing media instances
+     * 
+     * FIXME candidate for harmonization - rename to pageMedia
      */
     public Pager<Media> getMedia(DescriptionElementBase descriptionElement, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
     
-    public List<DescriptionElementBase> getDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+    public <T extends DescriptionElementBase> List<T>  getDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<? extends T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
-       public DistributionTree getOrderedDistributionsB(Set<TaxonDescription> taxonDescriptions, Set<NamedAreaLevel> levels);
+       public DistributionTree getOrderedDistributions(Set<TaxonDescription> taxonDescriptions, Set<NamedAreaLevel> levels, List<String> propertyPaths);
 
        /**
          * Generate a string representation of the structured <code>description</code> supplied in natural language
@@ -258,10 +266,22 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
 
        /**
         * Preliminary method to test whether a description contains structured data. 
-        * @deprecated The means of determining this fact may change soon, so this method is annotated a beeing deprecated.
+        * @deprecated The means of determining this fact may change soon, so this method is
+                                       annotated as being deprecated.
         * @param description
         * @return
         */
        @Deprecated
        public boolean hasStructuredData(DescriptionBase<?> description);
+       
+       /**
+        * Add the collection of {@link DescriptionElementBase description elements} to the <code>targetDescription</code>.
+        * Remove the description elements from the description they are currently associated with. 
+        * 
+        * @param descriptionElements
+        * @param targetDescription
+        * @param isPaste if true, the elements are only copied (cloned) and not removed from the
+        *      old description
+        */
+       public void moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements, DescriptionBase targetDescription, boolean isPaste);
 }
\ No newline at end of file