Class DisplayScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService

    @Component
    @Named("display")
    @Singleton
    public class DisplayScriptService
    extends Object
    implements org.xwiki.script.service.ScriptService
    Exposes Displayers to scripts.
    Since:
    3.2M3
    Version:
    $Id: 52e03a340c1795edd04f86f775ac975bc6a01378 $
    • 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)
      • get

        public <S extends org.xwiki.script.service.ScriptService> S get​(String serviceName)
        Gets a sub-service.
        Type Parameters:
        S - the type of the ScriptService
        Parameters:
        serviceName - the name of the sub ScriptService
        Returns:
        the ScriptService or null of none could be found
        Since:
        10.11RC1