The /atg/endeca/assembler/AssemblerTools component provides commonly used functionality to other ATG-Endeca query integration components. This component’s functionality includes:
Making the actual content request to the Assembler by invoking the
assemble()method on theNucleusAssemblerinstance and passing it the requestContentItem.Assisting the
AssemblerPipelineServletcomponent by transforming the page request URL into a requestContentItem.Identifying the renderer mapping component to use for the request.
The AssemblerTools component is of class atg.endeca.assember.AssemblerTools and it has the following core method:
public ContentItem invokeAssembler(ContentItem pContentItem)
Creating the Assembler Instance and Starting Content Assembly
The AssemblerTools component has a configurable property, assemblerFactory, that out of the box is set to /atg/endeca/assembler/NucleusAssemblerFactory. The NucleusAssemblerFactory component is responsible for creating the Assembler instance that collects and organizes content. The AssemblerTools.invokeAssembler() method calls createAssembler() on the NucleusAssemblerFactory component to create an Assembler instance and then it calls assemble() on that instance to begin the content collection process. More details on the NucleusAssemblerFactory component can be found in the Querying the Assembler section.
Transforming a Page Request URL for the AssemblerPipelineServlet
Note: This section describes transforming the URL for a page request into a request ContentItem when using the AssemblerPipelineServlet component only. Other mechanisms exist for creating the ContentItem when requesting a content collection or when using the InvokeAssembler servlet bean. See the Content Collection Request Identification and Handling and InvokeAssembler sections, respectively, for more information on how those mechanisms work.
For page requests, the AssemblerTools.getContentPath() method transforms the request URL into a ContentItem URI. This URI tells the Assembler the path it should use to determine what content to assemble. getContentPath() takes into account several configurable properties when it calculates the URI. For example, if a request is made to http://localhost:8080/crs/storeus/browse/, getContentPath() does the following:
Gets the request URI using the
atg.servlet.ServletUtilclass. In this case, the request URI is:/crs/storeus/browse/If the
AssemblerTools.isRemoveSiteBaseURL()property is true,getContentPath()removes the site base URL (also known as theproductionURL). In this example, the site base URL is/crs/storeus, so the modified URI is:/browse/If
AssemblerTools.isRemoveContextRoot()property is true and the site base URL has not been removed,getContentPath()removes the context root. In this case,getContentPath()has already removed the site base URL, so the URL remains as is:/browse/Finally,
getContentPathPrefix()inserts the content path prefix. This prefix can be passed in on the request, using thecontentPrefixparameter. WhengetContentPathPrefix()executes, it first checks for the existence of thecontentPrefixrequest parameter. If this parameter exists, its value is inserted at the beginning of the URI. IfcontentPrefixdoes not exist,getContentPathPrefix()invokes theAssemblerTools.isExperienceManager()method to determine if Experience Manager is in use. If Experience Manager is in use,isExperienceManger()returnsAssemblerTools.assemblerSettings.defaultExperienceManagerPrefix, which defaults to/pages. If not,isExperienceManager()returnsAssemblerTools.assemblerSettings.defaultGuidedSearchPrefix, which defaults to/services.In this example, we assume that Experience Manager is in use, so the final content path URI is:
/pages/browse/
The resulting content path URI is used to construct a content item.
Identifying the Renderer Mapping Component to Use for the Request
The AssemblerTools.defaultContentItemToRendererPath property specifies the default component that should be used to map a response ContentItem to its correct renderer. Having this default ensures that the same mapping component is used across all web sites:
# Our default service for mapping from a ContentItem to the path of # its corresponding JSP rendering page defaultContentItemToRendererPath=cartridge/renderer/ContentItemToRendererPath
You can override this setting on a web application-specific basis by specifying a context-param in your application’s web.xml file. The name of the parameter must be contentItemToRendererPath and the value must specify the Nucleus path of the mapping component you want to use:
<context-param>
<param-name>contentItemToRendererPath</param-name>
<param-value>Nucleus-path-to-mapper</param-value>
</context-param>
