Use the <cat:getProperty> tag to retrieve a property for display from either a ProductItem or Category. The property can either be an explicit property (a property that can be retrieved using a get method on the Catalog item) or an implicit property (a property available through the ConfigurableEntity getProperty methods on the Catalog item). The tag first checks to see if the specified property can be retrieved as an explicit property. If it cannot, the specified property is retrieved as an implicit property.
<tagName attribute="value" / >
getterArgument
Optional (String) - Denotes a reference to an object supplied as an argument to an explicit property getter method. May also be used to obtain implicit or custom properties that are defined using the property set framework, in which case the getterArgument would be the scope name for the property set.
The object must be presented in the form <%= getterArgumentReference %> and must be a run-time expression.
id
Optional (String) - id="newInstance". If the id attribute is supplied, the value of the retrieved property will be available in the variable name to which id is assigned. Otherwise, the value of the property is inlined.
object
Required (Catalog item) - Denotes a reference to a ProductItem or Category object that must be presented in the form <%= objectReference %>.
propertyName
Required (String) - propertyName="propertyName". Name of the property to retrieve. If the property is explicit, it may be one of the values shown in the following table.
returnType
Optional (String) - returnType="returnType". If the id attribute is supplied, declares the type of the variable specified by the id attribute.
Property Name | Catalog Item Type |
"contributor | coverage | creationDate | creator | description | image | key | language | modifiedDate | name | publisher | relation | rights | source" | Catalog Item (common properties) |
"jsp" | Category |
"availability | currentPrice | format | jsp | msrp | shippingCode | taxCode | type | visible" | ProductItem |
This example retrieves the detail JSP information from an existing ProductItem:
<cat:getPropertyobject="<%= item %>"propertyName="Jsp" getterArgument= "<%= new Integer(ProductItem.DETAILED_DISPLAY_JSP_INDEX) %>" id="detailJspInfo"returnType="com.beasys.commerce.ebusiness.catalog.JspInfo"/>
This example shows how to use the getterArgument attribute to obtain an implicit or custom property for a property set/schema with the following characteristics:
Note: Because the getterArgument must be a run-time expression, we assign MyCatalog to a String variable and use the variable as the value to the getterArgument.
<% String myPropertySetName = "MyCatalog"; ProductItem myProductItem= .....; // reference to a ProductItem%> <cat:getProperty
object="<%=myProductItem%>
propertyName="color"
getterArgument="<%=myPropertySetName%>"
/>