ALDSP uses a set of descriptors (or metadata) to provide information about data services. The metadata describes the data services: what information they provide and where the information derives from (that is, its lineage). In addition to documenting services for potential consumers, metadata helps administrators determine what services are affected when inevitable changes occur in the data source layer. If a database changes, you can easily tell which data services are affected by the change.
Objectives
After completing this lesson, you will be able to:
Synchronize physical data service metadata with changes made to the physical data source.
Analyze impacts and dependencies.
Create custom metadata for a logical data service.
Overview
ALDSP metadata information is stored as annotations at the data service and function levels. The metadata is openly structured as XML fragments for easy export and import. At deployment time, the metadata is incorporated into a compiled data service, and then deployed as part of the data service application in WebLogic Server.
Stored metadata includes:
Physical data service metadata:
Relational data source, type, and version
Column names, native data types, size, and scale
XML schema types
Web service WSDL URI
User-defined metadata:
Description
Custom properties at the data service level
Custom properties at the function level
Relationships created through data modeling
The Data Services Platform Console lets you access metadata stored within the ALDSP metadata repository. The ALDSP Console supports the following functionality:
Searching the metadata repository
Exploring where and how a given data service or function is consumed
Analyzing data service lineage and dependencies (all data service objects dependent on a given data service)
Imported physical data service metadata can be re-synchronized to capture changes at the data source.
14.1 Defining Customized Metadata for a Logical Data Service
There may be times when you need to modify the generated metadata descriptions to provide more detailed information to others who will be working with the data service.
Objectives
In this exercise, you will:
Create customized metadata for the CustomerProfile logical data service, at both the data service and function levels.
Build the DataServices project to enable persistence of the new metadata.
Instructions
Add customized metadata at the data service level, by completing the following steps:
Open CustomerProfile.ds in Design View. The file is located in the DataServices\CustomerManagement.
Click the data service header to open the Property Editor at the data service level. (If the Property Editor is not open, choose View Property Editor, or press Alt + 6.)
In Property Editor, click the Description field, located in the General section. This activates the Description field.
Click the "..." icon for the Description field. The Property Text Editor opens.
In Property Text Editor, enter the following text:
Unified Customer Profile View - contains CRM, order information, credit rating, and valuation information.
Click OK. The specified text is added to the Description field.
Figure 14-1 Property Text Editor
In Property Editor, click the + icon for the User-Defined Properties section.
Click the + icon for the Property(1) field. This activates the Property(1) field.
Add a user-defined property, using the following values:
Name = Owner
Value = <your name>
Figure 14-2 User-Defined Property for a Logical Data Service
Add customized metadata at the function level, by completing the following steps:
In Design View, click the getCustomerProfile() function arrow to open that function's Property Editor.
Note:
Do not click the function, which will open XQuery Editor View.
In Property Editor, click the + icon, located in the User-Defined Properties section.
Add a user-defined property, using the following values:
Name = Notes
Value = This function is consumed by the Customer Management Portal.
Figure 14-3 User-Defined Property for a Function
Save the file.
Build the DataServices project.
14.2 Viewing Data Service Metadata Using the ALDSP Console
All data service metadata, whether automatically generated or user-defined, can be viewed using the ALDSP Console.
Objectives
In this exercise, you will:
Use the ALDSP Console to view both generated and customized metadata.
Use the console's Search feature to locate metadata for a specific data service.
Instructions
Open the ALDSP Console, typically located at http://localhost:7001/ldconsole/.
Note:
WebLogic Server must be running.
Log in using the following credentials:
User = weblogic
Password = weblogic
Open the CustomerProfile data service, located in ldplatform\Evaluation\DataServices\CustomerManagement using the left-hand menu.
Figure 14-4 ALDSP Console
Click the Properties tab and verify that user-defined properties for the data service display. The property should be similar to that displayed in Figure 14-5, except that it will be your name in the Value field.
Figure 14-5 Customer Profile Properties Metadata
Explore the CustomerProfile data service metadata by completing the following steps:
Select the Read Functions tab.
Click getCustomerProfile().
Click the Properties tab. The Note that you created for getCustomerProfile() should be visible.
Figure 14-6 Metadata -- Read Function Properties
(Optional) Select the Return Type, Relationships, Properties, and Where Used tabs to view other metadata.
Search the DataServices folder for metadata by completing the following steps:
Right-click the Evaluation folder and click Search. (A search can be on data service name, function name, description, or return type.)
Enter CustomerProfile in the Data Service Name search box and click Search. The data service name, path, and type of data service are displayed for the CustomerProfile data service. Clicking the data service name displays the Admin page for the data service.
Figure 14-7 Search Results
14.3 Synching a Data Service with Underlying Data Source Tables
Sometimes the underlying data source changes; for example, a new table is added to a database. For those inevitable situations, ALDSP provides an easy way to update a data service.
Objectives
In this exercise, you will:
Import a Java project that contains additional CUSTOMER_ORDER database columns.
Synchronize the information in the Java project with the CUSTOMER_ORDER data service.
Confirm the addition of a new element in the CUSTOMER_ORDER data service schema.
Instructions
In WebLogic Workshop, choose File Import Project.
Select Java Project.
Navigate to <beahome>\weblogic81\samples\LiquidData\EvalGuide.
Select the AlterTable folder, click Open, and then click Import.
Figure 14-8 Importing Java Project
Open AlterTable.java. (The file is located in the AlterTable project folder).
Click the Start icon, and then click OK when a Confirmation message displays. Compiling the file adds a new column to the CUSTOMER_ORDER table.
Open the Output window and confirm that you see the CUSTOMER_ORDER_TABLE altered message.
Figure 14-9 Altered Table Message
Right-click the ElectronicsDB folder, located in the DataServices project folder.
Select Update Source Metadata. The Metadata Update Targets wizard opens, displaying a list of all new columns.
Figure 14-10 Physical Data Sources
Click Next. The Metadata Update Preview dialog box opens, which provides details on the data to be synchronized.
Figure 14-11 Synchronization Preview
Click Finish.
Open CUSTOMER_ORDER.ds in Source View. The file is located in the ElectronicsDB.
Expand the data service annotation, located on the first line of the file, to view the captured metadata for the relational data source (type, version, column names, native data types, size, scale, and XML schema types).