]> git.argeo.org Git - lgpl/argeo-commons.git/blob - CmsImageManager.java
8c637b8cb6791fc16a87535137294ce201d8ba2d
[lgpl/argeo-commons.git] / CmsImageManager.java
1 package org.argeo.api.cms;
2
3 import java.io.InputStream;
4
5 /** Read and write access to images. */
6 public interface CmsImageManager<V, M> {
7 /** Load image in control */
8 public Boolean load(M node, V control, Cms2DSize size);
9
10 /** @return (0,0) if not available */
11 public Cms2DSize getImageSize(M node);
12
13 /**
14 * The related &lt;img&gt; tag, with src, width and height set.
15 *
16 * @return null if not available
17 */
18 public String getImageTag(M node);
19
20 /**
21 * The related &lt;img&gt; tag, with url, width and height set. Caller must
22 * close the tag (or add additional attributes).
23 *
24 * @return null if not available
25 */
26 public StringBuilder getImageTagBuilder(M node, Cms2DSize size);
27
28 /**
29 * Returns the remotely accessible URL of the image (registering it if
30 * needed) @return null if not available
31 */
32 public String getImageUrl(M node);
33
34 // public Binary getImageBinary(Node node) throws RepositoryException;
35
36 // public Image getSwtImage(Node node) throws RepositoryException;
37
38 /** @return URL */
39 public String uploadImage(M context, M uploadFolder, String fileName, InputStream in, String contentType);
40
41 @Deprecated
42 default String uploadImage(M uploadFolder, String fileName, InputStream in) {
43 System.err.println("Context must be provided to " + CmsImageManager.class.getName());
44 return uploadImage(null, uploadFolder, fileName, in, null);
45 }
46 }