com.xpn.xwiki.script.display
Class DisplayScriptService

java.lang.Object
  extended by com.xpn.xwiki.script.display.DisplayScriptService
All Implemented Interfaces:
org.xwiki.script.service.ScriptService

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

Exposes Displayers to scripts.

Since:
3.2M3
Version:
$Id: 9e6fe9e610350789e0efc69fa2d0c3401efd9062 $

Constructor Summary
DisplayScriptService()
           
 
Method Summary
 String content(Document document)
           
 String content(Document document, Map<String,Object> parameters)
          Displays the content of the given document.
 org.xwiki.display.internal.DocumentDisplayerParameters createDocumentDisplayerParameters()
           
 String title(Document document)
           
 String title(Document document, Map<String,Object> parameters)
          Displays the document title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayScriptService

public DisplayScriptService()
Method Detail

createDocumentDisplayerParameters

public org.xwiki.display.internal.DocumentDisplayerParameters createDocumentDisplayerParameters()
Returns:
a new instance of DocumentDisplayerParameters

content

public String content(Document document)
Parameters:
document - the document whose content is displayed
Returns:
the result of rendering the content of the given document as XHTML using the configured displayer
See Also:
content(Document, Map)

content

public String content(Document document,
                      Map<String,Object> parameters)
Displays the content of the given document.

Parameters:
document - the document whose content is displayed
parameters - the display parameters
Returns:
the result of rendering the content of the given document using the provided parameters

title

public String title(Document document,
                    Map<String,Object> parameters)
Displays the document title. If a title has not been provided through the title field, it looks for a section title in the document's content and if not found return the page name. The returned title is also interpreted which means it's allowed to use Velocity, Groovy, etc. syntax within a title.

Parameters:
document - the document whose title is displayed
parameters - the display parameters
Returns:
the result of displaying the title of the given document

title

public String title(Document document)
Parameters:
document - the document whose title is displayed
Returns:
the result of rendering the title of the given document as XHTML using the configured displayer
See Also:
title(Document, Map)


Copyright © 2004–2014 XWiki. All rights reserved.