The content returned to the client browser can take several forms: JSP, XML, or JSON. The request-handling architecture for an Assembler-driven JSP page looks like this:
In this diagram, the following happens:
The application server receives a request.
The application server passes the request to the ATG request handling pipeline.
The ATG request handling pipeline does some preliminary work, such as setting up the profile and determining which site the request is for. At the appropriate point, the pipeline invokes the
/atg/endeca/assembler/AssemblerPipelineServlet
.The
AssemblerPipelineServlet
determines if the request is for a page or a content collection in Experience Manager and creates an appropriate requestContentItem
. Then,AssemblerPipelineServlet
calls theinvokeAssembler()
method on the/atg/endeca/assembler
/AssemblerTools
component and passes it the requestContentItem
.The
AssemblerTools
component invokes thecreateAssembler()
method on the/atg/endeca/assembler
/NucleusAssemblerFactory
component.The
NucleusAssemblerFactory
component returns anatg.endeca.assembler.NucleusAssembler
instance.The
AssemblerTools
component invokes theassemble()
method on theNucleusAssembler
instance and passes it the requestContentItem
.The
NucleusAssembler
instance assembles the correct content for the request. Content, in Endeca terms, corresponds to a set of cartridges and their associated data. TheNucleusAssembler
instance starts with the data in the Endeca Experience Manager cartridge configuration files and then modifies that data with information stored in the Endeca Content Repository (that is, changes made and saved via the Experience Manager UI). The assembled content takes the form of a responseContentItem
that consists of a rootContentItem
which may have sub-ContentItem
objects as attributes. ThisContentItem
hierarchy corresponds to the root cartridge and any sub-cartridges that were used to create the returned content.The
NucleusAssembler
instance recursively calls theNucleusAssembler.getCartridgehandler()
method, passing in theContentItem
type, to retrieve the correct cartridge handlers for the rootContentItem
and any of its sub-items.The cartridge handlers get resolved and executed for the root
ContentItem
and its sub-items. The resulting rootContentItem
is passed back to theNucleusAssembler
Instance.Note: If a cartridge handler doesn’t exist for a
ContentItem
, the initial version of the item, created in step 8, is returned.The
NucleusAssembler
instance returns the rootContentItem
toAssemblerTools
.The
AssemblerTools
component returns the rootContentItem
toAssemblerPipelineServlet
.The
AssemblerPipelineServlet
component calls the/atg/endeca/assembler/cartridge/renderer/ContentItemToRendererPath
component to get the path to the renderer (in this case, a JSP file) for the rootContentItem
. TheContentItemToRendererPath
component uses pattern matching to match theContentItem
type to a JSP file; for example, in Commerce Reference Store, if theContentItem
type isBreadcrumbs
, the JSP file is/cartridges/Breadcrumbs/Breadcrumbs.jsp
.Note: See ContentItemToRendererPath for more details on how the renderer path is calculated.
The
AssemblerPipelineServlet
component sets the assembledContentItem
as acontentItem
parameter on theHttpServletRequest
, then forwards the request to the JSP determined by theContentItemToRendererPath
componentThe JSP for the root
ContentItem
may also have to render sub-ContentItem
s. In this case, the JSP must includedsp:renderContentItem
tags for the sub-ContentItems
.dsp:renderContentItem
invokesContentItemToRendererPath
to retrieve the JSP renderer for the specifiedContentItem
. This process happens recursively until all sub-ContentItems
are rendered.The
dsp:renderContentItem
tag also sets thecontentItem
attribute on theHttpServletRequest
, thereby making the currentContentItem
available to the renderers; however, this value lasts only for the duration of theinclude
so that after theinclude
is done, thecontentItem
attribute’s value returns to the rootContentItem
.The JSPs returned by the
ContentItemToRendererPath
component are included in the response.The response is returned to the browser.