This section describes how to add a tab, a custom editor, property groupings, and custom site configuration properties to the default site category using the Commerce Reference Store as a model. You can see the results of the Commerce Reference Store modifications on the Presentation and Operations tabs in Site Administration. This illustration shows the Operations tab:
The Commerce Reference Store-specific properties on the Operations tab, organized by property grouping, are:
Commerce
Billable Country Codes
Nonbillable Country Codes
Shippable Country Codes
Nonshippable Country Codes
New Product Threshold Days
Localization
Default Country
Default Language
Languages
Email a Friend Enabled
Back in Stock From Address
New Password From Address
Updated Password From Address
Order Confirmation From Address
Registered User From Address
Promotion From Address
This illustration shows the Presentation tab:
All of the properties on this tab are Commerce Reference Store-specific and they include:
Presentation
Resource Bundle
Default Page Size
Appearance
Path to CSS File
Large Site Icon
Adding Tab, Editors, and Property Groupings
The <ATG10dir>/CommerceReferenceStore/Store/EStore/Versioned/install/data/site-template-viewmapping.xml
file does the following to the default site configuration:
Adds the Presentation tab.
Defines the Presentation and Appearance property groupings that appear on the Presentation tab.
Adds the Localization and Email property groupings to the Operations tab.
Creates a new property editor that limits input to two characters and assigns that editor to the Default Country and Default Language properties.
The following code excerpt shows the Commerce Reference Store site-template-viewmapping.xml
file with comments that describe what each section of the file does:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE gsa-template SYSTEM "dynamosystemresource:/atg/dtds/gsa/gsa_1.0.dtd"> <gsa-template> <import-items> <!-- ============================== --> <!-- === SITE ID EDITOR === --> <!-- ============================== --> <!—- Create a mapping item that is used to assign the new two-character editor to site configuration properties. --> <add-item item-descriptor="propertyViewMapping" id="SaPvmTwoCharEditor"> <set-property name="propertyView"> <![CDATA[SaPvTwoCharEditor]]> </set-property> <set-property name="description"> <![CDATA[Site Group Name propertyViewMapping]]> </set-property> </add-item> <!—- Create the new two-character editor. --> <add-item item-descriptor="propertyView" id="SaPvTwoCharEditor"> <set-property name="name"> <![CDATA[Property View which allows a maximum of 2 chars]]> </set-property> <set-property name="description"> <![CDATA[DefaultEditor with a 2 char max]]> </set-property> <set-property name="mode"> <![CDATA[AmMmDef]]> </set-property> <set-property name="type"> <![CDATA[string]]> </set-property> <set-property name="viewComponent"> <![CDATA[atg.assetmanager.editor.view.property.DefaultEditor]]> </set-property> <set-property name="isComponentPropertyView"> <![CDATA[false]]> </set-property> <set-property name="isDefault"> <![CDATA[false]]> </set-property> <set-property name="attributes"> <![CDATA[inputFieldMaxlength=SaPvadTwoCharInputFieldMaxLength inputFieldMaxWidth=AmPvadIntInputFieldMaxWidth]]> </set-property> </add-item> <add-item item-descriptor="propertyViewAttributeDefinition" id="SaPvadTwoCharInputFieldMaxLength"> <set-property name="defaultValue"> <![CDATA[2]]> </set-property> <set-property name="description"> <![CDATA[Max number of two characters in the input field]]> </set-property> </add-item> <!-- Create the itemViewMapping that defines the Presentation tab. --> <add-item item-descriptor="itemViewMapping" id="SaIvmSiteDefaultCategoryCRS"> <set-property name="name"> <![CDATA[AssetManager default site itemViewMapping]]> </set-property> <set-property name="displayName"> <![CDATA[SaIvmSiteDefaultCategoryCRS.displayName]]> </set-property> <set-property name="view"> <![CDATA[SaIvBaseSiteConfig]]> </set-property> <!-- Assign the two-character editor to the default country and default language properties that will appear on this tab. Note that the properties themselves are defined in <ATG10dir>/CommerceReferenceStore /Store/EStore/config/config.jar/atg/multisite/siteRepository.xml. --> <set-property name="propertyMappings" add="true"> <![CDATA[defaultCountry=SaPvmTwoCharEditor defaultLanguage=SaPvmTwoCharEditor]]> </set-property> <set-property name="attributeValues"> <![CDATA[resourceBundle=aMgrAvCrsResourceBundle, includedCategories=SaAvDefCatIncludedCatsCRS]]> </set-property> </add-item> <!-- Create the Presentation and Appearance property groupings on the Presentation tab. --> <add-item item-descriptor="attributeValue" id="SaAvDefCatIncludedCatsCRS"> <set-property name="value"> <![CDATA[categoryPresentation,categoryAppearance]]> </set-property> </add-item> </import-items> <!-- Update the default site category itemMapping with the viewMapping for the CRS Presentation tab. This code adds the Presentation tab to the default site category. --> <update-item item-descriptor="itemMapping" id="SaImSiteDefaultCategory"> <set-property name="viewMappings" add="true"> <![CDATA[SaIvmSiteDefaultCategoryCRS]]> </set-property> </update-item> <!--Update the default site category 'Ops' itemViewMapping's includedCategories value to include categoryLocalization and categoryEmail. This code adds the Localization and Email property groupings to the Operations tab. --> <update-item item-descriptor="attributeValue" id="SaAvDefCatIncCatsOps" skip-update="true"> <set-property name="value" add="true" value=",categoryLocalization,categoryEmail"> </set-property> </update-item> </gsa-template>
Note: The resource bundle that defines the display name of the Presentation tab is located in the /atg/remote/commerce/StoreResources.properties
file stored in <ATG10dir>/CommerceReferenceStore/Store/EStore/Versioned/lib/classes.jar
.