Package org.apache.wiki.ui
Interface EditorManager
- All Superinterfaces:
Initializable
,ModuleManager
- All Known Implementing Classes:
DefaultEditorManager
Defines an editor manager. An editor can be added by adding a suitable JSP file under templates/default/editors
If you want your editor to include any scripts or something, you can simply request it by adding the following in your
ini/jspwiki_module.xml
:
<modules> <editor name="myeditor"> <author>Janne Jalkanen</author> <script>foo.js</script> <stylesheet>foo.css</stylesheet> <path>editors/myeditor.jsp</path> </editor> </modules>
- Since:
- 2.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Known attribute name for storing the user edited text inside a session or a page contextstatic final String
Known name for the plain wikimarkup editor.static final String
Known name for the preview editor component.static final String
Parameter for changing editors at run-timestatic final String
The property name for setting the editor.static final String
Known attribute name for storing the user edited text inside a HTTP parameter.Fields inherited from interface org.apache.wiki.modules.ModuleManager
PLUGIN_RESOURCE_LOCATION
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getEditedText
(javax.servlet.jsp.PageContext ctx) Convenience function which examines the current context and attempts to figure out whether the edited text is in the HTTP request parameters or somewhere in the session.String[]
Returns a list of editors as Strings of editor names.getEditorName
(Context context) Returns an editor for the current context.getEditorPath
(Context context) Convenience method for getting the path to the editor JSP file.Methods inherited from interface org.apache.wiki.api.engine.Initializable
initialize
Methods inherited from interface org.apache.wiki.modules.ModuleManager
checkCompatibility, getModuleInfo, modules
-
Field Details
-
PROP_EDITORTYPE
The property name for setting the editor. Current value is "jspwiki.editor" - not used anymore: replaced by defaultpref.template.editor- See Also:
-
PARA_EDITOR
Parameter for changing editors at run-time- See Also:
-
EDITOR_PLAIN
Known name for the plain wikimarkup editor.- See Also:
-
EDITOR_PREVIEW
Known name for the preview editor component.- See Also:
-
REQ_EDITEDTEXT
Known attribute name for storing the user edited text inside a HTTP parameter.- See Also:
-
ATTR_EDITEDTEXT
Known attribute name for storing the user edited text inside a session or a page context- See Also:
-
-
Method Details
-
getEditorName
Returns an editor for the current context. The editor names are matched in a case insensitive manner. At the moment, the only place that this method looks in is the property file, but in the future this will also look at user preferences.Determines the editor to use by the following order of conditions: 1. Editor set in User Preferences 2. Default Editor set in jspwiki.properties
For the PREVIEW context, this method returns the "preview" editor.
- Parameters:
context
- The context that is chosen.- Returns:
- The name of the chosen editor. If no match could be found, will revert to the default "plain" editor.
-
getEditorList
String[] getEditorList()Returns a list of editors as Strings of editor names.- Returns:
- the list of available editors
-
getEditorPath
Convenience method for getting the path to the editor JSP file.- Parameters:
context
- WikiContext from where the editor name is retrieved.- Returns:
- e.g. "editors/plain.jsp"
-
getEditedText
Convenience function which examines the current context and attempts to figure out whether the edited text is in the HTTP request parameters or somewhere in the session.- Parameters:
ctx
- the JSP page context- Returns:
- the edited text, if present in the session page context or as a parameter
-