Class SyntaxContentEditScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService

    @Component
    @Singleton
    @Named("edit.syntaxContent")
    public class SyntaxContentEditScriptService
    extends AbstractTypedEditScriptService<org.xwiki.rendering.syntax.SyntaxContent>
    Edit script service specialized in SyntaxContent Editors.
    Since:
    8.2RC1
    Version:
    $Id: 1fe151448775b2eed3d5e49035e04c8e162416bd $
    • Constructor Detail

      • SyntaxContentEditScriptService

        public SyntaxContentEditScriptService()
    • Method Detail

      • getDefaultTextEditor

        public Editor<org.xwiki.rendering.syntax.SyntaxContent> getDefaultTextEditor()
        Returns:
        the default SyntaxContent editor in the "Text" category
      • getDefaultWysiwygEditor

        public Editor<org.xwiki.rendering.syntax.SyntaxContent> getDefaultWysiwygEditor()
        Returns:
        the default SyntaxContent editor in the "WYSIWYG" category
      • text

        public String text​(String content,
                           org.xwiki.rendering.syntax.Syntax syntax,
                           Map<String,​Object> parameters)
                    throws EditException
        Generates the HTML code needed to edit the given data.
        Parameters:
        content - the text content to edit
        syntax - the syntax of the given content
        parameters - the edit parameters
        Returns:
        the HTML code that displays the default text editor for SyntaxContent
        Throws:
        EditException - if rendering the editor fails
      • wysiwyg

        public String wysiwyg​(String content,
                              org.xwiki.rendering.syntax.Syntax syntax,
                              Map<String,​Object> parameters)
                       throws EditException
        Generates the HTML code needed to edit the given data.
        Parameters:
        content - the text content to edit
        syntax - the syntax of the given content
        parameters - the edit parameters
        Returns:
        the HTML code that displays the default WYSIWYG editor for SyntaxContent
        Throws:
        EditException - if rendering the editor fails