org.exoplatform.wiki.rendering.impl
Class RenderingServiceImpl

java.lang.Object
  extended by org.exoplatform.wiki.rendering.impl.RenderingServiceImpl
All Implemented Interfaces:
RenderingService, org.picocontainer.Startable

public class RenderingServiceImpl
extends Object
implements RenderingService, org.picocontainer.Startable


Constructor Summary
RenderingServiceImpl()
           
 
Method Summary
<T> T
getComponent(Type clazz)
           
 org.xwiki.component.manager.ComponentManager getComponentManager()
          Gets the Component Manager which provides ways to access and modify components (service) in the system.
 String getContentOfSection(String markup, String sourceSyntax, String sectionIndex)
          Gets content of a section.
 String getCssURL()
          Gets a CSS URL.
 org.xwiki.context.Execution getExecution()
          Gets the current execution instance.
 org.xwiki.rendering.block.XDOM parse(String markup, String sourceSyntax)
          Parses a wiki page markup based on the syntax.
 String render(String markup, String sourceSyntax, String targetSyntax, boolean supportSectionEdit)
          Renders a wiki page from its markup to HTML by using the right syntax.
 void setCssURL(String cssURL)
          Sets a CSS URL.
 void start()
           
 void stop()
           
 String updateContentOfSection(String markup, String sourceSyntax, String sectionIndex, String newSectionContent)
          Updates content of the selected section.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderingServiceImpl

public RenderingServiceImpl()
Method Detail

getExecution

public org.xwiki.context.Execution getExecution()
                                         throws org.xwiki.component.manager.ComponentLookupException,
                                                org.xwiki.component.manager.ComponentRepositoryException
Description copied from interface: RenderingService
Gets the current execution instance.

Specified by:
getExecution in interface RenderingService
Returns:
The execution instance.
Throws:
org.xwiki.component.manager.ComponentLookupException
org.xwiki.component.manager.ComponentRepositoryException

getComponentManager

public org.xwiki.component.manager.ComponentManager getComponentManager()
Description copied from interface: RenderingService
Gets the Component Manager which provides ways to access and modify components (service) in the system.

Specified by:
getComponentManager in interface RenderingService
Returns:
The Component Manager.

getComponent

public <T> T getComponent(Type clazz)

render

public String render(String markup,
                     String sourceSyntax,
                     String targetSyntax,
                     boolean supportSectionEdit)
              throws Exception
Description copied from interface: RenderingService
Renders a wiki page from its markup to HTML by using the right syntax.

Specified by:
render in interface RenderingService
Parameters:
markup - The wiki page markup.
sourceSyntax - The syntax used by the wiki page.
targetSyntax - The target syntax to apply.
supportSectionEdit - If "true", the "Edit section" function is supported. Otherwise, this function is not supported.
Returns:
The readable content of the rendered wiki page.
Throws:
Exception

getContentOfSection

public String getContentOfSection(String markup,
                                  String sourceSyntax,
                                  String sectionIndex)
                           throws Exception
Description copied from interface: RenderingService
Gets content of a section.

Specified by:
getContentOfSection in interface RenderingService
Parameters:
markup - The wiki page markup.
sourceSyntax - The syntax used by the wiki page.
sectionIndex - The index of the section.
Returns:
The section content.
Throws:
Exception

updateContentOfSection

public String updateContentOfSection(String markup,
                                     String sourceSyntax,
                                     String sectionIndex,
                                     String newSectionContent)
                              throws Exception
Description copied from interface: RenderingService
Updates content of the selected section.

Specified by:
updateContentOfSection in interface RenderingService
Parameters:
markup - The wiki page markup.
sourceSyntax - The syntax used by the wiki page.
sectionIndex - The section index.
newSectionContent - New content of the section.
Returns:
Content of the page which includes the modified section.
Throws:
Exception

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable

parse

public org.xwiki.rendering.block.XDOM parse(String markup,
                                            String sourceSyntax)
                                     throws Exception
Description copied from interface: RenderingService
Parses a wiki page markup based on the syntax.

Specified by:
parse in interface RenderingService
Parameters:
markup - The markup to parse.
sourceSyntax - The syntax to use.
Returns:
The XDOM object.
Throws:
Exception

getCssURL

public String getCssURL()
Description copied from interface: RenderingService
Gets a CSS URL.

Specified by:
getCssURL in interface RenderingService
Returns:
The CSS URL.

setCssURL

public void setCssURL(String cssURL)
Description copied from interface: RenderingService
Sets a CSS URL.

Specified by:
setCssURL in interface RenderingService
Parameters:
cssURL - The CSS URL.


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.