Oracle Commerce Core Platform has several components for creating a connection to an EAC application managed by the Workbench server. The connection components can vary depending on whether your environment has a single EAC application or multiple applications (for example, to support multiple languages). Here is a brief overview of the process:
On startup, the
/atg/endeca/assembler/cartridge/manager/DefaultWorkbenchContentSourcecomponent is instantiated. This component contains details for connecting to a default EAC application.If the environment has more than one EAC application, the
AssemblerApplicationConfigurationcomponent creates globally-scoped,WorkbenchContentSource_EAC-application-keycomponents for each EAC application. Each component has a suffix that identifies which EAC application the component is for, for example,WorkbenchContentSource_enandWorkbenchContentSource_de. These application-specific components have a set of properties that are comparable to those in theDefaultWorkbenchContentSource, but contain values that are specific to each individual EAC application.The
NucleusAssemblerresolves the/atg/endeca/assembler/cartridge/manager/WorkbenchContentSourcecomponent. This component in turn resolves either the/atg/endeca/assembler/cartridge/manager/DefaultWorkbenchContentSourcecomponent or the/atg/endeca/assembler/cartridge/manager/PerApplicationWorkbenchContentSourceResolveras theWorkbenchContentSourceto use for the current request.If the
DefaultWorkbenchContentSourceis resolved, the connection details defined by this component are used when retrieving content.If the
PerApplicationWorkbenchContentSourceResolveris resolved, the component relies on theAssemblerApplicationConfigurationto determine what the current EAC application is and then it references the correct EAC application-specificWorkbenchContentSourcethat theAssemblerApplicationConfigurationcomponent has already created in step 2.
The remaining sections provide more details on the individual Workbench-related components.
WorkbenchContentSource
The /atg/endeca/assembler/cartridge/manager/WorkbenchContentSource component represents the connection to a particular EAC application managed by the Workbench server. The NucleusAssembler class uses this component to connect to an EAC application and request content, using the content retrieval method specified.
Out of the box, the WorkbenchContentSource component uses a $basedOn property set to the /atg/endeca/assembler/cartridge/manager/PerApplicationWorkbenchContentSourceResolver, which is a request-scoped component that determines which EAC application-specific WorkbenchContentSource to use, based on the current request. This default configuration is primarily intended to support environments that have multiple EAC applications, although it works for single-application environments as well.
The WorkbenchContentSource properties file also includes some configuration, which has been commented out, that is more efficient for environments that have a single EAC application:
# $class=atg.nucleus.GenericReference
# $scope=global
# componentPath=DefaultWorkbenchContentSource
This configuration creates a globally-scoped WorkbenchContentSource component that gets its connection details from the /atg/endeca/assembler/cartridge/manager/DefaultWorkbenchContentSource component. This approach is more efficient for a single EAC application environment because it avoids having to resolve the WorkbenchContentSource for every request. If you have a single EAC application environment, you can use this configuration instead.
The following sections provide some additional details on the DefaultWorkbenchContentSource and PerApplicationWorkbenchContentSource components that provide the connection details stored in a WorkbenchContentSource component.
DefaultWorkbenchContentSource
The /atg/endeca/assembler/cartridge/manager/DefaultWorkbenchContentSource component, is a globally-scoped component of class atg.endeca.assembler.content.ExtendedWorkbenchContentSource. In a single EAC application environment, the DefaultWorkbenchContentSource component provides connection details for the single EAC application managed by the Workbench server that should be used for all requests. In a multi-application environment, this component provides connection details to a default EAC application when the PerApplicationWorkbenchContentSourceResolver cannot resolve an application-specific WorkbenchContentSource.
Out of the box, this component is included in the initialServices property of the /initial component, to ensure that it is created on start up.
initialServices+=\ /atg/endeca/assembler/AssemblerPipelineServlet,\ /atg/endeca/assembler/cartridge/manager/DefaultWorkbenchContentSource
The DefaultWorkbenchContentSource component has a set of properties that are used to create the WorkbenchContentSource that is used to connect to the Workbench. The DefaultWorkbenchContentSource component gets the values for some of these properties from the ApplicationConfiguration and AssemblerApplicationConfiguration components. It is the responsibility of these other two components to calculate the correct EAC application and Workbench server connection details to use. The DefaultWorkbenchContentSource properties include:
appName: The EAC application name. Defaults to/atg/endeca/ApplicationConfiguration.defaultApplicationName.host: The Workbench server host name. Defaults to../../AssemblerApplicationConfiguration.workbenchHostName.serverPort: The port number thatWorkbenchContentSourcecomponents must use to retrieve content from the Workbench. Defaults to 8007.Note that the
serverPortproperty refers to the port used for content retrieval (8007, by default), as opposed to the port used to connect to the Workbench (8006, by default).storeFactory: A reference to the store factory to use for retrieving content for the default EAC application. Defaults to/atg/endeca/assembler/cartridge/manager/DefaultFileStoreFactory. See the Retrieving Promoted Content chapter for more information.defaultSiteRootPath: The site root path to use when calculating the absolute path to the content being retrieved. Defaults toAssemblerSettings.defaultExperienceManagerPrefix.siteManager: A reference to theSiteManagercomponent for retrieving site-based information, such as the current site, for the request. Defaults to/atg/endeca/assembler/multisite/SiteManager.
PerApplicationWorkbenchContentSourceResolver
In an environment that has multiple EAC applications, it is the /atg/endeca/assembler/cartridge/manager/PerApplicationWorkbenchContentSourceResolver component’s responsibility to determine the correct globally-scoped, application-specific WorkbenchContentSource component to use for the current request. This component also defines a default WorkbenchContentSource component to use if an application-specific version cannot be found. PerApplicationWorkbenchContentSourceResolver is of class atg.endeca.assembler.configuration.PerEndecaApplicationGenericReference, which extends the atg.nucleus.GenericReference class to calculate the correct component to reference based on the EAC application key of the current request.
Note that PerApplicationWorkbenchContentSourceResolver is request-scoped. This means that the globally-scoped WorkbenchContentSource component that it resolves and references gets inserted into the request scope as an alias. This effectively allows the application to resolve the WorkbenchContentSource component on a per-request basis.
To perform its tasks, the PerApplicationWorkbenchContentSourceResolver component has the following properties:
defaultComponentPath: The Nucleus path of theWorkbenchContentSourcecomponent to default to if an EAC application-specific version cannot be resolved. Defaults to/atg/endeca/assembler/cartridge/manager/DefaultWorkbenchContentSource.componentBasePath: The base path for the application-specificWorkbenchContentSourcecomponents.PerApplicationWorkbenchContentSourceResolveradds the EAC application keys, such as_enand_es, as suffixes to this path to resolve the correctWorkbenchContentSourceto reference. Defaults to/atg/endeca/assembler/cartridge/manager/WorkbenchContentSource.assemblerApplicationConfiguration: The Nucleus path to theAssemblerApplicationConfigurationcomponent, where thePerApplicationWorkbenchContentSourceResolvergets the application keys. Defaults to../../AssemblerApplicationConfiguration.useDefaultIfSingleApplication: Indicates that thePerApplicationWorkbenchContentSourceResolvershould use theDefaultWorkbenchContentSourceif there is only one EAC application and avoid resolving an application-specificWorkbenchContentSource.
Manually Adding Application-specific WorkbenchContentSource Components
It is a requirement that the WorkbenchContentSource component used to communicate with any given EAC application be globally scoped and started up front, before any requests are made. To accommodate this requirement, the ApplicationAssemblerConfiguration component automatically creates corresponding WorkbenchContentSource components for each EAC application on start up.
If the automatically-created WorkbenchContentSource components are not sufficient for your needs, you can manually create .properties files for other application-specific WorkbenchContentSource components, for example:
$basedOn=DefaultWorkbenchContentSource # EAC application name appName=EAC-application-name# Workbench host host=Workbench-host-name# Workbench content retrieval port, defaults to 8007 serverPort=8007
Note that the serverPort property refers to the port used for content retrieval (8007, by default), as opposed to the port used to connect to the Workbench (8006, by default).
After creating the EAC application-specific WorkbenchContentSource components, you must add them to the intialServices property of the /initial component so that they are started on application start-up, for example:
initialServices+=\ /atg/endeca/assembler/cartridge/manager/WorkbenchContentSource_EAC-application-key

