Looks up an item in a specific repository, based on the item’s ID, and renders the item on the page.

Class Name

atg.targeting.RepositoryLookup

Component

/atg/targeting/RepositoryLookup

Required Input Parameters

id

The repository ID of the repository item to look up.

repository

The name of the repository that holds the item to look up.

url

The JNDI URL of the repository item. Use this parameter instead of the id and repository parameters.

Note: You can use this parameter only if the repository is registered. To register a repository, add it to the list of repositories in the initialRepositories property of the /atg/registry/ContentRepositories component.

Optional Input Parameters

itemDescriptor

The name of the item descriptor used to load the item.

fireViewItemEvent

Specifies whether to trigger a JMS view item event when a page is accessed. If set to true or omitted, an event fires. To prevent the ATG platform from firing a view item event, set this parameter to false.

fireContentEvent

Specifies whether to trigger an event when a page is accessed. If set to true or omitted, a JMS view event fires, 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.

Note: Instead of this parameter, use the fireViewItemEvent parameter.

fireContentTypeEvent

Specifies whether to trigger an event when a page is accessed. If this parameter is set to true or omitted, a JMS view event fires, 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.

Note: Instead of this parameter, use the fireViewItemEvent parameter.

fireContentEventItemDescriptor

Holds an item descriptor name. When the 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 Parameters

element

Set to the repository item specified by the input parameters.

Open Parameters

output

Specifies the HTML formatting when the element parameter is rendered.

empty

Rendered if the targeting operation returns no matching items.

Usage Notes

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

Example

The Quincy Funds demo application uses RepositoryLookup 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. RepositoryLookup 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>