public class ImagePlugin extends PluginActivator
Modifier and Type | Field and Description |
---|---|
static String |
DM4_HOST_URL |
static String |
FILEREPO_BASE_URI_NAME |
static String |
FILEREPO_IMAGES_SUBFOLDER |
private FilesService |
fileService |
private static Logger |
log |
private javax.ws.rs.core.UriInfo |
uriInfo |
bundle, dms
Constructor and Description |
---|
ImagePlugin() |
Modifier and Type | Method and Description |
---|---|
ResultList<Image> |
browse()
Returns a set of all image source URLs.
|
private void |
createImagesDirectoryInFileRepo() |
private String |
getCkEditorCall(Long func,
String uri,
String error)
Returns a in-line JavaScript snippet that calls the parent CKEditor.
|
private String |
getRepoUri(String path)
Returns an external accessible file repository URI of path based on the
dm4.host.url platform configuration option. |
private String |
prefix() |
Topic |
upload(UploadedFile image,
Long func)
Standard image upload integration.
|
String |
uploadCKEditor(UploadedFile image,
Long func)
CKEditor image upload integration, see
CKEDITOR.config.filebrowserImageBrowseUrl
|
getBundleContext, getPluginName, getStaticResource, getUri, init, preInstall, publishFileSystem, serviceArrived, serviceGone, setCoreService, shutdown, start, stop, toString
public static final String FILEREPO_BASE_URI_NAME
public static final String FILEREPO_IMAGES_SUBFOLDER
public static final String DM4_HOST_URL
private FilesService fileService
@Context private javax.ws.rs.core.UriInfo uriInfo
public ImagePlugin()
public String uploadCKEditor(UploadedFile image, Long func)
image
- Uploaded file resource.func
- CKEDITOR function number to call.public Topic upload(UploadedFile image, Long func)
image
- Uploaded file resource.public ResultList<Image> browse()
private void createImagesDirectoryInFileRepo()
private String getCkEditorCall(Long func, String uri, String error)
func
- CKEDITOR function number.uri
- Resource URI.error
- Error message.private String getRepoUri(String path)
dm4.host.url
platform configuration option.path
- Relative path of a file repository resource.Copyright © 2016. All Rights Reserved.