ref #10334 remove further unused methods
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 18 Jan 2024 16:41:40 +0000 (17:41 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 18 Jan 2024 16:41:57 +0000 (17:41 +0100)
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/description/IDescriptionDao.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/description/IDescriptionElementDao.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/description/DescriptionDaoImpl.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/description/DescriptionElementDaoImpl.java
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/description/DescriptionDaoHibernateImplTest.java
cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/persistence/dao/hibernate/description/DescriptionDaoHibernateImplTest.testListTaxonDescriptionMedia.xml [deleted file]
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/NamePortalController.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/DescriptionServiceImpl.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IDescriptionService.java
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/DescriptionServiceImplTest.java

index 1664a574a76c630126df4e0f4432634d06c30878..2cf668a6412bc60736c15ac9d9cdb4867dadb7d7 100644 (file)
@@ -21,46 +21,17 @@ import eu.etaxonomy.cdm.model.description.Feature;
 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.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.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
-import eu.etaxonomy.cdm.persistence.dao.media.IMediaDao;
 import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.SortableTaxonNodeQueryResult;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.SortableTaxonNodeQueryResult;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
 public interface IDescriptionDao extends IIdentifiableDao<DescriptionBase> {
 
 
 public interface IDescriptionDao extends IIdentifiableDao<DescriptionBase> {
 
-    /**
-     * List the descriptions of type <TYPE>, filtered using the following parameters
-     *
-     * @param type The type of description returned (Taxon, TaxonName, or Specimen)
-     * @param hasMedia Restrict the description to those that do (true) or don't (false) contain <i>elements</i> that have one or more media (can be null)
-     * @param hasText Restrict the description to those that do (true) or don't (false) contain TextData <i>elements</i> that have some textual content (can be null)
-     * @param feature Restrict the description to those <i>elements</i> which are scoped by one of the Features passed (can be null or empty)
-     * @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
-     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
-     * @param orderHints may be null
-     * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
-     * @return a List of DescriptionBase instances
-     */
-     public List<DescriptionBase> listDescriptions(Class<? extends DescriptionBase> type, Boolean hasMedia, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
-
-    /**
-     * Count the descriptions of type <TYPE>, filtered using the following parameters
-     *
-     * @param type The type of description returned (Taxon, TaxonName, or Specimen)
-     * @param hasMedia Restrict the description to those that do (true) or don't (false) contain <i>elements</i> that have one or more media (can be null)
-     * @param hasText Restrict the description to those that do (true) or don't (false) contain TextData <i>elements</i> that have some textual content (can be null)
-     * @param feature Restrict the description to those <i>elements</i> which are scoped by one of the Features passed (can be null or empty)
-     * @return a count of DescriptionBase instances
-     */
-     public long countDescriptions(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature);
-
     /**
      * Returns a count of TaxonDescription instances, optionally filtered by parameters passed to this method
      *
     /**
      * Returns a count of TaxonDescription instances, optionally filtered by parameters passed to this method
      *
@@ -140,34 +111,6 @@ public interface IDescriptionDao extends IIdentifiableDao<DescriptionBase> {
      */
     List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Set<DescriptionType> descriptionTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
      */
     List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Set<DescriptionType> descriptionTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
-    /**
-     * Returns a List of Media instances, optionally filtered by parameters passed to this method.
-     * Maybe in future a similar method is implemented in {@link IMediaDao} which allows more
-     * media sources to be included.
-     *
-     * @param taxonUuid The taxon uuid of the taxon which the description refers to (can be null for all TaxonDescription instances)
-     * @param restrictToGalleries if true, only returns media from TaxonDescriptions with isImageGallery = true
-     * @param markerTypes Restrict the results to those descriptions which are marked as true by one of the given marker types (can be null or empty)
-     * @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
-     * @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 List of Media instances
-     */
-    List<Media> listTaxonDescriptionMedia(UUID taxonUuid, Boolean restrictToGalleries, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
-
-    /**
-     * Returns a count of Media instances, optionally filtered by parameters passed to this method
-     * Maybe in future a similar method is implemented in {@link IMediaDao} which allows more
-     * media sources to be included.
-     *
-     * @param taxonUuid The taxon uuid of the taxon which the description refers to (can be null for all TaxonDescription instances)
-     * @param restrictToGalleries if true, only returns media from TaxonDescriptions with isImageGallery = true
-     * @param markerTypes Restrict the results to those descriptions which are marked as true by one of the given marker types (can be null or empty)
-     * @return a count of Media instances
-     */
-    int countTaxonDescriptionMedia(UUID taxonUuid, Boolean restrictToGalleries, Set<MarkerType> markerTypes);
-
-
     /**
      * Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to
      *
     /**
      * Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to
      *
@@ -177,7 +120,8 @@ public interface IDescriptionDao extends IIdentifiableDao<DescriptionBase> {
      * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
      * @return a List of TaxonName instances
      */
      * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
      * @return a List of TaxonName instances
      */
-    List<TaxonNameDescription> getTaxonNameDescriptions(TaxonName name, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+    //TODO add includePublished parameter
+    public List<TaxonNameDescription> getTaxonNameDescriptions(TaxonName name, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
     /**
      * Returns a count of TaxonNameDescription instances, optionally filtered by the name which they refer to
 
     /**
      * Returns a count of TaxonNameDescription instances, optionally filtered by the name which they refer to
@@ -185,6 +129,7 @@ public interface IDescriptionDao extends IIdentifiableDao<DescriptionBase> {
      * @param name Restrict the results to those descriptions that refer to a specific name (can be null for all TaxonNameDescription instances)
      * @return a count of TaxonName instances
      */
      * @param name Restrict the results to those descriptions that refer to a specific name (can be null for all TaxonNameDescription instances)
      * @return a count of TaxonName instances
      */
+    //TODO add includePublished parameter
     public long countTaxonNameDescriptions(TaxonName name);
 
     /**
     public long countTaxonNameDescriptions(TaxonName name);
 
     /**
@@ -229,17 +174,15 @@ public interface IDescriptionDao extends IIdentifiableDao<DescriptionBase> {
      *
      * @return
      */
      *
      * @return
      */
-    List<TermDto> listNamedAreasInUse(boolean includeAllParents, Integer pageSize, Integer pageNumber);
+    public List<TermDto> listNamedAreasInUse(boolean includeAllParents, Integer pageSize, Integer pageNumber);
 
     /**
 
     /**
-     * @param specimenUuid
-     * @param classificationUuid
-     * @return
+     * Used for DDS matrix generation, therefore no includePublished parameter is needed here.
      */
      */
-    List<SortableTaxonNodeQueryResult> getNodeOfIndividualAssociationForSpecimen(UUID specimenUuid, UUID classificationUuid);
-
+    public List<SortableTaxonNodeQueryResult> getNodeOfIndividualAssociationForSpecimen(
+            UUID specimenUuid, UUID classificationUuid);
 
 
-    DescriptionBaseDto loadDto(UUID descriptionUuid);
+    public DescriptionBaseDto loadDto(UUID descriptionUuid);
 
 
-    List<DescriptionBaseDto> loadDtos(Set<UUID> descriptionUuids);
+    public List<DescriptionBaseDto> loadDtos(Set<UUID> descriptionUuids);
 }
 }
index 6caede59d7500f991fbb023826e5f7f5440e492f..aee63afa9a8a664a6b7ddfb704d9d764d781c4d7 100644 (file)
@@ -6,35 +6,12 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-
 package eu.etaxonomy.cdm.persistence.dao.description;
 
 package eu.etaxonomy.cdm.persistence.dao.description;
 
-import java.util.List;
-
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao;
 import eu.etaxonomy.cdm.persistence.dao.common.ISearchableDao;
 import eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao;
 import eu.etaxonomy.cdm.persistence.dao.common.ISearchableDao;
-import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
 
 public interface IDescriptionElementDao extends IAnnotatableDao<DescriptionElementBase>,ISearchableDao<DescriptionElementBase> {
 
 
 public interface IDescriptionElementDao extends IAnnotatableDao<DescriptionElementBase>,ISearchableDao<DescriptionElementBase> {
 
-    /**
-     * Returns a List of Media that are associated with a given description element
-     *
-        * @param descriptionElement the description element associated with these media
-        * @param pageSize The maximum number of media returned (can be null for all related media)
-        * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
-        * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
-     * @return a List of media instances
-     */
-    public List<Media> getMedia(DescriptionElementBase descriptionElement, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
-
-    /**
-     * Returns a count of Media that are associated with a given description element
-     *
-        * @param descriptionElement the description element associated with these media
-     * @return a count of media instances
-     */
-       public long countMedia(DescriptionElementBase descriptionElement);
 }
 }
index c8d9075d0ae0a54458821ed37f9c9fe202916af0..1ed70e7c5edc2f7090983abee9a56687b8ddaec2 100644 (file)
@@ -41,7 +41,6 @@ import eu.etaxonomy.cdm.model.description.SpecimenDescription;
 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.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.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
@@ -56,7 +55,6 @@ import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.QuantitativeDataDto;
 import eu.etaxonomy.cdm.persistence.dto.SortableTaxonNodeQueryResult;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.QuantitativeDataDto;
 import eu.etaxonomy.cdm.persistence.dto.SortableTaxonNodeQueryResult;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
 @Repository
 @Qualifier("descriptionDaoImpl")
 
 @Repository
 @Qualifier("descriptionDaoImpl")
@@ -152,38 +150,6 @@ public class DescriptionDaoImpl
         }
     }
 
         }
     }
 
-    @Override
-    public long countDescriptions(Class<? extends DescriptionBase> clazz, Boolean hasImages, Boolean hasText, Set<Feature> features) {
-        checkNotInPriorView("DescriptionDaoImpl.countDescriptions(Class<TYPE> type, Boolean hasImages, Boolean hasText, Set<Feature> features)");
-
-        Criteria inner = getCriteria(clazz);
-
-        Criteria elementsCriteria = inner.createCriteria("descriptionElements");
-        if(hasText != null) {
-            if(hasText) {
-                elementsCriteria.add(Restrictions.isNotEmpty("multilanguageText"));
-            } else {
-                elementsCriteria.add(Restrictions.isEmpty("multilanguageText"));
-            }
-        }
-
-        if(hasImages != null) {
-            if(hasImages) {
-                elementsCriteria.add(Restrictions.isNotEmpty("media"));
-            } else {
-                elementsCriteria.add(Restrictions.isEmpty("media"));
-            }
-        }
-
-        if(features != null && !features.isEmpty()) {
-            elementsCriteria.add(Restrictions.in("feature", features));
-        }
-
-        inner.setProjection(Projections.countDistinct("id"));
-
-        return (Long)inner.uniqueResult();
-    }
-
     @Override
     public long countTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes,
             Set<NamedArea> geographicalScopes, Set<MarkerType> markerTypes, Set<DescriptionType> descriptionTypes) {
     @Override
     public long countTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes,
             Set<NamedArea> geographicalScopes, Set<MarkerType> markerTypes, Set<DescriptionType> descriptionTypes) {
@@ -481,66 +447,6 @@ public class DescriptionDaoImpl
         }
     }
 
         }
     }
 
-    /**
-     * Should use a DetachedCriteria & subquery, but HHH-158 prevents this, for now.
-     *
-     * e.g. DetachedCriteria inner = DestachedCriteria.forClass(type);
-     *
-     * outer.add(Subqueries.propertyIn("id", inner));
-     */
-    @Override
-    public List<DescriptionBase> listDescriptions(Class<? extends DescriptionBase> clazz, Boolean hasImages, Boolean hasText,  Set<Feature> features, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
-        checkNotInPriorView("DescriptionDaoImpl.listDescriptions(Class<TYPE> type, Boolean hasImages, Boolean hasText, Set<Feature> features, Integer pageSize, Integer pageNumber)");
-        Criteria inner = getCriteria(clazz);
-
-        Criteria elementsCriteria = inner.createCriteria("descriptionElements");
-        if(hasText != null) {
-            if(hasText) {
-                elementsCriteria.add(Restrictions.isNotEmpty("multilanguageText"));
-            } else {
-                elementsCriteria.add(Restrictions.isEmpty("multilanguageText"));
-            }
-        }
-
-        if(hasImages != null) {
-            if(hasImages) {
-                elementsCriteria.add(Restrictions.isNotEmpty("media"));
-            } else {
-                elementsCriteria.add(Restrictions.isEmpty("media"));
-            }
-        }
-
-        if(features != null && !features.isEmpty()) {
-            elementsCriteria.add(Restrictions.in("feature", features));
-        }
-
-        inner.setProjection(Projections.distinct(Projections.id()));
-
-        @SuppressWarnings("unchecked")
-        List<Object> intermediateResult = inner.list();
-
-        if(intermediateResult.isEmpty()) {
-            return new ArrayList<>();
-        }
-
-        Integer[] resultIds = new Integer[intermediateResult.size()];
-        for(int i = 0; i < resultIds.length; i++) {
-                resultIds[i] = (Integer)intermediateResult.get(i);
-        }
-
-        Criteria outer = getCriteria(clazz);
-
-        outer.add(Restrictions.in("id", resultIds));
-        addOrder(outer, orderHints);
-
-        addPageSizeAndNumber(outer, pageSize, pageNumber);
-
-        @SuppressWarnings({ "unchecked", "rawtypes" })
-        List<DescriptionBase> results = outer.list();
-        defaultBeanInitializer.initializeAll(results, propertyPaths);
-        return results;
-    }
-
     @Override
     public DescriptionBase find(LSID lsid) {
         DescriptionBase<?> descriptionBase = super.find(lsid);
     @Override
     public DescriptionBase find(LSID lsid) {
         DescriptionBase<?> descriptionBase = super.find(lsid);
@@ -675,87 +581,6 @@ public class DescriptionDaoImpl
         return query;
     }
 
         return query;
     }
 
-    @Override
-    public List<Media> listTaxonDescriptionMedia(UUID taxonUuid,
-            Boolean limitToGalleries, Set<MarkerType> markerTypes,
-            Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
-
-               AuditEvent auditEvent = getAuditEventFromContext();
-            if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {
-                String queryString = " SELECT media " +
-                    getTaxonDescriptionMediaQueryString(
-                        taxonUuid, limitToGalleries,  markerTypes);
-                queryString +=
-                    " GROUP BY media "
-//                                                     " ORDER BY index(media) "  //not functional
-                    ;
-
-                Query<Media> query = getSession().createQuery(queryString, Media.class);
-
-                setTaxonDescriptionMediaParameters(query, taxonUuid, limitToGalleries, markerTypes);
-//                 addMarkerTypesCriterion(markerTypes, hql);
-
-                addPageSizeAndNumber(query, pageSize, pageNumber);
-                List<Media> results = query.list();
-                defaultBeanInitializer.initializeAll(results, propertyPaths);
-
-                return results;
-            } else {
-                throw new OperationNotSupportedInPriorViewException("countTaxonDescriptionMedia(UUID taxonUuid, boolean restrictToGalleries)");
-            }
-    }
-
-    @Override
-    public int countTaxonDescriptionMedia(UUID taxonUuid,
-            Boolean limitToGalleries, Set<MarkerType> markerTypes) {
-        AuditEvent auditEvent = getAuditEventFromContext();
-        if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {
-            String queryString = " SELECT count(DISTINCT media) " +
-                getTaxonDescriptionMediaQueryString(
-                    taxonUuid, limitToGalleries, markerTypes);
-
-            Query<Long> query = getSession().createQuery(queryString, Long.class);
-            setTaxonDescriptionMediaParameters(query, taxonUuid, limitToGalleries, markerTypes);
-            return query.uniqueResult().intValue();
-        }else{
-            throw new OperationNotSupportedInPriorViewException("countTaxonDescriptionMedia(UUID taxonUuid)");
-        }
-    }
-
-    private void setTaxonDescriptionMediaParameters(Query query, UUID taxonUuid, Boolean limitToGalleries, Set<MarkerType> markerTypes) {
-        if(taxonUuid != null){
-            query.setParameter("uuid", taxonUuid);
-        }
-    }
-
-    private String getTaxonDescriptionMediaQueryString(UUID taxonUuid,
-            Boolean restrictToGalleries, Set<MarkerType> markerTypes) {
-        String fromQueryString =
-            " FROM DescriptionElementBase as deb INNER JOIN " +
-                " deb.inDescription as td "
-                + " INNER JOIN td.taxon as t "
-                + " JOIN deb.media as media "
-                + " LEFT JOIN td.markers marker ";
-
-        String whereQueryString = " WHERE (1=1) ";
-        if (taxonUuid != null){
-            whereQueryString += " AND t.uuid = :uuid ";
-        }
-        if (restrictToGalleries){
-            whereQueryString += " AND td.imageGallery is true ";
-        }
-        if (markerTypes != null && !markerTypes.isEmpty()){
-            whereQueryString += " AND (1=0";
-            for (MarkerType markerType : markerTypes){
-                whereQueryString += " OR ( marker.markerType.id = " + markerType.getId() + " AND marker.flag is true)";
-
-            }
-            whereQueryString += ") ";
-        }
-
-        return fromQueryString + whereQueryString;
-    }
-
     @Override
     public List<TermDto> listNamedAreasInUse(boolean includeAllParents, Integer pageSize, Integer pageNumber) {
 
     @Override
     public List<TermDto> listNamedAreasInUse(boolean includeAllParents, Integer pageSize, Integer pageNumber) {
 
index 6562d57abc5dc752e97b3f27431d1e99f1dcf144..7b403e18013858167025d66f4882d2044f40ac88 100644 (file)
@@ -8,7 +8,6 @@
 */
 package eu.etaxonomy.cdm.persistence.dao.hibernate.description;
 
 */
 package eu.etaxonomy.cdm.persistence.dao.hibernate.description;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.logging.log4j.LogManager;
 import java.util.List;
 
 import org.apache.logging.log4j.LogManager;
@@ -17,7 +16,6 @@ import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.queryparser.classic.ParseException;
 import org.apache.lucene.queryparser.classic.QueryParser;
 import org.hibernate.Hibernate;
 import org.apache.lucene.queryparser.classic.ParseException;
 import org.apache.lucene.queryparser.classic.QueryParser;
 import org.hibernate.Hibernate;
-import org.hibernate.query.Query;
 import org.hibernate.search.FullTextQuery;
 import org.hibernate.search.FullTextSession;
 import org.hibernate.search.Search;
 import org.hibernate.search.FullTextQuery;
 import org.hibernate.search.FullTextSession;
 import org.hibernate.search.Search;
@@ -26,8 +24,6 @@ import org.springframework.stereotype.Repository;
 
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.TextData;
 
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.TextData;
-import eu.etaxonomy.cdm.model.media.Media;
-import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.persistence.dao.QueryParseException;
 import eu.etaxonomy.cdm.persistence.dao.description.IDescriptionElementDao;
 import eu.etaxonomy.cdm.persistence.dao.hibernate.common.AnnotatableDaoBaseImpl;
 import eu.etaxonomy.cdm.persistence.dao.QueryParseException;
 import eu.etaxonomy.cdm.persistence.dao.description.IDescriptionElementDao;
 import eu.etaxonomy.cdm.persistence.dao.hibernate.common.AnnotatableDaoBaseImpl;
@@ -51,24 +47,6 @@ public class DescriptionElementDaoImpl
         indexedClasses[0] = TextData.class;
     }
 
         indexedClasses[0] = TextData.class;
     }
 
-    @Override
-    public long countMedia(DescriptionElementBase descriptionElement) {
-        AuditEvent auditEvent = getAuditEventFromContext();
-        if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {
-            Query<Long> query = getSession().createQuery("select count(media) from DescriptionElementBase descriptionElement join descriptionElement.media media where descriptionElement = :descriptionElement", Long.class);
-            query.setParameter("descriptionElement", descriptionElement);
-
-            return (query.uniqueResult());
-        } else {
-            // Horribly inefficient, I know, but hard to do at the moment with envers.
-            // FIXME Improve this (by improving envers)
-            List<String> propertyPaths = new ArrayList<>();
-            propertyPaths.add("media");
-            DescriptionElementBase d = super.load(descriptionElement.getUuid(), propertyPaths);
-            return d.getMedia().size();
-        }
-    }
-
     @Override
     public long count(Class<? extends DescriptionElementBase> clazz, String queryString) {
         checkNotInPriorView("DescriptionElementDaoImpl.countTextData(String queryString)");
     @Override
     public long count(Class<? extends DescriptionElementBase> clazz, String queryString) {
         checkNotInPriorView("DescriptionElementDaoImpl.countTextData(String queryString)");
@@ -91,44 +69,6 @@ public class DescriptionElementDaoImpl
         }
     }
 
         }
     }
 
-    @Override
-    public List<Media> getMedia(DescriptionElementBase descriptionElement, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
-        AuditEvent auditEvent = getAuditEventFromContext();
-        if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {
-            Query<Media> query = getSession().createQuery("select media from DescriptionElementBase descriptionElement join descriptionElement.media media where descriptionElement = :descriptionElement order by index(media)", Media.class);
-            query.setParameter("descriptionElement", descriptionElement);
-
-            addPageSizeAndNumber(query, pageSize, pageNumber);
-
-            List<Media> results = query.list();
-            defaultBeanInitializer.initializeAll(results, propertyPaths);
-            return results;
-        } else {
-            // Horribly inefficient, I know, but hard to do at the moment with envers.
-            // FIXME Improve this (by improving envers)
-            List<String> pPaths = new ArrayList<>();
-            propertyPaths.add("media");
-            DescriptionElementBase d = super.load(descriptionElement.getUuid(), pPaths);
-            List<Media> results = new ArrayList<>();
-            results.addAll(d.getMedia());
-            if(pageSize != null) {
-                int fromIndex = 0;
-                int toIndex = 0;
-                if(pageNumber != null) {
-                    // if the page is out of scope
-                    if(results.size() < (pageNumber * pageSize)) {
-                        return new ArrayList<>();
-                    }
-                    fromIndex =   pageNumber * pageSize;
-                }
-                toIndex = results.size() < (fromIndex + pageSize) ? results.size() : fromIndex + pageSize;
-                results = results.subList(fromIndex, toIndex);
-            }
-            defaultBeanInitializer.initializeAll(results, propertyPaths);
-            return results;
-        }
-    }
-
     @Override
     public List<DescriptionElementBase> search(Class<? extends DescriptionElementBase> clazz, String queryString, Integer pageSize,    Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
 //    public <S extends DescriptionElementBase> List<S> search(Class<S> clazz, String queryString, Integer pageSize,  Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
     @Override
     public List<DescriptionElementBase> search(Class<? extends DescriptionElementBase> clazz, String queryString, Integer pageSize,    Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
 //    public <S extends DescriptionElementBase> List<S> search(Class<S> clazz, String queryString, Integer pageSize,  Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
index 8f31ab68e5fa3fca1f3f03151006c36e73fafab1..767602b3113f8449ec6720a40b0eacd31ddc0bb8 100644 (file)
@@ -9,7 +9,6 @@
 package eu.etaxonomy.cdm.persistence.dao.hibernate.description;
 
 import static org.junit.Assert.assertEquals;
 package eu.etaxonomy.cdm.persistence.dao.hibernate.description;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
@@ -42,7 +41,6 @@ import eu.etaxonomy.cdm.model.description.SpecimenDescription;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
@@ -52,8 +50,6 @@ import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao;
 import eu.etaxonomy.cdm.persistence.dao.term.IDefinedTermDao;
 import eu.etaxonomy.cdm.persistence.dto.SortableTaxonNodeQueryResult;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dao.term.IDefinedTermDao;
 import eu.etaxonomy.cdm.persistence.dto.SortableTaxonNodeQueryResult;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.query.OrderHint;
-import eu.etaxonomy.cdm.persistence.query.OrderHint.SortOrder;
 import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest;
 import eu.etaxonomy.cdm.test.unitils.CleanSweepInsertLoadStrategy;
 
 import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest;
 import eu.etaxonomy.cdm.test.unitils.CleanSweepInsertLoadStrategy;
 
@@ -87,46 +83,6 @@ public class DescriptionDaoHibernateImplTest extends CdmTransactionalIntegration
         features = new HashSet<>();
     }
 
         features = new HashSet<>();
     }
 
-    @Test
-    public void testCountDescriptionsWithText() {
-        long numberOfDescriptions = descriptionDao.countDescriptions(TaxonDescription.class, null, true, null);
-
-        assertNotNull("countDescriptions should return a 2",numberOfDescriptions);
-    }
-
-    @Test
-    public void testListDescriptionsWithText() {
-        List<OrderHint> orderHints = new ArrayList<>();
-        orderHints.add(new OrderHint("titleCache",SortOrder.ASCENDING));
-        List<String> propertyPaths = new ArrayList<>();
-        propertyPaths.add("taxon");
-        List<DescriptionBase> descriptions = descriptionDao.listDescriptions(TaxonDescription.class, null, true, null,null,null,orderHints,propertyPaths);
-
-        assertNotNull("listDescriptions should return a List",descriptions);
-        assertFalse("listDescriptions should not be empty", descriptions.isEmpty());
-        assertEquals("listDescriptions should return 2 descriptions",2,descriptions.size());
-    }
-
-    @Test
-    public void testCountDescriptionsWithTextAndFeatures() {
-        features.add(Feature.ECOLOGY());
-        long numberOfDescriptions = descriptionDao.countDescriptions(TaxonDescription.class, null, true, features);
-
-        assertNotNull("countDescriptions should return a 1",numberOfDescriptions);
-    }
-
-    @Test
-    public void testListDescriptionsWithTextAndFeatures() {
-        assert Feature.ECOLOGY() != null;
-        features.add(Feature.ECOLOGY());
-
-        List<DescriptionBase> descriptions = descriptionDao.listDescriptions(TaxonDescription.class, null, true, features, null, null, null, null);
-
-        assertNotNull("listDescriptions should return a List",descriptions);
-        assertFalse("listDescriptions should not be empty", descriptions.isEmpty());
-        assertEquals("listDescriptions should return 1 descriptions",1,descriptions.size());
-    }
-
     @Test
     public void testCountDescriptionElements() {
 
     @Test
     public void testCountDescriptionElements() {
 
@@ -362,151 +318,6 @@ public class DescriptionDaoHibernateImplTest extends CdmTransactionalIntegration
 
     }
 
 
     }
 
-//
-//        //complete
-//        MarkerType completeMarkerType = (MarkerType)this.definedTermDao.findByUuid(UUID.fromString("b4b1b2ab-89a8-4ce6-8110-d60b8b1bc433")); //Marker "complete"
-//
-//        Assert.assertNotNull("MarkerType for 'complete' should exist", completeMarkerType);
-//        Set<MarkerType> markerTypes = new HashSet<MarkerType>();
-//        markerTypes.add(completeMarkerType);
-//        int n1 = this.descriptionDao.countTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes);
-//        Assert.assertEquals("There should be 1 description marked 'complete'", 1, n1);
-//        List<TaxonDescription> descriptions = this.descriptionDao.listTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
-//        Assert.assertEquals("There should be 1 description marked 'complete'", 1, descriptions.size());
-//
-//        //doubtful
-//        MarkerType isDoubtfulMarkerType = (MarkerType)this.definedTermDao.findByUuid(UUID.fromString("b51325c8-05fe-421a-832b-d86fc249ef6e")); //Marker "doubtful"
-//        Assert.assertNotNull("MarkerType for 'doubtful' should exist", isDoubtfulMarkerType);
-//        markerTypes = new HashSet<MarkerType>();  //reset
-//        markerTypes.add(isDoubtfulMarkerType);
-//        int n2 = this.descriptionDao.countTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes);
-//        Assert.assertEquals("There should be no description marked 'doubtful'", 0, n2);
-//        descriptions = this.descriptionDao.listTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
-//        Assert.assertEquals("There should be 0 description marked 'doubtful'", 0, descriptions.size());
-//
-//        //imported = false
-//        UUID uuidImported = UUID.fromString("96878790-4ceb-42a2-9738-a2242079b679");
-//        MarkerType importedMarkerType = (MarkerType)this.definedTermDao.findByUuid(uuidImported);
-//        Assert.assertNotNull("MarkerType for 'imported' should exist", completeMarkerType);
-//        markerTypes = new HashSet<MarkerType>();
-//        markerTypes.add(importedMarkerType);
-//        int n3 = this.descriptionDao.countTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes);
-//        Assert.assertEquals("There should be no description marked 'imported' as true", 0, n3);
-//        descriptions = this.descriptionDao.listTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
-//        Assert.assertEquals("There should be no description marked 'imported' as true", 0, descriptions.size());
-//        markerTypes = null;
-//        descriptions = this.descriptionDao.listTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
-//        Assert.assertEquals("There should be 1 description", 1, descriptions.size());
-//        TaxonDescription desc = descriptions.iterator().next();
-//        boolean hasMarkerImportedAsFalse = desc.hasMarker(importedMarkerType, false);
-//        Assert.assertTrue("The only description should have a negative marker on 'imported'", hasMarkerImportedAsFalse);
-//
-//    }
-
-
-    @Test
-    @DataSet("DescriptionDaoHibernateImplTest.testListTaxonDescriptionMedia.xml")
-    public void testListTaxonDescriptionMedia(){
-        //init
-        Taxon firstTaxon = (Taxon)this.taxonDao.findByUuid(UUID.fromString("496b1325-be50-4b0a-9aa2-3ecd610215f2"));
-        Taxon secondTaxon = (Taxon)this.taxonDao.findByUuid(UUID.fromString("822d98dc-9ef7-44b7-a870-94573a3bcb46"));
-        Taxon thirdTaxon = (Taxon)this.taxonDao.findByUuid(UUID.fromString("54e767ee-894e-4540-a758-f906ecb4e2d9"));
-        MarkerType markerType890 = (MarkerType)this.definedTermDao.findById(890);
-        MarkerType markerType892 = (MarkerType)this.definedTermDao.findById(892);
-
-        Assert.assertNotNull("First taxon should exist", firstTaxon);
-        Assert.assertNotNull("Second taxon should exist", secondTaxon);
-        Assert.assertNotNull("Third taxon should exist", thirdTaxon);
-        Assert.assertEquals("There should be 6 descriptions in the database", 6, this.descriptionDao.count());
-
-        //set parameter
-        Set<MarkerType> markerTypes = null;
-        Integer pageSize = null;
-        Integer pageNumber = null;
-        List<String> propertyPaths = null;
-
-        //test
-        //first Taxon gallery filter
-        List<Media> mediaList = this.descriptionDao.listTaxonDescriptionMedia(firstTaxon.getUuid(), true, markerTypes, pageSize, pageNumber, propertyPaths);
-        Assert.assertEquals("media list size for first taxon and filter on image galleries should be 1", 1, mediaList.size());
-
-        //first taxon all descriptions
-        mediaList = this.descriptionDao.listTaxonDescriptionMedia(firstTaxon.getUuid(), false, markerTypes, pageSize, pageNumber, propertyPaths);
-        Assert.assertEquals("media list size for first taxon without filter on image galleries should be 2", 2, mediaList.size());
-
-        //second taxon
-        mediaList = this.descriptionDao.listTaxonDescriptionMedia(secondTaxon.getUuid(), true, markerTypes, pageSize, pageNumber, propertyPaths);
-        Assert.assertEquals("media list size for second taxon and filter on image galleries should be 2", 2, mediaList.size());
-
-        //all taxa
-        mediaList = this.descriptionDao.listTaxonDescriptionMedia(null, true, markerTypes, pageSize, pageNumber, propertyPaths);
-        Assert.assertEquals("media list size for any taxon and filter on image galleries should be 3", 3, mediaList.size());
-        //with marker
-        markerTypes = new HashSet<MarkerType>();
-        mediaList = this.descriptionDao.listTaxonDescriptionMedia(null, true, markerTypes, pageSize, pageNumber, propertyPaths);
-        Assert.assertEquals("Empty marker type set should give same result as before: 3", 3, mediaList.size());
-        markerTypes.add(markerType890);
-        mediaList = this.descriptionDao.listTaxonDescriptionMedia(null, true, markerTypes, pageSize, pageNumber, propertyPaths);
-        Assert.assertEquals("markerType890 should only give 1 result", 1, mediaList.size());
-        markerTypes.add(markerType892);
-        mediaList = this.descriptionDao.listTaxonDescriptionMedia(null, true, markerTypes, pageSize, pageNumber, propertyPaths);
-        Assert.assertEquals("markerType892 should not give additional result as the markers value is false", 1, mediaList.size());
-        markerTypes = null;
-
-        //check deduplication
-        mediaList = this.descriptionDao.listTaxonDescriptionMedia(null, false, markerTypes, pageSize, pageNumber, propertyPaths);
-        Assert.assertEquals("media list size for any taxon without filter on image galleries should be 3", 3, mediaList.size());
-    }
-
-    @Test
-    @DataSet("DescriptionDaoHibernateImplTest.testListTaxonDescriptionMedia.xml")
-    public void testcountTaxonDescriptionMedia(){
-        //init
-        Taxon firstTaxon = (Taxon)this.taxonDao.findByUuid(UUID.fromString("496b1325-be50-4b0a-9aa2-3ecd610215f2"));
-        Taxon secondTaxon = (Taxon)this.taxonDao.findByUuid(UUID.fromString("822d98dc-9ef7-44b7-a870-94573a3bcb46"));
-        Taxon thirdTaxon = (Taxon)this.taxonDao.findByUuid(UUID.fromString("54e767ee-894e-4540-a758-f906ecb4e2d9"));
-        MarkerType markerType890 = (MarkerType)this.definedTermDao.findById(890);
-        MarkerType markerType892 = (MarkerType)this.definedTermDao.findById(892);
-
-        Assert.assertNotNull("First taxon should exist", firstTaxon);
-        Assert.assertNotNull("Second taxon should exist", secondTaxon);
-        Assert.assertNotNull("Third taxon should exist", thirdTaxon);
-        Assert.assertEquals("There should be 6 descriptions in the database", 6, this.descriptionDao.count());
-
-        //set parameter
-        Set<MarkerType> markerTypes = null;
-
-        //test
-        //first Taxon gallery filter
-        int mediaCount = this.descriptionDao.countTaxonDescriptionMedia(firstTaxon.getUuid(), true, markerTypes);
-        Assert.assertEquals("media list size for first taxon and filter on image galleries should be 1", 1, mediaCount);
-        mediaCount = this.descriptionDao.countTaxonDescriptionMedia(firstTaxon.getUuid(), false, markerTypes);
-        Assert.assertEquals("media list size for first taxon without filter on image galleries should be 2", 2, mediaCount);
-
-        //second taxon
-        mediaCount = this.descriptionDao.countTaxonDescriptionMedia(secondTaxon.getUuid(), true, markerTypes);
-        Assert.assertEquals("media list size for second taxon and filter on image galleries should be 2", 2, mediaCount);
-
-        //all taxa
-        mediaCount = this.descriptionDao.countTaxonDescriptionMedia(null, true, markerTypes);
-        Assert.assertEquals("media list size for any taxon and filter on image galleries should be 3", 3, mediaCount);
-        //with marker
-        markerTypes = new HashSet<MarkerType>();
-        mediaCount = this.descriptionDao.countTaxonDescriptionMedia(null, true, markerTypes);
-        Assert.assertEquals("Empty marker type set should give same result as before: 3", 3, mediaCount);
-        markerTypes.add(markerType890);
-        mediaCount = this.descriptionDao.countTaxonDescriptionMedia(null, true, markerTypes);
-        Assert.assertEquals("markerType890 should only give 1 result", 1, mediaCount);
-        markerTypes.add(markerType892);
-        mediaCount = this.descriptionDao.countTaxonDescriptionMedia(null, true, markerTypes);
-        Assert.assertEquals("markerType892 should not give additional result as the markers value is false", 1, mediaCount);
-        markerTypes = null;
-
-        //check deduplication
-        mediaCount = this.descriptionDao.countTaxonDescriptionMedia(null, false, markerTypes);
-        Assert.assertEquals("media list size for any taxon without filter on image galleries should be 3", 3, mediaCount);
-    }
-
     @Test
     @DataSets({
         @DataSet(loadStrategy=CleanSweepInsertLoadStrategy.class, value="/eu/etaxonomy/cdm/database/ClearDB_with_Terms_DataSet.xml"),
     @Test
     @DataSets({
         @DataSet(loadStrategy=CleanSweepInsertLoadStrategy.class, value="/eu/etaxonomy/cdm/database/ClearDB_with_Terms_DataSet.xml"),
diff --git a/cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/persistence/dao/hibernate/description/DescriptionDaoHibernateImplTest.testListTaxonDescriptionMedia.xml b/cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/persistence/dao/hibernate/description/DescriptionDaoHibernateImplTest.testListTaxonDescriptionMedia.xml
deleted file mode 100644 (file)
index 4616433..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../database/schema/dataset.xsd">
-  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="1" UUID="5f3265ed-68ad-4ec3-826f-0d29d25986b9" PROTECTEDTITLECACHE="true" TITLECACHE="Description 1" IMAGEGALLERY="true" PUBLISH="true" ISDEFAULT="false" TAXON_ID="1"/>
-  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="2" UUID="d69d6d40-eb98-42f9-8d30-fbeb0a7db33b" PROTECTEDTITLECACHE="true" TITLECACHE="Description 2" IMAGEGALLERY="true" PUBLISH="true" ISDEFAULT="false" TAXON_ID="2"/>
-  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="3" UUID="c6782124-7cf0-4454-880f-c4f16dc03105" PROTECTEDTITLECACHE="true" TITLECACHE="Description 3" IMAGEGALLERY="true" PUBLISH="true" ISDEFAULT="false" TAXON_ID="3"/>
-  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="4" UUID="68ff9cb2-3fc0-4580-8295-bbb0de0d42bf" PROTECTEDTITLECACHE="true" TITLECACHE="Description 4" IMAGEGALLERY="false" PUBLISH="true" ISDEFAULT="false" TAXON_ID="1"/>
-  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="5" UUID="1240e8ba-32a2-4914-ad00-2f87e18ab65e" PROTECTEDTITLECACHE="true" TITLECACHE="Description 5" IMAGEGALLERY="true" PUBLISH="true" ISDEFAULT="false" TAXON_ID="5"/>
-  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="6" UUID="5c4bef76-72a6-4e39-a6d8-1d8707519d7a" PROTECTEDTITLECACHE="true" TITLECACHE="Description 6" IMAGEGALLERY="false" PUBLISH="true" ISDEFAULT="false" TAXON_ID="5"/>
-  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="1" INDESCRIPTION_ID="1" UUID="40458e70-a065-450f-b27d-adf61cc28a7f" FEATURE_ID="930"/>
-  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="2" INDESCRIPTION_ID="2" UUID="d4099b8d-0644-4025-8a56-e7fc2d95004e" FEATURE_ID="930"/>
-  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="3" INDESCRIPTION_ID="3" UUID="317fafca-3722-4d8d-8c4f-701d4f5b911d" FEATURE_ID="930"/>
-  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="4" INDESCRIPTION_ID="4" UUID="31a0160a-51b2-4565-85cf-2be58cb561d6" FEATURE_ID="930"/>
-  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="5" INDESCRIPTION_ID="5" UUID="50f6b799-3585-40a7-b69d-e7be77b2651a" FEATURE_ID="936"/>
-  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="6" INDESCRIPTION_ID="6" UUID="c1e21ed1-4925-4e85-845f-e4b7a8386a33" FEATURE_ID="936"/>
-  
-  <DESCRIPTIONELEMENTBASE_MEDIA DESCRIPTIONELEMENTBASE_ID="1" MEDIA_ID="1" SORTINDEX="0"/>
-  <DESCRIPTIONELEMENTBASE_MEDIA DESCRIPTIONELEMENTBASE_ID="2" MEDIA_ID="2" SORTINDEX="1"/>
-  <DESCRIPTIONELEMENTBASE_MEDIA DESCRIPTIONELEMENTBASE_ID="2" MEDIA_ID="3" SORTINDEX="0"/>
-  <DESCRIPTIONELEMENTBASE_MEDIA DESCRIPTIONELEMENTBASE_ID="4" MEDIA_ID="3" SORTINDEX="0"/>
-  
-  <MEDIA ID="1" DTYPE="MediaKey" PROTECTEDTITLECACHE="false" UUID="2d357cac-5aba-477e-a8f6-2988f63e8b5b" UPDATED="2008-12-10 09:56:07.253"/>
-  <MEDIA ID="2" DTYPE="MediaKey" PROTECTEDTITLECACHE="false" UUID="3522bd38-72e7-4d31-8216-240c0b4b3636" UPDATED="2008-12-10 09:56:07.253"/>
-  <MEDIA ID="3" DTYPE="MediaKey" PROTECTEDTITLECACHE="false" UUID="5c2313fc-9be2-4595-ba23-7e0dd5b46694" UPDATED="2008-12-10 09:56:07.253"/>
-  <MEDIA ID="4" DTYPE="MediaKey" PROTECTEDTITLECACHE="false" UUID="c7376b14-c6b6-4e1d-bfcb-d4daa79bba4d" UPDATED="2008-12-10 09:56:07.253"/>
-
-  <DESCRIPTIONBASE_MARKER DESCRIPTIONBASE_ID="1" MARKERS_ID="1"/>
-  <DESCRIPTIONBASE_MARKER DESCRIPTIONBASE_ID="1" MARKERS_ID="2"/>
-  <MARKER ID="1" UUID="a0b943f6-3737-4ba4-9d5c-72f3f1476996" FLAG="TRUE" MARKERTYPE_ID="890"/>
-  <MARKER ID="2" UUID="e873c908-ec5b-4edf-8e80-11da5a9d26b3" FLAG="FALSE" MARKERTYPE_ID="892"/>
-
-  <TAXONBASE DTYPE="Taxon" ID="1" UUID="496b1325-be50-4b0a-9aa2-3ecd610215f2" PROTECTEDTITLECACHE="true" TITLECACHE=" sec. ???" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" NAME_ID="1"/>
-  <TAXONBASE DTYPE="Taxon" ID="2" UUID="822d98dc-9ef7-44b7-a870-94573a3bcb46" PROTECTEDTITLECACHE="true" TITLECACHE="  sec. ???" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" NAME_ID="1"/>
-  <TAXONBASE DTYPE="Taxon" ID="3" UUID="54e767ee-894e-4540-a758-f906ecb4e2d9" PROTECTEDTITLECACHE="true" TITLECACHE="Sphingidae Linnaeus, 1758 sec. cate-sphingidae.org" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" NAME_ID="1"/>
-  <TAXONBASE DTYPE="Taxon" ID="4" UUID="ef96fafa-7750-4141-b31b-1ad1daab3e76" PROTECTEDTITLECACHE="true" TITLECACHE="Lathoe Fabricius, 1807 sec. cate-sphingidae.org" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" NAME_ID="1"/>
-  <TAXONBASE DTYPE="Taxon" ID="5" UUID="17233b5e-74e7-42fc-bc37-522684657ed4" PROTECTEDTITLECACHE="true" TITLECACHE="Smerinthus Latreille, 1802 sec. cate-sphingidae.org" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" NAME_ID="1"/>
-
-  <TAXONNAME NAMETYPE="ICNAFP" ID="1" UUID="a49a3963-c4ea-4047-8588-2f8f15352730" UPDATED="2008-12-10 09:56:07.238" PROTECTEDTITLECACHE="true" TITLECACHE="" FULLTITLECACHE="" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="" BINOMHYBRID="false" GENUSORUNINOMIAL="Aus" HYBRIDFORMULA="false" MONOMHYBRID="false" NAMECACHE="Aus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" TRINOMHYBRID="false" ANAMORPHIC="false" HOMOTYPICALGROUP_ID="1" RANK_ID="774"/>
-  <HOMOTYPICALGROUP ID="1" UUID="7b214eb9-a6ac-48e5-af02-bbea634d2a03" UPDATED="2008-12-10 09:56:07.238"/>
-  <REFERENCE ID="1" UUID="596b1325-be50-4b0a-9aa2-3ecd610215f2" PROTECTEDTITLECACHE="true" TITLECACHE="Lorem ipsum" PROTECTEDABBREVTITLECACHE="false" ABBREVTITLECACHE="Sp. Pl." ABBREVTITLE="Sp. Pl." NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1"/>
-
-</dataset>
\ No newline at end of file
index 574ecd5c5a39936a637cf0bcde60196dc1286e47..f01e3fba17b1f5034abf62dcaf888dd58bf5cfe1 100644 (file)
@@ -231,6 +231,7 @@ public class NamePortalController extends BaseController<TaxonName, INameService
             method = RequestMethod.GET)
     public List<TaxonNameDescription> doGetNameDescriptions(@PathVariable("uuid") UUID uuid,
             HttpServletRequest request, HttpServletResponse response)throws IOException {
             method = RequestMethod.GET)
     public List<TaxonNameDescription> doGetNameDescriptions(@PathVariable("uuid") UUID uuid,
             HttpServletRequest request, HttpServletResponse response)throws IOException {
+
         logger.info("doGetNameDescriptions()" + request.getRequestURI());
 
         TaxonName tnb = getCdmBaseInstance(uuid, response, (List<String>)null);
         logger.info("doGetNameDescriptions()" + request.getRequestURI());
 
         TaxonName tnb = getCdmBaseInstance(uuid, response, (List<String>)null);
index 96259d88d9f31e9b6478e64f3d09e69c01101f99..d8b56cf398028574e3e2d7feeee9cdb3609b1a59 100644 (file)
@@ -63,7 +63,6 @@ import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
 import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
 import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
@@ -73,7 +72,6 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermTree;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dao.description.IDescriptionDao;
 import eu.etaxonomy.cdm.persistence.dao.description.IDescriptionElementDao;
 import eu.etaxonomy.cdm.persistence.dao.description.IDescriptiveDataSetDao;
 import eu.etaxonomy.cdm.persistence.dao.description.IDescriptionDao;
 import eu.etaxonomy.cdm.persistence.dao.description.IDescriptionElementDao;
 import eu.etaxonomy.cdm.persistence.dao.description.IDescriptiveDataSetDao;
@@ -204,24 +202,12 @@ public class DescriptionServiceImpl
         return super.updateCachesImpl(clazz, stepSize, cacheStrategy, monitor);
     }
 
         return super.updateCachesImpl(clazz, stepSize, cacheStrategy, monitor);
     }
 
-    @Override
-    public TermVocabulary<Feature> getDefaultFeatureVocabulary(){
-        String uuidFeature = "b187d555-f06f-4d65-9e53-da7c93f8eaa8";
-        UUID featureUuid = UUID.fromString(uuidFeature);
-        return vocabularyDao.findByUuid(featureUuid);
-    }
-
     @Override
     @Autowired
     protected void setDao(IDescriptionDao dao) {
         this.dao = dao;
     }
 
     @Override
     @Autowired
     protected void setDao(IDescriptionDao dao) {
         this.dao = dao;
     }
 
-    @Override
-    public long count(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText,Set<Feature> feature) {
-        return dao.countDescriptions(type, hasImages, hasText, feature);
-    }
-
     @Override
     public <T extends DescriptionElementBase> Pager<T> pageDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType,
             Set<Feature> features, Class<T> type, boolean includeUnpublished,
     @Override
     public <T extends DescriptionElementBase> Pager<T> pageDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType,
             Set<Feature> features, Class<T> type, boolean includeUnpublished,
@@ -247,25 +233,6 @@ public class DescriptionServiceImpl
         return results;
     }
 
         return results;
     }
 
-    @Override
-    public Pager<Media> getMedia(DescriptionElementBase descriptionElement,    Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
-        Long numberOfResults = descriptionElementDao.countMedia(descriptionElement);
-
-        List<Media> results = new ArrayList<>();
-        if(numberOfResults > 0) { // no point checking again //TODO use AbstractPagerImpl.hasResultsInRange(numberOfResults, pageNumber, pageSize)
-            results = descriptionElementDao.getMedia(descriptionElement, pageSize, pageNumber, propertyPaths);
-        }
-
-        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
-    }
-
-    @Override
-    public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
-        Set<MarkerType> markerTypes = null;
-        Set<DescriptionType> descriptionTypes = null;
-        return pageTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, descriptionTypes, pageSize, pageNumber, propertyPaths);
-    }
-
     @Override
     public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         Set<MarkerType> markerTypes = null;
     @Override
     public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         Set<MarkerType> markerTypes = null;
@@ -291,17 +258,6 @@ public class DescriptionServiceImpl
         return results;
     }
 
         return results;
     }
 
-
-    @Override
-    public List<Media> listTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths){
-        return this.dao.listTaxonDescriptionMedia(taxonUuid, limitToGalleries, markerTypes, pageSize, pageNumber, propertyPaths);
-    }
-
-    @Override
-    public int countTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes){
-        return this.dao.countTaxonDescriptionMedia(taxonUuid, limitToGalleries, markerTypes);
-    }
-
     @Override
     public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonName name, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         long numberOfResults = dao.countTaxonNameDescriptions(name);
     @Override
     public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonName name, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         long numberOfResults = dao.countTaxonNameDescriptions(name);
@@ -314,20 +270,6 @@ public class DescriptionServiceImpl
         return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
     }
 
         return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
     }
 
-
-    @Override
-    public Pager<DescriptionBase> page(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
-        long numberOfResults = dao.countDescriptions(type, hasImages, hasText, feature);
-
-        @SuppressWarnings("rawtypes")
-        List<DescriptionBase> results = new ArrayList<>();
-        if(numberOfResults > 0) { // no point checking again //TODO use AbstractPagerImpl.hasResultsInRange(numberOfResults, pageNumber, pageSize)
-            results = dao.listDescriptions(type, hasImages, hasText, feature, pageSize, pageNumber,orderHints,propertyPaths);
-        }
-
-        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
-    }
-
     /**
      * FIXME Candidate for harmonization
      * move: descriptionElementService.search
     /**
      * FIXME Candidate for harmonization
      * move: descriptionElementService.search
index 0b6228f84bc863fcb8a7f141b23f9d210bc9c352..4eee78efc0ecaf0744b397db86267629b12dbc39 100644 (file)
@@ -25,12 +25,10 @@ import eu.etaxonomy.cdm.model.description.Feature;
 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.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.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.TermTree;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
 import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
 import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.MergeResult;
@@ -40,39 +38,6 @@ import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
 public interface IDescriptionService extends IIdentifiableEntityService<DescriptionBase> {
 
 
 public interface IDescriptionService extends IIdentifiableEntityService<DescriptionBase> {
 
-    /**
-     * @return
-     * @deprecated use TermService#getVocabulary(VocabularyType) instead
-     */
-    @Deprecated
-    public TermVocabulary<Feature> getDefaultFeatureVocabulary();
-
-    /**
-     * List the descriptions of type <T>, filtered using the following parameters
-     *
-     * @param type The type of description returned (Taxon, TaxonName, or Specimen)
-     * @param hasMedia Restrict the description to those that do (true) or don't (false) contain <i>elements</i> that have one or more media (can be null)
-     * @param hasText Restrict the description to those that do (true) or don't (false) contain TextData <i>elements</i> that have some textual content (can be null)
-     * @param feature Restrict the description to those <i>elements</i> which are scoped by one of the Features passed (can be null or empty)
-     * @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
-     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
-     * @param orderHints may be null
-     * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
-     * @return a Pager containing DescriptionBase instances
-     */
-    public Pager<DescriptionBase> page(Class<? extends DescriptionBase> type, Boolean hasMedia, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
-
-    /**
-     * Count the descriptions of type <TYPE>, filtered using the following parameters
-     *
-     * @param type The type of description returned (Taxon, TaxonName, or Specimen)
-     * @param hasMedia Restrict the description to those that do (true) or don't (false) contain <i>elements</i> that have one or more media (can be null)
-     * @param hasText Restrict the description to those that do (true) or don't (false) contain TextData <i>elements</i> that have some textual content (can be null)
-     * @param feature Restrict the description to those <i>elements</i> which are scoped by one of the Features passed (can be null or empty)
-     * @return a count of DescriptionBase instances
-     */
-    public long count(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature);
-
     /**
      * Returns description elements of type <TYPE>, belonging to a given
      * description, optionally filtered by one or more features
     /**
      * Returns description elements of type <TYPE>, belonging to a given
      * description, optionally filtered by one or more features
@@ -135,22 +100,6 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
             Set<Feature> features, Class<T> type, boolean includeUnpublished,
             Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
             Set<Feature> features, Class<T> type, boolean includeUnpublished,
             Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
-
-    /**
-     * Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method
-     *
-     * @param taxon The taxon which the description refers to (can be null for all TaxonDescription instances)
-     * @param scopes Restrict the results to those descriptions which are scoped by one of the Scope instances passed (can be null or empty)
-     * @param geographicalScope Restrict the results to those descriptions which have a geographical scope that overlaps with the NamedArea instances passed (can be null or empty)
-     * @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
-     * @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 containing TaxonDescription instances
-     *
-     * @see #pageMarkedTaxonDescriptions(Taxon, Set, Set, Set, Integer, Integer, List)
-     */
-    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
      *
     /**
      * Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method
      *
@@ -195,29 +144,6 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
      */
     public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Set<DescriptionType> descriptionTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
      */
     public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Set<DescriptionType> descriptionTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
-    /**
-     * Returns all {@link Media} attached to a taxon via TaxonDescription.elements.media.
-     * @param taxonUuid the taxons uuid, if null media for all taxa are returned
-     * @param limitToGalleries if true only media in TaxonDescriptions with imageGallery flag=true are returned
-     * @param markerTypes only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
-     * @param pageSize
-     * @param pageNumber
-     * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
-     * @return
-     */
-    public List<Media> listTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
-
-    /**
-     * Returns count for all {@link Media} attached to a taxon via TaxonDescription.elements.media.
-     * @param taxonUuid the taxons uuid, if null media for all taxa are returned
-     * @param limitToGalleries if true only media in TaxonDescriptions with imageGallery flag=true are returned
-     * @param markerTypes only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
-     * @return
-     */
-    public int countTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes);
-
-
-
     /**
      * Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to
      *
     /**
      * Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to
      *
@@ -248,19 +174,6 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
      */
     public <S extends DescriptionElementBase> Pager<S> searchElements(Class<S> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
 
      */
     public <S extends DescriptionElementBase> Pager<S> searchElements(Class<S> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
 
-    /**
-     * Returns a List of Media that are associated with a given description element
-     *
-     * @param descriptionElement the description element associated with these media
-     * @param pageSize The maximum number of media returned (can be null for all related media)
-     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
-     * @param propertyPaths properties to initialize - see {@link IBeanInitializer#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);
-
     /**
      * Provides access to all DescriptionElements associated with the given Taxon
      * via a TaxonDescrition.
     /**
      * Provides access to all DescriptionElements associated with the given Taxon
      * via a TaxonDescrition.
index 032a8b2ef7a149c52c0d07893281926f8c31b674..01bb9662a3d6d8f1a4f1c85cc5984852d4f8746f 100644 (file)
@@ -54,11 +54,6 @@ public class DescriptionServiceImplTest extends CdmTransactionalIntegrationTest
     @SpringBeanByType
     private ITermService termService;
 
     @SpringBeanByType
     private ITermService termService;
 
-    @Test
-    public void testGetDefaultFeatureVocabulary() {
-        service.getDefaultFeatureVocabulary();
-    }
-
     @Test
     @DataSet("CommonServiceImplTest.xml")
     public void testChangeDescriptionElement(){
     @Test
     @DataSet("CommonServiceImplTest.xml")
     public void testChangeDescriptionElement(){