Writing Java Plugins

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

(Added draft of Writing Java Plugins article)
 
(Article contents proof-read)
Line 1: Line 1:
 
__TOC__{{CKFinder 2.x Writing Plugins Introduction}}
 
__TOC__{{CKFinder 2.x Writing Plugins Introduction}}
== Creating a plugin ==
+
== Creating a Plugin ==
  
==== Step1: Create plugin folder ====
+
==== Step 1: Create plugin folder ====
==== Step2: Add plugin definition ====
+
==== Step 2: Add plugin definition ====
==== Step3: Enable plugin ====
+
==== Step 3: Enable plugin ====
  
== Java plugin system ==
+
== Java Plugin System ==
  
 
=== Events ===
 
=== Events ===
  
CKFinder provides several events that can be used to extend the functionality of the CKFinder application. Assigning a class (also known as an event handler) to an event will cause that function to be called at the appropriate point in the main CKFinder code, to perform whatever additional task(s) the developer thinks would be useful at that point. Each event can have multiple event listeners assigned to it.
+
CKFinder provides several events that can be used to extend the functionality of a CKFinder application. Assigning a class (also known as an ''event handler'') to an event will cause that function to be called at an appropriate point in the main CKFinder code to perform whatever additional task(s) the developer considers useful at that point. Each event can have multiple event listeners assigned to it.
  
==== Available events ====
+
==== Available Events ====
 
{{CKFinder_2.x hooks table}}
 
{{CKFinder_2.x hooks table}}
  
 
{{#CUSTOMTITLE:Writing Java Plugins}}
 
{{#CUSTOMTITLE:Writing Java Plugins}}

Revision as of 21:38, 16 May 2011

CKFinder functionality can be extended with server-side plugins. Although the full source code of the CKFinder server connector is available and can be modified in any way desired, a much better way of enhancing the CKFinder connector is to create a plugin.

The main advantages of plugins are:

  • Upgrades are much easier.
  • The plugin code is stored in a single place.
  • Plugins can be easily disabled when they are not needed anymore.

Common use cases:

  • Adding a new server-side command (i.e. fileditor and imageresize plugin).
  • Working with uploaded files (i.e. watermark plugin).
  • Extending information returned by the Init command (i.e. imageresize plugin).

Creating a Plugin

Step 1: Create plugin folder

Step 2: Add plugin definition

Step 3: Enable plugin

Java Plugin System

Events

CKFinder provides several events that can be used to extend the functionality of a CKFinder application. Assigning a class (also known as an event handler) to an event will cause that function to be called at an appropriate point in the main CKFinder code to perform whatever additional task(s) the developer considers useful at that point. Each event can have multiple event listeners assigned to it.

Available Events

Hook Since Description
AfterFileUpload 2.0 Executed after successful file upload.
BeforeExecuteCommand 2.0 Executed before a server side command is executed.
InitCommand 2.0 Executed straight before sending the result of the Init command.