Write an Editor in a Wiki Page
Steps
Add an editor to a running instance without compiling anything, by writing it as a wiki page instead of in Java.
The editor is an XWiki.EditorClass object on a page, and the object's properties say what it edits, under which identifier and with which code. The example below is a plain text area for wiki content, in the text category.
- Create the page that will hold the editor. Its title becomes the editor's name and its content the editor's description, read from the translated page every time the editor is described, so both follow the reader's language:
Title: Simple Text Area Content: A plain text area with no toolbar, for editing wiki syntax by hand. - Add an object of type XWiki.EditorClass to that page with the Object editor:

- Fill the object's six properties:
Property Value in this example What it is Data Type org.xwiki.rendering.syntax.SyntaxContent the Java type the editor edits Role Hint simple-textarea the editor's identifier Code (the next step) the wiki content that produces the editor Icon pencil the icon shown for the editor Category text the editing mode the editor belongs to Scope Current Wiki where the editor is registered 
The first two decide whether the editor exists at all: the query that collects the editors defined in wiki pages skips an object whose Role Hint is empty, and an object whose Data Type is not a type the instance can load fails to register, with the reason in the log. Scope is the one thing a Java editor cannot choose: Current User registers the editor for the page's author only, Current Wiki for the wiki holding the page, Global for every wiki of the farm, and an empty value is read as Current Wiki.
- Write the Code property. Unlike the template of a Java editor it is page content, so it is written in the page's own syntax and may use macros. It reads $edit.data and $edit.parameters from the same edit binding a Java editor's template uses:
{{velocity}} {{html clean="false"}} <div class="box infomessage">Editing $escapetool.xml($edit.data.syntax.toIdString()) content.</div> <textarea id="$!edit.parameters.id" name="$!edit.parameters.name" rows="$!edit.parameters.rows" cols="$!edit.parameters.cols">$escapetool.xml($edit.data.content)</textarea> {{/html}} {{/velocity}} - Save the page. The editor is registered as soon as the page is saved, and naming it in the query string of an edit URL is enough to see it at work on the data type and category it declared:
/bin/edit/Sandbox/MeetingNotes?editor=wiki&SyntaxContent.text.editor=simple-textarea
To hand the editor to a user, a space or the whole wiki without naming it in the URL, see Configure the Default Editor.
Two of the editors shipped with XWiki are written this way and are worth reading as examples: CKEditor.SyntaxContentEditor registers ckeditor in the wysiwyg category, and XWiki.Realtime.WikiEditor registers realtime-wiki in the text category, both with the Current Wiki scope. Both keep the editor code in the page content and set the Code property to an include of their own page, and both guard that content so that it renders only while the page is being used as an editor, which keeps it out of the editor's description.