de.deepamehta.plugins.images
Class ImagePlugin

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.osgi.PluginActivator
      extended by de.deepamehta.plugins.images.ImagePlugin
All Implemented Interfaces:
PluginContext, org.osgi.framework.BundleActivator

public class ImagePlugin
extends PluginActivator

CKEditor compatible resources for image upload and browse.


Field Summary
private static String FILE_REPOSITORY_PATH
           
private  FilesService fileService
           
static String IMAGES
           
private static Logger log
           
private  javax.ws.rs.core.UriInfo uriInfo
           
 
Fields inherited from class de.deepamehta.core.osgi.PluginActivator
bundle, dms
 
Constructor Summary
ImagePlugin()
           
 
Method Summary
 ResultSet<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, ClientState cookie)
          CKEditor image upload integration, see CKEDITOR.config.filebrowserImageBrowseUrl
 
Methods inherited from class de.deepamehta.core.osgi.PluginActivator
getBundleContext, init, postInstall, publishDirectory, setCoreService, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IMAGES

public static final String IMAGES
See Also:
Constant Field Values

FILE_REPOSITORY_PATH

private static final String FILE_REPOSITORY_PATH

log

private static Logger log

fileService

private FilesService fileService

uriInfo

@Context
private javax.ws.rs.core.UriInfo uriInfo
Constructor Detail

ImagePlugin

public ImagePlugin()
Method Detail

upload

public String upload(UploadedFile image,
                     Long func,
                     @HeaderParam(value="Cookie")
                     ClientState cookie)
CKEditor image upload integration, see CKEDITOR.config.filebrowserImageBrowseUrl

Parameters:
image - Uploaded file resource.
func - CKEDITOR function number to call.
cookie - Actual cookie.
Returns:
JavaScript snippet that calls CKEditor

browse

public ResultSet<Image> browse()
Returns a set of all image source URLs.

Returns:
all image sources

serviceGone

public void serviceGone(PluginService service)
Nullify file service reference.

Specified by:
serviceGone in interface PluginContext
Overrides:
serviceGone in class PluginActivator

serviceArrived

public void serviceArrived(PluginService service)
Reference the file service and create the repository path if necessary.

Specified by:
serviceArrived in interface PluginContext
Overrides:
serviceArrived in class PluginActivator

postInstallMigration

private void postInstallMigration()

getCkEditorCall

private String getCkEditorCall(Long func,
                               String uri,
                               String error)
Returns a in-line JavaScript snippet that calls the parent CKEditor.

Parameters:
func - CKEDITOR function number.
uri - Resource URI.
error - Error message.
Returns:
JavaScript snippet that calls CKEditor

getRepoUri

private String getRepoUri(String path)
Returns an external accessible file repository URI of path based on actual request URI.

Parameters:
path - Relative path of a file repository resource.
Returns:
URI


Copyright © 2013. All Rights Reserved.