Oracle ATG Web Commerce has several components for creating a connection to the Workbench server. The Workbench connection components can vary depending on whether your environment has a single Endeca 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/DefaultWorkbenchContentSource
component is instantiated. This component contains default Endeca application, host name, and port information for the Workbench server. TheDefaultWorkbenchContentSource
component gets its host and port values from theAssemblerApplicationConfiguration.workbenchHostName
andAssemblerApplicationConfiguration.workbenchPort
properties, respectively. It gets the Endeca application name from theApplicationConfiguration.defaultApplicationName
property.If the environment has more than one Endeca application (for example, because it supports multiple languages with one language per Endeca application), the
AssemblerApplicationConfiguration
component creates globally-scoped,WorkbenchContentSource_
Endeca-application-key
components for each Endeca application. Each component has a suffix that identifies which Endeca application the component is for, for example,WorkbenchContentSource_en
andWorkbenchContentSource_de
.The
NucleusAssembler
resolves the/atg/endeca/assembler/cartridge/manager/WorkbenchContentSource
component. This component in turn resolves either the/atg/endeca/assembler/cartridge/manager/DefaultWorkbenchContentSource
component or the/atg/endeca/assembler/cartridge/manager/PerApplicationWorkbenchContentSourceResolver
as theWorkbenchContentSource
for the current request.If the
DefaultWorkbenchContentSource
is resolved, the host, port, and Endeca application defined by this component are used when connecting to the Workbench server.If the
PerApplicationWorkbenchContentSourceResolver
is resolved, the component relies on theAssemblerApplicationConfiguration
to determine what the current Endeca application is and then it references the correct Endeca application-specificWorkbenchContentSource
that theAssemblerApplicationConfiguration
component has already created.
The remaining sections provide more details on the individual Workbench-related components.
WorkbenchContentSource
The /atg/endeca/assembler/cartridge/manager/WorkbenchContentSource
component represents the current Endeca application’s connection to the Workbench server. The NucleusAssembler
class uses this component to connect to the correct Endeca application configuration running on the Workbench server.
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 Endeca application-specific WorkbenchContentSource
to use, based on the current request. This default configuration is primarily intended to support environments that have multiple Endeca 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 always have a single Endeca 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-application environment because it avoids having to resolve the WorkbenchContentSource
for every request. If you have a single-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, of class atg.endeca.assembler.content.ExtendedWorkbenchContentSource
, is a globally-scoped component that includes default Endeca application, host, and port properties for connecting to the Workbench server. Out of the box, this property 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
In a single Endeca application environment, the DefaultWorkbenchContentSource
component provides connection details to the single Endeca application running on the Workbench server that should be used for all requests. In a multi-application environment, this component provides connection details to a default Endeca application when the PerApplicationWorkbenchContentSourceResolver
cannot resolve an Endeca application-specific WorkbenchContentSource
.
The DefaultWorkbenchContentSource
component has a set of properties that represent the constructor arguments that are used to create the WorkbenchContentSource
. The DefaultWorkbenchContentSource
component gets the values for these properties from the ApplicationConfiguration
and AssemblerApplicationConfiguration
components. It is the responsibility of these other two components to calculate the correct Endeca application and Workbench connection to use. The DefaultWorkbenchContentSource
properties include:
# Arg1 - Workbench app name: This property provides the first constructor argument for
WorkbenchContentSource
and it points to the Endeca application. The default property setting is:$constructor.param[1].value^=/atg/endeca/ApplicationConfiguration.defaultApplicationName
# Arg3 - Workbench host: This property provides the third constructor argument for
WorkbenchContentSource
and it points to the host that the Workbench is installed on. The default property setting is:$constructor.param[3].value=../../AssemblerApplicationConfiguration.workbenchHostName
# Arg 4 - Workbench port: This property provides the fourth constructor argument for
WorkbenchContentSource
and it points to the port that the Workbench is using. The default property setting is:$constructor.param[4].value^=../../AssemblerApplicationConfiguration.workbenchPort
PerApplicationWorkbenchContentSourceResolver
In an environment that has multiple Endeca applications, it is the /atg/endeca/assembler/cartridge/manager/PerApplicationWorkbenchContentSourceResolver
component’s responsibility to determine the correct globally-scoped, Endeca application-specific WorkbenchContentSource
component to use for the current request. This component also defines a default WorkbenchContentSource
component to use if an Endeca 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 Endeca 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 theWorkbenchContentSource
component to default to if an Endeca application-specific version cannot be resolved. Defaults to/atg/endeca/assembler/cartridge/manager/DefaultWorkbenchContentSource
.componentBasePath
: The base path for the Endeca application-specificWorkbenchContentSource
components.PerApplicationWorkbenchContentSourceResolver
adds the Endeca application keys, such as_en
and_es
, as suffixes to this path to resolve the correctWorkbenchContentSource
to reference. Defaults to/atg/endeca/assembler/cartridge/manager/WorkbenchContentSource
.assemblerApplicationConfiguration
: The Nucleus path to theAssemblerApplicationConfiguration
component, where thePerApplicationWorkbenchContentSourceResolver
gets the application keys. Defaults to..
.useDefaultIfSingleApplication
: Indicates that thePerApplicationWorkbenchContentSourceResolver
should use theDefaultWorkbenchContentSource
if there is only one Endeca application and avoid resolving an Endeca application-specificWorkbenchContentSource
.
Manually Adding Application-specific WorkbenchContentSource Components
It is an Endeca requirement that the WorkbenchContentSource
component used to communicate with any given Workbench 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 Endeca application on start up.
If the automatically-created WorkbenchContentSource
components are not sufficient for your needs, you can manually create .properties
files for other Endeca application-specific WorkbenchContentSource
components, for example:
$basedOn=DefaultWorkbenchContentSource # Arg1 - Workbench app name $constructor.param[1].value=Endeca-application-name
# Arg3 - Workbench host $constructor.param[3].value=Workbench-host-name
# Arg 4 - Workbench port $constructor.param[4].value=Workbench-host-port
After creating the Endeca 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_application-key