15.2 Sample scenario

 < Day Day Up > 

This sample scenario illustrates how you configure and implement the Portlet Preview facility using WebSphere Studio Site Developer V5 and the Portal Toolkit V5.

15.2.1 Defining the Portlet Preview preference

The first task is to configure your Portlet Preview preferences. Start the remote Portal server and configure preferences in the Portlet Preview function. For example, execute these steps:

  1. If required, start the IBM WebSphere Studio Application Developer; click Start -> Programs -> IBM WebSphere Studio -> Site Developer 5.0 .

  2. Stop any server running on the WebSphere Test Environment inside WebSphere Studio Site Developer. Right-click the started server and select Stop .

    Figure 15-5. Stop servers

    graphics/15fig05.gif

  3. Start the external WebSphere Portal; click Start -> Programs -> IBM WebSphere -> Portal Server V5.0 -> Start the Server .

  4. Wait a few minutes for the external Portal server to start.

  5. Using the Preferences page, define the attributes used for previewing portlets. To define these preferences, from the Window menu select Preferences -> Portlet Preview .

  6. Specify the following (see Figure 15-6 on page 470):

    Figure 15-6. Portlet Preview configuration panel

    graphics/15fig06.jpg

    1. Host Address : http://portaldev.itso.ral.ibm.com:9081

      Where portaldev is the fully-qualified host name of the machine where WebSphere Portal is running. For this sample scenario, the remote server has been configured to use port 9081.

      Note : You cannot use the WebSphere Portal installed for the test environment.

    2. Base URI : /wps

      The base URI for the portal, which is defined during WebSphere Portal installation. The default URI is /wps. Be sure you enter the one your server is using (default or customized value).

    3. Default page : /portal

      The home page. The default home page is /portal . Be sure you enter the one your server is using (default or customized value).

    4. Version : 5.0

      Select the version of the Portal Server.

    5. WebSphere Security : uncheck

      Check whether WebSphere Security is enabled. This is not required in this sample scenario.

    6. WebSphere Portal Administrator User ID : provide the proper Portal server administrator user ID

      Note : The default ID is wpsadmin. This ID is used for administration tasks to prepare for previewing portlets.

    7. WebSphere Portal Administrator Password : provide the proper Portal server administrator password

    8. WebSphere Portal Log In User ID : provide the proper Portal server user ID to log in to Portal server and access the portlet

    9. WebSphere Portal Log In Password : provide the proper password

      Note : The user must be created manually in the Portal Administration before previewing. The permissions will be automatically assigned to the user at the edit level. The user ID will also be used for the name of the preview page. To use a single WebSphere Portal for multiple users, you must use an owner specific user ID.

    10. Place for Preview (optional) : leave blank

      It is recommended to keep these fields blank.

      1. Name :

        The name of the place to be used for previewing. The default name is Preview. The place will be created automatically by the Portlet Preview if the specified place does not exist.

        The portlet preview will set the user permission level to access the place for preview even if the place was already created and the current permission level is not adequate. The original permission level will be restored with the Reset Portlet Preview action.

      2. Ordinal :

        The ordinal attribute which specifies the sorting order of portal resources. The default value is 20.You can specify where to insert the preview place among places.

        Note : For information on the ordinal attributes, refer to "Special configuration data entries" in the InfoCenter of WebSphere Portal.

  7. Click OK .

15.2.2 Previewing the portlet

In this section, we show how to preview the portlet. You can preview a portlet application in the internal browser and also using an external browser. To preview a portlet application, follow these steps:

  1. In the J2EE Navigator view, right-click the portlet project you want to preview, for example HelloWorld .

  2. Select Preview Portlet... in the pop-up menu.

    Figure 15-7. Invoking Preview Portlet option

    graphics/15fig07.jpg

    Note : If any unsaved changes exist in the project, the Export Problems dialog appears. Click Yes to save the changes and export the project. Click No to export the project without saving them.

  3. The configured browser will be launched (the default uses the internal browser) and the portlet will be previewed.

    Note : If the portlet does not immediately appear, click the page name ( padmin page in this scenario).

    Figure 15-8. Portlet preview in internal browser

    graphics/15fig08.gif

    Note : Alternatively, you can preview the portlet by selecting the portlet project you want to preview, then clicking the Preview Portlet button in the toolbar.

    Note also that if there are any problems in the portlet, it will not be previewed correctly and you will need to verify the Tasks view for errors.

  4. Reset Portlet Preview (see Figure 15-7 on page 471) or use the proper option in toolbar. Temporary resources and the configuration of the portal server are generated to preview the portlet. You can delete them by performing the reset portlet preview action. For example, follow these steps:

    1. In the J2EE Navigator view, right-click the portlet project and select the Reset Preview Portlet in the pop-up menu.

    2. Alternatively, you can reset the portlet preview by selecting any portlet project, then clicking the toolbar Preview Portlet button and selecting Reset Portlet Preview .

      Note : The following tasks will be carried out by this action:

      1. In the portal server, all portlet applications previewed by the current user will be uninstalled .

      2. In the portal server, the preview page of the current user will be deleted.

      3. In your development machine, WAR files exported and previewed by the current user will be deleted.

  5. Configure an external browser to be launched and preview the portlet. Select Window -> Preferences .

    Figure 15-9. Preferences

    graphics/15fig09.gif

  6. Select Web Browser and check the box Use external Web Browser .

  7. Configure the external browser location by browsing to the Internet Explorer location, for example: c:\Program Files\Internet Explorer\IEXPLORE.EXE.

    Figure 15-10. External Web browser configuration

    graphics/15fig10.jpg

  8. Select the portlet application and click Preview Portlet (see Figure 15-7 on page 471) or use the option in the toolbar. This will bring up Internet Explorer to log in to the remote portal, deploy and run your selected portlet application. Click the page name if you do not see the portlet.

Figure 15-11. Portlet preview in external browser (IE)

graphics/15fig11.gif

 < Day Day Up > 


IBM WebSphere Portal V5 A Guide for Portlet Application Development
IBM Websphere Portal V5: A Guide for Portlet Application Development
ISBN: 0738498513
EAN: 2147483647
Year: 2004
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net