Tutorials - Getting Started With Weblogic Portal
Tutorials - Getting Started With Weblogic Portal
Portal
Copyright
Copyright 1995-2006 BEA Systems, Inc. All Rights Reserved.
Contents
1. Introduction
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
iii
iv
CHAPTER
Introduction
Introduction
The tutorials presented in this document introduce you to some of the common tasks you perform in developing the pieces of a portal project and organizing those parts into a version that end users see. The tools you use to perform these tasks include BEA Workshop for WebLogic Platform and BEA WebLogic Portal, including the WebLogic Portal Administration Console. This document describes the following tasks, organized by chapter: Chapter 2, Setting Up Your Portal Development Environment Chapter 3, Creating a Portal in Your Development Environment Chapter 4, Assembling a Desktop in Your Staging Environment
1-1
Introductio n
1-2
CHAPTER
This tutorial helps you prepare your Workshop for WebLogic environment for portal development. For more detailed information about each dialog of the wizards used in this chapter, refer to the Portal Development Guide.
Tutorial Steps
Using the tutorial, you will perform tasks that are required to get your Workshop for WebLogic environment ready for portal development. The tutorial includes instructions on how to perform these tasks:
2-1
Create a Portal Domain Create a Portal EAR Project Associate the EAR Project with the Server Create a Portal Web Project Create a Datasync Project In your actual development environment you do not need to follow the order of the steps as presented in this tutorial; for example, you can create the portal domain after performing all the other steps. However, we recommend that you follow the steps as presented here so that you can easily see the relationships among the parts of a portal project.
2-2
T ut o r i al St e p s
5. Expand Server in the tree, click Server in the expanded tree, and then click Next. The New Server Define a New Server dialog displays, as shown in Figure 2-2.
2-3
6. In the tree, verify that BEA Systems, Inc. is expanded and that BEA WebLogic v9.2 Server is selected, then click Next. The host name localhost is shown in the Host name field. For the tutorial, leave this entry unchanged. The New Server New BEA WebLogic Server dialog displays, as shown in Figure 2-3.
2-4
T ut o r i al St e p s
7. Click the link that is labeled Click here to launch Configuration Wizard to create a new domain. The BEA WebLogic Configuration Wizard starts, as shown in Figure 2-4.
2-5
8. Follow the wizard prompts and enter the values shown in Table 2-1. Click Next as appropriate to continue through the wizard. Table 2-1 Configuration Wizard Values In this Wizard Page...
Welcome Select Domain Source
Select or Enter...
Create a new WebLogic domain (the default) In the Generate a domain configured automatically to support the following BEA products list, select WebLogic Portal. Notice that a WebLogic Portal GroupSpace check box is available on this wizard dialog; portal projects based on the GroupSpace sample application must have a a GroupSpace-enabled domain. This tutorial does not use GroupSpace.
2-6
T ut o r i al St e p s
Select or Enter...
User name: weblogic User password: weblogic Confirm user password: weblogic
No (the default) Domain name: myPortalDomain Domain location: Accept the default, or specify another directory on your system.
9. When you are finished with these entries, click Create in the Create WebLogic Domain dialog. The Creating Domain status page appears, indicating the progress of the domain creation. 10. When the domain is created, click Done. The display returns to the New Server New BEA WebLogic Server dialog. 11. Click Browse and navigate to the directory of the domain that you just created. By default, the path is BEA_HOME\user_projects\domains\myPortalDomain. 12. In the Browse for Folder dialog, select the domain directory and click OK to return to the Define a New Server New BEA WebLogic Server dialog. 13. Click Finish. The new server displays in the Servers view in the Workshop for WebLogic workbench, and a Servers node is added to the tree in the Package Explorer view. Figure 2-5 shows the Servers view and the new server. For now, you do not need to start the server. Later in this tutorial, you will create a simple portal application, start the server, and run the portal application on the server.
2-7
2-8
T ut o r i al St e p s
Figure 2-6 New Project Select a Wizard Dialog with Portal EAR Project Selected
3. Click Next. 4. In the New Portal EAR Project dialog, enter myPortalEAR in the Project Name field, leave the other entry fields unchanged, and click Next. The New Portal EAR Project Select Project Facets dialog displays, as shown in Figure 2-7.
2-9
Figure 2-7 New Portal EAR Project Select Project Facets Dialog
5. In the New Portal EAR Project Select Project Facets dialog, verify that WebLogic Portal and all features that fall under the WebLogic Portal node are selected, as shown in Figure 2-7. The selections WebLogic Portal (Optional) and WebLogic Portal Collaboration are also available here. These selections are not needed for the tutorial; leave them unselected. For more information about what happens when you select these options, refer to the Portal Development Guide. 6. Click Finish. The Portal EAR Project node is added to the Package Explorer view, as shown in Figure 2-8. If you expand the folder you can see the EAR content folder and the required APP-INF and META-INF directories for the project.
2-10
T ut o r i al St e p s
Note: The error icon on the EAR folder appears because the Portal EAR Project references library modules that have not yet been added to the project. Later in this tutorial when you create a Portal Web Project, the library modules will be added and the error icon will disappear when Workshop for WebLogic automatically rebuilds the workspace.
2-11
2. Click to select myPortalEAR in the Available projects column and then click Add. The project is added to the Configured projects column on the right. 3. Click Finish. The Portal EAR Project is now associated with the server. To verify this, in the Servers view you can expand the server node to view the servers associated projects. The myPortalEAR project should be shown as a subordinate node.
2-12
T ut o r i al St e p s
Figure 2-10 New Project Select a Wizard Dialog with Portal Web Project Selected
3. Click Next. The New Portal Web Project dialog displays, as shown in Figure 2-11.
2-13
4. In the New Portal Web Project dialog, enter myPortalWebProject in the Project name field. In the Project contents area of the dialog, leave the default setting unchanged. 5. Select the Add project to an EAR check box. Because myPortalEAR is the only EAR project, it appears in the dropdown menu by default. This associates the Portal EAR project that you created previously with this Portal Web Project. Tip: If you create a portal web project without associating it with an EAR, you can do this step later by right-clicking the EAR project in the Package Explorer tree and selecting Properties; then use the J2EE Module Dependencies setting to associate the project with the EAR.
6. Click Next. The New Portal Web Project Select Project Facets dialog displays, as shown in Figure 2-12.
2-14
T ut o r i al St e p s
Figure 2-12 New Portal Web Project Select Project Facets Dialog
7. In the New Portal Web Project Select Project Facets dialog, verify that the WebLogic Portal node is selected. Also, be sure that all of the features under the WebLogic Portal node are selected, as shown in Figure 2-12. 8. Click Finish. The myPortalWebProject folder now appears in the Package Explorer view, as shown in Figure 2-13. If you expand the folder you can see the default library modules and required directory structure for the project. For more information about the use of Library Modules in WebLogic Portal, refer to the Portal Development Guide.
2-15
2-16
T ut o r i al St e p s
3. Click Next. The Create New Datasync Project Add Datasync Project dialog displays, as shown in Figure 2-15.
2-17
4. In the Create New Datasync Project Add Datasync Project dialog, enter myData in the Project name field. In the other areas of this dialog, leave the default settings unchanged. 5. Click Next. The Create New Datasync Project EAR Projects dialog displays, as shown in Figure 2-16.
2-18
T ut o r i al St e p s
6. Select the myPortalEAR check box. This associates the Datasync project with the Portal EAR project that you created previously. Tip: If you create a datasync project without associating it with an EAR, you can do this step later by right-clicking the datasync project in the Package Explorer tree and selecting Properties; then expand the Datasync node in the tree and select EAR Projects to associate the project with the EAR.
7. Click Finish. The myData folder now appears in the Package Explorer window, as shown in Figure 2-17. If you expand the folder you can see the src folder and the data directory structure for the project.
2-19
Summary
With the completion of this tutorial, you have created the basic required elements of a portal development environment. These components are created on your file system in your current workspace. To learn about some basic portal development tasks using the Workshop for WebLogic workbench, continue to Chapter 3, Creating a Portal in Your Development Environment.
2-20
CHAPTER
This tutorial helps you learn how to create a portal and portlets using WebLogic Portal in the Workshop for WebLogic workbench. For m ore detailed information about each dialog of the wizards used in this chapter, refer to the Portal Development Guide.
Tutorial Steps
Using the tutorial, you will create a portal and two portlets, create an additional page for the portal, and then place the portlets onto a page of the portal. The tutorial includes instructions on how to perform these tasks: Create a Portal Add a Page to Your Portal Deploy and View Your New Portal Create Portlets Add Portlets to the Portal and View the Result
3-1
C re at i n g a P o rt a l i n Y o ur D e v e l o pme n t En v i r o n m e nt
Create a Portal
In this task you will create a portal for the project that you created in Create a Portal Web Project on page 2-12. To create a portal, perform these steps: 1. If the Portal perspective is not already open, select it by choosing Window > Open Perspective > Portal. Using the Portal perspective is optional, but the instructions and figures in this tutorial are based on the views that are available in the Portal perspective. 2. Navigate to the myPortalWebProject/WebContent directory, right-click and then select New > Portal. The New Portal dialog displays, as shown in Figure 3-1. Because you started this wizard by right-clicking the web content directory, the parent folder field automatically displays that directory name. Figure 3-1 New Portal Dialog
3-2
T ut o r i al St e p s
As a best practice, you should locate your portal file in a web content directory that is subordinate to the web project directory. The default web content directory name is WebContent, and is assigned when you use the Portal Web Project Wizard. You can change the name of your web content directory if you wish; for more information, refer to the Portal Development Guide. 3. In the File name field, enter myPortal. A file type of .portal is required for portals; you can type the .portal extension to the portals name if you wish, but WebLogic Portal automatically adds the extension if you dont enter it. 4. Click Finish. The wizard adds myPortal.portal to the WebContent folder in the Portal web project and a view of the portal displays in the workbench, as shown in Figure 3-2. Figure 3-2 Portal Displayed in Workbench
The created portal includes a desktop, header, footer, book, and page. A desktop is a user-specific view of the portal content. A portal can support many desktops. A single portal might support an employee-specific desktop, a customer-specific desktop, and others, where each
BEA WebLogic Portal Tutorial 3-3
C re at i n g a P o rt a l i n Y o ur D e v e l o pme n t En v i r o n m e nt
desktop exposes different kinds of content to different sets of users. Any part of a portal can be included or excluded from a desktop, including a book, a page, a specific application, or an individual link. Desktops can also define the look and feel attributes of a Portal. Desktops can be associated with a particular skin that defines the color scheme, fonts, and images used. Desktops also contain a header and footeryou can place images, text, or any web content in these areas to give consistency to the look and feel of a desktop. You use books to organize your content and navigation in a hierarchical manner. Books can contain other books or pages. In a browser, a book is rendered as a set of tabs or links. Each portal contains a main book called, by default, Main Page Book. A page consists of a set of columns and/or windows that organize the actual content of your portal. You navigate to a page by clicking on an individual tab or a link.
3-4
T ut o r i al St e p s
The new page has a default title of New Page. To change it, perform these steps: 1. Click the new page tab to select it. 2. In the Properties view, enter Page 2 as the new title, as shown in Figure 3-4. When you enter the new value, the editor shows that the title has changed from New Page to Page 2.
3-5
C re at i n g a P o rt a l i n Y o ur D e v e l o pme n t En v i r o n m e nt
The Run On Server - Define a New Server dialog displays. Make sure the server that you created during the previous WebLogic Portal tutorial task is highlighted. 2. Click Finish to begin the deployment process.
3-6
T ut o r i al St e p s
Wait while Workshop for WebLogic starts the server, deploys files to the server, and runs the application. While deployment is in process, you can view status messages in the status bar at the bottom of the window. The results appear in a new tab in the editor view, as shown in Figure 3-6. Tip: If you previously deployed a project of the same name and that project is in a different location, you need to undeploy that project. To do this, double-click the server in the Servers view, and delete myPortalWebProject (not the library modules) from the Published Modules list. For more information about this task, refer to the Managing Servers section of the Workshop for WebLogic help.
Leave this new tab open; after you add portlets you will refresh this display to view them. Tip: You can choose to always use an external web browser to view your portal if you wish. To do so, select Window > Preferences and select General > Web Browser in the property tree; then select the Use external Web browser radio button.
Create Portlets
In this task you will create two portlets: a Browser URL portlet and a simple JSP portlet.
3-7
C re at i n g a P o rt a l i n Y o ur D e v e l o pme n t En v i r o n m e nt
The New Folder dialog displays, as shown in Figure 3-7. Figure 3-7 New Folder Dialog - Create Folder for Portlets
3-8
T ut o r i al St e p s
The Finish button is initially disabled; the button enables when you select a valid parent folder and type a portlet name. If you select an invalid portal project in the folder tree on this dialog, an error message appears in the status area near the top of the dialog explaining that the project is not a valid portal project. 2. Type myBrowserPortlet as the file name for the new portlet. 3. Click Finish. The Portlet Wizard displays the Select Portlet Type dialog. 4. Click Browser (URL) Portlet and then click Next. The Portlet Wizard displays the Portlet Details dialog; Figure 3-9 shows an example.
3-9
C re at i n g a P o rt a l i n Y o ur D e v e l o pme n t En v i r o n m e nt
5. Specify the values for this portlet, using Table 3-1 as a guide. Table 3-1 Portlet Wizard - Browser Portlet Data Entry Fields Field
Title
Value/Description
BEA Browser Portlet This value appears in the title bar of the portlet in the editor view of the Workshop for WebLogic workbench.
Content URL
http://www.bea.com This is the value for the Content URL (external URL) that the portlet should use to retrieve its information.
Has Titlebar
Leave the box checked. In order for a portlet to have changeable states or modes, the portlet must have a title bar.
Select all four check boxes: Minimizable, Maximizable, Floatable, and Deleteable. Leave these fields blank.
3-10
T ut o r i al St e p s
6. Click Create. The Workshop for WebLogic window updates, adding the myBrowserPortlet.portlet file to the portlets folder and displaying the new portlet in the editor, as shown in Figure 3-10. Figure 3-10 New Browser Portlet Displayed in Editor
3-11
C re at i n g a P o rt a l i n Y o ur D e v e l o pme n t En v i r o n m e nt
3. Select File > Save As and save this JSP file as jsp_portlet.jsp. 4. Drag the jsp_portlet.jsp file into the portlets folder. 5. Right-click jsp_portlet.jsp and select Generate Portlet from the menu. Because you are generating a portlet from an existing .jsp file, the Portlet Wizard goes directly to the Portlet Details dialog; Figure 3-12 shows an example.
3-12
T ut o r i al St e p s
6. Specify the values specified in Table 3-2. Table 3-2 Portlet Wizard - JSP Portlet Data Entry Fields Field
Title Content URI
Value/Description
Simple JSP Portlet /portlets/jsp_portlet.jsp Because you are creating this portlet based on an existing JSP file, WebLogic Portal automatically fills in this value.
Leave this box checked. Select the check boxes Minimizable and Maximizable.
7. Click Create. The Workshop for WebLogic window updates, adding the jsp_portlet.portlet file to the portlets folder.
3-13
C re at i n g a P o rt a l i n Y o ur D e v e l o pme n t En v i r o n m e nt
Checkpoint: Your WebContent directory should look like the example shown in Figure 3-13. Figure 3-13 WebContent Directory Including Portal, Browser Portlet, and JSP Portlet
3-14
T ut o r i al St e p s
5. Save your change. To view the new portlets in a browser, follow these steps: 1. Click to select the New Portal Desktop tab in the editor view. 2. On the toolbar, click Refresh .
Because your change does not require redeploying the change to the server, you do not need to select the Run on Server option to see the new portlets. Your updated portal should look like the example shown in Figure 3-15.
3-15
C re at i n g a P o rt a l i n Y o ur D e v e l o pme n t En v i r o n m e nt
Figure 3-15 Running Portal with Browser Portlet and JSP Portlet Added
Summary
With the completion of this tutorial, you have created a portal, added a portal page, and created two new portlets that can be displayed in the portal. These components are created on your file system in your current workspace. To learn about creating desktops using the WebLogic Portal Administration console, continue to Chapter 4, Assembling a Desktop in Your Staging Environment.
3-16
CHAPTER
This tutorial helps you learn how to use the WebLogic Portal Administration Console for some basic portal organization tasks. For more detailed information about each dialog of the wizards used in this chapter, refer to the Portal Development Guide.
4-1
This tutorial describes some of the basic Portal Management tasks. The Portal Development Guide and Portlet Development Guide provide details about Portal Management tasks. User, Groups, & Roles User and group management, security provider configuration, Delegated Administration, and Visitor Entitlements. The User Management Guide and Security Guide provides detailed information about the tasks in this category. Configuration Settings Server settings for Cache Management, Server Maintenance Mode, Personalization, Security, Unified User Profiles, and WSRP. The Security Guide, Portal Development Guide, Federated Portals Guide, Interaction Management Guide, and User Management Guide provide detailed information about the tasks in this category. Interaction Management Campaigns, Placeholders, User Segments, And Content Selectors. The Interaction Management Guide provides detailed information about the tasks in this category. Content Management Content and repositories. The Content Management Guide provides detailed information about the tasks in this category.
Tutorial Steps
Using the tutorial, you will create a portal desktop based on the portal and portlets created previously, make some modifications to your desktop, and then view your results. The tutorial includes instructions on how to perform these tasks: Open the Administration Console Log in to the Administration Console Create a Portal and Desktop Update the Desktop Page Contents to Rearrange Portlets Create a New Page on the Desktop
4-2
T ut o r i al St e p s
Wait while Workshop for WebLogic starts the server. This process might take some time, depending on the speed of your system.When the process completes, the Status column in the Servers view displays Started and the square Stop the Server button becomes active. 4. Click myPortal.portal in the Package Explorer view to select it. 5. From the main menu, select Run > Open Portal Administration Console, as shown in the example in Figure 4-1. Figure 4-1 Menu Selection for Run > Open Portal Administration Console
4-3
The Administration Console opens in a new tab in the workbench editor view, with the login dialog displayed, as Figure 4-2 shows. Figure 4-2 WebLogic Portal Administration Console Login Dialog
Password
portaladmin weblogic
Description
Administrator for the portal domain WebLogic Server system administrator with full privileges in the domain
For purposes of this tutorial, you will use the default WebLogic Server login so that you have full privileges. To log in to the WebLogic Portal Administration Console, follow these steps:
4-4
T ut o r i al St e p s
1. Type the user name weblogic and password weblogic into the dialog and click Sign In. The main menu of the Administration Console displays. 2. To get a better view of the console and its functions, click Maximize toolbar. Your display should look like the example in Figure 4-3. in the editor view
Note: If you set up your Workshop for WebLogic preferences to open external browsers instead of the internal browser, you do not need to perform this step. Figure 4-3 Administration Console Main Page, Maximized
4-5
Notice that the display is based on the Portal Web Project that you created in Chapter 3, Creating a Portal in Your Development Environment. if you expand the Library > Portlets portion of the tree, you can see the portlets that you created earlier. 2. Click Portals in the tree. The Portals page displays, with the Browse Portals tab active. Because no portals exist yet, the table containing portals is empty. 3. Click Create New Portal. The Create a New Portal dialog displays, as shown in Figure 4-5. Figure 4-5 Create a New Portal Dialog in Administration Console
4-6
T ut o r i al St e p s
Value/Description
myBEAportal general BEA portal myBEAportal (leave blank)
5. Click Create New Portal. When the Portals page displays again, the Browse Portals table includes the portal you created, and the Portal Resources tree includes the new portal. 6. Click myBEAportal in the Browse Portals table to view the details for this portal. The Portals page displays, with the Browse Desktops tab active. Because no desktops exist yet, the table containing desktops is empty. 7. Click Create New Desktop. The Create Desktop wizard displays, as shown in Figure 4-6.
4-7
8. Enter values for the desktop in the appropriate wizard pages, using Table 4-3 as your guide: Table 4-3 Create Desktop Wizard Field Descriptions Field or Selection
Step 1: Select how you want to create a desktop...
Value/Description
1. Select a .portal file radio button. 2. Click Next.
4-8
T ut o r i al St e p s
Table 4-3 Create Desktop Wizard Field Descriptions (Continued) Field or Selection
Step 2: Search for templates
Value/Description
1. Click Show All. The portal you created using Workshop for WebLogic displays in the list. 2. Click to select myPortal.portal. 3. Click Next.
Title myDesktop Description general desktop Partial URL desktop1 Default Shell (leave as is) Look and Feel (leave as is)
9. Click Next to review the desktop properties, and Next again to create the desktop. A confirmation dialog confirms that the desktop has been created and displays related information. 10. Click Finish to return to the main Administration Console page. The Browse Desktops table includes the desktop you created, and the Portal Resources tree includes the new desktop, as shown in Figure 4-7, which shows the expanded tree. Figure 4-7 New Desktop in Portal Resources Tree
Notice that the portlets that you created for this portal (which was used as the template for this desktop) appear automatically in the new desktop.
BEA WebLogic Portal Tutorial 4-9
2. Click Page 1 to select it. The Page 1 details display in the right pane of the Administration Console. 3. Select the Edit Contents tab; it appears, as shown in Figure 4-9.
4-10
T ut o r i al St e p s
4. Drag the BEA Browser Portlet into the same placeholder as the Simple JSP Portlet, as shown in Figure 4-10. Figure 4-10 Moving the BEA Browser Portlet by Dragging
When you release the portlet, it displays above the Simple JSP Portlet, as shown in Figure 4-11.
4-11
5. Click Save Changes. Figure 4-11 Result After Moving the BEA Browser Portlet in the Administration Console
6. In the Portal Resources tree, click myDesktop to display the Details page. 7. Click View Desktop. The desktop displays in a browser, with the portlets in their new positions, as shown in Figure 4-12.
4-12
T ut o r i al St e p s
2. Click Pages to display the Browse Pages tab, as shown in Figure 4-14.
4-13
3. Click Create New Page. The Create New Page dialog displays, as shown in Figure 4-15. Figure 4-15 Create New Page Dialog in Administration Console
4-14
Summary
4. Enter values for the new page, using Table 4-4 as a guide: Table 4-4 Create New Page Field Descriptions Field
Title Description Layout Theme
Value/Description
Tutorial Page new page for tutorial Three Column Layout (leave as is - None)
5. Click Create. The new page is added, and is displayed in the Details page for the desktop; the Portal Resources tree updates to include the new page, as shown in Figure 4-16. Figure 4-16 New Page Added to the Portal Resources Tree
Summary
With the completion of this tutorial, you have created a basic desktop and performed some additional tasks to become familiar with the staging environment and the WebLogic Portal Administration Console. To get started with actual portal development and desktop staging, refer to WebLogic Portal document library on e-docs.
4-15
4-16