Project

General

Profile

Download (2.98 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2020 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* 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
package eu.etaxonomy.cdm.remote.controller.util;
10

    
11
import java.io.IOException;
12
import java.util.List;
13

    
14
import eu.etaxonomy.cdm.model.media.Media;
15
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
16
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
17
import eu.etaxonomy.cdm.model.media.MediaUtils.MissingValueStrategy;
18

    
19
/**
20
 * @author a.kohlbecker
21
 * @since Jul 8, 2020
22
 */
23
public interface IMediaToolbox {
24

    
25
    /**
26
     * Extend the set of media representations in <code>media</code>, filter the resulting representations by the
27
     * attributes defined via the parameters <code>type</code>, <code>size</code>, <code>height</code>, <code>widthOrDuration</code>
28
     * and <code>mimeTypes</code> and finally return the list of matching MediaRepresentations ordered by the ranging of the match.
29
     *
30
     */
31
    public List<Media> processAndFilterPreferredMediaRepresentations(Class<? extends MediaRepresentationPart> type,
32
            String[] mimeTypes, Integer widthOrDuration, Integer height, Integer size, List<Media> taxonGalleryMedia) throws IOException;
33

    
34
    /**
35
     * Filters the Media  objects and the contained MediaRepresentations by the
36
     * attributes defined via the parameters <code>type</code>, <code>size</code>, <code>height</code>, <code>widthOrDuration</code>
37
     * and <code>mimeTypes</code> and finally return the media objects which have at lease one matching representation.
38
     * The MediaRepresentations are also filtered and ordered by the ranging of the match.
39
     *
40
     * @deprecated needs to be replaced, see https://dev.e-taxonomy.eu/redmine/issues/9160
41
     */
42
    @Deprecated
43
    public List<Media> filterPreferredMediaRepresentations(List<Media> mediaList, Class<? extends MediaRepresentationPart> type,
44
            String[] mimeTypes, Integer widthOrDuration, Integer height, Integer size);
45

    
46
    /**
47
     * Extend the set of media representations in <code>media</code>, filter the resulting representations by the
48
     * attributes defined via the parameters <code>type</code>, <code>size</code>, <code>height</code>, <code>widthOrDuration</code>
49
     * and <code>mimeTypes</code> and finally return the best matching MediaRepresentation.
50
     *
51
     * @param media
52
     * @param type
53
     * @param size
54
     * @param height
55
     * @param widthOrDuration
56
     * @param mimeTypes
57
     * @param missingValStrategy Strategies for replacing <code>null</code> values with a numeric value.
58
     * @return
59
     * @throws IOException
60
     */
61
    public MediaRepresentation processAndFindBestMatchingRepresentation(Media media,
62
            Class<? extends MediaRepresentationPart> type, Integer size, Integer height, Integer widthOrDuration,
63
            String[] mimeTypes, MissingValueStrategy missingValStrategy) throws IOException;
64

    
65
}
(2-2/5)