bea.com | products | dev2dev | support | askBEA

Download Docs | Site Map | Glossary
Search

Portlet Features and Functionality

Miscellaneous Portlets

This topic discusses portlets that have a variety of functionality. The following portlets are described:

- Email Portlet

- WhatsHot Portlet

- MyToDo and GroupToDo Portlets

- CustomerService Portlet

Email Portlet

The Email portlet demonstrates the use of the Java Mail API. The Email portlet displays a list of messages in an email inbox. Although you can see which messages are there, you cannot read them. This section describes how to set up the Email portlet.

Java source: <BEA_HOME>/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/src/examples/sampleportal/email

JSP source: <BEA_HOME>/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/portlets/email

To configure the Email portlet, complete the following directions:

1. Log in as any visitor.

2. In the Email portlet, click the Edit button, as shown in Figure 7-1.

   Figure 7-1 Email Portlet—Not Configured

3. In the expanded Email portlet, fill in the fields. Figure 7-2 shows an example.

   Figure 7-2 Email Portlet—Edit

4. Click the Save button, and then click the Finished button.

   If you have entered the correct information, you should see your new emails in the Email portlet, as shown in Figure 7-3.

   Figure 7-3 Email Portlet—New Email

   If the information you entered is not correct, the Email portlet indicates a problem, as shown in Figure 7-4.

   Figure 7-4 Email Portlet—Improperly Configured

5. Log out of the portal.

WhatsHot Portlet

The WhatsHot portlet is an example of a simple reporting portlet. It shows the number of times a campaign ad or company profile has been clicked. This portlet pulls information from the WebLogic Portal event tracking system. Specifically, the WhatsHot portlet collects real-time information from an event and displays the information. It shows the use of an asynchronous custom event listener. The content of WhatsHot can also be displayed in an Excel spreadsheet.

Java source: <BEA_HOME>/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/src/examples/sampleportal/whatshot

JSP source: <BEA_HOME>/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/portlets/whatshot

To learn about the WhatsHot portlet, complete the following instructions:

1. Log in as "visitor4". The portlet appears as shown in Figure 7-5. The right column indicates the number of times that the link for each company has been clicked in the CompanyProfiles portlet.

   Figure 7-5 WhatsHot—Citigroup, 3 Counts

2. Notice the number of counts for any company. For example Citigroup has a count of three, as indicated by the red arrow in Figure 7-5.

3. Go to the CompanyProfiles portlet and click any company (Figure 7-6).

   Figure 7-6 CompanyProfiles Portlet

4. After the CompanyProfiles portlet expands, click the Unmaximize button to return the portlet to its original size.

5. Now go back and look at the WhatsHot portlet. Notice that the number of counts for the company you picked increments by one. For example, Citigroup now has a count of four hits, as shown in Figure 7-7.

   Figure 7-7 WhatsHot—Citigroup, 4 Counts

6. Click View as Excel Spreadsheet. The browser displays the spreadsheet, as shown in Figure 7-8.

   Figure 7-8 WhatsHot—Excel Spreadsheet

7. To return to the portlet, click the browser Back button.

MyToDo and GroupToDo Portlets

The MyToDo portlet provides a list for personal activities. The GroupToDo portlet provides a list for team activities. Any changes in the GroupToDo portlet are displayed for each team member. Every member of the team can update the GroupToDo portlet. The MyToDo and GroupToDo portlets are implemented through Enterprise JavaBeans (EJB) 2.0 entity beans.

Java source: <BEA_HOME>/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/src/examples/sampleportal/collaboration

JSP source: <BEA_HOME>/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/portlets/collaboration

To learn more about these portlets, complete the following instructions:

1. Log in as "visitor4".

2. In the GroupToDo portlet, click the Edit button, as shown in Figure 7-9.

   Figure 7-9 GroupToDo Portlet—No Items Saved

3. After the portlet expands, enter a task, set its priority, and then click the Add to List button, as shown in Figure 7-10

   Figure 7-10 GroupToDo Portlet—New To Do Items

4. Add a second task. The portlet updates to show the changes, as shown in Figure 7-11.

   Figure 7-11 GroupToDo Portlet—Item Added

5. Click the Finished button. The portlet now contains a To Do list, as shown in Figure 7-12.

   Figure 7-12 GroupToDo Portlet—Items Added

6. Log out as Visitor 4 and log in as "visitor1". The GroupToDo portlet for Visitor 1 now shows the items entered by Visitor 4.

7. In the Visitor 1 GroupToDo portlet, click one of the check boxes, and then click the Update button. Figure 7-13 shows an example.

   Figure 7-13 GroupToDo Portlet—Item Checked

8. Log out as Visitor 1 and log in as "visitor4". The GroupToDo portlet for Visitor 4 now shows the checked item entered by Visitor 1.

9. Log out as Visitor 4.

The MyToDo portlet operates in the same way, except other team member portlets are not updated.

CustomerService Portlet

The CustomerService portlet demonstrates EJB 2.0 implementation and integration with the J2EE Connector Architecture (JCA) sample database adaptor provided with WebLogic Server 7.0. The CustomerService portlet has two views: the Individual view, where visitors can see only their service requests and add new requests, and the Service Representative view, where all service requests from every group member are displayed.

Java source: <BEA_HOME>/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/src/examples/sampleportal/customerservice

JSP source: <BEA_HOME>/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/portlets/customerservice

To learn more about the CustomerService portlet, complete the following instructions:

1. Log in as "visitor5". The CustomerService portlet appears as shown in Figure 7-14.

   Note: Only the CustomerService Representative (Visitor 5) can see all the requests.

   Figure 7-14 CustomerService Portlet—Default (Visitor 5)

2. Log out as Visitor 5 and then log in as "visitor1". The CustomerService Portlet appears as shown in Figure 7-15.

   Figure 7-15 CustomerService Portlet—Default (Visitor 1)

3. In the Visitor 1 CustomerService portlet, click the Edit button. The portlet expands as shown in Figure 7-16.

   Figure 7-16 CustomerService Portlet—Enter Request (Visitor 1)

4. Enter a request, click the Save button, and then click the Finished button. The portlet now shows the service request, as shown in Figure 7-17.

   Figure 7-17 CustomerService Portlet—New Request (Visitor 1)

5. Log out as Visitor 1 and then log back in as "visitor5". The portlet shows the new service request, as shown in Figure 7-18.

   Figure 7-18 CustomerService Portlet—New Request Added (Visitor 5)

6. Log out as Visitor 5.

What's Next

This concludes the Portal Example—Portlet Features and Functionality tour. To learn about portal functionality, see Portal Example—Visitor and Administrator Features at http://edocs.bea.com/wlp/docs70/ptour/index.htm.

To learn about WebLogic Portal administration, see the Administration Guide at http://edocs.bea.com/wlp/docs70/admin/index.htm.

To learn about WebLogic Portal development, see the Development Guide at http://edocs.bea.com/wlp/docs70/dev/index.htm.