Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


Keep Your Data Flowing
Keep Your Data Flowing

Providing a first-class online user experience can require access to multiple sources of data.

The required data often resides in multiple databases, packaged applications, and other information silos. Accessing and relating such data is a key challenge facing modern enterprises. The IT world knows this problem as the enterprise information integration (EII) problem: enterprise applications need to be able to easily access and combine information about a given business entity from a distributed and highly varied collection of information sources. To meet this need, BEA offers Liquid Data for WebLogic.

Liquid Data provides unified access to data in relational databases, Web services, packaged applications (through J2EE CA adapters and application views), XML files, XML messages, and, through a custom function mechanism, most any other data source as well. It provides default XML views of all of the enterprise data sources, and includes an XQuery-based graphical view-and-query editing tool for integrating and enhancing information drawn from one or more of the data sources. It includes a distributed XML query processor and provides advanced features such as query result caching and data source-level and stored query-level access control.

A general overview of BEA Liquid Data for WebLogic appeared in WLDJ (Vol. 2, issue 4) earlier this year. Related articles (XML-Journal, Vol. 2, issues 6 and 7) described Liquid Data's overall approach to enterprise information integration, namely the use of XQuery and related XML standards to define and query XML views of disparate data sources. This article highlights the key new features of Liquid Data for WebLogic 8.1.

Liquid Data 8.1
The main theme for the BEA Liquid Data for WebLogic 8.1 release is seamless interoperability with the rest of BEA WebLogic Platform 8.1 for application developers. Within this theme, three areas of interoperability with other WebLogic Platform components were key focal points:
1.  Making it easy for portal developers to consume results from Liquid Data queries
2.  Making Liquid Data easy to use as an enterprise data access layer in Web services
3.  Making Liquid Data easy to use for data enrichment and augmentation in integration projects

A major theme for the WebLogic Platform 8.1 release is the provision of a unified integrated development environment, the BEA WebLogic Workshop IDE, where developers can create entire applications that include portals, Web services, and integration components. The WebLogic Workshop IDE programming model is based on the notion of Java controls - simple components with a visual representation in the design view that have methods, events, and properties - and the generation and use of annotated Java code that enables developers to declaratively specify desired behaviors instead of writing complex J2EE infrastructure code. Java controls provide simplified access to J2EE resources such as JDBC data sources, JMS queues, EJBs, or Web services. Application developers can also create new controls to encapsulate business logic in a reusable package that other application developers can then use. Liquid Data for WebLogic 8.1 provides a Liquid Data control that makes it easy for WebLogic Workshop applications to use Liquid Data queries.

In addition to providing the new Liquid Data control, Liquid Data now includes support for accessing delimited files and "in-flight" XML fragments in queries. And, it provides a means to utilize SQL stored procedures and vendor-specific SQL extensions in developing queries and views. Improvement-wise, this release includes important enhancements in the area of query builder UI usability.

In the remainder of this article we'll build a distributed query using Data View Builder (Liquid Data's query builder UI) and then create a Liquid Data control to encapsulate the query in the WebLogic Workshop IDE. After creating this control, we'll demonstrate how easy it is to create portals, page flows, Web services, and workflows that use this control. At the end of this article we'll look at some of the other features and improvements mentioned above.

Liquid Data Java Control
The BEA Liquid Data for WebLogic Java control allows application developers to develop applications in the BEA WebLogic Workshop IDE that can easily consume Liquid Data queries. When creating an instance of the control using the Liquid Data control design environment, application developers can browse the Liquid Data server repository and select one or more stored queries. The selected queries then become available as methods on the control. In addition, the control also provides a way for applications to directly issue ad hoc queries against the Liquid Data server. In both cases, the query results are returned to the application using WebLogic Workshop's XMLBeans technology. For each method, the return type is an XMLBeans instance that the Liquid Data control design environment auto-generates based on the query's XML Schema result type.

For those of you who haven't encountered XMLBeans before, it's a new XML-Java binding technology from BEA that uses XML Schema as a basis for generating Java classes that provide convenient, typed access to XML instance data in Java programs. XMLBeans was designed to support both type-safe Java access to XML instance data as well as full access to the underlying XML data itself, combining the best features of low-level APIs like SAX and DOM (which provide full access) with the convenience of Java binding. Its generated type-safe Java classes provide schema-constrained read/write access to the underlying XML data, while full access to the data is provided via an efficient cursor-based interface. The XML cursor defines a location in the underlying XML data where a program can perform actions (e.g., set or get values, insert or remove pieces of XML, copy chunks of XML to other parts of the document) on the selected XML data. By delivering its query results via XMLBeans, the Liquid Data control makes it easy for a WebLogic Workshop application developer to create page flows, portals, Web services, and workflows that use XML query results obtained through calls to a Liquid Data control.

An Example Application Scenario
Avitek is an online electronics retailer that wants to build and deploy a new customer self-service application. The goal is to reduce call center expenses by adding customer self-service capabilities to the Avitek Web site. Once a customer logs in, he or she should be able to view their profile information and check their order information. To build this customer self-service portal for Avitek, we'll start by developing a CustomerOrder query to retrieve the customer profile and order information for a given online customer.

To keep the example simple, suppose that there are two data sources containing data relevant to the customer self-service portal:

  • RTL-Customer: A relational database that contains the customer profile information
  • ElectOrderService: A Web service fronting a packaged order management application that contains the electronics order information for Avitek's customers

    Graphical Customer Order Query
    Figure 1 shows how the BEA Liquid Data for WebLogic 8.1 query builder tool, Data View Builder (DVB), can be used to graphically construct the query that assembles all the information needed for Avitek's customer self-service information page. The shape of the query result is determined by its target schema (shown on the right); the target schema contains a top-level element called CustProfile. CustProfile has a child element, Customer, that has basic profile information such as Customer_ID, First_Name, Last_Name, Email_Address. The Customer element itself has a child element Customer_Order that contains summary information for any/all orders for a given customer. The customer profile information for the query comes from the Customer table in the relational data source RTL-Customer. The order information for a given customer results from calling the Web service method ElectOrderService.getOrderSummary(). This Web service call takes custid as a single input parameter that comes from the Customer_ID column of the Customer table. The query is designed to be a parameterized query that takes a customer id as input and returns the profile and order information for the indicated customer.

    Customer Order XQuery Source
    Listing 1 shows the detailed structure of the XQuery generated by Liquid Data for WebLogic 8.1 as a result of Figure 1's mappings. The topmost FOR clause in the XQuery binds a variable to each Avitek customer who satisfies the query's outer WHERE predicate, which only keeps those customers whose customer ID matches the given query parameter. The outermost RETURN clause specifies the query's output, which consists of customer data from the RTL-Customer database plus the result of a nested query. The nested query pulls order data from the Electronics Order Web Service. The nested query's WHERE clause ensures that only orders for the customer of interest are queried, and the inner RETURN clause retrieves the desired order information. Listing 2 shows a sample of this query's output.

    Now that we have designed and tested the query successfully, we are ready to deploy the query and its associated target schema to the Liquid Data server as a stored query. Deploying a stored query directly from DVB is a new capability in Liquid Data 8.1. Once deployed, the query becomes immediately available for use by applications using the Liquid Data control in the WebLogic Workshop IDE, so we are now ready to create a Liquid Data Java control.

    Creating a Liquid Data Control
    Having deployed the Avitek customer order query using DVB, we are now ready to launch the BEA WebLogic Workshop IDE and start creating the desired application using the Liquid Data for WebLogic 8.1 control. To create an instance of a Liquid Data control, we will begin by creating a new default application in WebLogic Workshop and creating a folder called orders within it. We will then create a new control by selecting Liquid Data from the controls selection presented to us when we ask WebLogic Workshop to create a new Java control. Having done this, clicking on the next button will take us to a second screen that asks us to choose between a local and a remote Liquid Data server. Liquid Data supports two deployment scenarios. It can either be colocated in the same server as the final application, or it can be on a remote. In this example we will select the local option and click Create. This will take us to a third screen in the Liquid Data control creation process, which allows us to browse the deployed stored queries in the repository of the Liquid Data server. At this point we can select one or more queries to become methods when we create the Liquid Data control. Figure 2 shows the dialog for choosing among a set of available Liquid Data queries.

    We can now select the query crm.CustOrder and press the Finish button; the Java source code for defining the desired Liquid Data control instance will be created as the file CustOrder.jcx. As alluded to earlier, creating this control also auto-generates the XMLBeans classes related to the target schema associated with the query. These XMLBeans classes provide typed accessor methods for traversing the XML data returned by the query. Listing 3 shows the contents of the Liquid Data control JCX file. Given that we selected just our one query when creating the control, this file defines just one method, one that corresponds to the query that we selected. The name of the method defaults to the name of the query, although developers have the option of changing the method name. Note that this method, CustomerOrder(), takes one parameter, Customer ID (the input parameter for the stored query CustomerOrder), and returns a result of type CustOrderDocument (the root document type for the collection of XMLBeans classes generated from the query's target XML schema). The method annotations in the JCX file include the name of the stored query and a copy of its XML schema.

    Once this Liquid Data Java control instance has been created, it can be used in developing WebLogic Workshop applications such as page flows, portals, Web services, and workflows.

    Creating Web Applications
    BEA WebLogic Workshop 8.1 provides tools for developing Web applications using JavaServer Pages (JSPs) and page flows, separating presentation, business logic, and navigational control logic to help minimize application complexity. Page flows in WebLogic Workshop allow developers to separate their user interface code for a Web application from their navigational control logic and their other business logic (which may include data aggregation code). User interface code is placed where it belongs, in JSP files. Navigational control logic is implemented separately (but easily) in the page flow's controller file (which is a special Java file that uses a JPF file extension). Data aggregation logic can be implemented in a Liquid Data control. In this section we will walk through the process of creating a Web application that uses our Liquid Data control for data aggregation and page flows for data presentation.

    Given a Liquid Data control, right-clicking on the control's JCX file causes WebLogic Workshop to prompt for one of two options: generate page flow or generate test JWS (Java Web service) file. If we select the option to generate a page flow, WebLogic Workshop will launch its page flow-generation wizard to guide us through the creation of a page flow based on our Liquid Data control. The default page flow that it generates includes JSPs that allow users to enter values for the input parameters for the control's methods and then to invoke the methods. The generated JSPs don't take care of result formatting, however; they simply display the returned results in XML string format. In this example, we want fancier formatting - we would like our result page to have a header to show the Customer profile data along with a table listing all the order information for the given customer.

    To format the query's XML results as desired in the JSP result page, we will need to declare a public variable of type Customer in the page flow so that it will be accessible in the WebLogic Workshop page flow properties data palette. After declaring this variable and assigning the results of the query to it in the source code, we need to create a table for formatting header information. In the header block we'll simply create a table with two columns and four rows. The first column will have the labels for the Customer information and the second column will have the actual values. These values can be dragged and dropped into the table from the Customer object in the properties data palette. As shown in Figure 3, for the Order Information table we will need to drag-and-drop the CustomerOrderArray element from the Customer object in the properties data palette. As we drop the CustomerOrderArray onto the JSP, a RepeaterWizard will pop up and walk us through the creation of the orders table. The RepeaterWizard will provide us with choices, including the selection of what fields we want to display and the formatting style to be used. At this point we have completed the formatting of our JSP pages and are ready to test our application. Figure 4 shows the output of running the resulting Web application. It shows the results formatted with a header block containing the customer profile information and a detail block containing all of the orders related to the customer. It is interesting to note how little actual coding was required to create the desired customer self-service application.

    Once we've created a Liquid Data control, it's just as easy to create a portal, a Web service, or a workflow that incorporates it. The paradigm for consuming Liquid Data queries in any other WebLogic Workshop project is the same as what we've shown for creating Web applications.

    Other Notable Liquid Data Features
    In addition to the Liquid Data control, which is the central new feature in Liquid Data for WebLogic 8.1, this release added several new ways for XML data to enter the Liquid Data world and improved on manageability and performance in several key areas.

    Delimited Files
    Liquid Data 1.0 supported only XML files when it came to file data sources. BEA Liquid Data for WebLogic 8.1 adds support for delimited files, which are text files that contain a predefined character as a data separator. Delimited files are typically exported from a database, a spreadsheet, or another application like a spreadsheet. It's now possible to create delimited file data sources in Liquid Data for use in queries. Such data sources have associated (partially implied) XML schemas and they make it possible to combine delimited file data with any other Liquid Data data source(s) by creating queries that use the delimited file data source.

    Complex Parameter Types
    Complex parameter types (CPTs) are another addition. Essentially, CPTs make it possible to use XML data as an input parameter to a Liquid Data query. CPTs make it possible to define an XML data stream of an arbitrary (XML Schema) type and then pass XML data of that type as input to a query. A typical CPT use case might be a workflow that receives an XML message and needs to enrich the message with information culled from a collection of back-end heterogeneous data sources.

    SQL Calls as Data Sources
    BEA Liquid Data for WebLogic 8.1 also includes support for using SQL stored procedures and SQL queries as parameterized data sources for use in Liquid Data queries and views. To use a stored procedure or a SQL query as a data source in Liquid Data, one creates a SQL Call Description File (SCDF). The SCDF is an XML file that defines the types and the functions for a set of SQL stored procedures and/or SQL queries. These SQL calls then become available for use in building queries in the Data View Builder just like any other data source.

    Summary
    In this article, we looked at how BEA Liquid Data for WebLogic 8.1 makes it easy to develop applications - including Web applications, portals, Web services, and workflows - that require access to data from multiple heterogeneous sources. You can try developing applications using BEA Liquid Data for WebLogic 8.1 yourself by downloading it from http://commerce.bea.com/index.jsp.

    References

  • Carey, M.; and Mangtani, N. "Liquid Data: XQuery-Based Enterprise Information Integration." BEA WebLogic Developer's Journal, Vol. 2, issue 4, April 2003.
  • Carey, M.; Florescu, D; and Mangtani, N. "Integrating Enterprise Information on Demand with XQuery." XML-Journal, Vol. 2, issues 6 and 7.
  • BEA Liquid Data 8.1 Documentation: http://edocs/liquiddata/docs81/index.html
  • XMLBeans: An Easy Way to use XML in Java: http://dev2dev.bea.com/technologies/xmlbeans/overview.jsp.
  • In order to post a comment you need to be registered and logged in.

    Register | Sign-in

    Reader Feedback: Page 1 of 1

    Enterprise Open Source Magazine Latest Stories . . .
    Apache Deltacloud, the Red Hat-contributed ReSTful API that abstracts differences between clouds so services on any cloud can be managed – provided of course there’s a driver – has graduated from the Apache Foundation’s incubator and is now a full-fledged Top-Level Project (TLP). The...
    With Cloud Expo 2012 New York (10th Cloud Expo) just four months away, what better time to start introducing you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the conference... We have technical and st...
    AMD said late Tuesday that its chief sales officer Emilio Ghilardi had left the company and that CEO and president Rory Read is going to do his job while a replacement is sought. AMD didn’t say why Ghilardi left but it’s assumed Read wants his own people. Read is relatively new to th...
    During the lifespan of M3 (Monitis Monitor Manager) there has always been something lacking – timers. M3 execution procedure was outlined in this previous article. The execution mentioned in the latter was a one-time-execution, whereas server monitoring requires periodic invocati...
    Red Hat is putting its bought-in Gluster scale-out NAS storage technology, acquired in October, on the Amazon cloud. It’s styled Red Hat Virtual Storage Appliance for Amazon Web Services and other clouds are supposed to follow in short order.
    A new episode of the screencast series is now available at the OpenNebula YouTube Channel. This screencast demonstrates the new easily-customizable self-service portal for cloud consumers. Its aim is to offer a simplified access to shared infrastructure for non-IT end users. The scree...
    Subscribe to the World's Most Powerful Newsletters
    Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
    Click to Add our RSS Feeds to the Service of Your Choice:
    Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
    myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
    Publish Your Article! Please send it to editorial(at)sys-con.com!

    Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


    SYS-CON Featured Whitepapers
    ADS BY GOOGLE