Skip navigation.

Interaction Management Guide

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

Content Selectors

Content selectors are a powerful tool for personalization, letting you target specific groups of people with one or more specific content items from the BEA's Virtual Content Repository.

For example, if a user logs in who is identified in her user profile as a "book nerd," a content selector can display a list of recommended books.

A content selector is made up of two parts: a content selector file you create in WebLogic Workshop and a companion JSP tag that performs the processing.

In Figure 3-1, the content selector file is called "classic", and the JSP tag references the content selector file.

Figure 3-1 The two parts of a content selector: a content selector file and a JSP tag

The two parts of a content selector: a content selector file and a JSP tag


 

This chapter includes the following sections:

 


How Content Selectors Work

Users do not have to be authenticated (log in) to be targeted by content selectors. For example, the presence of specific HTTP request or session properties, or specific date/time conditions can trigger content to be displayed. You can, for example, display targeted holiday content to users who visit your portal in the month of December and who are viewing your portal with a specific type of Web browser.

However, authenticated users (as well as anonymous tracked users) have profile information associated with them that you can use to target them more accurately with personalized content. The "book nerd" example in the chapter introduction is an example of this.

The following sections describe the structure of a content selector in more detail: the content selector file and the JSP tag.

Content Selector File

A content selector file contains two parts:

Figure 3-2 shows a content selector file called classic.sel. The condition that triggers the content selector is a user whose user profile has a "Graphic Preference" property with a value of "classic". The content that is retrieved is any content with a binary file name that contains "IRACampaign".

Figure 3-2 Content selector file in WebLogic Workshop

Content selector file in WebLogic Workshop


 

<pz:contentSelector> JSP Tag

After you have created a content selector file, you must use the <pz:contentSelector> JSP tag to display the content. Following is an JSP tag for the "classic" content selector shown in Figure 3-2.

<pz:contentSelector rule="classic" id="nodes"/>

The JSP tag has two required attributes:

There are many other useful attributes you can set on the <pz:contentSelector> tag. See "<pz:contentSelector> Tag" in the WebLogic Workshop help system at http://download.oracle.com/docs/cd/E13226_01/workshop/docs81/doc/en/portal/taglib/www.bea.com/servers/portal/tags/personalization/contentSelector.html

 


Types of Content that Content Selectors Can Display

Content selectors retrieve content properties, most of which are the text or numeric values. For example, say you want your content selectors to retrieve information about books. Book content can be assigned many properties, such as title, author, publication date, ISBN, and a URL to the publisher's Web site. You may want your content selector to display a bulleted list of titles and link each title to the publisher's Web site. All of that is accomplished through using only the text values of the content properties.

But say book content also has a binary property that stores an image of the book's cover. The content selector can also display that binary property—show the actual image—using the ShowProperty servlet, as described in Using Content Selectors. The the type of binary content that content selectors can display is dependent upon the MIME types you have configured. By default, WebLogic Portal provides MIME support for displaying image, Shockwave, and XHTML files. To display content for other MIME types, see "Supporting Additional MIME Types" in the WebLogic Workshop help system at http://download.oracle.com/docs/cd/E13226_01/workshop/docs81/doc/en/portal/buildportals/mimetypes.html.

Setting up Content for Use in Content Selectors

For content selectors to display binary content such as images, the binary content property must be set to "Primary Property" in the Virtual Content Repository. See "Displaying Binary Content" in the Setting up Content chapter in this guide.

 


Creating Content Selectors

Creating a placeholder involves creating a content selector file in WebLogic Workshop and using companion <pz:contentSelector> JSP tags in any relevant JSPs. Each <pz:contentSelector> JSP tag must use its "rule" attribute to reference a content selector you have created in WebLogic Workshop, and it must use its "id" attribute to store the array of the content query results.

For steps on creating content selectors, see the following topics in the WebLogic Workshop Help system:

Tutorial

The WebLogic Workshop help system includes a tutorial called "Showing Personalized Content in a Portlet" at http://download.oracle.com/docs/cd/E13226_01/workshop/docs81/doc/en/portal/tutorials/tutP13nPortletIntro.html. This tutorial involves creating content selectors and surfacing the content in a portlet.

Building Content Queries

WebLogic Portal provides advanced content query features for building powerful content queries. For more information, see "Building Content Queries with Expressions" in the WebLogic Workshop help system at http://download.oracle.com/docs/cd/E13226_01/workshop/docs81/doc/en/portal/buildportals/contentExpression.html.

Adding Content Selectors to JSPs

After you create a content selector file in WebLogic Workshop, you can add the content selector to a JSP in a number of ways in WebLogic Workshop:

 


Using Content Selectors

This section provides guidance on using content selectors.

 


Using <pz:div> Instead of a Content Selector

With the <pz:div> JSP tag, you can provide in-line HTML personalization. You can populate a JSP with sets of inline content and wrap it with the tag. The tag uses a "rule" attribute that takes the name of an existing user segment. Only members of that user segment can see the inline content. For example, say you have created a user segment called booknerdUserSegment.seg in WebLogic Workshop that makes anyone a member who has a "bookNerd" user profile property set to "true". You could do the following:

<pz:div rule="booknerdUserSegment">
	<p>Only users who are book nerds will see this text!</p>
</pz:div>

User segment rules (conditions) are the same as those available to content selectors, so the <pz:div> tag provides a similar level of personalization as content selectors. The difference is that content selectors retrieve their content from the Virtual Content Repository, and <pz:div> encloses its content inline in the JSP.

 

Skip navigation bar  Back to Top Previous Next