`
`
`
`
`
`Merrill Communications LLC
`d/b/a Merrill Corporation
`Exhibit 1006 pt. 2
`
`
`
`le lasttenred ital
`
`AMM orcadyee Ce easteobaresaceasta
`real-time interactive application, so the Microsoft
`Web Applications Teambuiltarealistic Auction Demo
`to show how simply one can be implemented as an
`XML three-tier Web application. This chapteris
`sponsored by Microsoft Corporation,
`, and wasprepared by Charles
`
`4h he Auction Demo is a three-tier Web application that simu-
`
`lates an online auction using technologies thatare available in
`Internet Explorer 4.0 (1E 4.0). It allows you to view the items
`available for auction, place bids on those items, and monitor the bids
`placed by fellow bidders.
`the Auction Demo has data
`Like otherthree-tier Web applications,
`-sources on the backend, a user interface on theclient, and a Webserverin
`the middle. We'll see how it was developed,using just three permanent Web
`pages:
`
`userInterface.htm
`This page uses Dynamic HTML (DHTML) to allow the Web
`browser to present the auction informationto the user, It contains
`scripts that collect or update data on the middle tier by requesting
`Active Server Pages (ASP).
`
`auction.asp
`This page is an ASP file. When userInterface.htm requests this
`page,
`the scripts in it are executed on theserver. The scripts
`
`©1998 THE XML HANDBOOK™
`
`79
`
`
`
`
`
`CHAPTER 6 |
`
`BUILDING AN ONLINE AUCTION WEBSITE
`
`generate auction.xml, an XML documentthat containsthelatest
`auction data, which is delivered to theclient.
`
`makebid.asp
`This page is requested by userInterface.htm when the user wants
`to makea bid.It is executed on the middle tier, causing the data
`source to be updated with the new bid information.
`
`The user interface (UI) for the Auction Demo is shown in Figure 6-1. It is
`the rendition of the userInterface.htm Dynamic HTML page, which is
`downloadedto the client when the user clicks on a link to the auction.
`
`That page has scripts within it that handle all the client-side activity.
`That includes requesting data from the middle tier in order to display the
`most current values of the items and bids. We'll see later how the UI page
`doesits thing, but first let’s look at how the middle tier collects and trans-
`mits the data. It does so by packaging the data as XML documents.
`
`6.1 | Getting data from the middle tier
`
`The role of the middle tier in a Web application is to gather information
`from data sources and deliver it in a consistent mannerto clients. In the
`Auction Demo westart with a single data source, an ODBC-compliant
`database. (Later we'll see how multiple data sources of different kinds can
`be accessed.)
`
`The “Auction” database used for the Auction Demo is a relational data-
`base with two tables, an “Item” table and a “Bids” table. The “Item” table
`contains data about each of the items up for auction.It is shown in Figure
`6-2.
`
`For the sake ofclarity, we'll just cover the “Item” table in this chapter(the
`“Bids” are handled similarly). You can see the full demo at http: //
`www.microsoft.com/xml. We want to deliver the data in that table in the
`form of an XML document,so the client’s user interface page won't have to
`know anything aboutthe actual data source.
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`GETTING DATA
`
`FROM THE MIDDLE TIER
`
`81
`
`a a)
`Yajannets|Fullscreen
`
`Geach Ch Favorites Histay
`
`
`
`CACts)aMeteel
`Vase and Stones
`$3300
`Still Life / Onions
`$3200
`
`| Linda Mann
`VASE AND STONES
`peatACencereeeeea
`
`Wee
`
`CRETE
`Cort ie
`$3700
`$2800 Bidder
`$2600 (enter name)
`=;nd George
`$
`Ringo
`Paul
`
`opening price
`CPUBGs
`
`K ACTIVITY B
`
`Tine
`
`ED)
`Ce va
`10:47 AM
`Teeter YG
`POPa
`
`Oil, 1996, 20x30 inches B
`
`
` [| ig treadtiiretsine
`Zi
`T
`ro
`Aieaots |[ByAvetian Waline | 1057aM)
`|utisiant) |SAD | siretnaGadealintiation | CARESnelOAL) SIFU ONLPaidCams|
`Figure 6-1 The Auction Demouserinterface.
`
` a
`
`
`
`
`
`Materials | Year
`Dimensions
`Artist
`Title
`
`
`|20x30 inches|Oil
`Vase and Stones—| Linda Mann
`
`
`| 20x30 inches| Oil
`Still Life / Onions
`| Linda Mann
`
`
`sandstone
`‘Linda Mann
`(20x30 inches|Oil
`
`
`(20x30 inches | Oil
`Jewelry Box
`Linda Mann
`
`
`20x30 inches | Oil
`Personal Objects
`| Linda Mann
`
`
`20x30 inches | Gil
`Still Life / Sweets—| Linda Mann
`Bread and Apples
`| Linda Mann
`'20x30 inches | Oil
`
`
`(20x30 inches | Oil
`Rabbits
`[Linda Mann
`
`
`20x30 inches | Oil
`Risotta
`‘Linda Manin
`Figure 6-2 The Auction Demo item table.
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`CHAPTER 6 | BUILDING AN ONLINE AUCTION WEBSITE
`6.1.1 Defining the XML documentstructure
`Thekey to creating useful XML documentsis the proper structuring of the
`data. For the Auction Demo,that meansdeciding howarecordin the “Item”
`table will be represented as an ITEM element in XML. Thereis a straight-
`forward mapping, shownin the following data-less element:
`
`Example 6-1. Template for an ITEM element.
`<ITEM>
`<TITLE></TITLE>
`<ARTIST></ARTIST>
`<DIMENSIONS></DIMENSIONS>
`<MATERIALS></MATERIALS>
`<YEAR></YEAR>
`</ITEM>
`
`For each field in the “Item”table, there is a corresponding subelement of
`the ITEM element.
`To generate XML documents with these ITEM elements, the Auction
`Demouses ASPfiles.
`
`6.1.2 Using ASPfiles to generate XML
`documents
`
`XMLcan be generated on the middle tier using Active Server Pages. ASP
`offers an environmentin which Web authors can create documents dynam-
`ically by intermixing markup languages with in-line scripts. The scripts can
`be written in a variety of scripting languages,
`including JScript and
`VBScript, and can invoke server-side components to access databases, exe-
`cute applications, and process information.
`When a browser requests an ASPfile,it is first processed by the server,
`which delivers a generated Web page containing standard markup.
`In an ASPfile, commands andscripts are delimited by “<%” and “%>”.
`Everything notso delimited is markup or data thatwill appear in the gener-
`ated page. For example, consider the followingtrivial ASP file:
`Thefile, after establishing that the scripting language is VBScript, creates
`the variable “Total” with the value “2”. The following line generates an
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`6.1 | GETTING DATA FROM THE MIDDLE TIER
`
`83
`
`Example 6-2. Sample ASP file.
`<%@ LANGUAGE = VBScript%>
`<%DIM Total = 2%>
`<AMOUNT><%=Total%></AMOUNT>
`
`XML “AMOUNT”element whose contentis generated by executing the
`small script, which in this case retrieves the value of “Total”.
`When the browser requeststhis file, it will actually receive the XML doc-
`umentthat is generated from thefile, as shownin Example 6-3:
`
`Example 6-3. XML documentgenerated by sample ASP file.
`<AMOUNT>2</AMOUNT>
`eeeNN
`
`. %>) does not cause an XML parsing
`.
`Note that the ASP syntax (<% .
`etror, Thatis because the ASPfile is notitself an XML document. The ASP
`file is processed on theserver and only the generated XML documentis
`returnedto theclient.
`In the case of the Auction Demo,thefile auction.asp is used to access the
`“Auction” database and generate XML containing the data within the
`“tem” and “Bids” tables. The ability to generate XML onthe middle tier
`makesit possible to provide the Web application with content that can be
`manipulated ontheclient andrefreshed without having to refresh the entire
`user interface.
`In Example 6-4, auction.asp beginslike the ASPfile in Example 6-2, by
`declaring the scripting language. The next twolines are the XML declara-
`tion andthe start-tag of the root element (AUCTIONBLOCK) ofthe
`XML documentto be generated, which wewill call “auction.xml”,
`
`Example 6-4. Start of auction.asp.
`<%@ LANGUAGE = VBScript %>
`<?XML VERSION="1.0"?>
`<AUCTIONBLOCK>
`a———————
`
`Next, a connection to the “Auction”databaseis established and that con-
`nection is opened:
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`84
`
`CHAPTER 6 | BUILDING AN ONLINE AUCTION WEBSITE
`
`Example 6-5. Connecting to the database.
`<%
`
`Set Conn = Server. CreateObject ("ADODB.Connection")
`Conn.Open "Auction", "Auction", "Auction"
`&>
`ooeeeeeeSsSsSsS—
`
`A “record set” variable (ItemRS) is now established to contain each
`record of the “Item”table asit is accessed, and a “Do While” loop is begun
`to perform the access.
`
`Example 6-6. Preparingto access the “Item” records.
`<%
`
`*
`
`from item")
`
`ItemRS = Conn.Execute("select
`Set
`Do While Not
`ItemRS.EOF
`
`>T
`
`Tees
`
`Next, the template in Example 6-1 is used to create the XML ITEMele-
`mentthatwill be generated. Just as in Example 6-2, a small script is inserted
`as the content of each subelement of ITEM within auction.asp. In this case,
`the script extracts the correspondingfield’s data from therecord set.
`
`Example6-7. Markup and scripts to generate an ITEM element.
`
`<ITEM>
`
`<TITLE><%=ItemRS ("Title") $></TITLE>
`<ARTIST><%=ItemRS ("Artist") %></ARTIST>
`<DIMENSTONS><%=ItemRS ("Dimensions") $></DIMENSIONS>
`<MATERIALS><%=ItemRS ("Materials") $></MATERIALS>
`<YEAR><%=ItemRS ("Year") $></YEAR>
`</ITEM>
`eee
`
`After an ITEM elementis generated, the script moves to the next record
`in the record set. The loop is then repeated. Onceall of the records have
`been run through,the root element is ended.
`The complete auction.aspfile is in Example 6-9.
`Example 6-10 is an abridged version of the XML document
`tion.xml) generated by the auction.aspfile in Example 6-9.
`
`(auc-
`
`©1998 THE XML HAaNDBOOK™
`
`
`
`
`
`6.1 | GETTING DATA FROM THE MIDDLE TIER
`
`85
`
`Example 6-8. Repeating the loop and ending the document.
`<%
`ItemRS .MoveNext
`Loop
`>
`</AUCTIONBLOCK>
`
`Example 6-9. The complete auction.aspfile.
`<%@ LANGUAGE = VBScript %>
`<?XML VERSION="1.0"?>
`<AUCTIONBLOCK>
`<%
`
`Set Conn = Server.CreateObject ("ADODB.Connection")
`Conn.Open "Auction", "Auction", "Auction"
`Set
`ItemRS = Conn.Execute("select *
`from item")
`Do While Not
`ItemRS.EOF
`S>
`
`<ITEM>
`
`<TITLE><%=ItemRS ("Title") $></TITLE>
`<ARTIST><%=ItemRS ("Artist") $></ARTIST>
`<DIMENSTIONS><%=ItemRS ("Dimensions") $></DIMENSIONS>
`<MATERIALS><%=ItemRS ("Materials") %></MATERIALS>
`<YEAR><%=ItemRS ("Year") $></YEAR>
`</ITEM>
`<%
`ItemRS .MoveNext
`Loop
`>
`</AUCTIONBLOCK>
`
`Example 6-10. Abridged auction.xml document generated by auction.asp.
`<?XML VERSION="1.0"?>
`<AUCTIONBLOCK>
`<ITEM>
`<TITLE>Vase and Stones</TITLE>
`<ARTIST>Linda Mann</ARTIST>
`<DIMENSIONS>20 X 30 inches<DIMENSIONS>
`<MATERIALS>01i1</MATERIALS>
`<YEAR>1996</YEAR>
`</ITEM>
`<ITEM>
`
`</ITEM>
`
`</AUCTIONBLOCK>OO
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`86
`
`CHAPTER 6 | BUILDING AN ONLINE AUCTION WEBSITE
`
`6.1.3 Generating XMLfrom multiple
`databases
`
`One powerful reason to generate XML documentson the middletier is that
`they can contain data that is sourced from multiple independent databases.
`The technique is similar to what we've already seen. The only difference is
`that multiple database connections are madeinstead of one.
`The ASPfile in Example 6-11 does just this, generating a single XML
`documentwith data from the databases “Gallery1” and “Gallery2”.
`The XMLgenerated by the ASPfile in Example 6-11 looks structurally
`just like Example 6-10, an AUCTIONBLOCKelement with multiple
`ITEM children. However, the data content originates from two different
`data sources.
`
`Also notice that, for the DIMENSIONS, MATERIALS, and YEARele-
`ments, the source fields in the “Gallery2” database are actually labeled dif-
`ferently from the corresponding fields in “Gallery1.” One benefit of
`consolidating the data on the middletier is that the semantics can be iden-
`tified consistently, and therefore made moreeasily accessible.
`
`6.1.4 Generating XMLfrom both databases
`and XML data sources
`
`The middle tier can source data of different kinds, not just databases. In
`Example 6-11, the ASPfile, as in previous examples,first accesses data from
`“Gallery 1”, an ODBC compliant database. However, it then adds data
`from “Gallery 3”, a source of XML documents.
`The Gallery3 XML document
`is processed by the MSXML parser
`(details below), which allows access to the document’s data content. Note
`that there is no way — and no need — to tell whether Gallery3 is a persistent
`document, or wasgenerated by another middle-tier application.
`Also, look at the YEAR element. Just as with the Gallery2 databasein the
`previous example,
`the original semantic label — in this case the DATE
`generic identifier — is changed on the middle tier to ensure consistency.
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`6.1 | GETTING DATA FROM THE MIDDLE TIER
`
`87
`
`Example 6-11. Generating one XML documentfrom two databases.
`<%@ LANGUAGE = VBScript %>
`<?XML VERSION="1.0"?>
`<AUCTIONBLOCK>
`<%
`‘The connection to the Galleryl data source is made
`Set Conn = Server.CreateObject ("ADODB.Connection")
`Conn. Open "Galleryl","Gallery1","Gallery1"
`Set
`ItemRS = Conn.Execute("select
`*
`from item")
`Do While Not
`ItemRS.EOF
`>
`
`<ITEM>
`<TITLE><%=ItemRS ("Title") %></TITLE>
`<ARTIST><%=ItemRS ("Artist") %></ARTIST>
`<DIMENSIONS><%=ItemRS ("Dimensions") $></DIMENSIONS>
`<MATERIALS><%=ItemRS ("Materials") %></MATERIALS>
`<YEAR><%=ItemRS ("Year") %></YEAR>
`</ITEM>
`<%
`ItemRS.MoveNext
`Loop
`>
`
`<%
`'The connection to the Gallery2 data source is made
`Set Conn = Server.CreateObject ("ADODB.Connection")
`Conn.Open "Gallery2", "Gallery2","Gallery2"
`Set
`ItemRS = Conn.Execute("select *
`from item")
`Do While Not
`ItemRS.EOF
`&>
`
`<ITEM>
`<TITLE><%=ItemRS ("Title") %></TITLE>
`<ARTIST><%=ItemRS ("Artist") %></ARTIST>
`<DIMENSIONS><%=ItemRS ("Size") $></DIMENSIONS>
`<MATERIALS><%=ItemRS ("Medium") $></MATERIALS>
`<YEAR><%=ItemRS ("Date") $></YEAR>
`</ITEM>
`<%
`ItemRS .MoveNext
`Loop
`&>
`</AUCTIONBLOCK>
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`CHAPTER 6 | BUILDING AN ONLINE AUCTION WEBSITE
`
`Example 6-12. Generating one XML document from a database and
`anotherXMLdocument.
`
`<%@ LANGUAGE = VBScript %>
`<?XML VERSION="1.0"?>
`<AUCTIONBLOCK>
`<%
`
`Set Conn = Server.CreateObject ("ADODB.Connection")
`Conn.Open "Galleryl", "Galleryl","Gallery1"
`
`Set
`ItemRS = Conn.Execute("select *
`from item")
`Do While Not
`ItemRS.EOF
`>
`
`<ITEM>
`<TITLE><%=ItemRS ("Title") $></TITLE>
`
`<ARTIST><%=ItemRS ("Artist") %></ARTIST>
`<DIMENSIONS><%=ItemRS ("Dimensions") $></DIMENSIONS>
`<MATERIALS><%=ItemRS ("Materials") %$></MATERIALS>
`<YEAR><%=ItemRS ("Year") %></YEAR>
`</ITEM>
`<%
`ItemRS .MoveNext
`Loop
`>
`
`<%
`
`'Here the connection to the Gallery3 data is made
`Set XML = Server.CreateObject ("msxml")
`XML.URL = "http://datasource3/Gallery3.xml"
`Set Items = XML.root.children
`For I = 0
`to Items.length -
`1
`>
`
`<ITEM>
`
`<TITLE><%=Items.item(I).children.item("TITLE").text%>
`</TITLE>
`<ARTIST><%=Items.item(I).children.item("ARTIST") .text%>
`</ARTIST>
`<DIMENSIONS><%=Items.item(I) .children.item("DIMENSIONS") .text%>
`</DIMENSIONS>
`<MATERIALS><%=Items.item(I).children.item("MATERIALS") .text%>
`</MATERIALS>
`<YEAR><%=Items.item(I).children.item("DATE") .text%>
`</YEAR>
`</ITEM>
`<SNext%3>
`</AUCTIONBLOCK>
`
`|
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`6.2 | BUILDING THE USER INTERFACE
`
`89
`
`6.2 | Building the user interface
`
`The user interfaceis critical to the success of any application. It must allow
`the user to interact with the application in an efficient and straightforward
`manner. Theuser interface for the Auction Demo was built using DHTML.
`DHTMLisa setof features in Jnternet Explorer 4.0 for creating interac-
`tive and visually interesting Web pages. It is based on existing HTMLstan-
`dards and is designed to work well with applications, ActiveX controls, and
`other embeddedobjects.
`With DHTMLa developer can create a robust and efficient UI without
`additional support from applications or embedded controls, or even return
`trips to the server. A Dynamic HTMLpageis self-contained, using styles
`and scripts to process user input and directly manipulate the HTML
`markup and other text within the page.
`Let’s see how userInterface.htm creates the Auction Demointerface by
`using scripts and the JE 4.0 Document Object Model. Two basic techniques
`are employed: proceduralscripts and descriptive binding.
`
`6.2.1 Using proceduralscripts
`
`Internet Explorer 4.0 includes the MSXMLparser, which exposes the parsed
`XML documentas a document object model. Once exposed, scripts can
`access the data content of the XML elements and dynamically insert the
`data into the user interface.
`The userInterface.htm code in Example 6-13 applies MSXML to auc-
`tion.xml, the XML document generated by auction.asp. That creates an
`ActiveX object representing the parsed document.
`
`Example 6-13. Creating the auction documentobject.
`var auction = new ActiveXObject ("msxml") ;
`auction.URL = "http://Webserver/auction.asp";
`
`
`1. The W3Cis currently developing a common documentobject model for
`XMLand HTML.There is a working draft on the CD-ROM. The JE 4.0
`Document Object Model attempts to maintain compliance with the W3C draft
`as it evolves.
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`CHAPTER 6 | BUILDING AN ONLINE AUCTION WEBSITE
`In Example 6-14, the script nextretrieves the root element. It then navi-
`gates thetree until it locates the TITLE elementwithinthe first ITEM ele-
`ment of auction.xml. The innerText property is used to insert the data
`content of TITLE into the user interface as the value of the “item_title”
`attribute, which appears on a DIV element.
`
`Example 6-14. Extracting data from the auction documentobject.
`var root = auction.root;
`var item0 = root.children.item("ITEM", 0)
`var title = item0.children.item("TITLE") .text;
`document.all("item_title") .innerText = title;
`<DIV [TpD="item_title"></DIV>
`eeen
`
`Oneofthe benefits of using procedural scripts to display XML docu-
`ments is that you can manipulate the data content of an XML element
`before you display it. For example, ifyou wanted to display the dimensions
`of each painting using the metric system, rather than feet and inches, your
`script could simply convert the content of the DIMENSIONSelement
`from inches to centimeters.
`
`6.2.2 Using descriptive data binding
`The IE 4.0 XML Data Source Object XML DSO)is a declarative alterna-
`tive to the procedural scripts described in the last section. The XML DSO
`is an applet (see Example 6-15) that enables the data of XML elements to
`be boundas the content of HTMLelements.
`
`Example 6-15. The IE 4.0 XML Data Source Object applet.
`<APPLET ID=auction CODE=com.ms.xml.dso.XMLDSO.class MAYSCRIPT
`WIDTH=0 HEIGHT=0>
`<PARAM NAME="url" VALUE="auction.asp">
`</APPLET>
`$$$
`
`In Example 6-15, the “url” parameter points the XML DSO to auc-
`tion.asp, which causes auction.xml to be generated on the middle tier. A
`persistent XML source could also have been used.
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`6.3 | UPDATING THE DATA SOURCE FROM THE CLIENT
`In Example 6-16, data binding is used to populate the part of the user
`interface that shows the painting and the caption beneathit.
`
`91
`
`Example 6-16. Data binding with the XML DSO.
`
`<TD>
`<DIV STYLE="margin-left:16px;
`margin-top: 16px;margin-right :16px">
`<DIV ID=pict></DIV>
`<DIV CLASS="details">
`<SPAN DATASRC=#auction DATAFLD=MATERIALS></SPAN>,
`<SPAN DATASRC=#auction DATAFLD=YEAR></SPAN>,
`<SPAN DATASRC=#auction DATAFLD=DIMENSIONS></SPAN>
`</DIV>
`</DIV>
`</DIV>
`</TD>
`
`With the XML DSOapplet embedded in the Web page, noscripting is
`required to bind the data content of XMLelements to HTMLelements.
`Instead, the name of the document object (ID of the APPLET in Example
`6-15) is specified as the value of the DATASRCattribute, and the generic
`identifier ofthe XMLelementis specified for the DATAEFLDattribute.
`Oneadvantageofdisplaying XMLwith the XML DSOis that the XML
`documentis processed asynchronously to the rendering of the page. There-
`fore, ifthe inventory of paintings were very large, theinitial elements ofthe
`XML documentcould be displayed even before the last elements were pro-
`cessed.
`
`6.3 | Updating the data source from the
`client
`We have seen how userInterface.htm on the client obtained data to display
`to the user by invoking auction.asp on the middle tier. It can also enable the
`user to make his own bid by invoking another middle tier page, make-
`bid.asp.
`In the Auction Demo, the user bids by overwriting the price and bidder
`namein thefirst row of the bid table. A bid therefore consists of the “title”
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`92
`
`CHAPTER 6 | BUILDING AN ONLINE AUCTION WEBSITE
`
`of the item currently displayed, the “price” of the new bid, and the name of
`the new “bidder”.
`These data items must be passed as parameters to makebid.asp, which
`executes a script to process them and update the database. The script
`returns to the client a “return message” XML document:a single element
`containing information aboutthestatus ofthe processing.
`Thescript in userlnterface.htm (see Example 6-17) begins by assigning
`the title of the current item up for auction to the “title” variable, the value
`of the “price” text box to the “price” variable, and the value of the “bidder”
`text box to the “bidder” variable.
`It then creates the return message document object, which will state
`whether makebid.asp successfully updated the database. The three variables
`are passed as parameters to the ASP file whenitis invoked.
`
`Example 6-17. Sending a new bid to makebid.asp.
`var title = current_item.children.item("TITLE") .text;
`var price = price.value;
`var bidder = bidder.value;
`var returnMsg = new ActiveXObject ("msxml") ;
`returnMsg.URL = "http://auction/makebid.asp?title="_ +
`title + "&price=" + price + "&bidder=" + bidder;eeOOOO
`
`In Example 6-18, makebid.asp (called by userInterface.htm in Example
`6-17) assigns the values of the parameters “title”, “price”, and “bidder” to
`variables with the same names.
`The “BidRS” record set object is then created and a connection to the
`“Auction” database is made. Note that the connection is made for both
`reading and writing. The “Bids”table is then opened and the new informa-
`tion is addedto therecord set, after which the connectionis closed. The
`process is much the sameasit was for auction.asp, except that the database
`is written to instead ofjust being read.
`Finally, makebid.asp generates the return message document with the
`status of the update.
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`6.4 | CONCLUSION
`
`93
`
`Example 6-18. The makebid.asp file updates the database.
`<%@ LANGUAGE = VBScript %>
`<%
`
`title = Request.QueryString("title")
`price = Request. QueryString ("price")
`bidder = Request.QueryString ("bidder")
`
`Set BidRS = Server.CreateObject ("ADODB.RecordSet")
`connect = "data source=Auction;user id=sa;password=;"
`BidRS.CursorType = 2
`' read/write
`BidRS.LockType = 3
`BidRS.Open "Bids", connect
`
`BidRS.AddNew
`BidRS("item")
`BidRS("price")
`BidRS("bidder")
`BidRS.Update
`BidRS.Close
`
`= title
`= price
`= bidder
`
`&>
`<STATUS>OK</STATUS>
`
`6.4 | Conclusion
`The entire Auction Demo wasbuilt using the methods described above. You
`can get a head start on building a similar Web application by modifying
`these scripts to suit your particular requirements.
`XMLenables Web applications by providing dynamic, accessible content
`that can be navigated and manipulated on theclient. In addition,it enables
`the updating of content without having to refresh the entire user interface,
`This ability saves time by reducing roundtripsto the server for information
`that already exists on theclient.
`With XML, users can manage data over the Internet just as they pres-
`ently do on their local machines. As a result, the Web is made a moreinter-
`active and interoperable medium. As the information superhighway is
`transformed into the data superhighway, Web applications similar to the
`
`©1998 THE XML HANDBOOK™
`
`
`
`94
`
`CHAPTER 6 | BUILDING AN ONLINE AUCTION WEBSITE
`
`Auction Demo will allow for better utilization of the vast resources made
`available by the Web.
`
`| Analysis—The Auction Democlearly illustrates the
`| architecture of a three-tier application. It uses the middle tier as a
`transient data aggregator and normalizer. In other chapters you'll
`_ see different approachesto the middle tier, including persistent
`| storage of metadata andthe use of object paradigms rather than
`data paradigms.
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`
`
`
`
`
`XML and EDI:
`The new Web
`
`commerce
`
`Bf Traditional EDI: Built on outdated principles
`
`B Ubiquitous EDI: A quantum leap forward
`
`@ The New EDI: Leveraging XML andthe Internet
`
`©1998 THE XML HANDBOOK a
`
`
`
`
`
`Chapter
`
`
`
`prepared by Mike Hogan.
`
`XML andthe Internet will dramatically reshape
`the Electronic Data Interchange (EDI) landscape. By
`driving down costsand complexity, EDI will become
`a truly ubiquitoustechnology that will reshape
`business as we knowit. This introduction to EDI is
`sponsored by POETSoftware Corporation, «<5.
`WpoetmeonnrOutrekuieacoucunas
`Ane ayaaMelereroU mitluneseSacctme cancts
`
`ver the past several decades, corporations have invested tril-
`°§ lions ofdollars in automating their internal processes. While
`
`this investmenthas yielded significant improvementsin effi-
`ciency, that efficiency has not been extended to external processes.
`In effect, companies have created islands of automation that are isolated
`from their vendors and customers — their trading partners. The interaction
`among companies and their trading partners remains slow and inefficient
`becauseitis still based on manual processes.
`
`7.1 | What is EDI?
`Electronic Data Interchange (EDI) has been heralded as the solution to this
`problem. EDIis defined as the exchangeof data between heterogeneoussys-
`tems to supporttransactions.
`EDIis not simply the exportation of data from one system to another,
`but actual interaction between systems. For example, CompanyBis a sup-
`plier to CompanyA.Instead ofsending purchase orders, bills and checks in
`
`©1998 THE XML HANDBOOK™
`
`97
`
`
`
`
`
`98
`
`CHAPTER 7 | XML AND EDI: THE NEW WEB COMMERCE
`hard copy form, the two might connecttheir systems to exchangethis same
`data electronically.
`In the process they could benefit in many other ways, including faster
`turnaround onorders, better inventory control, reduced financial float,
`complete real-time information about orders and inventory for improved
`decision-making, reduced costs for manual data input, and more. Compa-
`nies that have implemented EDIrave aboutthe various beneftts,
`In fact, these benefits can be expanded to a chain ofsuppliers. For exam-
`ple, Company C mightbe a supplier to CompanyB above.Ifcompanies B
`and C implement EDI, then CompanyA gains the additional benefits of
`superior integration with their entire supply chain ofsuppliers.
`
`7.1.1 Extranets can’t hack it
`
`Thereis a significant gap between the business benefits described above and
`the actual implementation of EDI. This is because the actual implementa-
`tion of“traditional EDI”is fundamentally flawed.It is difficult and costly
`to implementand, even worse,it requires a unique solution for each pair of
`trading partners. This situation is analogous to requiring a unique tele-
`phoneline to be wired to each person to whom you wish to speak.
`Manypeoplefalsely proclaimed theInternetas the solution to this prob-
`lem, By implementing EDIover a single network, our problems would be
`solved. This “solution” was so exciting it was even given its own name, the
`extranet. Unfortunately, a network with a common protocolis still only a
`partial solution.
`This is because the systems implemented in each company are based on
`different platforms, applications, data formats (notations), protocols, sche-
`mas, business rules, and more. Simply “connecting” these systems over the
`Internet does not, by itself, solve the problem. To use the phone system
`analogy again,
`this is analogous to wiring each business into the global
`phonenetwork,onlyto realize that each company’s phonesystem is unique,
`and incompatible with every other phonesystem.
`Andgiven thetrillions ofdollars companies haveinvested in automation,
`they are not simply going to teplace these systems with new “compatible”
`solutions, assuming such thingsexisted.
`
`©1998 THE XML HanNDBOOK™
`
`
`
`
`
`7.1 | WHAT IS EDI?
`
`99
`
`7.1.2 XML can!
`
`The eXtensible Markup Language (XML)providesa solution for EDI over
`the Internet. XMLis a universal notation (data format) that allows comput-
`ers to store andtransfer data that can be understood by any other computer
`system. XML maintains the content and structure, but separates the busi-
`ness rules from the data. As a result, each trading partner can apply its own
`business rules. This flexibility is critical to creating a complete solution for
`EDI.
`There are additional technologies which are also part of the complete
`solution. Security, for example,
`is critical to EDI. Transactional integrity,
`connectionstability, authentication and other services are also critical to
`implementing a complete solution. These requirements are addressed by
`technologies that are layered on top ofthe Internet. We refer to them gener-
`ically as Internet-based services.
`Thefinal piece of the EDI solution is data storage. XML introduces a
`unique set of requirements for hierarchical namingandstructure. It also
`requires rich relationships and complex linking. XMLuse in EDIaddsfur-
`ther requirements for metadata and versioning. These requirements levy
`heavy demands on database technology.
`
`7.1.3 The new EDI
`
`the Internet, Internet-based services and database
`By combining XML,
`connectivity, we have a complete solution for New EDI. Together,
`these
`technologieswill not only change EDI, they will change ourentire business
`landscape. EDI will metamorphose from a handful of unique interconnec-
`tions, defined by the supply chain, into a “supply web”. The supply webis
`an intelligent common fabric of commerceover the Internet.
`According to Metcalfe’s Law!, the value of a networkis roughly propor-
`tional to the numberofusers squared. Imagine what this means when your
`EDI “network” expands from a one-to-one proposition, to a true network
`that encompasses practically every company in the world. Suddenly,
`the
`trillions of dollars companies have invested in internal automation increase
`in value by several factors. By the sametoken, this information can also be
`
`1. Robert Metcalfe is the creator of Ethernet.
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`
`
`100
`
`CHAPTER 7 | XML AND EDI: THE NEW WEB COMMERCE
`
`extended to customers, adding significant value to the vendor-customer
`relationship, thereby enhancing customerloyalty.
`This is a pivotal time in the history of technology. With the emergence of
`XML,all of the pieces are available to create a universal mechanism for
`EDI. TheInternet provides the transport. XML provides the flexible, exten-
`sible, structured message format. Various Internet-based services provide
`solutions for security,
`transactional integrity, authentication, connection
`stability, network fail-over and more.
`Addto this sophisticated data storage and you haveall of the pieces nec-
`essary to unite corporate islands of automation into a single coherentfabric
`of electronic commerce. This will result in dramatic improvements in effi-
`ciency, cost-savings, superior access to real-time data for analysis and deci-
`sion-making, superior inventory management, and more.
`Let’s examinethese propositionsin detail, and the technology that makes
`them possible. The new EDIis already emerging as the driving force behind
`the use of XML on the Web.
`
`7.1.4 Ubiquitous EDI: A quantum leap
`forward
`
`Ubiquitous EDI will have a profound impact on business-to-business and
`business-to-consumer
`relationships. The many problems with current
`implementations of EDI have relegated it to large enterprises and selected
`industries. However, the combination ofthe Internet, Internet-based tech-
`nologies, and XML will open up EDInotonly to small-to-medium enter-
`prises (SMEs), butalso to individuals (Example 7-1).
`Through deploymentof these technologies, EDI will experience growth
`and market penetration that will rival the e-mail market. Electronic com-
`merce will finally blossom on the Web and becomean everyday part of our
`lives. In short, EDI will usher in a new era in computing. TheInternet will
`metamorphosefrom a transport for Web pages into a ubiquitous and seam-
`less foundation for every imaginable transaction. In the future, EDI will
`touch every aspect of computing.
`Various formsof “data interchange” have been implemented with various
`degrees of success. Examples include OLE and DDE for sharing data
`among heterogeneous applications on the same computer. CORBA,Java
`RMI, COM and COMs+are generalized technologies for data interchange
`
`©1998 THE XML HANDBOOK™
`
`
`
`
`
`7.1 | WHat
`
`is EDI?
`
`101
`
`Example 7-1. The value of data interchange.
`Mikeopens his companyexpense report, and in the microsecondit takes to
`launch, he reminisces about the old days when he had tofill out these
`things himself. Now the computer does it for him. Mike recently took a
`trip to Utah to close a major deal. In the process he purchased a plane
`ticket, a rental car and various meals. In the old days, he used to enterall of
`these charges manually into an expense program...not any more.
`Mike uses a corporate American Express card for these purchases. When
`he opens the expensereport, it automatically connects to American Express,
`via EDI, andpresentsa list of new charges. Mikeselects the charges that are
`appropriate for this expense report.
`American Express sends this data to Mike