Interface EditorManager

All Superinterfaces:
Initializable, ModuleManager
All Known Implementing Classes:
DefaultEditorManager

public interface EditorManager
extends ModuleManager, Initializable
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 Details

  • 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

      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

      static 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.
      Parameters:
      ctx - the JSP page context
      Returns:
      the edited text, if present in the session page context or as a parameter