The atg.endeca.assembler.configuration.AssemblerApplicationConfiguration
class provides a central place for calculating and storing Workbench and MDEX host and port information. This information complements the information contained in the /atg/endeca/ApplicationConfiguration
component and allows the Assembler to communicate with Workbench applications and MDEX instances. The ATG-Endeca integration includes a component of the AssemblerApplicationConfiguration
class, /atg/endeca/assembler/AssemblerApplicationConfiguration
, that other components use to retrieve Workbench and MDEX connection details. This section provides information on how the AssemblerApplicationConfiguration
component identifies the correct Workbench application and MDEX to connect to. The sections after provide details on the components that reference this information.
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 a particular Endeca application’s connection to a Workbench application (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 an Endeca requirement that a globally-scoped com.endeca.infront.content.source.WorkbenchContentSource
object be instantiated for each Workbench application in your environment before any content requests are made. Environments that have multiple Endeca applications, for example, to support multiple languages, will have multiple Workbench applications and, therefore, 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_
Endeca-application-key
Adding the Endeca-application-key
to the end of the WorkbenchContentSource
component name uniquely identifies the correct WorkbenchContentSource
to use for each Endeca 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 Endeca application name, which it gets from the AssemblerApplicationConfiguration
component’s currentInitializingWorkbenchContentSourceApplicationName
property.
Calculating Which MDEX to Use
The AssemblerApplicationConfiguration
component is responsible for determining 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, can then refer to the AssemblerApplicationConfiguration
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 calculated.
Typically, if your application uses a single MDEX, you set the defaultMdexHostName
and defaultMdexPort
properties of the AssemblerApplicationConfiguration
component to the host and port for that MDEX, for example:
defaultMdexHostName=localhost
defaultMdexPort=15000
The AssemblerApplicationConfiguration
then uses the defaultMdexHostName
and defaultMdexPort
settings to set the currentMdexHostName
and currentMdexPort
properties.
If your application uses multiple MDEX engines, for example, one MDEX for each language, you must configure the applicationKeyToMdexHostAndPort
property. This property contains a map where the keys identify each Endeca application and the values specify the host names and port numbers for the MDEX engines associated with each application. For example, if your environment has two Endeca applications to support two languages, English and German, the applicationKeyToMdexHostAndPort
would be set as follows:
applicationKeyToMdexHostAndPort=\
en=host-for-English-MDEX
:
port-for-English-MDEX
\
de=host-for-German-MDEX
:
port-for-German-MDEX
To calculate which MDEX host and port to use, the AssemblerApplicationConfiguration
component retrieves the Endeca application key for the current request from the ApplicationConfiguration
component, and then uses that key to retrieve the correct host and port values from the applicationKeyToMdexHostAndPort
map. To enable the call to the ApplicationConfiguration
component, the AssemblerApplicationConfiguration
component includes the following required property:
applicationConfiguration=../ApplicationConfiguration
Note: For more details, on the ApplicationConfiguration
component, see the Configuring the ApplicationConfiguration Component section