The atg.endeca.assembler.NucleusAssemblerFactory
class is responsible for creating the atg.endeca.assembler.NucleusAssembler
instance that retrieves and organizes content. The NucleusAssemblerFactory
class implements the com.endeca.infront.assembler.AssemblerFactory
interface and defines a createAssembler()
method that the AssemblerTools
component invokes to get a NucleusAssembler
instance. NucleusAssembler
is an inner class of NucleusAssemblerFactory
. It implements the com.endeca.infront.assembler.Assembler
interface and defines an assemble()
method that the AssemblerTools
component invokes to begin a query. The following code excerpt from AssemblerTools.java
shows the use of these two methods:
// Get the assembler factory and create an Assembler Assembler assembler = getAssemblerFactory().createAssembler(); assembler.addAssemblerEventListener(new AssemblerEventAdapter()); // Assemble the content ContentItem responseContentItem = assembler.assemble(pContentItem);
In addition to retrieving the base content from the cartridge XML configuration files, the NucleusAssembler
class also modifies that content as necessary using CartridgeHandler
components. The NucleusAssemblerFactory
component provides the NucleusAssembler
class with the configuration it needs to find the correct CartridgeHandler
components. CartridgeHandlers
can be found either by using a default naming strategy (that is, looking for a Nucleus component named after the cartridgeType
in one of the NucleusAssemblerFactory
component’s path properties), or via an explicit mapping. To support these strategies, the NucleusAssemblerFactory
component provides the following properties:
experienceManagerHandlerPath
: Defaults to the/atg/endeca/assembler/cartridge/handler/experiencemanager
folder.guidedSearchHandlerPath
: Defaults to the/atg/endeca/assembler/cartridge/handler/guidedsearch
folder.defaultHandlerPath
: Defaults to the/atg/endeca/assembler/cartridge/handler
folder.handlerMapping
: AMap<String, String>
property that provides a map from thecartridgeType
to the Nucleus path of the correspondingCartridgeHandler
component. This property can be used to override the default mapping specified in path properties.
When looking for a cartridge handler, the NucleusAssembler
class first invokes the AssemblerTools.isExperienceManager()
method to determine if Experience Manager is present or not. If isExperienceManager()
returns true
, the NucleusAssembler
class tries to locate the correct handler in the path specified by the NucleusAssemblerFactory
.experienceManagerHandlerPath
property. For example, for the MyCartridge
cartridge, the NucleusAssembler
class would look for the handler called /atg/endeca/assembler/cartridge/handler/experiencemanager/MyCartridge
. If isExperienceManager()
returns false
, the NucleusAssembler
class looks for the handler in the path specified by the NucleusAssemblerFactory.guidedSearchHandlerPath
property. If neither path resolves successfully, the NucleusAssembler
class looks for the handler in the path specified by the NucleusAssemblerFactory.defaultHandlerPath
. Finally, if the NucleusAssembler
class still cannot find the correct handler, it looks at the explicit mappings defined in the NucleusAssemblerFactory.handlerMapping
property.