Targeted Menu Portlet

This portlet demonstrates using navigation from a portlet to control a specific book.

Concepts Demonstrated by this Sample

The JSP portlet provides portlet-based navigation by acquiring a book's context, sub-books, and pages and constructing a tree-like list of links to the sub-books and pages.

This portlet uses functionality similar to the Left Navigation Shell. The difference between the two samples is scope. This portlet provides navigation for a single book, and the left navigation shell provides navigation for the entire desktop.

Location of Sample Files

This sample is located in the <BEA_HOME>/<WEBLOGIC_HOME>/samples/portal/portalApp/portalApp.work application.

How to Run the Sample

To run the sample:

  1. Add the portlet to a page in sample.portal.
  2. In the Portal Designer, select the book for which you want to provide navigation. In the Property Editor window, note the value for the book's Definition Label property.
  3. Open the portlet in the Portlet Designer, and select the TargetBook portlet preference.
  4. In the Property Editor window, set the Preference Value property value to the book's Definition Label.
  5. Save the portlet and portal files.
  6. In the WebLogic Workshop menu, choose Portal --> Open Current Portal.

How to Use the Sample in Your Portals

  1. Create a portal application. Make sure you create a Portal Application and add a Portal Web Project to it.
  2. Import or copy the following directories and files into your portal application and portal Web project. You may need to create the appropriate directories in your application:
    Import or copy this to this directory (create if necessary)

    <WEBLOGIC_HOME>/samples/portal/portalApp/
    sampleportal/portlets/navigation/targeted/
    targetedMenu.portlet

    <PORTAL_APP>/<project>/portlets/navigation/targeted/
    <WEBLOGIC_HOME>/samples/portal/portalApp/
    sampleportal/portlets/navigation/targeted/
    targetedMenu.jsp
    <PORTAL_APP>/<project>/portlets/navigation/targeted/
    <WEBLOGIC_HOME>/samples/portal/portalApp/
    sampleportal/WEB-INF/src/examples/navigation/NavigationNode.java
    <PORTAL_APP>/<project>/
    WEB-INF/src/examples/navigation/
    <WEBLOGIC_HOME>/samples/portal/portalApp/
    sampleportal/WEB-INF/src/examples/navigation/NavigationUtil.java
    <PORTAL_APP>/<project>/
    WEB-INF/src/examples/navigation/
  3. Open your portal file and navigate the page where you want the portlet to appear.
  4. In the Data Palette window, drag the Targeted Menu portlet onto a placeholder on the page.
  5. In the Portal Designer, select the book for which you want to provide navigation. In the Property Editor window, note the value for the book's Definition Label property.
  6. Open the portlet in the Portlet Designer, and select the TargetBook portlet preference.
  7. In the Property Editor window, set the Preference Value property value to the book's Definition Label.
  8. Save the portlet and portal files.
  9. In the WebLogic Workshop menu, choose Portal --> Open Current Portal.

Related Topics

Left Navigation Shell

Portal Samples