@Component @Named(value="wysiwyg") @Singleton public class WysiwygEditorScriptService extends Object implements org.xwiki.script.service.ScriptService
Constructor and Description |
---|
WysiwygEditorScriptService() |
Modifier and Type | Method and Description |
---|---|
String |
fromAnnotatedXHTML(String html,
String targetSyntaxId)
Converts the given annotated HTML produced by the WYSIWYG editor to the specified target syntax.
|
String |
importOfficeAttachment(AttachmentReference attachmentReference,
Map<String,Object> parameters)
Builds the annotated XHTML needed to import the specified office attachment in the WYSIWYG editor.
|
boolean |
isSyntaxSupported(String syntaxId)
Checks if there is a parser and a renderer available for the specified syntax.
|
String |
parseAndRender(String html,
String syntaxId)
Deprecated.
since 11.9RC1, use
parseAndRender(String, Syntax, EntityReference) instead |
String |
parseAndRender(String html,
org.xwiki.rendering.syntax.Syntax syntax,
EntityReference sourceReference)
Parses the given HTML fragment and renders the result in annotated XHTML syntax.
|
String |
render(DocumentReference templateReference)
Produces the input for the editor by rendering the specified content template as a full HTML page, making sure
the skin extension hooks are resolved.
|
String |
toAnnotatedXHTML(String source,
String syntaxId)
Deprecated.
since 11.9RC1 use
|
String |
toAnnotatedXHTML(String source,
org.xwiki.rendering.syntax.Syntax syntax,
EntityReference sourceReference)
Converts the given source text from the specified syntax to annotated XHTML, which can be used as input for the
WYSIWYG editor.
|
public boolean isSyntaxSupported(String syntaxId)
This method should be called before attempting to load the WYSIWYG editor.
syntaxId
- the syntax identifier, like xwiki/2.0
true
if the specified syntax is currently supported by the editor, false
otherwise@Deprecated public String parseAndRender(String html, String syntaxId)
parseAndRender(String, Syntax, EntityReference)
instead
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.
html
- the HTML fragment to be renderedsyntaxId
- the storage syntax identifierpublic String parseAndRender(String html, org.xwiki.rendering.syntax.Syntax syntax, EntityReference sourceReference)
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.
html
- the HTML fragment to be renderedsyntax
- the storage syntax identifiersourceReference
- the reference of the html (where it's coming from)public String render(DocumentReference templateReference)
templateReference
- specifies the document that serves as the template for the editor content@Deprecated public String toAnnotatedXHTML(String source, String syntaxId)
source
- the text to be convertedsyntaxId
- the syntax identifierpublic String toAnnotatedXHTML(String source, org.xwiki.rendering.syntax.Syntax syntax, EntityReference sourceReference)
source
- the text to be convertedsyntax
- the syntax of the sourcesourceReference
- the reference of the sourcepublic String fromAnnotatedXHTML(String html, String targetSyntaxId)
html
- the annotated HTML to be convertedtargetSyntaxId
- the target syntaxpublic String importOfficeAttachment(AttachmentReference attachmentReference, Map<String,Object> parameters)
attachmentReference
- the office attachment to importparameters
- the import parameters; filterStyles
controls whether styles are filtered when importing
office text documents; useOfficeViewer
controls whether the office viewer macro is used
instead of converting the content of the office file to wiki syntaxCopyright © 2004–2022 XWiki. All rights reserved.