]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.api.cms/src/org/argeo/api/cms/ux/CmsImageManager.java
1 package org
.argeo
.api
.cms
.ux
;
3 import java
.io
.InputStream
;
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
);
10 /** @return (0,0) if not available */
11 public Cms2DSize
getImageSize(M node
);
14 * The related <img> tag, with src, width and height set.
16 * @return null if not available
18 public String
getImageTag(M node
);
21 * The related <img> tag, with url, width and height set. Caller must
22 * close the tag (or add additional attributes).
24 * @return null if not available
26 public StringBuilder
getImageTagBuilder(M node
, Cms2DSize size
);
29 * Returns the remotely accessible URL of the image (registering it if
30 * needed) @return null if not available
32 public String
getImageUrl(M node
);
34 // public Binary getImageBinary(Node node) throws RepositoryException;
36 // public Image getSwtImage(Node node) throws RepositoryException;
39 public String
uploadImage(M context
, M uploadFolder
, String fileName
, InputStream in
, String contentType
);
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);