> Samples Tutorial
> (Optional) Consuming Data Services through Portals & Business Processes
Samples Tutorial
(Optional) Consuming Data Services through Portals & Business Processes
The previous lessons demonstrated how ALDSP provides a convenient way to quickly access ALDSP from a WebLogic Workshop application such as page flows, process definitions, or portals. This optional lesson details the steps you take to use a portal to access data services.
Note:
WebLogic Portal must be installed.
Objectives
After completing this lesson, you will be able to:
Import a WebLogic Portal project that contains portals and business processes.
Install the Data Service Control in the project, thereby making data services available from the portal and business processes.
Recognize how a Data Service Control is used from a portal and business process.
Overview
At its most basic level, a portal is a Web site that simplifies and personalizes access to content, applications, and processes. Technically speaking, a portal is a container of resources and functionality that can be made available to end-users. These portal views, which are called Desktops in WebLogic Portal, provide the uniform resource location (URL) that end users access.
Figure 17-1 Consuming Data Services from Portals
17.1 Installing a Data Service Control in a Portal Project
The steps within this exercise are similar to those detailed in Installing a Data Service Control.
Objectives
In this exercise, you will:
Import a portal web project's files and libraries, which you will use to create a new portal project.
Create a new portal project.
Add a control to the portal project.
Instructions
Right-click the Evaluation application.
Choose Install Portal. ALDSP installs the necessary portal files and libraries.
Create a new portal web project by completing the following steps:
Right-click the Evaluation application.
Choose Import Project.
Select Portal Web Project.
Select MyPortal, located in the <beahome>\weblogic81\samples\ liquiddata\EvalGuide directory.
Click Open and then click Import.
Figure 17-2 Importing a Portal Web Project
Create a new folder in the MyPortal folder, and name it controls.
Create a Data Service Control within the portal by completing the following steps:
Right-click the MyPortal project.
Choose New Java Control.
Select Data Service Control and name it CustomerData.
Figure 17-3 Creating a New Data Service Control
Click Next and then click Yes at the Message window.
Select MyPortal\controls as the subfolder in which to locate the new control.
Click Select. The New Java Control ALDSP window opens.
Figure 17-4 Setting Data Service Control Specifications
Click Create to accept the default settings. A list containing available data service queries displays.
Open CustomerProfile.ds (located in DataServices\CustomerManagement) and select the following methods:
getCustomerProfile()
submitCustomerProfile()
Click Add and then Finish.
Figure 17-5 Selecting Query Functions
After creating the ALDSP control, perform the following steps:
Open the CustomerData.jcx control in Source View.
Add a new function with the same signature as the getCustomerProfile() function and name it getCustomerProfileWithFilter.
Add the following parameter to the getCustomerProfileWithFilter() function:
FilterXQuery filter
After adding this parameter, the function signature will display as follows:
As with all data services, you should test functionality before you deploy the application.
Objectives
In this exercise, you will:
Run the CustomerManagement.portal application.
Retrieve data.
Review the results.
Instructions
Open CustomerManagement.portal.
Click the Start icon to open the Workshop Test Browser and run the portal application containing the CustomerManagementWebApp and the CustomerReport that were used in earlier lessons.
Enter CUSTOMER3 in the Customer ID field and press Submit. The Customer Profile Information page opens.
Figure 17-6 Portal Access to Web Application Data
Click the Reports link. For the Reports page, the first invocation may take a few moments before displaying.
Figure 17-7 Portal Access to Crystal Reports Data
Open the process.jpd file, located in the MyPortal\processes folder. You will see the Design View of the process definition that accepts a CUSTOMER_ID String, invokes the Data Service Control, and returns the customer information in an XML document.
Figure 17-8 Design View of process.jpd File
Click the Start icon to test the process definition.
Enter CUSTOMER3 in the Customer ID field and then click clientRequestwithReturn.
Scroll through the page to view customer information included in the "Returned from getCustomerProfile on LDControl" section.
Figure 17-9 Business Process View of Customer Data
Lesson Summary
In this lesson you learned how to:
Import a WebLogic Portal project that contains portals and business processes.
Install the Data Service Control in the project, thereby making data services available from the portal and business processes.
Recognize how a Data Service Control is used from a portal and business process.