]>
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
;
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
);
11 /** @return (0,0) if not available */
12 public Cms2DSize
getImageSize(M node
);
15 * The related <img> tag, with src, width and height set.
17 * @return null if not available
19 public String
getImageTag(M node
);
22 * The related <img> tag, with url, width and height set. Caller must
23 * close the tag (or add additional attributes).
25 * @return null if not available
27 public StringBuilder
getImageTagBuilder(M node
, Cms2DSize size
);
30 * Returns the remotely accessible URL of the image (registering it if
31 * needed) @return null if not available
33 public String
getImageUrl(M node
);
35 // public Binary getImageBinary(Node node) throws RepositoryException;
37 // public Image getSwtImage(Node node) throws RepositoryException;
40 public String
uploadImage(M context
, M uploadFolder
, String fileName
, InputStream in
, String contentType
);
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);