The /atg/endeca/assembler/droplet/InvokeAssembler
servlet bean, which is of class atg.endeca.assembler.droplet.InvokeAssembler
, provides a means of invoking the Assembler via a servlet bean on a page. It is useful on pages that contain mostly ATG content, with a section of Assembler-based content. Note that, for pages that have multiple sections of Assembler content, you should consider combining the requests for that content into a single InvokeAssembler
call for performance reasons.
Input Parameters
The InvokeAssembler
servlet bean has two input parameters, includePath
and contentCollection
, described below. Note that you must provide one of these parameters but they are mutually exclusive.
includePath
Use the includePath
parameter for a page request. The path you specify must correspond to the name of a page in Experience Manager, with the addition of a /pages
prefix. For example, to assemble content for a browse
page, specify /pages/browse
for the includePath
(passing in a /browse
path will not match because it is missing the /pages
prefix).
InvokeAssembler
parses the includePath
into a ContentInclude
component. This component contains a set of parameters, including the request URI, that is used to form a content request for the Assembler.
The includePath
and contentCollection
parameters are mutually exclusive but one of them must be passed when using the InvokeAssembler
servlet bean.
contentCollection
Use the contentCollection
parameter for a content collection request. The value you provide for contentCollection
must correspond to the name of a content collection in Experience Manager, for example, Search Box Auto Suggest Content
. InvokeAssembler
parses the contentCollection
into a ContentSlotConfig
component. This component specifies a content collection and the number of content items to return from that collection (note, the number of items to return is specified using the InvokeAssembler.ruleLimit
parameter, described next).
The includePath
and contentCollection
parameters are mutually exclusive but one of them must be passed when using the InvokeAssembler
servlet bean.
ruleLimit
This optional parameter is used in conjunction with the contentCollection
parameter to specify the number of items that should be returned from the specified content collection.
Output Parameters
The InvokeAssembler
servlet bean has one output parameter, contentItem
. This parameter contains the root ContentItem
returned by the Assembler. If this content item is empty, the request was not an Assembler request.
Open Parameters
The InvokeAssembler
has three open parameters.
output
Rendered when the Assembler returns a ContentItem
.
error
Rendered if the Assembler returns a ContentItem
with an @error
key. The presence of this key indicates that the ContentItem
does not contain any content because the Assembler threw an exception or returned an error.
Example
This code snippet shows how to use the InvokeAssembler
servlet bean on a page:
<dsp:importbean bean="/atg/endeca/assembler/droplet/InvokeAssembler"/> <dsp:droplet name="InvokeAssembler"> <dsp:param name="includePath" value="/pages/browse"/> <dsp:oparam name="output"> <dsp:getvalueof var="contentItem" vartype="com.endeca.infront.assembler.ContentItem" param="contentItem" /> </dsp:oparam> </dsp:droplet>