public class ImagePlugin extends PluginActivator
Modifier and Type | Field and Description |
---|---|
private static String |
FILE_REPOSITORY_PATH |
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 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
actual request URI.
|
private void |
postInstallMigration() |
void |
serviceArrived(PluginService service)
Reference the file service and create the repository path if necessary.
|
void |
serviceGone(PluginService service)
Nullify file service reference.
|
String |
upload(UploadedFile image,
Long func)
CKEditor image upload integration, see
CKEDITOR.config.filebrowserImageBrowseUrl
|
getBundleContext, getPluginName, getStaticResource, getUri, init, postInstall, publishDirectory, setCoreService, shutdown, start, stop, toString
public static final String FILEREPO_BASE_URI_NAME
public static final String FILEREPO_IMAGES_SUBFOLDER
private static final String FILE_REPOSITORY_PATH
private FilesService fileService
@Context private javax.ws.rs.core.UriInfo uriInfo
public ImagePlugin()
public String upload(UploadedFile image, Long func)
image
- Uploaded file resource.func
- CKEDITOR function number to call.cookie
- Actual cookie.public ResultList<Image> browse()
public void serviceGone(PluginService service)
serviceGone
in interface PluginContext
serviceGone
in class PluginActivator
public void serviceArrived(PluginService service)
serviceArrived
in interface PluginContext
serviceArrived
in class PluginActivator
private void postInstallMigration()
private String getCkEditorCall(Long func, String uri, String error)
func
- CKEDITOR function number.uri
- Resource URI.error
- Error message.private String getRepoUri(String path)
path
- Relative path of a file repository resource.Copyright © 2015. All Rights Reserved.