@Component @Named(value="rendering") @Singleton public class RenderingScriptService extends Object implements org.xwiki.script.service.ScriptService
Constructor and Description |
---|
RenderingScriptService() |
Modifier and Type | Method and Description |
---|---|
String |
escape(String content,
org.xwiki.rendering.syntax.Syntax syntax)
Escapes a give text using the escaping method specific to the given syntax.
|
List<org.xwiki.rendering.syntax.Syntax> |
getAvailableParserSyntaxes() |
List<org.xwiki.rendering.syntax.Syntax> |
getAvailableRendererSyntaxes() |
List<org.xwiki.rendering.syntax.Syntax> |
getConfiguredSyntaxes() |
List<String> |
getDefaultTransformationNames() |
List<org.xwiki.rendering.syntax.Syntax> |
getDisabledSyntaxes() |
org.xwiki.rendering.macro.descriptor.MacroDescriptor |
getMacroDescriptor(org.xwiki.rendering.macro.MacroId macroId) |
List<org.xwiki.rendering.macro.descriptor.MacroDescriptor> |
getMacroDescriptors(org.xwiki.rendering.syntax.Syntax syntax) |
org.xwiki.rendering.block.XDOM |
parse(String text,
String syntaxId)
Parses a text written in the passed syntax.
|
String |
render(org.xwiki.rendering.block.Block block,
String outputSyntaxId)
Render a list of Blocks into the passed syntax.
|
org.xwiki.rendering.macro.MacroId |
resolveMacroId(String macroIdAsString) |
org.xwiki.rendering.syntax.Syntax |
resolveSyntax(String syntaxId)
Converts a Syntax specified as a String into a proper Syntax object.
|
public List<org.xwiki.rendering.syntax.Syntax> getAvailableParserSyntaxes()
public List<org.xwiki.rendering.syntax.Syntax> getAvailableRendererSyntaxes()
public List<String> getDefaultTransformationNames()
public org.xwiki.rendering.block.XDOM parse(String text, String syntaxId)
text
- the text to parsesyntaxId
- the id of the syntax in which the text is written inpublic String render(org.xwiki.rendering.block.Block block, String outputSyntaxId)
block
- the block to renderoutputSyntaxId
- the syntax in which to render the blockspublic org.xwiki.rendering.syntax.Syntax resolveSyntax(String syntaxId)
syntaxId
- the syntax as a string (eg "xwiki/2.0", "html/4.01", etc)public String escape(String content, org.xwiki.rendering.syntax.Syntax syntax)
One example of escaping method is using escape characters like ~
for the Syntax.XWIKI_2_1
syntax
on all or just some characters of the given text.
The current implementation only escapes XWiki 1.0, 2.0 and 2.1 syntaxes.
content
- the text to escapesyntax
- the syntax to escape the content in (e.g. Syntax.XWIKI_1_0
, Syntax.XWIKI_2_0
,
Syntax.XWIKI_2_1
, etc.). This is the syntax where the output will be used and not necessarily
the same syntax of the input contentnull
if the given content or the given syntax are null
, or if the
syntax is not supportedpublic List<org.xwiki.rendering.syntax.Syntax> getConfiguredSyntaxes()
public List<org.xwiki.rendering.syntax.Syntax> getDisabledSyntaxes()
public List<org.xwiki.rendering.macro.descriptor.MacroDescriptor> getMacroDescriptors(org.xwiki.rendering.syntax.Syntax syntax) throws org.xwiki.rendering.macro.MacroLookupException
syntax
- the syntax for which to return the list of Macro descriptorsorg.xwiki.rendering.macro.MacroLookupException
- if a macro component descriptor cannot be loaded@Unstable public org.xwiki.rendering.macro.MacroId resolveMacroId(String macroIdAsString)
macroIdAsString
- a string representing a macro idnull
if resolving the given string fails@Unstable public org.xwiki.rendering.macro.descriptor.MacroDescriptor getMacroDescriptor(org.xwiki.rendering.macro.MacroId macroId)
macroId
- the macro idnull
otherwiseCopyright © 2004–2019 XWiki. All rights reserved.