Skip Headers
Oracle® Fusion Middleware Portal Development Guide for Oracle WebLogic Portal
10g Release 3 (10.3.4)

Part Number E14243-06
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

9 Using the Dynamic Visitor Tools

This chapter discusses how to configure, use, and extend the Dynamic Visitor Tools (DVT). This chapter includes the following sections:

9.1 What Is the DVT?

The Dynamic Visitor Tools ("DVT") feature includes tools that allow end users to customize the appearance, behavior, and content of Oracle Oracle WebLogic Portal applications. The DVT enables end users to:

An administrative user in Admin Mode can make any of the above listed changes apply to all desktop users.

Note:

Oracle Oracle WebLogic Portal includes two features that, when enabled, let users customize portals.

The DVT—described in this chapter—uses Oracle Oracle WebLogic Portal's Web 2.0 functionality, such as a Dynamic Interface SCripting (Disc) framework and a REpresentational State Transfer (REST) Framework. We recommend that you use the DVT for all new Oracle Oracle WebLogic Portal applications.

The other feature, Visitor Tools, does not utilize Oracle Oracle WebLogic Portal's Web 2.0 functionality. For details, see Chapter 11, "Enabling Visitor Tools."

9.2 Configuring the DVT

These instructions assume that a portal web project exists for which you want to configure the DVT. For information on creating a portal web project using the Portal Web Project Wizard, see Section 4.6, "Portal Web Project Wizard."

To configure the DVT:

  1. Add the Portal Dynamic Visitor Tools facet to the portal web project. For details, see Section 9.2.1, "Adding the Portal Dynamic Visitor Tools Facet to the Portal Web Project."

  2. Add a Login portlet to the desktop; the DVT requires that users be authenticated.

    Tip:

    As a convenience, WLP provides an optionally installed login shell to provide the required login capability for DVT. For more information, see Section 9.4, "Installing the Sample Login Shell."

  3. Enable the DVT. For details, see Section 9.2.2, "Enabling the DVT."

  4. Test the DVT configuration. For details, see Section 9.2.3, "Testing the DVT Configuration."

9.2.1 Adding the Portal Dynamic Visitor Tools Facet to the Portal Web Project

You must add the Portal Dynamic Visitor Tools facet to the portal web project for which you want to enable the DVT:

You do not need to perform this procedure if:

  • You created the portal web project using the Portal Web Project Wizard and kept the wizard's default selections, which includes adding the Portal Dynamic Visitor Tools facet to the web project.

  • You already added the Portal Dynamic Visitor Tools facet to the portal web project.

To add the Portal Dynamic Visitor Tools facet:

  1. In Oracle Enterprise Pack for Eclipse, right-click the desired portal web project, then select Properties.

  2. In the portal web project's Properties dialog box, select Project Facets.

  3. In the Project Facets tree, expand WebLogic Portal.

  4. Select Portal Dynamic Visitor Tools.

  5. Click OK.

9.2.2 Enabling the DVT

This section discusses how to enable the DVT.

Note:

Only authenticated users can use the DVT. Typically, you provide a login portlet to satisfy this requirement. As a convenience, WLP provides an optionally installed login shell to provide the required login capability for DVT. For more information, see Section 9.4, "Installing the Sample Login Shell."

Note:

These instructions assume that a desktop already exists for which you want to enable the DVT. For instructions on setting up a desktop in the Oracle Oracle WebLogic Portal Administration Console, see "Setting Up a Desktop in the Administration Console" in Oracle Fusion Middleware Portal Development Guide for Oracle WebLogic Portal.

Note:

You do not need to perform this procedure if you already enabled the DVT for the desktop when you created the desktop in Oracle WebLogic Portal Administration Console.

If you are a portal application developer, you enable the DVT for a file-based portal (using Oracle Enterprise Pack for Eclipse). If you are a portal application administrator, you enable the DVT for a streaming portal (using the Oracle Oracle WebLogic Portal Administration Console). This section discusses:

9.2.2.1 Enabling the DVT in a File-based Portal

You enable the DVT in a file-based portal using Oracle Enterprise Pack for Eclipse. Note that the DVT only works with a streaming desktop.

Note:

The DVT only works with a streaming desktop (one that has been configured in the Administration Console). By enabling the DVT in the IDE, as explained in this section, the DVT is enabled by default when you convert the .portal to a streaming desktop.

To enable the DVT for a file-based portal:

  1. In Oracle Enterprise Pack for Eclipse, open the desired portal (.portal file) for which you want to enable the DVT in the Portal editor.

  2. Ensure that the Properties editor is open for the portal.

    If you need to open it, select Window > Show View > Properties.

  3. Click the desktop border, as shown in Figure 9-1, "Clicking the Desktop Border".

    Figure 9-1 Clicking the Desktop Border

    This graphic shows the mouse clicking the desktop border.
    Description of "Figure 9-1 Clicking the Desktop Border"

  4. In the Properties editor, set the following properties:

    • Asynchronous Mode to enabled.

    • DVT Enabled to true (Note that when you set this property to true, the Disc Enabled property is automatically set to true.)

  5. Save the portal.

  6. If you have not yet created a desktop, create a desktop using the Oracle WebLogic Portal Administration Console.

    For details on creating a desktop, see "Creating a Desktop" in Oracle Fusion Middleware Portal Development Guide for Oracle WebLogic Portal.

9.2.2.2 Enabling the DVT for a Streaming Portal

You enable the DVT for a streaming portal using the Oracle Oracle WebLogic Portal Administration Console.

Note:

You do not need to perform this procedure if you enabled the DVT when you created a desktop using the Desktop Creation Wizard.

To enable the DVT for a streaming portal:

  1. Launch the Oracle WebLogic Portal Administration Console.

    To do so, in Oracle Enterprise Pack for Eclipse, select Run > Open Portal Administration Console, then log in.

  2. On the administration console's home page, click Portal Management.

  3. In the navigation tree, navigate to and click the name of the desktop for which you want to enable the DVT.

  4. On the Details tab, click the Advanced Properties link to launch the Update Tree Optimization dialog box.

  5. In the Enable DVT drop-down list box, choose true.

  6. Click Update.

    You are returned to the desktop's properties.

9.2.3 Testing the DVT Configuration

This procedure describes how to test the DVT configuration.

Note:

You can only use the DVT Customizations feature in a streaming portal (one that has been created through the WLP Administration Console).

To test the DVT configuration:

  1. In the Oracle WebLogic Portal Administration Console's navigation tree, navigate to and click the name of the desktop for which you want to enable the DVT.

  2. Click View Desktop to view the desktop in a browser.

  3. Log in to the desktop using a login portlet; DVT users must be authenticated.

    Tip:

    As a convenience, WLP provides an optionally installed login shell to provide the required login capability for DVT. For more information, see Section 9.4, "Installing the Sample Login Shell."

  4. The Customize button should appear in the upper right-hand corner of the desktop.

    If you click the Customize button, its menu should include the options shown in Figure 9-2, "Customize Menu Options". Note that the Admin Mode function is only visible for users with administrator privileges.

Figure 9-2 Customize Menu Options

This graphic shows the Customize menu options.
Description of "Figure 9-2 Customize Menu Options"

9.3 Working with the DVT

As an end user, the DVT enables you to customize your own view of a desktop, as well as its pages, books, and portlets.

If you belong to the Portal Administrators group, you can customize the desktop for all users. For details, see Section 9.3.6, "Customizing the Desktop for All Desktop Users."

This section includes the following topics:

9.3.1 Accessing Customization Options

The DVT customization options that are available to you depend on the user entitlements that have been granted to you.

To access the DVT's customization options for the desktop, click the Customize button in the upper right-hand corner of the desktop.

To customize pages, books, or portlets, click the Customize icon (as shown in Figure 9-2, "Customize Menu Options") within the desired page, book, or portlet.

Figure 9-3 Customize Icon

This graphic shows an example of the Customize icon.
Description of "Figure 9-3 Customize Icon"

9.3.2 Adding a Page Tab or Book of Tabs

A page tab—also known as a page—is the primary container for individual portal elements such as portlets. You add pages to books, which are also known as books of tabs. The pages contained within a book can themselves contain portlets and books, with the latter allowing for an infinite level of nesting. Nesting books provides a hierarchical organization that is very flexible, although there is a practical limit to the nesting based on the available screen real estate.

To add a page tab or book, click the Customize button, then choose Add Page Tab or Add Book of Tabs.

After the pages or books are added, you can do the following:

  • Name the page or book. To do so, click the tab name (initially called New Page or New Book), type the new name, and press the Enter key.

  • Make one page or book the default page or book, so that whenever you navigate to the desktop, that page or book always appears initially selected. To do so, click the Customize icon for the desired page or book, then choose Set as Default Tab.

  • Drag and drop tabs to change the order in which they appear on the desktop.

9.3.3 Changing the Appearance of the Portal, Pages, Books, and Portlets

This section discusses:

9.3.3.1 Changing the Appearance of the Portal

You can change the appearance of the portal to suit your individual aesthetic tastes by choosing from various Look and Feels. A Look and Feel is a collection of a skin and skeleton that is used to determine the way that a portal is rendered and the way that it behaves. The Look and Feel of a portal is independent of the organizational and navigational structure of a portal. For more details on Look and Feels, see Chapter 7, "User Interface Development with Look And Feel Features."

To change the Look and Feel of the portal, click the Customize button, then choose Change Appearance. The Change Appearance tab on the Edit sheet lists the Look and Feels that you can use. After you have selected a Look and Feel, click Done to close the Edit sheet.

Note:

Out of the box, DVT only supports Bighorn-based Look and Feels. Although it is possible to write a Look and Feel injector to use a non-Bighorn L&F, extra work is required to make the Placeable Movement feature of the DVT work with this use case. For non-Bighorn L&Fs, the injector/L&F developers must make sure that the Disc calls work with their L&F. For more information, see Section 9.3.10.1, "Creating a Look and Feel Injector." See also "The WLP Disc Framework" in the Oracle Fusion Middleware Client-Side Developer's Guide for Oracle WebLogic Portal.

9.3.3.2 Changing the Appearance of Pages, Books, and Portlets

You can also change the appearance of pages, books, and portlets by choosing from various themes. A theme is similar to a Look and Feel; however, the scope of a theme is limited to only a component of a desktop, such as a page, book, or portlet. A theme can be used to change the appearance of a desktop's components without affecting the desktop itself.

To change the appearance of pages, books, or portlets, click the Customize icon in the page, book, or portlet that you want to edit, then choose Change Appearance. The Change Theme tab on the Edit sheet lists the themes that you can use. After you have selected a theme, click Done to close the Edit sheet.

9.3.4 Changing the Menu of the Desktop or a Book

A menu provides the user interface for navigating the various pages and books in a desktop. Menus frequently are designed to appear as tabs, trees, or drop-down menus to end users. Oracle Oracle WebLogic Portal is delivered with the following menu types:

  • Single Level Menu: Recommended for navigating across multiple pages

  • Multi Level Menu: Recommended for navigating across multiple nested books

To change the menu of the desktop or a book, click the Customize button (for a desktop) or Customize icon (for a book), then choose Change Menu. The Change Book menu on the Edit sheet lists the menus that you can use. If desired, you can search for menus by using the Search field. After you have selected a menu, click Done to close the Edit sheet.

9.3.5 Restoring the Default View

Your administrator determines the default desktop customizations for all users of your desktop. At any time, you can revert all of your own customizations and restore your desktop to your administrator's customization settings by clicking the Customize button, then choosing Restore Default View. For information on customizing the desktop for all desktop users, see Section 9.3.6, "Customizing the Desktop for All Desktop Users".

9.3.6 Customizing the Desktop for All Desktop Users

By default, when you use the DVT, you are customizing how the desktop appears to you only. If you are an administrator and belong to the Portal Administrators group, you can customize how the desktop appears to all users of the desktop.

To do so, click the Customize button, then choose Admin Mode. Any changes that you make are applied to all users of the desktop. To exit out of Admin Mode, choose Admin Mode again. Desktop users can restore their desktop views to the administrator's customization settings. For details, see Section 9.3.5, "Restoring the Default View"

9.3.7 Changing the Layout of a Page

A layout determines the arrangement of portlets and books within a matrix; one layout is applied to each page. Each cell of this matrix contains a placeholder, which can contain one or more portlets or books that are arranged vertically or horizontally.

To change the layout of a page, click the Customize icon on the desired page tab, then choose Change Layout. The Changing Layout tab on the Edit sheet lists the layouts that you can use. If desired, you can search for layouts by using the Search field. After you have selected a layout, click Done to close the Edit sheet.

9.3.8 Adding and Removing Content

You can add content (in the form of portlets) to a page to suit your individual content needs.

To add a portlet to a page, click the Customize icon on the desired page tab, then choose Add Content. The Add Content tab on the Edit sheet lists the portlets that you can add. You can also search for portlets by using the Search field. If your administrator has grouped available portlets into portlet categories, you can narrow your search by choosing a portlet category from the category drop-down menu. After you have selected a portlet, click Done to close the Edit sheet.

To remove a portlet, select Remove Portlet from the Customize menu.

Tip:

If a page uses a layout that contains two or more columns, you can drag and drop portlets between the page's columns.

9.3.9 Making Remote Portlets Available to Your Users

A portal administrator can make WSRP (remote) portlets available to users' desktops. To make remote portlets available to users:

  1. Using the Oracle WebLogic Portal Administration Console, add the desired producer to the library. You will make this producer's portlets available to your users.

    For details on adding remote resources to the library, see "Adding Remote Resources to the Library" in Oracle Fusion Middleware Federated Portals Guide for Oracle WebLogic Portal.

  2. Log in to the DVT.

  3. Click the Customize button.

  4. Choose Admin Mode.

  5. Click the Customize button.

  6. Choose Add Content to launch the Edit sheet.

  7. Click the Get More Portlets button to launch the Get More Portlets dialog box.

  8. Select the WSRP portlets that you want to make available to your users.

    Note:

    It might take some time for all of the WSRP portlets to load for the first time.

  9. Click Done to close the Get More Portlets dialog box.

  10. Click Done to close the Edit sheet.

9.3.10 Implementing Custom Look and Feels for the DVT

You must create and implement a Look and Feel injector for each custom Look and Feel that you want to use with the DVT. To implement a Look and Feel for the DVT, you must:

  1. Create a Look and Feel injector for your custom Look and Feel. For details, see Chapter 9, "Creating a Look and Feel Injector."

  2. Instantiate the Look and Feel injector that you created. For details, see Chapter 9, "Instantiating a Look and Feel Injector."

9.3.10.1 Creating a Look and Feel Injector

To create a Look and Feel injector, you can perform either of the following:

  • If your custom Look and Feel has major differences from the delivered Bighorn Look and Feels, you can extend the com.bea.wlp.dvt.injector.<LookAndFeelInjector> class, replacing the <LookAndFeelInjector> class name with the class name of your custom Look and Feel.

  • If your custom Look and Feel has only minor differences from the delivered Bighorn Look and Feels, you can extend and override any of the methods in the code below, replacing the <BighornInjector> class name with the class name of your custom Look and Feel.

Example 9-1 lists the code that you edit to create a Look and Feel injector. You can save this file in the Merged Project Content folder under <webapp_name>/Merged Project Content/dvt following standard class-naming conventions. For example, the class com.bea.wlp.dvt.injector.MyLAFInjector would be stored under <webappname>/dvt/com/bea/wlp/dvt/injector/MyLAFInjector.js.

Example 9-1 Sample Look and Feel Injector Class

wlp_dvt_dojo.declare(
    "com.bea.wlp.dvt.injector.<BighornInjector>",
    [com.bea.wlp.dvt.injector.<LookAndFeelInjector>],
    {
        /**
         * Adds a customize link to the primary book
         * @param discBook The primary book from the DISC api
         */
         injectCustomizeLinkForPrimaryBook: function(discBook)
         {
        },
 
         /**
          *  Adds a Customize link to a book in a book.
          *  @param diskBook The book from DISC
          */
         injectCustomizeLinkForBookNavigable: function(discBook)
         {
        },
 
        /**
          *  Adds a Customize link to a page in a book.
          *  @param diskPage The page from DISC
          */
         injectCustomizeLinkForPageNavigable: function(discPage)
         {
         },
 
         /**
          * Add a Customize link to a book on a page.
          * @param discBook The book from DISC.
          */
         injectCustomizeLinkForBookPlaceable: function(discBook)
         {
         },
 
         /**
          * Add a Customize link to a portlet on a page.
          * @param discPortlet The portlet from DISC.
          */
         injectCustomizeLinkForPortletPlaceable: function(discPortlet)
         {
         },
 
         /**
         * Method used to inject a new tab/navigable into a book menu.
         * @param bookItem The book that will contain the tab/navigable.
         * @param newTitle The title of the new tab navigable.
         * @param append True indicating the new tab will appear as the last
         * element in the book menu.
         */
         injectNewNavigableTab: function(bookItem, newTitle, append)
         {
         }
    }
);

9.3.10.2 Instantiating a Look and Feel Injector

After you have created a Look and Feel injector for your custom Look and Feel, you must instantiate it. To instantiate a Look and Feel injector:

  1. In Oracle Enterprise Pack for Eclipse, click the Merged Projects tab.

  2. Navigate to the config.js file, located in the dvt folder of your web project.

  3. Right-click the config.js file, then choose Copy to Project.

  4. Right-click the config.js file, then choose Open.

  5. In the code for the config.js file, scroll down to the lafInjector function.

  6. Add the class that you edited in Chapter 9, "Creating a Look and Feel Injector" to the lafInjector, using the following code as a guide:

afInjector: function()
{
    if(typeof lafInjectorInstance == 'undefined')
     {
         wlp_dvt_dojo.require("com.YourInjectorClass");
         lafInjectorInstance = new com.YourInjectorClass();
     }
     return lafInjectorInstance;
}

9.4 Installing the Sample Login Shell

WLP provides an optionally installed sample login shell that is designed to provide the DVT's required login capability. This section explains how to install the sample login shell into an existing web application.

Note:

The login shell is a sample only. It is provided to developers as a convenience only. It is not supported by Oracle. Oracle recommends that you provide your own login mechanism for production applications.

9.4.1 Summary of Steps

To add the sample login shell to a portal web application, you must perform these basic steps:

  1. Add the Sample Framework Components facet to your portal web project.

  2. Be sure the portals's Enable Disc property is set to true.

  3. For the portal desktop, change the Shell property to Login Shell.

These steps are explained in the following sections. Figure 9-4 shows part of a portal with the sample login shell enabled. Fields for entering username and password appear in the upper-right corner of the portal.

Figure 9-4 Sample Login Shell Enabled

Description of Figure 9-4 follows
Description of "Figure 9-4 Sample Login Shell Enabled"

9.4.2 Installing the Portal Examples Component

To use the sample login shell, the Portal Examples component must be included in your portal installation. To add this component:

  1. Start the Oracle Installer.

  2. In the Choose Products and Components part of the installer wizard, select the Portal Examples component as shown in Figure 9-5.

    Note:

    If the Portal Examples checkbox is already selected, exit the wizard; no further action is required.

    Figure 9-5 Installing the Portal Examples Component

    Description of Figure 9-5 follows
    Description of "Figure 9-5 Installing the Portal Examples Component"

  3. Complete the rest of the wizard steps to add the component to your portal installation.

9.4.3 Add the Sample Framework Components Facet

Follow the instructions in Section 5.5, "Adding Facets to an Existing Project" to add the Sample Framework Components facet to your portal web project. In the Project Facets dialog, open the Portal Samples node and be sure that the Sample Framework Components facet is selected. See Figure 9-6.

After the facet is installed, redeploy your web application.

Figure 9-6 Project Facets Dialog

Description of Figure 9-6 follows
Description of "Figure 9-6 Project Facets Dialog"

9.4.4 Adding the Sample Login Shell to a Portal Desktop

This section explains how to add the sample login shell to a desktop in Oracle Enterprise Pack for Eclipse and in the WebLogic Portal Administration Console.

To add the sample login shell to a portal desktop in Oracle Enterprise Pack for Eclipse:

  1. Open the .portal file in the Portal Editor.

  2. Click on the border of the portal in the editor to display the desktop's Properties View.

  3. Under Desktop Properties, change the Shell property to Login Shell, as shown in Figure 9-7.

    Figure 9-7 Adding the Sample Login Shell in the IDE

    Description of Figure 9-7 follows
    Description of "Figure 9-7 Adding the Sample Login Shell in the IDE"

  4. Be sure the Disc Enabled property is set to true.

To add the sample login shell to a portal desktop in the Administration Console:

  1. Open the Desktop to which you want to add the sample login shell.

  2. In the Appearance and Contents part of the Details tab, click Edit Appearance.

  3. Select Login Shell from the Default Shell dropdown menu.

  4. Click Update. The default shell is now set to Login Shell, as shown in Figure 9-8.

    Figure 9-8 Default Shell Set to Login Shell

    Description of Figure 9-8 follows
    Description of "Figure 9-8 Default Shell Set to Login Shell"

  5. In the Advanced Properties section, be sure the Disc Enabled property is set to true.