Interaction Management Guide
Placeholders display a single content item on a JSP—a content item dynamically retrieved from BEA's Virtual Content Repository. A placeholder retrieves content using predefined queries that are put in the placeholder.
Think of a placeholder as a bucket that holds queries, runs one query at a time, and displays one of the content items retrieved by the query. A placeholder is made up of two parts: a placeholder file you create in WebLogic Workshop and a companion JSP tag that performs the processing.
In Figure 4-1, the placeholder file is called "foo", and the JSP tag references the placeholder file.
Figure 4-1 The two parts of a placeholder: a placeholder file and a JSP tag
This chapter describes how queries are put in placeholders and how the placeholder decides which query to run and which content item to display.
This chapter includes the following sections:
Placeholders can run two types of queries: default queries and campaign queries. Both types of queries have the exact same structure but come from different places.
A placeholder can run a default query each time a user loads a page that includes the placeholder. For example, you define a header for a particular shell that contains a JSP file with a placeholder. If that placeholder contains a default query, a user is likely to see different content in the header each time the user visits or refreshes the desktop.
Figure 4-2 shows the location on a page where the placeholder will display an image, either from a default query or a campaign query. The image is retrieved from BEA's Virtual Content Repository through a query. A placeholder uses different factors to determine, first, which of its queries to run, and then which of the retrieved content items to display.
Figure 4-2 Placeholders can display default content and campaign content
Placeholders use a document's MIME-type attribute to generate the appropriate HTML tags that the browser requires. By default, placeholders generate the appropriate HTML tags only for the following MIME types:
If you want to use additional MIME types in placeholders, 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.
There are specific properties you can add to content items to better support the use of content in placeholders. See Setting up Content in this guide.
Creating a placeholder involves creating a placeholder file in WebLogic Workshop and using companion <ph:placeholder> JSP tags in any relevant JSPs. Each <ph:placeholder> JSP tag must use its "name" attribute to reference a placeholder you have created in WebLogic Workshop.
For steps on creating placeholders, see the following topics in the WebLogic Workshop Help system:
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.
After you create a placeholder file in WebLogic Workshop, you can add the placeholder to a JSP in a number of ways in WebLogic Workshop:
Placeholders go through a two-step process in choosing which content to display. This section describes:
When you add a default query to a placeholder or create a campaign query in WebLogic Workshop, you can assign each query a "priority": highest, high, normal, low, or lowest. The higher the priority, the higher the likelihood that the query will be run instead of other queries.
If a query does not find any documents, the placeholder chooses another query and runs it.
You can also define default queries so that they do not run when campaign queries are present. For more information, see Combining Default Queries and Campaign Queries in Placeholders.
Depending on how broadly you define a query and on the number of documents in your content management system, a query could return multiple content items. By default, a placeholder randomly selects a content item to display. To make this selection less of a random choice, you can add a property called adWeight
to your content items, as described in Setting up Content in this guide.
The higher the adWeight number you assign to a content item, the higher the likelihood that the content item will be displayed in a placeholder when the content item is retrieved by a query.
Placeholders can often become crowded with many queries, especially if more than one campaign uses a placeholder to display content. Campaign queries can remain in placeholders indefinitely unless something specific occurs to remove them. This section describes techniques you can use to clear out unwanted queries and better control the content that is displayed in a placeholder.
You can also use the <ad:adTarget> JSP tag to display a content item on a JSP. This tag does not rely on a definition file like a placeholder does. You simply add a query using the tag's "query" attribute. The query retrieves one or more content items (the same types of content items that placeholders can display), and the tag chooses which content item to display in the same manner as the <ph:placeholder> tag. Campaigns do not put queries into an <ad:adTarget> tag, so the tag cannot display personalized content.
For information on building queries, 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.
See "<ad:adTarget> 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/ad/adTarget.html.