A property can consist of a collection of properties (key-value pairs) of any valid type.
Because item properties can be used for a variety of purposes, InFront does not include any generic editors for working with items. However, editors intended for specific purposes may store their values in item properties.
To add an item property to a template:
Specify the
class
attribute with the fully qualified class name of the configuration model class that corresponding to this item property.Optionally, specify a default value by inserting a
<xavia:Property>
of type<String>
,<Boolean>
,<xavia:List>
, or<xavia:Item>
. (A<Property>
with no type specified is treated as a string by default.)Note
Properties defined within
<xavia:Item>
must declare the Xavia namespace (i.e.,<xavia:Property>
instead of<Property>
.
Following is an example of a template that uses an item with a default value:
<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" xmlns:editors="editors" xmlns:xavia="http://endeca.com/schema/xavia/2010" type="MainContent"> <!-- additional elements omitted from this example --> <ContentItem> <Name>Results List</Name> <!-- additional elements omitted from this example --> <Property name="sortOption"> <xavia:Item class="com.endeca.infront.navigation.model.SortOption"> <xavia:Property name="label">Most Sales</xavia:Property> <xavia:Property name="sorts"> <xavia:List> <xavia:Item class="com.endeca.infront.navigation.model.SortSpec"> <xavia:Property name="key">product.analytics.total_sales</xavia:Property> <xavia:Property name="ascending">true</xavia:Property> </xavia:Item> </xavia:List> </xavia:Property> </xavia:Item> </Property> <!-- additional elements omitted from this example --> </ContentItem> <!-- additional elements omitted from this example --> </ContentTemplate>
Following is an example of a template that uses an item without a default value:
<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" xmlns:editors="editors" xmlns:xavia="http://endeca.com/schema/xavia/2010" type="SidebarContent"> <!-- additional elements omitted from this example --> <ContentItem> <!-- additional elements omitted from this example --> <Property name="recordSelection"> <xavia:Item class="com.endeca.infront.cartridge.RecordSpotlightSelection" /> </Property> <!-- additional elements omitted from this example --> </ContentItem> <!-- additional elements omitted from this example --> </ContentTemplate>