For each target repository, you must create a destination GSARepository
. For example, given two targets, staging and production, and two repositories on each target, ProductCatalog
and PriceLists
, four destination repositories are required:, two for staging and two for production, as configured by these properties files:
/atg/commerce/catalog/ProductCatalog_staging.properties
/atg/commerce/pricing/priceLists/PriceLists_staging.properties
/atg/commerce/catalog/ProductCatalog_production.properties
/atg/commerce/pricing/priceLists/PriceLists_production.properties
Note: The distribution for Merchandising provides ProductCatalog
and PriceLists
repositories and their corresponding destination repositories, for production-only and production/staging deployments. If you create your own repositories, you must also create their destination repositories.
Foreign Repository Mappings
Items in one destination repository can link to items in another through their repository
attribute. Because the destination repositories are renamed copies of the corresponding production repositories, you must provide a way to resolve external references. For example, items in the destination repository ProductCatalog_production
might reference items in the original repository PriceList
, as follows:
<property name="priceList" column-name="price_list" item-type="priceList" repository="/atg/myApp/PriceLists" >
To ensure that cross-references resolve correctly, you can create a RepositoryMapper
component from the class atg.repository.RepositoryMapper
, which extends the GenericService
class. This component’s RepositoryMappings
property provides the mappings that are required by a foreign repository, as follows:
repositoryMappings=\ /Nucleus-path/original-repository=/Nucleus-path/new-repository,\ /Nucleus-path/original-repository=/Nucleus-path/new-repository,\ ...
where Nucleus-path
must be the repository’s absolute Nucleus path.
Thus, given the previous example, you set the RepositoryMappings
property for a RepositoryMapper
as follows:
repositoryMappings=\ /atg/myApp/ProductCatalog=/atg/myApp/ProductCatalog_production,\ /atg/myApp/PriceLists=/atg/myApp/PriceLists_production
Each repository that requires mapping for its items must set a RepositoryMapper
in its foreignRepositoryMapper
property. Given the previous example, ProductCatalog_production.properties
and PriceLists_production.properties
must set their foreignRepositoryMapper
property to a RepositoryMapper
as follows:
foreignRepositoryMapper=/
Nucleus-path
/
repository-mapper
Note: The Oracle Commerce Platform distribution provides a RepositoryMapper
that contains required mappings; you can add your own mappings to these by creating, in the management server’s localconfig
layer, /atg/repository/ProductionRepositoryMapper.properties
, and setting repositoryMappings
with the increment/assignment operator +=
as follows:
repositoryMappings+=mapping[,]...
Procedure
To create a destination repository, perform these steps:
Copy an existing unversioned repository properties file into the
localconfig
directory of the asset management server and rename it.In the properties file:
Set the value of the
repositoryName
property to the name of the destination repository.Set the
dataSource
property to point to this repository’s data source. Each destination repository must be set to a data source component that is specific to the destination. For example, all destination repositories for the production server might set theirdataSource
property to/atg/dynamo/service/jdbc/JTDataSource_production
, while all destination repositories for the staging server might specify/atg/dynamo/service/jdbc/JTDataSource_staging
.Set the
lockManager
property to a ClientLockManager component. This ClientLockManager is defined to communicate with the corresponding ServerLockManager on the production server. While the ClientLockManager component is configured on the asset management server, it is logically part of the production server cluster and must be configured against that server’s components.For information about configuring a ClientLockManager, refer to the SQL Repository Caching chapter in the Repository Guide.
Set
foreignRepositoryMapper
to theRepositoryMapper
that you use to map destination repository names, as described earlier.
For example:
repositoryName=ProductCatalog_production dataSource=/atg/dynamo/service/jdbc/JTDataSource_production lockManager=/atg/dynamo/service/ClientLockManager_production foreignRepositoryMapper=/atg/repository/ProductionRepositoryMapper