ClassName

atg.targeting.RepositoryLookup

Component

/atg/targeting/RepositoryLookup

The RepositoryLookup servlet bean looks up a single repository item based on that item’s ID, and renders the item on the page. To obtain a repository item’s ID in the appropriate form, use the repositoryId property of the repository item.

Input Parameters

id
This input parameter represents the repository ID of the repository item you want to look up.

repository
This input parameter specifies the name of the repository that holds the item you want to look up.

itemDescriptor
The name of the item descriptor to use to load the item.

fireViewItemEvent
Indicates whether to trigger a JMS view item event when a page is accessed. Default is true, so an event is fired if this parameter is omitted. To prevent the ATG platform from firing a view item event, set this parameter to false.

fireContentEvent
Indicates whether to trigger an even when a page is accessed. By setting this parameter to true or omitting it, you cause a JMS view event to fire, and when the accessed page is an item in a Content repository, a content viewed event also fires. To prevent the ATG platform from firing these two events, set this parameter to false. It is recommended that you use the fireViewItemEvent parameter instead of the fireContentEvent parameter.

fireContentTypeEvent
Indicates whether to trigger an even when a page is accessed. By setting this parameter to true or omitting it, you cause a JMS view event to fire, and when the accessed page is an item in a Content repository, a content type event also fires. To prevent the ATG platform from firing these two events, set this parameter to false. It is recommended that you use the fireViewItemEvent parameter instead of the fireContentTypeEvent parameter.

fireContentEventItemDescriptor
This parameter holds an item descriptor name. When this servlet bean retrieves an item, it fires a content viewed event that contains the item’s type. Use this parameter to replace the item’s type in the content viewed event with the item’s item descriptor name.

Output Parameter

element
This output parameter is set to the repository item specified by the input parameters.

Open Parameter

output
This open parameter specifies the HTML formatting when the element parameter is rendered.

empty
This optional parameter is rendered if the targeting operation returns no matching items.

Example

The Quincy Funds demo application uses the RepositoryLookup servlet bean in its sendprospectus.jsp page. This page is passed the ID number of a repository item as a page parameter named ElementId. This repository item holds information about a mutual fund. The RepositoryLookup servlet bean uses the ElementId parameter as its id input parameter, and renders the name of the requested mutual fund:

<p>You have requested the application and prospectus for the
  <dsp:droplet name="/atg/targeting/RepositoryLookup">
    <dsp:param bean="/atg/demo/QuincyFunds/repositories/Funds/Funds"
    name="repository"/>
    <dsp:param name="id" param="ElementId"/>
    <dsp:oparam name="output">
      <b><nobr><dsp:valueof param="element.fundName"/></b>.</nobr>
    </dsp:oparam>
  </dsp:droplet>
 
loading table of contents...