CurrentLocation
The user profile has a property called currentLocation
that may be used by complex targeting systems to enable the targeter to know what kind of targeting information is available. It is an enumerated property type whose choices are unknown
, home
, store_home
, shopping_cart
, catalog_category
, catalog_product
, catalog_search
, checkout
, and profile
. Because this is a category page, we set the property like this:
<dsp:setvalue bean="/atg/userprofiling/Profile.currentLocation"
value="catalog_category"/>
HTML Header and Title
The HeadBody.jsp
fragment is invoked on every page in the site to render the HTML header and the opening <BODY>
tag. This is a good example of separating fragments that are used on every page into reusable droplets. This fragment takes a pagetitle
parameter and uses it as the HTML <TITLE>
. In passing this parameter to HeadBody.jsp
we used the single quotation mark ( '
) syntax to evaluate '"Pioneer Cycling - " +request.getParameter("element.displayName")'
as a Java statement. When '"Pioneer Cycling - " +request.getParameter("element.displayName")'
is compiled, executed, and rendered on the browser, the user sees “Pioneer Cycling – Accessories.”
CategoryLookup Component
We used the CategoryLookup
component to get a Category
object for a particular category ID. The id
parameter required by CategoryLookup
is passed to this page as a URL parameter, so it doesn’t have to be passed again here. The user’s locale is passed as the repositoryKey
parameter so that the category is generated in the proper language. (See the section on Adding Support for Multi Locales for more information). In response to these parameters, CategoryLookup
binds the element
parameter to the Category repository item that it found. The element parameter is in scope between the <dsp:oparam name="output">
and </dsp:oparam>
tags.
CategoryBrowsed Droplet
We used the CategoryBrowsed
component to generate an ItemViewed
message for this category. The message can have any number of listeners. The listener for the ItemViewed
event is a ATG Consumer Commerce scenario that logs the message to a data set that can later produce reports on the categories viewed, how often they were viewed, and by which users. Pioneer Cycling has an additional listener that is a scenario that records the category in the user’s categoriesViewed
property.
Product display pages use the ProductBrowsed
component, which is analogous to CategoryBrowsed
.
Navigation History
We used breadcrumbs.jsp
to collect and display navigation history information. It is also invoked by product pages. For more information, please refer to the section on Adding Catalog Navigation.
Displaying Child Products and Categories
Repository items of type Category
have the properties childProducts
and childCategories
. These properties describe the hierarchical relationships between categories and between categories and products. DisplayChildrenGeneric.jsp
is invoked to display the products and categories in the hierarchy contained by the current category. It displays an array of repository items in a table. The parameter is supplied to specify the number of columns in the table and the array to display.
Displaying Promotions
We used DisplayMediaSlot.jsp
to display promotions. A “slot” is an ATG Relationship Management Platform term for a generic place to hold objects. Slots can be populated in many ways but the most common way is by using a scenario. DisplayMediaSlot.jsp
can display any number of objects from the slot. In this page, it is invoked with the numToDisplay
parameter set to “1”.
Search
We used SimpleSearchFragment.jsp
to display the Search form on each catalog page. There are two kinds of searching in Pioneer Cycling: simple search and advanced search. The formAction
parameter indicates which search method to use.