This post if part of a series about the File System Toolkit - a custom content delivery API for SDL Tridion.
This post describes a Component Presentation Assembler factory. Its role is to retrieve a Dynamic Component Presentation and to trigger the execution of its content. Then the resolved content is returned.
The only method the assembler has is getContent(int, int, int), which takes parameters Publication id, Component id and Component Template id. It uses the ComponentPresentationFactory to retrieve the DCP.
Next, it triggers the execution of any custom tags might be in the DCP's content. The content can contain XML-like tags (e.g. <mytag>some body</mytag>). The tag support engine will execute all custom tags it finds in the content.
Finally, the resolved content is returned by the assembler and it is ready to be displayed on the response.
This post describes a Component Presentation Assembler factory. Its role is to retrieve a Dynamic Component Presentation and to trigger the execution of its content. Then the resolved content is returned.
The only method the assembler has is getContent(int, int, int), which takes parameters Publication id, Component id and Component Template id. It uses the ComponentPresentationFactory to retrieve the DCP.
Next, it triggers the execution of any custom tags might be in the DCP's content. The content can contain XML-like tags (e.g. <mytag>some body</mytag>). The tag support engine will execute all custom tags it finds in the content.
Finally, the resolved content is returned by the assembler and it is ready to be displayed on the response.
public String getContent(int publicationId, int componentId, int templateId) { ComponentPresentationMeta dcp = cpFactory.getComponentPresentation( publicationId, componentId, templateId); if (dcp == null) { return null; } else { String content = dcp.getContent(); content = TagFactory.INSTANCE.executeTags(content); return content; } }
Comments