org.xwiki.rendering.script
Class RenderingScriptService

java.lang.Object
  extended by org.xwiki.rendering.script.RenderingScriptService
All Implemented Interfaces:
org.xwiki.script.service.ScriptService

@Component
@Named(value="rendering")
@Singleton
public class RenderingScriptService
extends Object
implements org.xwiki.script.service.ScriptService

Provides Rendering-specific Scripting APIs.

Since:
2.3M1
Version:
$Id: 3ba84d000e7e2b9777c3ab3aaa5073688e316408 $

Constructor Summary
RenderingScriptService()
           
 
Method Summary
 List<org.xwiki.rendering.syntax.Syntax> getAvailableParserSyntaxes()
           
 List<org.xwiki.rendering.syntax.Syntax> getAvailableRendererSyntaxes()
           
 List<String> getDefaultTransformationNames()
           
 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.syntax.Syntax resolveSyntax(String syntaxId)
          Converts a Syntax specified as a String into a proper Syntax object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderingScriptService

public RenderingScriptService()
Method Detail

getAvailableParserSyntaxes

public List<org.xwiki.rendering.syntax.Syntax> getAvailableParserSyntaxes()
Returns:
the list of syntaxes for which a Parser is available

getAvailableRendererSyntaxes

public List<org.xwiki.rendering.syntax.Syntax> getAvailableRendererSyntaxes()
Returns:
the list of syntaxes for which a Renderer is available

getDefaultTransformationNames

public List<String> getDefaultTransformationNames()
Returns:
the names of Transformations that are configured in the Rendering Configuration and which are used by the Transformation Manager when running all transformations

parse

public org.xwiki.rendering.block.XDOM parse(String text,
                                            String syntaxId)
Parses a text written in the passed syntax.

Parameters:
text - the text to parse
syntaxId - the id of the syntax in which the text is written in
Returns:
the XDOM representing the AST of the parsed text or null if an error occurred
Since:
3.2M3

render

public String render(org.xwiki.rendering.block.Block block,
                     String outputSyntaxId)
Render a list of Blocks into the passed syntax.

Parameters:
block - the block to render
outputSyntaxId - the syntax in which to render the blocks
Returns:
the string representing the passed blocks in the passed syntax or null if an error occurred
Since:
3.2M3

resolveSyntax

public org.xwiki.rendering.syntax.Syntax resolveSyntax(String syntaxId)
Converts a Syntax specified as a String into a proper Syntax object.

Parameters:
syntaxId - the syntax as a string (eg "xwiki/2.0", "html/4.01", etc)
Returns:
the proper Syntax object representing the passed syntax


Copyright © 2004–2014 XWiki. All rights reserved.