YOUR FEEDBACK
Gregor Rosenauer wrote: well, not what's your take on this? Did I miss a second page of this article or...
AJAXWorld RIA Conference
Early Bird Savings Expire Friday Register Today and SAVE !..

2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts

SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


Data Views in Liquid Data
Data Views in Liquid Data

BEA Liquid Data for WebLogic provides a unified view of data aggregated from multiple resources such as databases, XML files, Web services, EJBs, or Java 2 Connector Architecture (J2CA) adapters. At a very high level, Liquid Data can be thought of as an enterprise-wide JOIN tool that provides an XML view of data from any source. This data can be accessed using evolving technologies such as XQuery.

Liquid Data provides several different mechanisms through which Data Views in Liquid Data can be leveraged by the rest of the BEA Platform. In this article I'll introduce several ways of accessing Data Views outside of the Liquid Data for WebLogic Data View Builder itself.

Quick Introduction to Data Views
Data Views are rich data sources built using XQuery technologies to aggregate data from discrete sources using a single query. BEA Liquid Data for WebLogic provides a rich graphical interface, called the Data View Builder, through which users can set up the data sources they need to access, set up security and authentication information, and then define various queries that they need to execute. The Data View Builder allows users to define XML Schemas for the individual data sources or the resulting data that they get from the execution of the query.

Data Views can aggregate data from various sources such as relational databases (using standard SQL or stored procedures), XML, or delimited files stored in a file system; Web services; and legacy EIS. Using the Data View Builder, one or more of these sources' schemas are aggregated to form the target schema. Users can define JOIN conditions, and other data aggregation or selection logic that you are used to doing while accessing relational data using SQL. Users also have the ability to design custom functions to access data in different way.

This article assumes that you have already created some Data Views. I'll focus on the various mechanisms available to access them.

Accessing Data Views
Data Views in Liquid Data are available through various access mechanisms to the rest of the BEA Platform. Any Java program with the appropriate security credentials, and that can access the Java Naming and Directory Interface (JNDI), can issue queries against a Liquid Data server. The different types of Java programs include:

  • Stand-alone Java applications
  • Java servlets
  • JavaServer Pages (JSPs)
  • JavaBeans
  • Enterprise JavaBeans (EJBs)
  • Web services
  • Business process management (BPM) components or workflows in BEA WebLogic Integration
  • Portlets in BEA WebLogic Portal
Access to Data Views Through EJB Clients
A stateless session EJB exposes the query API, which delegates queries through a query processor to the underlying data stores. Any Java program that can access EJBs can use this EJB-based API. Stand-alone Java applications, Javabeans, and other EJBs all use this API, and collectively are called EJB clients. These programs can use the EJB remote or local interfaces directly.

EJB clients are any applications that invoke queries on the Liquid Data server using the Liquid Data EJB API. All Java clients can leverage the flexibility and data integration properties offered by XQuery to meet their data access needs. All of these clients access the EJB remote interfaces directly; therefore, they can be collectively characterized as EJB clients. The Data View builder that is part of the core Liquid Data product is a special kind of EJB client.

The four basic steps to access Data Views through this mechanism are:

  • Connect and authenticate with a Liquid Data server
    JNDI is used to look up the EJBs and standard EJB calls are used to connect to a Liquid Data server. Once connected, queries can be executed anonymously or through authentication itself by passing a security context to the corresponding JNDI environment properties SECURITY_PRINCIPAL and SECURITY_CREDENTIALS.

  • Specify parameters for the search query
    In most cases users would want to execute queries based on certain conditions. XQuery-based parameters are used to pass search conditions to a Liquid Data server. The following code snippet is an excerpt of how to pass search parameters to a data view.

    import com.bea.ldi.server.common.QueryParameters;
    ...
    QueryParameters qp = new QueryParameters();
    qp.setString("title", "WebLogic Developers Journal");

  • Execute the query on the Liquid Data server There are different mechanisms to execute the query based on the type of query being executed. If an ad hoc query is being executed you would use

    execute (queryString, [qp]) command

    If the query is a stored, named query, you would use

    executeStored (queryName, [qp]) command

    The "qp" parameter is optional based on whether you are passing query parameters.

  • Receive and process the results to the query
    When the query is executed, the Liquid Data server returns an unformatted XML string. You can use the toXML() or getDocument() methods to receive an XML or DOM format with the results of the query.

    Access to Data Views Through JSP
    Liquid Data for WebLogic provides a set of tag libraries that can be used by a JSP to access Data Views. The basic tags provided are a "query" tag and a "param" tag.

    The "query" tag is used to connect to a Liquid Data server and execute a query. It takes the name of the query, the connection to the server, and the username and password needed to authenticate with the server

    The "param" tag is used to pass parameters for the query using name/value pairs. Listing 1 shows some sample code on how to use the "query" and "param" tags.

    You can use these tag libraries to execute both ad hoc and stored queries. The resulting XML can be displayed on the JSP using XLST translations. WebLogic server comes with an XSLT JSP Tag Library that can be used for an XSL transformation. Alternatively, you could use a third-party or open source library for this functionality.

    Access to Data Views Through Web Services
    A stored query in Liquid Data can be exposed as a Web service through the Liquid Data administration console. The URL of the WSDL of a generated Web service has the following pattern:

    http://host:port/liquiddata/query_name/webservice?WSDL

    Once you have exposed a Liquid Data query as a Web service, you would use standard Web services mechanisms to look up the WSDL and execute the Web service.

    BEA Liquid Data for WebLogic 8.1 also provides a control in WebLogic Workshop that can be used to invoke this query. WebLogic Workshop can also be used to test the Liquid Data Web service-based query.

    Access to Data Views Through WebLogic Integration BPM Components
    BPM components in WebLogic Integration would typically use the stateless session EJB API discussed above to access Liquid Data queries. A business operation in WebLogic Integration would define the JNDI name of the Query EJB to be invoked (com.bea.ldi.server.QueryHome) and the method to invoke on the EJB.

    Liquid Data helps BEA WebLogic Integration integrate data from various relational, non-relational, and Web sources. The Liquid Data views are read-only. WebLogic Integration components such as workflows are used to initiate two-way transactions from the rich set of data that is provided using the Data Views in BEA Liquid Data for WebLogic.

    Access to Data Views Through Portlets
    Portlets and other components in BEA WebLogic Portal can use all the different mechanisms discussed to access Liquid Data queries. Portlets could use Web services or the JSP tag libraries. Other Portal components could use the EJB APIs.

    Liquid Data thus becomes a rich data feed and WebLogic Portal becomes the layer that handles the presentation of this rich data.

    Summary
    This article has briefly introduced the several ways to leverage Data Views in BEA Liquid Data for WebLogic outside of Liquid Data itself. Basically, any piece of Java code that can access an EJB or a Web service can execute queries on a Liquid Data server. Even JSP-based applications can leverage Liquid Data queries directly, without having to go through an EJB tier.

    References

  • E-Docs for Liquid Data 1.1: http://e-docs.bea.com/liquiddata/docs11
    About Kunal Mittal
    Kunal Mittal is a consultant for implementation and strategy for Web services and services-oriented architectures. He has co-authored and contributed to several books on Java, WebLogic and Web services.

  • BEA WEBLOGIC LATEST STORIES
    Since its emergence, Web Service technology has gone a long way towards perfecting itself and finding its right application in the real world. With the maturity of the specifications, Web Service technology, with its power of interoperability, is now the major enabling technology of SO...
    Join Scott Guthrie as he discusses Microsoft’s commitment to web standards development, Rich Internet Applications and how Microsoft is contributing to help move the web forward. Join Adobe’s Kevin Lynch as he demonstrates how Flash and HTML come together to make the most engaging,...
    Virtualization has become a critical part of Enterprise IT strategy. Why and how has it become one of the most important change agents in our industry? To answer these questions I had the good fortune recently to be able to speak to a select group of top IT industry executives who join...
    Watching VMware stock and its market cap spike since it IPO'd must have had Red Hat positively pea green with envyWatching VMware stock and its market cap spike since it IPO'd must have had Red Hat positively pea green with envy - so green in fact that it's gonna try taking VMware on b...
    A standard from OASIS called Web Services for Remote Portlets (WSRP) is used so portlets can be decoupled from a portal. In part one (JDJ, Volume. 13, issue 3) of this article, we introduced the relevant standards and specifications and then demonstrated WSRP's capabilities by consumin...
    SYS-CON's upcoming '3rd International Virtualization Conference & Expo' faculty includes such distinguished speakers as: Al Aghili (Managed Methods), Alan Chhabra (Egenera), Andi Mann (Enterprise Management Associates), Andrew Conte (APC), Andy Astor (EnterpriseDB), Ariel Cohen (Xsigo ...
    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
    BREAKING NEWS FROM THE WIRES

    Autodesk, Inc. (NASDAQ:ADSK) today announced that its Autodesk LocationLogic platfo...