Content Management Guide

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

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 WebLogic Portal Interaction Management Guide:

This chapter includes the following sections:

 


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.

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 JSP Javadoc for Content Management.

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.

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 Listing 9-1 to retrieve CarPic.

Figure 9-1 Content Hierarchy

Content Hierarchy

Listing 9-1 Sample Code for Retrieving CarPic
<%@ taglib uri="content.tld" prefix="cm"%>
<cm:getNode path="/WLP Repository/Dev2Dev/CarPic" id="carpic" />

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 Interaction Management Guide.

 


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 Interaction Management Guide.

Table 9-2 list the JSP tags that can display content. For a complete reference for the tags listed, see the JSP Javadoc for Content Management.

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 Workshop for WebLogic. 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 Workshop for WebLogic.
<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 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 Using Display Templates.


  Back to Top       Previous  Next