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:

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.

Note that, out of the box, the handlerMapping property provides override mappings to handlers for the default set of Endeca cartridges:

# Explicit cartridge handler mappings
handlerMapping=\
  DimensionSearchAutoSuggestItem=/atg/endeca/assembler/cartridge/handler/\
                                 DimensionSearchResults,\
  HorizontalRecordSpotlight=/atg/endeca/assembler/cartridge/handler/\
                            RecordSpotlight,\
  ContentSlotHeader=/atg/endeca/assembler/cartridge/handler/ContentSlot,\
  ContentSlotSecondary=/atg/endeca/assembler/cartridge/handler/ContentSlot,\
  ContentSlotMain=/atg/endeca/assembler/cartridge/handler/ContentSlot,\
  PageSlot=/atg/endeca/assembler/cartridge/handler/ContentSlot

Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices