Interface EditorManager

All Superinterfaces:
org.apache.wiki.api.engine.Initializable, ModuleManager
All Known Implementing Classes:
DefaultEditorManager

public interface EditorManager extends ModuleManager, org.apache.wiki.api.engine.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 Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Known attribute name for storing the user edited text inside a session or a page context
    static 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-time
    static 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_I18N_RESOURCE, PLUGIN_RESOURCE_LOCATION
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getEditedText(jakarta.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.
    Returns a list of editors as Strings of editor names.
    getEditorName(org.apache.wiki.api.core.Context context)
    Returns an editor for the current context.
    getEditorPath(org.apache.wiki.api.core.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

  • Method Details

    • getEditorName

      String getEditorName(org.apache.wiki.api.core.Context context)
      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

      String getEditorPath(org.apache.wiki.api.core.Context context)
      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(jakarta.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