org.xwiki.wysiwyg.server
Interface WysiwygEditorScriptService

All Superinterfaces:
org.xwiki.script.service.ScriptService

@Role
public interface WysiwygEditorScriptService
extends org.xwiki.script.service.ScriptService

The WYSIWYG editor API exposed to server-side scripts like Velocity.

Version:
$Id: b58645171e4092cdad2044afa83cdabf17611443 $

Method Summary
 WysiwygEditorConfiguration getConfig()
           
 boolean isSyntaxSupported(String syntaxId)
          Checks if there is a parser and a renderer available for the specified syntax.
 String parseAndRender(String html, String syntaxId)
          Parses the given HTML fragment and renders the result in annotated XHTML syntax.
 String toAnnotatedXHTML(String source, String syntaxId)
          Converts the given source text from the specified syntax to annotated XHTML, which can be used as input for the WYSIWYG editor.
 

Method Detail

isSyntaxSupported

boolean isSyntaxSupported(String syntaxId)
Checks if there is a parser and a renderer available for the specified syntax.

This method should be called before attempting to load the WYSIWYG editor.

Parameters:
syntaxId - the syntax identifier, like xwiki/2.0
Returns:
true if the specified syntax is currently supported by the editor, false otherwise

parseAndRender

String parseAndRender(String html,
                      String syntaxId)
Parses the given HTML fragment and renders the result in annotated XHTML syntax.

This method is currently used in wysiwyginput.vm and its purpose is to refresh the content of the WYSIWYG editor. This method is called for instance when a macro is inserted or edited.

Parameters:
html - the HTML fragment to be rendered
syntaxId - the storage syntax identifier
Returns:
the XHTML result of rendering the given HTML fragment

toAnnotatedXHTML

String toAnnotatedXHTML(String source,
                        String syntaxId)
Converts the given source text from the specified syntax to annotated XHTML, which can be used as input for the WYSIWYG editor.

Parameters:
source - the text to be converted
syntaxId - the syntax identifier
Returns:
the annotated XHTML result of the conversion

getConfig

WysiwygEditorConfiguration getConfig()
Returns:
the WYSIWYG editor configuration object


Copyright © 2004-2012 XWiki. All Rights Reserved.