The business user builds the targeter rules; the page developer inserts the targeter servlet bean into the investor home page. There are several kinds of targeter beans: each one governs the order in which targeted items display differently. The bean in this example, TargetingRange, is used when several items are available for display, because there may be multiple features that meet these criteria.

Examine the TargetingRange bean in the investor home page. In short, this code executes the targeter rules, returns the number of items desired by the logged in visitor, and sorts them alphabetically by title. Then the system displays the article name and image and provides a link to the feature text in full. If no items are returned, it displays “No Features Today” notice.

To see how these tags appear on a page:

<dsp:droplet name="/atg/targeting/TargetingRange">
     <dsp:param bean="/atg/registry/RepositoryTargeters/Features/Features"
      name="targeter"/>
     <dsp:param bean="Profile.numberfeatureitems" name="howMany"/>
     <dsp:param name="sortProperties" value="+title"/>
     <dsp:param name="fireContentEvent" value="false"/>
     <dsp:param name="fireContentTypeEvent" value="false"/>
     <dsp:oparam name="outputStart">
     </dsp:oparam>
     <dsp:oparam name="output">
       <tr valign=top>
         <td><dsp:a href="feature.jsp">
         <dsp:param name="ElementId" param="element.repositoryId"/>
         <img height="73" vspace="2" border="0" hspace="8" width="73"
         src="<dsp:valueof
         param="element.SmallImageURL">images/features/noimage.gif</dsp:valueof>">
         </dsp:a></td>
         <td><dsp:a href="feature.jsp">
         <dsp:param name="ElementId" param="element.repositoryId"/>
         <b><dsp:valueof param="element.title"/></b></dsp:a><br>
         <dsp:valueof param="element.headline"></font></dsp:valueof> </td>
       </tr>
     </dsp:oparam>
     <dsp:oparam name="empty">
       <tr>
         <td colspan=2>No Features today.</td>
       </tr>
     </dsp:oparam>
   </dsp:droplet>

Tag

Description

<dsp:droplet name="/atg/targeting/TargetingRange">

Invokes the TargetingRange servlet bean. For more information on TargetingRange, see the Page Developer's Guide.

<dsp:param bean="/atg/registry/Repository
Targeters/Features/Features" name="targeter"/>

Instructs the servlet bean to run the Features targeter against the items in the Features repository.

<dsp:param bean="Profile.numberfeatureitems" name="howMany"/>

Sets the servlet bean’s howMany input parameter to the visitor’s numberoffeatureitems property. A visitor can change this property value through the Preferences page.

<dsp:param name="sortProperties" value="+title"/>

Alphabetizes the located features by title. Additional sorting mechanisms are available, see the Page Developer's Guide.

<dsp:oparam name="output">….</dsp:oparam>

Renders the located items as output.

<dsp:a href="feature.jsp">
<dsp:param name="ElementId" param="element.repositoryId"/>
<dsp:valueof param="element.SmallImageURL">images/
features/noimage.gif</dsp:valueof>">
</dsp:a>

Sets the ElementID parameter to the feature’s ID. Displays the image stored in the feature’s smallImageURL property, which is also a link to the feature’s text. When the image is clicked, feature.jsp uses the ElementId to display the text stored in the offer’s relativePath property

<dsp:a href="feature.jsp">
<dsp:param name="ElementId" param="element.repositoryId"/>
<dsp:valueof param="element.title"/></dsp:a>

Sets the ElementID parameter to the feature’s ID. Displays the feature’s title as a link to the feature’s text. When the title is clicked, the page passes the ElementID to Feature.jsp, which inserts the text fragment appropriate for that feature article.

<dsp:valueof param="element.headline">
</dsp:valueof>

Displays the feature’s headline.

<dsp:oparam name="empty">
<td colspan=2>No Features today.</td></dsp:oparam>

Displays “No Features today” if no features are returned by the TargetingRange bean.


Copyright © 1997, 2014 Oracle and/or its affiliates. All rights reserved. Legal Notices