A Data Service control provides WebLogic Workshop applications with easy access to data service functions.
After completing this lesson, you will be able to:
A convenient way to quickly access ALDSP from a WebLogic Workshop application, such as page flows, process definitions, portals, or Web services, is through the Data Service control.
The Data Service control is a wizard-generated Java file that exposes to WebLogic Workshop client applications only those data service function that you choose. You can add functions to a control from data services deployed on any WebLogic Server that is accessible to the client application, whether it is on the same WebLogic Server as the client application or on a remote WebLogic Server.
If accessing data services on a remote server, information regarding the information that the service functions return (in the form of XML schema files) are first downloaded from the remote server into the current application. The schema files are placed in a schema project named after the remote application. The directory structure within the project mirrors the directory structure of the remote server.
When you create a Data Service control, WebLogic Workshop generates interface files for the target schemas associated with the queries and then a Java Control Extension (.jcx) file. The .jcx file contains the methods included from the data services when the control was created and a commented method that, when uncommented, allows you to pass any XQuery statement to the server in the form of an ad-hoc query.
Data Service controls let you easily access data from page flows, process definitions, portals, or Web services.
Note: | The Data Service option will not display if you previously installed a Data Service control. |
Note: | Do not change any default settings. |
It will take a few moments for the project to compile. After compilation, you should see a Java-based Data Service Control called CustomerData.jcx, with the following signatures:
Note: | You can use the data service control that you define as any WebLogic Workshop control in a workflow, a JPF, or a portal. |
import com.bea.ld.filter.FilterXQuery;
/**
*
* @jc:XDS functionURI="ld:DataServices/CustomerManagement/CustomerProfile" functionName="getCustomerProfile" schemaURI="http://temp.openuri.org/DataServices/schemas/CustomerProfile.xsd" schemaRootElement="CustomerProfile"
*/
org.openuri.temp.dataServices.schemas.customerProfile.CustomerProfileDocument getCustomerProfile(java.lang.String CustomerID);
/**
*
* @jc:XDS functionURI="ld:DataServices/CustomerManagement/CustomerProfile" functionName="getCustomerProfile" schemaURI="http://temp.openuri.org/DataServices/schemas/CustomerProfile.xsd" schemaRootElement="CustomerProfile"
*/ org.openuri.temp.dataServices.schemas.customerProfile.CustomerProfileDocument getCustomerProfileWithFilter(java.lang.String CustomerID, FilterXQuery filter);
FilterXQuery filter
After adding this parameter, the function signature will display as:
/**
*
* @jc:XDS functionURI="ld:DataServices/CustomerManagement/CustomerProfile" functionName="getCustomerProfile" schemaURI="http://temp.openuri.org/DataServices/schemas/CustomerProfile.xsd" schemaRootElement="CustomerProfile"
*/ org.openuri.temp.dataServices.schemas.customerProfile.CustomerProfileDocument getCustomerProfileWithFilter(java.lang.String CustomerID, FilterXQuery filter);
At this point, you have created a Data Service Control and specified which data service functions (getCustomerProfile() and submitCustomerProfile()) you want to want to use in this control. However, the control is not yet associated with a page flow, from which end-users can retrieve data.
Note: | There are two "errors" in the file, indicated by the two red marks in the scrollbar. This is because the getCustomer() and submitCustomer() functions are not yet associated with a Data Services Control. |
customerDocument = LDControl.gCustomerProfileWithFilter(form.getCustomerID(),filter);
customerDocument = LDControl.getCustomerProfile(form.getcustomerID());
In this exercise you will see the Data Service Control in action.
Note: | The WebLogic Server must be running. |
Modify the customer information by completing the following steps:
The new order information displays in the Workshop Test Browser.
In this lesson, you learned how to: