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()
          Get the Component Manager
 String getContentOfSection(String markup, String sourceSyntax, String sectionIndex)
          Get the content of a section
 String getCssURL()
          Get the CSS url
 org.xwiki.context.Execution getExecution()
          Get the current execution instance
 org.xwiki.rendering.block.XDOM parse(String markup, String sourceSyntax)
          Parse the markup of the page based on the syntax
 String render(String markup, String sourceSyntax, String targetSyntax, boolean supportSectionEdit)
          Render a wiki page from its markup to html by using the right syntax
 void setCssURL(String cssURL)
          Set the CSS url
 void start()
           
 void stop()
           
 String updateContentOfSection(String markup, String sourceSyntax, String sectionIndex, String newSectionContent)
          Update the 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
Get 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
Get the Component Manager

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
Render a wiki page from its markup to html by using the right syntax

Specified by:
render in interface RenderingService
Parameters:
markup - The markup of the page
sourceSyntax - The syntax used by the wiki page
targetSyntax - The target syntax to apply
supportSectionEdit - True if we support the section edit or false if not
Returns:
The result rendered
Throws:
Exception

getContentOfSection

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

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

updateContentOfSection

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

Specified by:
updateContentOfSection in interface RenderingService
Parameters:
markup - The markup of the page
sourceSyntax - The syntax used by the wiki page
sectionIndex - The index of the section
newSectionContent - The new content of the section
Returns:
The content as string
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
Parse the markup of the page based on the syntax

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

getCssURL

public String getCssURL()
Description copied from interface: RenderingService
Get the CSS url

Specified by:
getCssURL in interface RenderingService
Returns:
the CSS url

setCssURL

public void setCssURL(String cssURL)
Description copied from interface: RenderingService
Set the CSS url

Specified by:
setCssURL in interface RenderingService
Parameters:
cssURL - CSS url to set


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.