/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { Node } from "../../types/javax/jcr/Node"; import type { Map } from "../../types/java/util/Map"; import type RendererContext from "../RendererContext"; import type { ContentRenderer } from "../../types/senselogic/sitevision/api/render/ContentRenderer"; import type { Builder } from "../../types/senselogic/sitevision/api/base/Builder"; /** *

* Builder for creating a {@link ContentRenderer} instance. *

* *

* ContentRendererBuilder has one mandatory attribute and two optional attributes: *

* * *

* Using the ContentRendererBuilder is pretty straightforward, if you remember that it is stateful. Conceptually you * would typically use it like this: *

*
    *
  1. Get the ContentRendererBuilder
  2. *
  3. Set the page
  4. *
  5. Potentially set the page parameters
  6. *
  7. Do build
  8. *
*

* When you have built a ContentRenderer instance, you can re-use the ContentRendererBuilder to build more instances. * Typically like: *

*
    *
  1. Set the page
  2. *
  3. Potentially set the page parameters
  4. *
  5. Do build
  6. *
* *

* Tip! The {@link senselogic.sitevision.api.base.Builder Builder interface documentation} contains * more information about Builders and how to work with them and {@link TextModuleRenderer} has a code example of how * this builder and its result can be used. *

* *

* An instance of the Sitevision class implementing this interface can be obtained via * {@link RendererBuilderFactory#getContentRendererBuilder()}. * See {@link RendererBuilderFactory} for how to obtain an instance of the RendererBuilderFactory interface. *

* @author Magnus Lövgren * @since Sitevision 2026.01.1 */ export interface ContentRendererBuilder extends Builder { /** * Sets the page of this builder. * *

* Note! Due to security reasons (potential never-ending loops) it is prohibited to create a content renderer for * the currently executing page (i.e. {@link senselogic.sitevision.api.context.PortletContextUtil#getCurrentPage()})! *

* @param aPageNode a page node (sv:page, sv:article, sv:sitePage) where current user has READ permission, must not be null or "current page". * @return this builder */ setPage(aPageNode: Node): ContentRendererBuilder; /** * Sets parameters for the page, to be used when rendering content. * @param aParameters a map of parameters * @return this builder */ setParameters(aParameters: Map | {}): ContentRendererBuilder; /** * Sets the renderer context to use when rendering content. * *

* If not set or set to null, the default renderer context ({@link RendererContext#ORIGIN_PAGE}) will be used. *

* @param aRendererContext the render context * @return this builder * @since Sitevision 2026.03.1 */ setRendererContext(aRendererContext: RendererContext): ContentRendererBuilder; /** * Creates a ContentRenderer instance for the page of this builder. * @return a content renderer instance * @throws IllegalStateException if no page is set or if page is invalid (e.g. "current page") */ build(): ContentRenderer; } declare namespace ContentRendererBuilder {} declare var contentRendererBuilder: ContentRendererBuilder; export default contentRendererBuilder;