Use the SiteApplicationRoutingStrategy
class if you have a separate EAC application for each site (with all languages in a given site being handled by that site’s EAC application), or if you have a separate EAC application for each combination of site and language.
To use SiteApplicationRoutingStrategy
, set the ApplicationConfiguration
component’s applicationRoutingStrategy
property as follows:
applicationRoutingStrategy=\
/atg/endeca/configuration/SiteApplicationRoutingStrategy
In addition, to ensure that separate records are created for each site, you need to add the UniqueSiteVariantProducer
to the variantProducers
property of each EndecaIndexingOutputConfig
component. For example
variantProducers+=/atg/search/repository/UniqueSiteVariantProducer
EndecaIndexingOutputConfig
components are discussed in the next several chapters of this manual. For information about variant producers, including UniqueSiteVariantProducer
, see the Using Variant Producerssection of the Customizing the Output Records chapter.
Set the routingObjectAdapter
property of the /atg/endeca/index/IndexingApplicationConfiguration
component to specify the ContextRoutingObjectAdapter
component to use:
routingObjectAdapter=\
/atg/endeca/index/configuration/SiteContextRoutingObjectAdapter
Set the routingObjectAdapter
property of the /atg/endeca/assembler/AssemblerApplicationConfiguration
component to specify the RequestRoutingObjectAdapter
component to use:
routingObjectAdapter=\
/atg/endeca/index/configuration/SiteRequestRoutingObjectAdapter
Additional configuration differs depending on whether you have a single EAC application for each site or a separate EAC application for each combination of site and language.
One EAC Application per Site
If you have one EAC application per site (with all languages for each individual site being handled by that site’s EAC application), set the ApplicationConfiguration
component’s defaultLanguageForApplications
property to the two-letter language code for the default language. For example:
defaultLanguageForApplications=it
Note that you should set this property even if your data is in only one language.
The site IDs are used as the application keys for routing. The value of the SiteApplicationRoutingStrategy
component’s applicationNameFormatString
property specifies the default naming scheme for the EAC applications. The value of this property is a format string in which 0 is the value of the baseApplicationName
property, 1 is the site ID, and 2 is the two-letter language code. In this case, since routing does not take language into account, the 2 should be omitted, and the property should be set to:
applicationNameFormatString={0}{1}
Suppose, for example, that baseApplicationName
is ATG
and you have three sites whose IDs are storeIT
, storeDE
, and storeFR
. The default names of the EAC applications are ATGstoreIT
, ATGstoreDE
, and ATGstoreFR
. If your applications are named differently, use the ApplicationConfiguration
component’s keyToApplicationName
property to explicitly map the site IDs to your application names. For example:
keyToApplicationName=\
storeIT=MyItalyStore,\
storeDE=MyGermanyStore,\
storeFR=MyFranceStore
Separate EAC Application for each Combination of Site and Language
If you have a separate EAC application for each combination of site and language, set the defaultLanguageForApplications
property to null. This property is null by default, but if it has been subsequently set to a non-null value, you must explicitly set it back to null:
defaultLanguageForApplications^=/Constants.null
Since in this case routing must take into account both site and language, each application key is formed by concatenating the site ID with the language code, separated by the underscore character (_
). Similarly, the application names need to reflect the sites and languages, so the value of the SiteApplicationRoutingStrategy
component’s applicationNameFormatString
property should be set to:
applicationNameFormatString={0}{1}{2}
Suppose, for example, that baseApplicationName
is ATG
and you have Canada site whose ID is storeCA
. If the site has two languages, French and English, the default names for the corresponding EAC applications would be ATGstoreCAfr
and ATGstoreCAen
, and the keys for these applications would be storeCA_fr
and storeCA_en
.
Note that if you have multiple sites and multiple languages, but not all of the sites support all of the languages, SiteApplicationRoutingStrategy
does not create keys for the missing combinations. Records are generated only for valid combinations of sites and languages.
If your applications do not use the default naming scheme, use the ApplicationConfiguration
component’s keyToApplicationName
property to explicitly map the keys to your application names. For example:
keyToApplicationName=\
storeCA_fr=MyCanadaStoreFrench,\
storeCA_en=MyCanadaStoreEnglish,\
storeDE_de=MyGermanyStoreGerman,\
storeDE_en=MyGermanyStoreEnglish,\
storeFR_fr=MyFranceStoreFrench