source: extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java @ 10494

Last change on this file since 10494 was 10494, checked in by anthony43, 13 years ago

addSimple ws api method added, with unit tests
http://piwigo.org/doc/doku.php?id=en:dev:webapi:pwg.images.addsimple
pom upgraded to 0.3.0-SNAPSHOT since this is a minor change, and also a dependency was added (httpmime)
SessionManagerImpl was modified to make available its httpclient.

File size: 2.5 KB
Line 
1package fr.mael.jiwigo.service;
2
3import java.io.File;
4import java.io.IOException;
5import java.security.NoSuchAlgorithmException;
6import java.util.List;
7
8import fr.mael.jiwigo.om.Image;
9import fr.mael.jiwigo.transverse.exception.FileAlreadyExistsException;
10import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
11import fr.mael.jiwigo.transverse.exception.WrongChunkSizeException;
12
13public interface ImageService {
14
15    /**
16     * Lists all images for a category
17     * @param categoryId the id of the category
18     * @return the list of images
19     * @throws IOException
20     * @throws ProxyAuthenticationException
21     */
22    public List<Image> listByCategory(Integer categoryId, boolean rafraichir) throws IOException,
23            ProxyAuthenticationException;
24
25    /**
26     * Method called to send an image to the server.
27     * @param filePath
28     * @param idCategory
29     * @param originalWidth width for the original image
30     * @param originalHeight height for the original image
31     * @return true if the image is created
32     * @throws IOException
33     * @throws WrongChunkSizeException
34     * @throws ProxyAuthenticationException
35     * @throws FileAlreadyExistsException
36     * @throws NoSuchAlgorithmException
37     * @throws Exception
38     */
39    public boolean create(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,
40            Double chunckSize, Integer privacyLevel) throws IOException, NoSuchAlgorithmException,
41            FileAlreadyExistsException, ProxyAuthenticationException, WrongChunkSizeException;
42
43    /**
44     * Add tags to an existing image
45     * @param image the image
46     * @param tagId the ids of the tags
47     * @return true if successful
48     * @throws IOException
49     * @throws ProxyAuthenticationException
50     */
51    public boolean addTags(Image image, String tagId) throws IOException, ProxyAuthenticationException;
52
53    /**
54     * Search images from a string
55     * @param queryString the string
56     * @return images matching the string
57     * @throws IOException
58     * @throws ProxyAuthenticationException
59     */
60    public List<Image> search(String queryString) throws IOException, ProxyAuthenticationException;
61
62    /**
63     * Uses the pwg.images.addsimple web API to add a new picture
64     * http://piwigo.org/doc/doku.php?id=en:dev:webapi:pwg.images.addsimple
65     *
66     * @param file
67     * @param category
68     * @param title
69     * @throws IOException
70     */
71    public void addSimple(File file, Integer category, String title) throws IOException;
72
73}
Note: See TracBrowser for help on using the repository browser.