Samples Tutorial

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Managing Data Service Metadata

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:

 


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:

The Data Services Platform Console lets you access metadata stored within the ALDSP metadata repository. The ALDSP Console supports the following functionality:

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:

Instructions

  1. Add customized metadata at the data service level, by completing the following steps:
    1. Open CustomerProfile.ds in Design View. The file is located in the DataServices\CustomerManagement.
    2. Click the data service header to open the Property Editor at the data service level. (If the Property Editor is not open, choose View Arrow symbol Property Editor, or press Alt + 6.)
    3. In Property Editor, click the Description field, located in the General section. This activates the Description field.
    4. Click the "..." icon for the Description field. The Property Text Editor opens.
    5. In Property Text Editor, enter the following text:
    6. Unified Customer Profile View - contains CRM, order information, credit rating, and valuation information.
    7. Click OK. The specified text is added to the Description field.
    8. Figure 14-1 Property Text Editor


      Property Text Editor

    9. In Property Editor, click the + icon for the User-Defined Properties section.
    10. Click the + icon for the Property(1) field. This activates the Property(1) field.
    11. 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


        User-Defined Property for a Logical Data Service

  2. Add customized metadata at the function level, by completing the following steps:
    1. In Design View, click the getCustomerProfile() function arrow to open that function's Property Editor.
    2. Note: Do not click the function, which will open XQuery Editor View.
    3. In Property Editor, click the + icon, located in the User-Defined Properties section.
    4. 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


        User-Defined Property for a Function

  3. Save the file.
  4. 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:

Instructions

  1. Open the ALDSP Console, typically located at http://localhost:7001/ldconsole/.
  2. Note: WebLogic Server must be running.
  3. Log in using the following credentials:
  1. Open the CustomerProfile data service, located in ldplatform\Evaluation\DataServices\CustomerManagement using the left-hand menu.
  2. Figure 14-4 ALDSP Console


    ALDSP Console

  3. 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.
  4. Figure 14-5 Customer Profile Properties Metadata


    Customer Profile Properties Metadata

  5. Explore the CustomerProfile data service metadata by completing the following steps:
    1. Select the Read Functions tab.
    2. Click getCustomerProfile().
    3. Click the Properties tab. The Note that you created for getCustomerProfile() should be visible.
    4. Figure 14-6 Metadata -- Read Function Properties


      Metadata -- Read Function Properties

    5. (Optional) Select the Return Type, Relationships, Properties, and Where Used tabs to view other metadata.
  6. Search the DataServices folder for metadata by completing the following steps:
    1. Right-click the Evaluation folder and click Search. (A search can be on data service name, function name, description, or return type.)
    2. 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.
    3. Figure 14-7 Search Results


      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:

Instructions

  1. In WebLogic Workshop, choose File Arrow symbol Import Project.
  2. Select Java Project.
  3. Navigate to <beahome>\weblogic81\samples\LiquidData\EvalGuide.
  4. Select the AlterTable folder, click Open, and then click Import.
  5. Figure 14-8 Importing Java Project


    Importing Java Project

  6. Open AlterTable.java. (The file is located in the AlterTable project folder).
  7. 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.
  8. Open the Output window and confirm that you see the CUSTOMER_ORDER_TABLE altered message.
  9. Figure 14-9 Altered Table Message


    Altered Table Message

  10. Right-click the ElectronicsDB folder, located in the DataServices project folder.
  11. Select Update Source Metadata. The Metadata Update Targets wizard opens, displaying a list of all new columns.
  12. Figure 14-10 Physical Data Sources


    Physical Data Sources

  13. Click Next. The Metadata Update Preview dialog box opens, which provides details on the data to be synchronized.
  14. Figure 14-11 Synchronization Preview


    Synchronization Preview

  15. Click Finish.
  16. Open CUSTOMER_ORDER.ds in Source View. The file is located in the ElectronicsDB.
  17. 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).
  18. Scroll down until you locate the following code, which represents the customized metadata that you define in Exercise 14.1 Defining Customized Metadata for a Logical Data Service:
  19. <field type="xs:string" xpath="OWNER">
      <extension nativeFractionalDigits="0" nativeSize="50" nativeTypeCode="12" nativeType="VARCHAR" nativeXpath="OWNER"/>
      <properties nullable="true"/>
    </field>
    Figure 14-12 Source View of Updated Metadata


    Source View of Updated Metadata

  20. Select the Design View tab, and verify that an Owner element exists in the XML type for the CUSTOMER_ORDER data service.
  21. Figure 14-13 Design View


    Design View

  22. Right-click the CUSTOMER_ORDER Data Service header and select Display Native Type. Confirm that there is a new element, called OWNER VARCHAR(50).

 


Lesson Summary

In this lesson, you learned how to:


  Back to Top       Previous  Next