A renderer is a .jsp file that contains HTML and JSP for rendering repository items returned by a slot. A renderer must have the following variable passed into it: a param called targetingResults. This param contains the list of items returned by the slot. The renderers you create should be able to handle and display a repository item for a specific repository item type. For instance, you should create a renderer that handles only solution items from the Service repository, but not commerce promotions. If you use a renderer that tries to access properties that are not valid for the current item type, it will result in repository error messages. Therefore, the more specific the renderer is to the particular item-type, the better.

ATG Service includes the following five renderers located at <ATG2007.3dir>/Service2007.3/Service/Agent/extensions/j2ee-apps/
extensions.ear/extensions.war/renderer:

Note: the promotion.jsp renderer displays the displayName and only one media item of a promotion

Refer to Out of the Box Samples for more information on the out of the box slots and renderers.

Below is the code for a sample renderer. This renderer displays a solution title to the panel. You may use this as a guideline for creating renderers.

Code for sample renderer:

<ul>
<dspel:droplet name="/atg/dynamo/droplet/ForEach">
 <dspel:param name="array" param="targetingResults"/>
  <dspel:setvalue param="CurrentSolution" paramvalue="element"/>
  <dspel:oparam name="output">
    <li>Solution title:
      <dspel:valueof param="CurrentSolution.rawTitle"/>
  </dspel:oparam>
</dspel:droplet>
</ul>

When a renderer is displayed in ATG Service Center, it is dynamically included in the page from within an internal-only JSP fragment, referred to as a renderer wrapper.

The renderer wrapper performs the targeting operation using a TargetingArray servlet bean. The results are then passed to the page so that the renderer can be displayed on the page. Renderer wrappers are different from the renderers themselves and are not intended for modification.

 
loading table of contents...