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:
Open
investorhome.jsp
in<ATG2007.3dir>/DSSJ2EEDemo/j2ee-apps/QuincyFunds/web-app/en
.Find the first instance of the
TargetingRange
bean, which is used to locate items in the Features repository.
<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>
| Invokes the |
| Instructs the servlet bean to run the Features targeter against the items in the Features repository. |
| Sets the servlet bean’s |
| Alphabetizes the located features by title. Additional sorting mechanisms are available, see the ATG Page Developer's Guide. |
| Renders the located items as output. |
| Sets the |
| Sets the |
| Displays the feature’s headline. |
| Displays “No Features today” if no features are returned by the |