Skip Headers
Oracle® Fusion Middleware Content Management Guide for Oracle WebLogic Portal
10g Release 3 (10.3.4)

Part Number E14230-02
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

9 Delivering Content Within Your Portal

When developing your portal, you use JSP tags, the content API, and personalization tools to retrieve and display content to your portal users.

Retrieving and displaying content is typically done within a JSP page. Within a JSP page, you can use the API, JSP tags, content selectors, placeholders, and campaigns to retrieve content based on queries and personalization rules.

For more information about delivering personalized content, see the following sections in the Oracle Fusion Middleware Interaction Management Guide for Oracle WebLogic Portal:

This chapter includes the following sections:

9.1 Working with JSP Tags

JSP tags both retrieve and display content. Retrieving content or searching for the content is typically done within the context of a JSP page. You can also retrieve content using the content API.

9.1.1 Retrieving Content with JSP Tags

The four content-specific JSP tags that retrieve content are listed in Table 9-1. For more information about JSP tags, see the Oracle Fusion Middleware JSP Tag Java API Reference for Oracle WebLogic Portal.

Table 9-1 Content JSP Tags

JSP Tag Usage
<cm:getNode>

Retrieves a content node and stores the node in a variable.

<cm:search>

Searches for and retrieves content nodes based on a supplied query and stores the results in a variable.

<cm:getProperty>

Retrieves a property value from a content node and stores it as a variable or prints it in the JSP.

<cm:getBinaryProperty>

Retrieves a binary property associated with a content node.


Regardless of which JSP tag you use, you retrieve content within a tag by using a repository path or by using queries.

9.1.1.1 Retrieving Content Using a Repository Path

All content is addressable by a unique path. This path is visible in the WebLogic Portal Administration Console as you create folders and content. Within the <cm:getNode> JSP tag, you can specify the repository path to retrieve content. For example, if your content hierarchy appears in the WebLogic Portal Administration Console as shown in Figure 9-1, you could use the code in Example 9-1 to retrieve CarPic.

Figure 9-1 Content Hierarchy

Description of Figure 9-1 follows
Description of "Figure 9-1 Content Hierarchy "

Example 9-1 Sample Code for Retrieving CarPic

<%@ taglib uri="http://www.bea.com/servers/portal/tags/content" prefix="cm"%>
<cm:getNode path="/WLP Repository/Dev2Dev/CarPic" id="carpic" />

9.1.1.2 Using Queries to Retrieve Content

You can also use queries to retrieve content. For more information about creating queries, see "Building a Content Query with Expressions" in the Oracle Fusion Middleware Interaction Management Guide for Oracle WebLogic Portal.

9.2 Displaying Content with JSP Tags

After retrieving content, you need to decide how to display it within the portal. This section discusses using JSP tags and provides some examples. Displaying content can also be done using personalization tools. For more information about personalizing content, see the Oracle Fusion Middleware Interaction Management Guide for Oracle WebLogic Portal.

Table 9-2 list the JSP tags that can display content. For a complete reference for the tags listed, see the Oracle Fusion Middleware JSP Tag Java API Reference for Oracle WebLogic Portal.

Table 9-2 JSP Tags Used to Display Content

JSP Tag Description
<ad:adTarget>

Uses the Ad service to send an ad query to the content management system.

<ad:render>

Renders a content node from the Virtual Content Repository in the current JSP.

<ph:placeholder>

Displays personalized web content in a JSP based on placeholder and campaign rules and queries that have been defined.

<pz:contentQuery>

Performs a content attribute search in a content management system and returns an array of content objects.

<pz:contentSelector>

Implements a Content Selector that has been defined using Oracle Enterprise Pack for Eclipse. Displays personalized Web content in a JSP based on Content Selector rules and queries defined.

<pz:div>

Allows a piece of in-line content to be shown if a user belongs to the specific User Segment defined with Oracle Enterprise Pack for Eclipse.

<dt:displaytemplate>

Requests the registered view for a resource, which in turn renders it in the JSP.

To use this tag, you must create display templates (views) and a mapping file (XML) to map to the templates. For more information about setting up templates, see Chapter 11, "Using Display Templates."

<dt: displaycmtemplate>

Requests the registered view for a content management resource, which in turn renders it in the JSP.

To use this tag, you must create display templates (views) and a mapping file (XML) to map to the templates with the respective content types. For more information about setting up templates, see Chapter 11, "Using Display Templates."