Package com.xpn.xwiki.script.display
Class DisplayScriptService
- java.lang.Object
-
- com.xpn.xwiki.script.display.DisplayScriptService
-
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component @Named("display") @Singleton public class DisplayScriptService extends Object implements org.xwiki.script.service.ScriptService
ExposesDisplayer
s to scripts.- Since:
- 3.2M3
- Version:
- $Id: 52e03a340c1795edd04f86f775ac975bc6a01378 $
-
-
Constructor Summary
Constructors Constructor Description DisplayScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
<S extends org.xwiki.script.service.ScriptService>
Sget(String serviceName)
Gets a sub-service.String
title(Document document)
String
title(Document document, Map<String,Object> parameters)
Displays the document title.
-
-
-
Field Detail
-
ROLEHINT
public static final String ROLEHINT
The role hint of this component.- See Also:
- Constant Field Values
-
-
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 displayedparameters
- 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 displayedparameters
- 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)
-
get
public <S extends org.xwiki.script.service.ScriptService> S get(String serviceName)
Gets a sub-service.- Type Parameters:
S
- the type of theScriptService
- Parameters:
serviceName
- the name of the subScriptService
- Returns:
- the
ScriptService
or null of none could be found - Since:
- 10.11RC1
-
-