The Content Presenter portlet allows users to retrieve and display different kinds of content in a portal in real time, without assistance from your IT Department or software developers. For example, you might want to display a list of the most recent Press Releases so users can browse them and click one to read the entire Press Release. You can place images (a photograph or a chart, for example) or add textual content on a portal page. You can also segregate content by subject matter to target different audiences.
In the Content Presenter Example, you can perform inline editing to quickly change the content that displays in the portlet.
Tip: | The Content Presenter portlet works only with streamed portals. |
This chapter includes these sections:
WebLogic Portal includes a Content Presenter Example, and allows you to perform inline editing on a Content Presenter portlet to modify the portlet’s content. Editing the portlet’s content also changes the content in the content repository. The Example’s Content Presenter portlet uses the public Dojo rich text editor.
This section contains the following topics:
Note: | You must install the Portal Examples before you perform these steps. See “Installing the Sample Applications and Domain” in the WebLogic Portal Release Notes for details. |
To start the Content Presenter sample:
startWebLogic.cmd
file located in the <WLPORTAL_HOME>/samples/domains/portal/bin
directory.)http://localhost:7041/contentpresenter/
). See Performing Inline Editing in the Content Presenter Example for instructions on how to perform inline edits to the content in a portlet in the Content Presenter Example.
The Content Presenter Example is the only portal where you can perform inline HTML content editing without doing additional setup tasks. By default, the Content Presenter Example lets you immediately edit the content in the Letter from the CEO Portlet, or you can enable the Training Announcement Portlet for inline editing. Inline editing in the Content Presenter Example works only on single-item portlets.
The Letter from the CEO portlet in the Content Presenter Example is already configured for inline editing because it uses the template view with inline editing enabled and has the appropriate entitlement rights. To configure the Training Announcement portlet for inline editing, seeEnabling Inline Editing for the Training Announcement Portlet.)
This section contains the following topics:
To enter inline edits to the Letter from the CEO portlet:
Tip: | You can perform inline editing on two portlets in the Content Presenter Example. Inline editing is not available for the Content Presenter portlets in your portal. |
One other portlet in the Content Presenter Example, the Training Announcement portlet, allows inline editing. Inline editing is turned off by default for this portlet, so you must first enable the inline editing capability by choosing a different content display template view.
To enable inline editing for the Training Announcement portlet:
You can use the three sample JSP files that ship with WLP to enable inline HTML editing in your own Content Presenter portlets. Inline editing does not work with library services enabled, because library services support versioning.
Edit the files in the order listed below. The files are located in the following directories:
<WLPORTAL_HOME>\samples\applications\portalApp\ contentPresenterSampleWeb\samplePresenterTemplates\ inlineEditExamplePresenterTemplate.jsp
\samples\applications\portalApp\contentPresenterSampleWeb\sampleCMTemplates\inlineEditExampleCMTemplate.jsp
\samples\applications\portalApp\contentPresenterSampleWeb\sampleCMTemplates\saveNode.jsp
The files include detailed comments to help you customize them for your portlets. For example, you might want to replace the DOJO rich text editor with your own rich text editor. You might want to change the entitlements on the portlets or their look and feel.
The Content Presenter portlet ships with WebLogic Portal. You must configure the portlet before you can use it.
Tip: | To see a sample web application built with the Content Presenter portlet, download a demo at http://wlp.bea.com. |
The Content Presenter portlet uses a portlet framework that is based on Content Management, metadata, and templates that let business users step through a wizard to quickly retrieve and display content that is appropriate to the audience. The framework allows WebLogic Portal customers to easily publish content in a variety of ways to almost any site.
The Content Presenter portlet can read content from any configured content provider. Content providers can be any repository that implements the WebLogic Portal Content Management Service Provider Interface, including third-party Content Management vendor products, file systems, or other database systems.
When you plan your Content Presenter portlet, determine who will view your content and if you plan to re-use the portlet later for a different audience. Plan entitlements to determine who can choose content to display in the Content Presenter portlet. If a logged-in user has Delegated Administration rights, the user can edit the content in the Content Presenter portlet.
You must be a member of the Portal System Administrators role or the Content Presenter Administrators role to configure the Content Presenter portlet. Portal System Administrators and Content Presenter Administrators have edit and delete capabilities on the Content Presenter portlet itself, and edit capabilities on any page where the portlet is placed.
If you plan to have a group of users (for example, a subset of the Portal System Administrators role) edit the Content Presenter portlet, this subgroup must have edit and delete capabilities for the Content Presenter portlet itself and edit capabilities for the page that contains the portlet. If the group does not have edit and delete capabilities to the portlet, the group’s members will not be able to see the Edit icon in the portlet.
See the Security Guide for more information on setting entitlements and creating roles and groups. Portal System Administrators and Content Presenter Administrators can also turn a portlet off by disabling the activation flag in the portlet’s preferences in the Administration Console.
WARNING: | If you add or modify your Content Presenter portlet using the Visitor Tools (rather than the Administration Console), the portlet is no longer configurable in your desktop. You should add or modify your Content Presenter portlet in the Administration Console. |
If you use Portlet Publishing to configure a Content Presenter portlet, some features are not available. See Using Portlet Publishing to Expose a Content Presenter Portlet for more information.
This section contains the following topic:
The Content Presenter portlet ships with WebLogic Portal. You must add the Content Presenter facet in Workshop for WebLogic when you set up your portal web project. By default, your portal administrator has the ability to administer the Content Presenter portlet (to move portlets, turn a portlet off, and so on) in the Administration Console.
In a desktop, use the Content Presenter's Configuration Wizard to determine the content you want to display, and how to display it (through templates and template views). The Content Presenter portlet stores those choices as portlet preferences for each portlet instance.
Perform the following steps to configure the Content Presenter portlet:
Tip: | When you create your Portal Web Project, you must select the Content Presenter Framework facet in the WebLogic Portal (Optional) directory in order to view and use the Content Presenter portlet. |
.portal
file) according to the instructions in
Getting Started With WebLogic Portal tutorial.Library/Pages
directory (or wherever you saved it). Add the Content Presenter portlet to the page by clicking Add Page Contents. Click Add Contents in the appropriate column, select the check boxes next to the Content Presenter portlet and a login portlet (if that is the method you are using to authenticate users), and click Save. (If you do not see a list of portlets in the Add Books and Portlets to Placeholder page, click the drop-down box and select Portlets, and click Show all.)See Figure 10-4. Click Next after you select an option.
You can also select Search to find content by keyword or content type. (If you have multiple content repositories configured, you can also search by repository.) By default, all content types are listed in the Content Type field. If you want to control which content types appear in the Content Type field, you can set entitlements by user. In order to have these entitlements by user evaluated, override the com.bea.content.ui.framework.AllowObjectClassViewRights
context parameter in the web.xml
file. If you change the setting to false, the entitlements set on the content types determine the content types that are listed in the Content Type field. If you change the setting to true, or you omit the context parameter altogether, all content types appear for all users.
See the Security Guide for instructions on setting up users and roles in the Administration Console, and adding view capabilities so users can see the object classes in the Content Type field. Click Update Search Results to view the results. Adjust the Items per Page field to determine how many search results to display in the wizard. Select an item; see Figure 10-6. Click Next.
You can also click Search for Content Items, enter a keyword, and click Update Search Results to retrieve content by keyword. If you have multiple content repositories configured, you can also search within a specific repository. To search your repository, you must configure it and make it searchable. The repository that ships with a WebLogic Portal for a new domain is not automatically indexed for searching. See the Content Management Guide for instructions on indexing your repository.
Figure 10-6 shows that after you retrieve multiple items and click Browse for Content Items, you can select an item and click Add Item to List. The custom list lets you control the order in which the content displays by selecting the check box next to the item and clicking Move Up or Move Down. Moving content to the top of the list ensures that a certain content item displays first. See Figure 10-7.
You can also verify that you selected the correct content by clicking View Content to preview the content you selected. The actual content and other details appear in a separate window. If you selected an image, the image also appears. You can also click Edit Content to change the property values of the item. If the item is a binary file, you can download the item, upload new values, or change the property values.
After you determine the order of the content, click Next.
You can click Advanced Search Query Options to create a query filter or a sort filter. Clicking Create New Query Filter applies a filter to your query, such as property name, an operator, and a value to narrow down your search results. For example, you can search for content created after 1/1/07 by selecting the Creation Date property, selecting After, and then entering a date. Click Add Filter and the new filter appears in the Query Filters section, as shown in Figure 10-7.
Tip: | The Similar operator retrieves results that contain words that are similar to the keyword (for example, the word might be misspelled). |
You can click Create New Sort Filter to determine how to display the search results. For example, you can display the most recently-modified content by selecting the Last Modified Date property, selecting Descending, and clicking Add Sort Filter. The new sort filter appears in the Sort Filters section. See Figure 10-7 to see how you can display the most recently-modified content first (descending order). You can change the order in which the results are sorted by clicking the up or down arrow to move the items in the sort filter up or down in the list (from ascending to descending, for example.)
Click Preview Query Results to view the results of the search query. The search query searches both property values and binary content. Adjust the Items per page field to determine how many search results to display in the wizard (it does not affect the final display). Each time someone visits the Content Presenter portlet, the search is re-run. Since content in the repository can change, the results might be different the next time the portlet renders. Click Next.
Tip: | Running a search query is more resource intensive than retrieving content from a specific node or retrieving the contents of a specific folder. When possible, try to retrieve specific content, rather than running a search. |
WebLogic Portal ships with the following two default templates:
You should create your own custom template based on the content you want to display. The custom templates you create appear in the wizard. See the Content Management Guide for instructions on creating custom templates and views.
Select an item in the Template Views field. A template view controls the layout and formatting of the content in the portlet. For example, you might create a template for your company’s Press Releases. You could then create several custom template views that display the content in the following ways: a summary of the Press Release, the full text of the press release, details of the Press Release, and so on.
If you chose the Default Single Item Template in step 10 in this section (which displays a single piece of content), or a custom template that you created that does not contain views, select Default Single Item View for the template view. If you chose the Default Multiple Items Template in step 10 in this section, select Default Multiple Items View for the template view. If you created a custom template view as described in the Content Management Guide, that template view also appears here.
For templates or views that support pagination of multiple content items, set the Items per Page value to the maximum number of items you want to display at one time on the template. With the appropriate pagination JSP tags on the template or view, users can navigate large numbers of items while viewing only a manageable few.
Note: | You can customize how templates and views paginate in the Content Presenter Configuration Wizard. For more information on the pagination tags, see the CM JSP Tag Javadoc. |
Click Next after you select a template and view. See Figure 10-8.
Tip: | Clicking Preview Changes in Portlet puts the portlet into a "preview state". The portlet will remain in its preview state until you click Cancel or Save in the wizard. The preview state is maintained even if you log out or close your browser window. If you make changes in other steps of the wizard, you must click Preview Changes in Portlet to update the preview with your changes, or click Save to make the changes public. |
You can also click Advanced Options and select Save to Current Page (to save your changes to the current page only) or select Save to Shared Portlet in Library, to save changes to this shared portlet in the library. Saving changes at the library level globally affects everywhere the shared portlet was placed. You see this option enabled only if you clicked Create New Shared Portlet. When you click Create New Shared Portlet, you use these settings to create a new portlet in the library. The new portlet is available to all entitled users of this web application and can be placed on any page. The current page is updated to use this new portlet, rather than the current portlet. The new portlet also appears in the Administration Console in the \Library\Portlets\
directory. Inheritance rules apply to shared portlets in the library. See the
Portal Development Guide for more information on inheritance. Figure 10-10 shows the Finish window.
Note: | Content Presenter portlets that are configured on pages in the library will remain on the page in the library, even if the page has been customized on the desktop. The only way to make Content Presenter configurations local to a desktop is to add a configured or unconfigured Content Presenter portlet directly to the desktop, or customize the portlet on the desktop by changing or adding localizations to the portlet on the desktop using the Administration Console. |
When you finish previewing the portlet, click Return to Wizard or click the Edit icon to return to this step in the wizard and make any additional changes. If you want to save your changes, click Save.
Tip: | To be able to use the Create New Shared Portlet button in the Advanced Options, you must have edit rights on the page and delete rights on the portlet, in addition to the rights needed to configure a Content Presenter portlet. |
The new content displays in the Content Presenter portlet. Figure 10-11 shows an example of content that is an advertisement for a college savings account.
You can use a custom template or template view to change the look of the Content Presenter portlet. See Displaying Content with the Content Presenter Portlet in the Content Management Guide for instructions.
Tip: | The Content Presenter portlet uses error logging to catch exceptions and displays an error message in the portlet if you have rights to configure the portlet. For example, you might receive an error message if content your portlet is referencing was deleted, or a template or view the portlet is using was removed. The error message instructs you to reconfigure the Content Presenter portlet to fix the errors. You must have edit and delete capabilities in order to configure the portlet. |
This section also contains the following topics:
You can change the amount of content that a portlet displays. Use the Content Presenter Example to edit the Avitek - In the News portlet to display three specific press releases, rather than a list of all press releases.
Perform the following steps to change how much content appears in a portlet:
You must be entitled to use Portlet Publishing to expose a Content Presenter portlet. If you use Portlet Publishing to expose your Content Presenter portlet, some features are not available.
The following list describes features that are not part of a Content Presenter portlet exposed with Portlet Publishing:
Tip: | When you use Portlet Publishing, work with only one Content Presenter portlet on a page at a time. If you work on more than one Content Presenter portlet on a page, an error appears. Close one of the Content Presenter wizards to continue working. |
For more information on Portlet Publishing, see the Portlet Guide.