Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

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.
  • Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    @ThingsExpo Stories
    With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
    Amazon is pursuing new markets and disrupting industries at an incredible pace. Almost every industry seems to be in its crosshairs. Companies and industries that once thought they were safe are now worried about being “Amazoned.”. The new watch word should be “Be afraid. Be very afraid.” In his session 21st Cloud Expo, Chris Kocher, a co-founder of Grey Heron, will address questions such as: What new areas is Amazon disrupting? How are they doing this? Where are they likely to go? What are th...
    SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
    In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, will lead you through the exciting evolution of the cloud. He'll look at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering ...
    Digital transformation is changing the face of business. The IDC predicts that enterprises will commit to a massive new scale of digital transformation, to stake out leadership positions in the "digital transformation economy." Accordingly, attendees at the upcoming Cloud Expo | @ThingsExpo at the Santa Clara Convention Center in Santa Clara, CA, Oct 31-Nov 2, will find fresh new content in a new track called Enterprise Cloud & Digital Transformation.
    SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp emp...
    Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
    Most technology leaders, contemporary and from the hardware era, are reshaping their businesses to do software. They hope to capture value from emerging technologies such as IoT, SDN, and AI. Ultimately, irrespective of the vertical, it is about deriving value from independent software applications participating in an ecosystem as one comprehensive solution. In his session at @ThingsExpo, Kausik Sridhar, founder and CTO of Pulzze Systems, will discuss how given the magnitude of today's applicati...
    As popularity of the smart home is growing and continues to go mainstream, technological factors play a greater role. The IoT protocol houses the interoperability battery consumption, security, and configuration of a smart home device, and it can be difficult for companies to choose the right kind for their product. For both DIY and professionally installed smart homes, developers need to consider each of these elements for their product to be successful in the market and current smart homes.
    SYS-CON Events announced today that Avere Systems, a leading provider of enterprise storage for the hybrid cloud, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere delivers a more modern architectural approach to storage that doesn't require the overprovisioning of storage capacity to achieve performance, overspending on expensive storage media for inactive data or the overbui...
    Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
    SYS-CON Events announced today that Avere Systems, a leading provider of hybrid cloud enablement solutions, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere Systems was created by file systems experts determined to reinvent storage by changing the way enterprises thought about and bought storage resources. With decades of experience behind the company’s founders, Avere got its ...
    High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, will discuss how by using...
    In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...
    SYS-CON Events announced today that CAST Software will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CAST was founded more than 25 years ago to make the invisible visible. Built around the idea that even the best analytics on the market still leave blind spots for technical teams looking to deliver better software and prevent outages, CAST provides the software intelligence that matter ...
    SYS-CON Events announced today that Daiya Industry will exhibit at the Japanese Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ruby Development Inc. builds new services in short period of time and provides a continuous support of those services based on Ruby on Rails. For more information, please visit https://github.com/RubyDevInc.
    As businesses evolve, they need technology that is simple to help them succeed today and flexible enough to help them build for tomorrow. Chrome is fit for the workplace of the future — providing a secure, consistent user experience across a range of devices that can be used anywhere. In her session at 21st Cloud Expo, Vidya Nagarajan, a Senior Product Manager at Google, will take a look at various options as to how ChromeOS can be leveraged to interact with people on the devices, and formats th...
    SYS-CON Events announced today that Yuasa System will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Yuasa System is introducing a multi-purpose endurance testing system for flexible displays, OLED devices, flexible substrates, flat cables, and films in smartphones, wearables, automobiles, and healthcare.
    SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
    Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities – ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups. As a result, many firms employ new business models that place enormous impor...