Package de.espirit.firstspirit.agency
Interface RenderingAgent
public interface RenderingAgent
Agent to perform content rendering of FirstSpirit elements.
Example usage:
IDProvider
node = ..; String content = context.requireSpecialist(RenderingAgent.TYPE
).createRenderer(node) .templateSet
("html") .language
("EN_US") .preview()
.render();
- Since:
- 5.2.1503
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Rendering result.static interface
Listener which is called when a link to a media is generated.static interface
Node specific renderer, useRenderingAgent.Renderer.render()
orRenderingAgent.Renderer.getResult()
to get the rendered template output.static interface
An intermediate instance which has to be enriched with a link root before further usage.static enum
Rendering mode, eitherRenderingAgent.RenderMode.PREVIEW
,RenderingAgent.RenderMode.WEBEDIT
, orRenderingAgent.RenderMode.DEFAULT
.static interface
Rendering result. -
Field Summary
Modifier and TypeFieldDescriptionstatic final SpecialistType<RenderingAgent>
The agents technical type to be used to request the agent from aSpecialistsBroker
. -
Method Summary
Modifier and TypeMethodDescription@NotNull RenderingAgent.Renderer
createRenderer
(@NotNull IDProvider node) Create a content renderer for the provided node.createRenderer
(@NotNull String templateSource) Create a renderer for a template source string.
-
Field Details
-
TYPE
The agents technical type to be used to request the agent from aSpecialistsBroker
.- Since:
- 5.2.1503
-
-
Method Details
-
createRenderer
Create a content renderer for the provided node. Supported node types arePage
,Section
,PageRef
,Dataset
(including derived classes),parsed
Media
, andTemplateContentProvider
like e.g. aFormatTemplate
) (supported since version 5.2.1805).- Parameters:
node
- Node to render.- Returns:
- A new
RenderingAgent.Renderer
instance. - Since:
- 5.2.1503
-
createRenderer
@NotNull @NotNull RenderingAgent.RendererWithoutLinkRoot createRenderer(@NotNull @NotNull String templateSource) throws ParsingError Create a renderer for a template source string.Usage example:
final String url = context.requireSpecialist(RenderingAgent.TYPE) .createRenderer("$CMS_REF(node)$") .
linkRoot(pageRef)
.additionalContext("node", node) .webedit() .render();- Returns:
- A new
intermediate renderer
instance. - Throws:
ParsingError
- If the provided template source isn't syntactical correct.- Since:
- 5.2.1805
- See Also:
-