Monday, April 6, 2015

How to extend an ATG version-ed repository (ATG Oracle Commerce)

As example of how to extend an ATG a version-ed repository we will use SiteRepository as example.

This example assume the reader does know the basics about ATG repository definition.

We will add all kind of type of properties (Simple data-types, component-data-types, List, and Maps).

First Thing to do is we need to create file called siteRepository.xml and this must be inside of config folder at /atg/multisite/ on a common module, since is the one we will use for Store Instances, BCC, and CSC.

We add the following content to siteRepository.xml :



Then we will start adding new item descriptors inside our

Before create the item descriptor we need to design our Site extension:

The extension will have 3 categories Presentation, Configuration, and Internationalization, with the below properties into each of them,

Notation:
[] = List Property
[k,v] = Map Property

Presentation
resourceBundle
[] .CSS files
[k,v]Images
large, small, favicon, medium


Config
[k,v]email addresses
[k,v]thirdPartyKeys
channel

I18n
defaultCountry
defaultLanguage
[]Languages
[]locale


First lets create a table to hold all the simple data type properties:

resourceBundle
defaultCountry
defaultLanguage
channel

We need to create 2 tables 1 of them will be on PUB schema, and the other will be on both CatalogA and B schema

On PUB we will create as follows:

When this is done, then we proceed to define the item-descriptor, since we are going to extend an existing one we will do append on xml-combine attribute
then we will add our table, which will be auxiliary since we are adding new properties to our existing siteConfiguration item-descriptor

Inside our table we will add our proprieties, based on the Database Table created with the above script


Please note we are using display-name-resource and  category-resource attribute of the properties, this is because we are adding the display name for those into a resourceBundle file that is already defined by the site repository atg.multisite.SiteRepositoryTemplateResources, we just need to extend this on our common module.

All the properties below are String, but one of them is coming from an enumerated



Then lets continue with the List type properties


[] .CSS files
[]Languages
[]locale


Again, we need to create tables on PUB schema, and both Catalogs schemas

On PUB we will create as follows:
On the catalogs

We will add new properties to our exiting item-descriptor xml definition:



Let's continue with the Map Properties:


[k,v]Images
  large, small, favicon, medium

[k,v]email addresses
[k,v]thirdPartyKeys


And Again, we need to create tables on PUB schema, and both Catalogs schemas

On PUB we will create as follows:
On Catalogs

We will add new properties to our exiting item-descriptor xml definition:


The definition above is not adding propertySortPriority attribue, that is up to the desired orderdering on the application.


If everything is correct the BCC will looks similar to this:


In order to display the properties on a separate Tab as in the image above, ViewMappingRepository is the place where you define that, on a future post this will be explained.


Post a Comment