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 ATG 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 ATG 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:

  1. Copy an existing unversioned repository properties file into the localconfig directory of the asset management server and rename it.

  2. In the properties file:

    For example:

    repositoryName=ProductCatalog_production
    dataSource=/atg/dynamo/service/jdbc/JTDataSource_production
    lockManager=/atg/dynamo/service/ClientLockManager_production
    foreignRepositoryMapper=/atg/repository/ProductionRepositoryMapper

 
loading table of contents...