The atg.endeca.assembler.configuration.AssemblerApplicationConfiguration
class configures the following:
Workbench host information
MDEX host and port information
The method to use (direct calls to the Workbench versus retrieving content that the Workbench has stored on the file system) when retrieving content in a multi-EAC application environment.
This information complements the configuration stored the /atg/endeca/ApplicationConfiguration
component, and enables communication with both the EAC applications managed by the Workbench server and any MDEX instances.
The Guided Search integration includes a component of the AssemblerApplicationConfiguration
class, /atg/endeca/assembler/AssemblerApplicationConfiguration
, that other components reference to retrieve the Workbench and MDEX connection details. The AssemblerApplicationConfiguration
component also has an applicationConfiguration
property that points to the ApplicationConfiguration
component:
applicationConfiguration=/atg/endeca/ApplicationConfiguration
This section provides information on how the AssemblerApplicationConfiguration
component calculates these details, while the sections after provide information on the components that use them. The following chapter, Retrieving Promoted Content, provides details on the different content retrieval methods and how to configure them.
Creating Application-specific Workbench Connections
Note: This section introduces the WorkbenchContentSource
and DefaultWorkbenchContentSource
components, in the context of what the AssemblerApplicationConfiguration
component does with them. Additional information is provided about these component types in the following sections.
The /atg/endeca/assembler/cartridge/manager/WorkbenchContentSource
component holds details for connecting to a particular EAC application managed by the Workbench server (or, to be more specific, it functions as an alias for other components that calculate the connection details based on the environment and the current request). It is a requirement that a globally-scoped com.endeca.infront.content.source.WorkbenchContentSource
object be instantiated for each EAC application in your environment before any content requests are made. Environments that have multiple EAC applications (for example, a separate application for each language or site), will need multiple WorkbenchContentSource
components. The AssemblerApplicationConfiguration
component is responsible for creating these components when necessary.
To create the application-specific WorkbenchContentSource
components, the AssemblerApplicationConfiguration
component resolves a prototype-scoped /atg/endeca/assembler/cartridge/manager/PrototypeWorkbenchContentSource
component, which is of class atg.endeca.assembler.content.ExtendedWorkbenchContentSource
, and inserts it into the Nucleus global scope under a new name that follows this pattern:
WorkbenchContentSource_
EAC
-application-key
Adding the EAC
-application-key
to the end of the WorkbenchContentSource
component name uniquely identifies the WorkbenchContentSource
component as the one to use for a given EAC application.
The PrototypeWorkbenchContentSource
configuration includes a $basedOn
property that references the /atg/endeca/assembler/cartridge/manager/DefaultWorkbenchContentSource
component, where arguments for the WorkbenchContentSource
constructor are provided. The PrototypeWorkbenchContentSource
component gets its settings from the DefaultWorkbenchContent
component, with the exception of the EAC application name, which it gets from the AssemblerApplicationConfiguration
component’s currentInitializingWorkbenchContentSourceApplicationName
property.
Determining Which MDEX to Use
The AssemblerApplicationConfiguration
component determines which host name and port to use to connect to the correct MDEX engine for any given request. The /atg/endeca/assembler/cartridge/manager/MdexResource
component, which represents the connection to a single MDEX, refers to the AssemblerApplicationConfiguration
component when creating a connection for a specific request.
The MDEX host and port values are stored in the AssemblerApplicationConfiguration.currentMdexHostname
and AssemblerApplicationConfiguration.currentMdexPort
properties, respectively. The AssemblerApplicationConfiguration
component includes configuration settings that specify how the currentMdexHost
and currentMdex
port properties are determined.
To direct a request to the correct MDEX, you configure the applicationKeyToMdexHostAndPort
property on the /atg/endeca/ApplicationConfiguration
component. The AssemblerApplicationConfiguration
component also has an applicationKeyToMdexHostAndPort
property that is set automatically to the value of the ApplicationConfiguration.applicationKeyToMdexHostAndPort
property.
The applicationKeyToMdexHostAndPort
property is a map where the keys identify each EAC application and the values specify the host names and port numbers for the MDEX engines associated with each application.
If you have a single EAC application, the key is default
, and you map it to the MDEX as follows:
applicationKeyToMdexHostAndPort=\
default=host
:port
For example:
applicationKeyToMdexHostAndPort=\
default=myHost.example.com:15300
Note that if the applicationKeyToMdexHostAndPort
property is not set, the hostname and port are obtained from the values of the AssemblerApplicationConfiguration.defaultMdexHostName
and AssemblerApplicationConfiguration.defaultMdexPort
properties . These properties default to localhost
and 15000
respectively, but you can explicitly set them to other values. However, if you set applicationKeyToMdexHostAndPort
, it overrides these properties.
If you have multiple applications (for example, a separate application for each language), the keys depend on the routing strategy you are using:
If you are using
SingleApplicationRoutingStrategy
and you have a separate MDEX for each language, the keys are the two-letter codes for the languages (for example,en
for English,fr
for French,it
for Italian).If you are using
SiteApplicationRoutingStrategy
and you have a separate MDEX for each site, the keys are the site IDs.If you are using
SiteApplicationRoutingStrategy
and you have a separate MDEX for each combination of site and language, each key is formed by concatenating the site ID with the language code, separated by the underscore character (for example,storeSiteUS_fr
).If you are using
GroupingApplicationRoutingStrategy
, the keys are the names of EAC applications.
To determine which MDEX to direct a request to, the component specified by the AssemblerApplicationConfiguration.routingObjectAdapter
property examines the request and related objects to find locale and site information. This component, which is of a class that implements the RequestRoutingObjectAdapter
interface, must match the routing strategy you are using. For example, if your routing strategy is SiteApplicationRoutingStrategy
, the routingObjectAdapter
property should be set to SiteRequestRoutingObjectAdapter
.
Based on the information returned by the RequestRoutingObjectAdapter
component, the AssemblerApplicationConfiguration
component retrieves the key in one of two ways:
If the routing strategy is
SingleApplicationRoutingStrategy
orSiteApplicationRoutingStrategy
, the key is retrieved from theApplicationConfiguration
component.If the routing strategy is
GroupingApplicationRoutingStrategy
, the key is retrieved from theGroupingApplicationRoutingStrategy
component.
The key is then used to retrieve the host and port values from the applicationKeyToMdexHostAndPort
map.
For example, if your environment has two EAC applications to support two languages, English and German, and your routing strategy is SingleApplicationRoutingStrategy
, the applicationKeyToMdexHostAndPort
setting might be:
applicationKeyToMdexHostAndPort=\
en=localhost:15000,\
de=localhost:15100
For more information about the ApplicationConfiguration
component, see the Configuring the ApplicationConfiguration Component section of the Introduction. For more information about routing strategies, see the Routingchapter.