newest changes for INameService.delete
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IMediaService.java
index e3eaf92a120f632b64379c0b59e3dba6064704e5..d751851fa04bc0b46215602252dcdb1d2ea2a436 100644 (file)
 \r
 package eu.etaxonomy.cdm.api.service;\r
 \r
-import java.util.Collection;\r
 import java.util.List;\r
-import java.util.Map;\r
 import java.util.Set;\r
-import java.util.UUID;\r
 \r
 import eu.etaxonomy.cdm.api.service.pager.Pager;\r
-import eu.etaxonomy.cdm.model.description.IdentificationKey;\r
+import eu.etaxonomy.cdm.model.description.MediaKey;\r
 import eu.etaxonomy.cdm.model.location.NamedArea;\r
 import eu.etaxonomy.cdm.model.media.Media;\r
-import eu.etaxonomy.cdm.model.media.MediaRepresentation;\r
-import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;\r
+import eu.etaxonomy.cdm.model.media.Rights;\r
 import eu.etaxonomy.cdm.model.taxon.Taxon;\r
+import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;\r
+import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
 \r
-public interface IMediaService extends IAnnotatableService<Media> {\r
+public interface IMediaService extends IIdentifiableEntityService<Media> {\r
 \r
-       // FIXME candidate for harmonization?\r
-       public abstract Map<UUID, Media> saveMediaAll(Collection<Media> mediaCollection);\r
-       \r
-       // FIXME candidate for harmonization?\r
-       public abstract List<Media> getAllMedia(int limit, int start);\r
-\r
-       public abstract List<MediaRepresentation> getAllMediaRepresentations(int limit, int start);\r
-\r
-       public abstract List<MediaRepresentationPart> getAllMediaRepresentationParts(int limit, int start);\r
-       \r
        /**\r
-        * Return a List of IdentificationKeys, optionally filtered by the parameters passed.\r
+        * Return a List of MediaKeys, optionally filtered by the parameters passed.\r
         * \r
         * @param taxonomicScope a Set of Taxon instances that define the taxonomic scope of the key (can be null)\r
         * @param geoScopes a Set of NamedArea instances that define the geospatial scope of the key (can be null)\r
         * @param pageSize The maximum number of keys returned (can be null for all keys)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
-        * @return a Pager containing IdentificationKey instances\r
+        * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}\r
+        * @return a Pager containing MediaKey instances\r
+        */\r
+       public Pager<MediaKey> getMediaKeys(Set<Taxon> taxonomicScope, Set<NamedArea> geoScopes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);\r
+       \r
+       /**\r
+        * Return a Pager of rights belonging to this object\r
+        * \r
+        * @param t The media object\r
+        * @param pageSize The maximum number of rights returned (can be null for all rights)\r
+        * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+        * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+        * @return a Pager of Rights entities\r
+        */\r
+    public Pager<Rights> getRights(Media t, Integer pageSize, Integer pageNumber, List<String> propertyPaths);\r
+    \r
+    /**\r
+        * Returns a Paged List of Media instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)\r
+        * \r
+        * @param clazz filter the results by class (or pass null to return all Media instances)\r
+        * @param queryString\r
+        * @param pageSize The maximum number of media returned (can be null for all matching media)\r
+        * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+        * @param orderHints\r
+        *            Supports path like <code>orderHints.propertyNames</code> which\r
+        *            include *-to-one properties like createdBy.username or\r
+        *            authorTeam.persistentTitleCache\r
+        * @param propertyPaths properties to be initialized\r
+        * @return a Pager Media instances\r
+        * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>\r
         */\r
-       public Pager<IdentificationKey> getIdentificationKeys(Set<Taxon> taxonomicScope, Set<NamedArea> geoScopes, Integer pageSize, Integer pageNumber);\r
+       public Pager<Media> search(Class<? extends Media> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
 }\r