When you create a new site in Site Administration, you must select a site category. The site category you choose determines the site configuration properties you can set for the site (that is, the settings you see in Site Administration).
Out of the box, the ATG platform ships with a default site category that includes basic properties that most sites are likely to require, such as Site Description and Site Name. Other modules, such as Commerce (DCS
) and Commerce Reference Store (CommerceReferenceStore
), layer on additional properties to the default site category, such as default price lists and CSS file locations. For Commerce Reference Store 10.1, site configuration properties are added to the default site category by:
The ATG platform
Commerce
Search
Self Service
Commerce Reference Store
Note: For details on each module’s properties, refer to the documentation for the individual module.
Depending on your application’s requirements, you may choose to append site configuration properties to the default site category (this is the Commerce Reference Store’s approach), or you may choose to create an entirely new site category. You should create a new site category if:
You want to define a set of characteristics for a particular kind of site, for example, you could have one site category for commerce applications that sell products to customers and another category for customer support applications.
You want your site configuration properties to behave differently on different sites, for example, a property could be required on one type of site and hidden on another.
You want to modify any of the editors for properties that are part of the default site category (for example, creating a menu of pre-configured choices for a string property in place of the standard text box editor).
Whether you create a new site category or append properties to the default site category, it is important to understand the underlying site category structure. Each site category in Site Administration is backed by a corresponding siteTemplate
item in the Site repository that gives the category a name and points to a view mapping. View mappings control the display of repository item properties in a UI. You can have more than one view mapping refer to the same type of repository item, with each view mapping specifying different display and editing characteristics for the properties of the repository item. To return to our previous example, one view mapping could mark a property as required while another could mark it as hidden.
It is possible to define characteristics such as required and read only, or to provide a default value for a property, in the siteConfiguration
XML repository definition file. However, any configuration you specify in the siteConfiguation
XML definition will apply to all site configurations; that is, all site configuration items in the Site repository will use that default value. Specifying characteristics like defaults in view mappings allows you to have different defaults for different site categories. When you select a category for your site, you get the corresponding default. For example, consider the following diagram:
In this diagram, the following happens:
The
/atg/multisite/siteRepository.xml
defines three properties for thesiteConfiguration
item type, Properties 1, 2, and 3. Property 3 has a default value ofTrue
. Because it is specified at the XML definition file level, this property will be the same for all sites created in the Site repository.View Mapping A further refines Property 1 to mark it as required, and Property 2 to set its default value to
True
. These values will be reflected in Site Administration. View Mapping A doesn’t further refine Property 3 beyond specifying that the property should be visible in Site Administration.View Mapping B further refines Property 1 to mark it as hidden, meaning it will not appear in Site Administration, and Property 2 to set its default value to
False
. Like View Mapping A, View Mapping B doesn’t further refine Property 3 beyond specifying that the property should be visible in Site Administration.Both view mappings configure the display of the site properties in Site Administration. However, because they specify different behavior for the properties, the presentation and behavior of the properties in the Site Administration will also be different.
siteTemplate A
defines Site Category A and specifies that the category should use View Mapping A as its view mapping.siteTemplate B
defines Site Category B and specifies that the category should use View Mapping B as its view mapping.When you create a site using Site Category A in Site Administration, the following happens:
A value for Property 1 is required in order for the site to be saved in Site Administration.
The value for Property 2 defaults to
True
, as defined in View Mapping A.The value for Property 3 defaults to
True
, as defined insiteRepository.xml
.
When you create a site using Site Category B in Site Administration, the following happens:
Property 1 is not visible in Site Administration. Its value in the Site Repository is null. (Note that, while this example does not demonstrate it, it is possible to provide a default value for a property and mark it as hidden, in which case the default value will be stored in the Site Repository and the property will not appear in Site Administration).
The value for Property 2 defaults to
False
, as defined in View Mapping B.The value for Property 3 defaults to
True
, as defined insiteRepository.xml
.
In general, you should define the existence of site properties in the siteRepository.xml
and define the behavior of properties (read only, defaults, required, and so on) in view mappings. The exception to this rule is a property that should behave identically across all sites stored in the Site Repository.
The following sections describe how to append custom site configuration properties to the default site category, using Commerce Reference Store as an example. For detailed information on creating new site categories, see Defining Site Categories. In particular, pay attention to the caveats described in the Important Warning section. For more details on view mappings themselves, see the ATG Content Administration Programming Guide.