By defining a property as an enumerated String
instead of an enumerated
data type, the following options are available to you:
Save enumerated codes as String values in the database.
Save one or more strings from a list of multiple choice strings.
You provide the property with the values by adding the following attribute:
<attribute name="stringEnumProvider" value="
string-enum-provider-value
"/>
where string-enum-provider-value
is an implementation of atg.adapter.gsa.StringEnumProvider
. The Oracle Commerce Platform installation provides two implementations for this interface, which are referenced by two properties in the site repository:
/atg/multisite/SiteTypesProvider
: Specified bysiteConfiguration.siteTypes
, obtains a list of site types from theSiteManager
./atg/multisite/ShareableTypeStringEnumProvider
: Specified bysiteGroup.shareableTypes
properties, obtains a list of shareable types from theSiteGroupManager
.
For example, the site repository’s item descriptor siteConfiguration
defines its siteTypes
property as a collection of enumerated String
values as follows:
<item-descriptor name="siteConfiguration" ... > ... <property name="siteTypes" column-names="site_type" data-type="set" component-data-type="enumerated string" category-resource="categoryBasics" display-name-resource="siteTypes"> <attribute name="stringEnumProvider" value="/atg/multisite/SiteTypesProvider"/> <attribute name="propertySortPriority" value="100"/> </property> ... </item-descriptor>