1 |
c2f269f9
|
Andreas Kohlbecker
|
/**
|
2 |
|
|
* Copyright (C) 2007 EDIT
|
3 |
d9f134f9
|
Katja Luther
|
* European Distributed Institute of Taxonomy
|
4 |
c2f269f9
|
Andreas Kohlbecker
|
* http://www.e-taxonomy.eu
|
5 |
d9f134f9
|
Katja Luther
|
*
|
6 |
c2f269f9
|
Andreas Kohlbecker
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8 |
|
|
*/
|
9 |
|
|
|
10 |
fdf5453b
|
a.babadshanjan
|
package eu.etaxonomy.cdm.api.service;
|
11 |
|
|
|
12 |
2eb4c6b4
|
Andreas Kohlbecker
|
import java.io.IOException;
|
13 |
fdf5453b
|
a.babadshanjan
|
import java.util.List;
|
14 |
2eb4c6b4
|
Andreas Kohlbecker
|
import java.util.Map;
|
15 |
d57c0df0
|
ben.clark
|
import java.util.Set;
|
16 |
d9f134f9
|
Katja Luther
|
import java.util.UUID;
|
17 |
fdf5453b
|
a.babadshanjan
|
|
18 |
2eb4c6b4
|
Andreas Kohlbecker
|
import org.apache.http.HttpException;
|
19 |
|
|
|
20 |
d9f134f9
|
Katja Luther
|
import eu.etaxonomy.cdm.api.service.config.MediaDeletionConfigurator;
|
21 |
d57c0df0
|
ben.clark
|
import eu.etaxonomy.cdm.api.service.pager.Pager;
|
22 |
0f7d0d42
|
h.fradin
|
import eu.etaxonomy.cdm.model.description.MediaKey;
|
23 |
d57c0df0
|
ben.clark
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
24 |
fdf5453b
|
a.babadshanjan
|
import eu.etaxonomy.cdm.model.media.Media;
|
25 |
2eb4c6b4
|
Andreas Kohlbecker
|
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
|
26 |
d44277a9
|
ben.clark
|
import eu.etaxonomy.cdm.model.media.Rights;
|
27 |
2eb4c6b4
|
Andreas Kohlbecker
|
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
|
28 |
d57c0df0
|
ben.clark
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
29 |
b9cbcc7c
|
Andreas Kohlbecker
|
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
|
30 |
aba8d6ad
|
ben.clark
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
31 |
fdf5453b
|
a.babadshanjan
|
|
32 |
c4e812bc
|
ben.clark
|
public interface IMediaService extends IIdentifiableEntityService<Media> {
|
33 |
fdf5453b
|
a.babadshanjan
|
|
34 |
d57c0df0
|
ben.clark
|
/**
|
35 |
0f7d0d42
|
h.fradin
|
* Return a List of MediaKeys, optionally filtered by the parameters passed.
|
36 |
d9f134f9
|
Katja Luther
|
*
|
37 |
d57c0df0
|
ben.clark
|
* @param taxonomicScope a Set of Taxon instances that define the taxonomic scope of the key (can be null)
|
38 |
|
|
* @param geoScopes a Set of NamedArea instances that define the geospatial scope of the key (can be null)
|
39 |
|
|
* @param pageSize The maximum number of keys returned (can be null for all keys)
|
40 |
|
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
41 |
dd4c21b7
|
Andreas Kohlbecker
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
42 |
0f7d0d42
|
h.fradin
|
* @return a Pager containing MediaKey instances
|
43 |
d57c0df0
|
ben.clark
|
*/
|
44 |
0f7d0d42
|
h.fradin
|
public Pager<MediaKey> getMediaKeys(Set<Taxon> taxonomicScope, Set<NamedArea> geoScopes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
45 |
d9f134f9
|
Katja Luther
|
|
46 |
d44277a9
|
ben.clark
|
/**
|
47 |
|
|
* Return a Pager of rights belonging to this object
|
48 |
d9f134f9
|
Katja Luther
|
*
|
49 |
d44277a9
|
ben.clark
|
* @param t The media object
|
50 |
|
|
* @param pageSize The maximum number of rights returned (can be null for all rights)
|
51 |
|
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
52 |
dd4c21b7
|
Andreas Kohlbecker
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
53 |
d44277a9
|
ben.clark
|
* @return a Pager of Rights entities
|
54 |
|
|
*/
|
55 |
d9f134f9
|
Katja Luther
|
@Override
|
56 |
d44277a9
|
ben.clark
|
public Pager<Rights> getRights(Media t, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
57 |
d9f134f9
|
Katja Luther
|
|
58 |
aba8d6ad
|
ben.clark
|
/**
|
59 |
|
|
* Returns a Paged List of Media instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
|
60 |
d9f134f9
|
Katja Luther
|
*
|
61 |
aba8d6ad
|
ben.clark
|
* @param clazz filter the results by class (or pass null to return all Media instances)
|
62 |
|
|
* @param queryString
|
63 |
|
|
* @param pageSize The maximum number of media returned (can be null for all matching media)
|
64 |
|
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
65 |
|
|
* @param orderHints
|
66 |
|
|
* Supports path like <code>orderHints.propertyNames</code> which
|
67 |
|
|
* include *-to-one properties like createdBy.username or
|
68 |
|
|
* authorTeam.persistentTitleCache
|
69 |
|
|
* @param propertyPaths properties to be initialized
|
70 |
|
|
* @return a Pager Media instances
|
71 |
|
|
* @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
|
72 |
|
|
*/
|
73 |
d9f134f9
|
Katja Luther
|
@Override
|
74 |
|
|
public Pager<Media> search(Class<? extends Media> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
public DeleteResult delete(UUID mediaUuid, MediaDeletionConfigurator config);
|
78 |
2eb4c6b4
|
Andreas Kohlbecker
|
|
79 |
|
|
/**
|
80 |
|
|
* Reads the metadata as stored in the file or web resource and filters the data by the include and exclude lists of key names
|
81 |
|
|
* as stored in the data base properties {@link PreferencePredicate#MediaMetadataKeynameExcludes} and {@link PreferencePredicate#MediaMetadataKeynameExcludes}
|
82 |
|
|
* <p>
|
83 |
|
|
* Metadata of multiple parts is merged into one common metadata map whereas the later part being read may overwrite data from previous parts.
|
84 |
|
|
* The consequences of this can be neglected since we don't expect that multiple parts are actually being used.
|
85 |
|
|
*
|
86 |
|
|
* @param representation
|
87 |
|
|
* @return
|
88 |
|
|
* @throws IOException
|
89 |
|
|
* @throws HttpException
|
90 |
|
|
*/
|
91 |
|
|
Map<String, String> readResourceMetadataFiltered(MediaRepresentation representation) throws IOException, HttpException;
|
92 |
69d28708
|
Katja Luther
|
|
93 |
|
|
/**
|
94 |
|
|
* @param mediaUuids
|
95 |
|
|
* @param config
|
96 |
|
|
* @return
|
97 |
|
|
*/
|
98 |
|
|
public DeleteResult delete(Set<UUID> mediaUuids, MediaDeletionConfigurator config);
|
99 |
fdf5453b
|
a.babadshanjan
|
}
|