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