Skip Headers

Oracle9i Case Studies - XML Applications
Release 1 (9.0.1)

Part Number A88895-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

6
Using Oracle9i Internet File System (9iFS) to Build XML Applications

This chapter contains the following sections:

Introducing Oracle9i Internet File System (9iFS)

Oracle9i Internet File System (9iFS) facilitates organizing and accessing documents and data using a file- and folder-based metaphor through standard Windows and Internet protocols such as SMB, HTTP, FTP, SMTP, or IMAP4.

iFs aids in the building and administering of web-based applications. It is an application interface for Java and can load a document, such as a Powerpoint.PPT file, into Oracle9i, and display the document from a web server, such as Oracle9i Application Server.

Working with XML in 9iFS

iFS is a simple way for developer's to work with XML, where 9iFS serves as the repository for XML. 9iFS can perform the following tasks on XML documents:

When a file is requested, it delivers select information, for example, on the web.

iFS also supports an extensible way of defining new file types and provides built-in support for defining, parsing, and rendering file types that are XML documents.

Rather than just store the XML data, 9iFS makes it possible to unlock the full potential of XML for implementing business intelligence, generating dynamic content, and sharing data across applications.

Supply a Document Descriptor

In 9iFS, when registering an XML-based file type, you supply a document descriptor that specifies the following:

For example, you can save your document in its complete form in a Large Object (LOB) in the database.

9iFS document descriptors use an XML-based syntax to describe the structure (or "schema") of its XML-based file types.

When a file is saved or sent to 9iFS, it recognizes the document as one of your file types, parses its XML, and stores the data in tables as you have specified in the document descriptor.

The same information is used to render, that is, reassemble for delivery, the XML document when a particular instance of your filetype is requested through any 9iFS supported protocols.

See Also:

 

Using the 9iFS Parsers

When you drop a new XML file, whose structure 9iFS understands, into a folder, Oracle XML Parser for Java can dissect the XML file and store the separate attributes in the 9iFS schema. By defining an 9iFS subclass, you are specifying which attributes go into which columns. You can also let 9iFS make a default attribute-to-column mapping.

Once parsed, the attributes originally within the file become attributes of the file, This is extra metadata that you can edit and use as search criteria in the file system.

Consider an XML-based company standard insurance claim form. You can instruct 9iFS to parse the XML insurance claim files, extracting the attribute tag information from each file and storing these chunks separately in a table.

You can then search on the XML attributes, such as region or agent, as you would for any attribute in a file. The data is now also available for use by a relational application, such as insurance industry analytical tools.

Because the XML file has been parsed does not mean that this is the end of that file. When someone opens the original XML file, the XML renderer reconstructs it. See "Rendering XML in 9iFS" .

Standard 9iFS Parsers and Custom Parsers

In 9iFS your XML application will require a custom parser if the document format produced by the application needs it.

When Must 9iFS Parser be Explicitly Invoked?

9iFS parser is invoked depending on how the documents produced by your application are entered into 9iFS.

Using 9iFS Standard Parsers

9iFS offers several standard parsers for creating applications in 9iFS. Table 6-1 lists the 9iFS standard parser classes.

Table 6-1 9iFS Standard Parser Classes
Class  Description 

SimpleXmlParser 

Creates an object in the 9iFS repository from an XML document body. Used as the default parser for all XML documents stored in 9iFS. SimpleXmlParser extends XmlParser.  

XmlParser 

A base class for custom XML parser development.  

SimpleTextParser 

Provided as a starting point for developers who need to create a custom parser. The SimpleTextParser uses a simple name=value syntax.  

ClassSelectionParser 

Adds custom attributes to all files of a specified format. Performs no actual parsing.  

Parsing Options

The following parsing options are provided by 9iFS:

Using 9iFS Custom Parsers

If parsing non-XML documents, such as .doc or .xls documents, or if you have defined a custom type, such as .vcf for Vcards, you must write a custom parser to create database objects from these documents. To create a custom parser, you can either subclass an existing 9iFS parser or create a custom class from scratch, implementing the oracle.9iFS.beans.parsers.Parser interface.

How 9iFS XML Parsing Works

When you place an XML representation of a document in 9iFS, SimpleXmlParser() is called to create the document object.

Assume gking.vcf document instance has been converted to an XML file, gking.xml, and that the end user is using the 9iFS Windows interface.

  1. Assume next that you have dragged an instance of the XML document, such as gking.xml, into 9iFS folder, /iFS/system/vcards.

  2. SMB performs a parser lookup based on the file extension, .xml. SMB is a protocol that lets you access 9iFS through Microsoft Windows 95, Windows 98, and Windows NT clients. You can drag files into and out of Oracle 9iFS, or they can edit them directly in 9iFS.

  3. Because this is an XML file, the parser lookup finds a match and invokes the SimpleXmlParser().

  4. Because the Vcard custom class definition file was previously stored in 9iFS, the SimpleXmlParser() recognizes gking.xml as a Vcard document.

  5. SimpleXmlParser() parses gking.xml, creating a Vcard object called gking.

    If the gking.vcf document instance had been used instead, the result of the parser lookup in Step 2 would be that SMB would invoke the custom parser, VcardParser.

Writing a Parser Application

To write a parser application you will need to carry out the following steps

  1. Write the Parser Class

  2. Deploy the Parser

  3. Invoke the Parser (in the parser application)

  4. Write a ParserCallback (optional)

    See Also:

    http://otn.oracle.com/products/ifs 

For more information about parsers, see the following classes in the 9iFS Javadoc:

oracle.ifs.beans.parsers.SimpleXmlParser 
oracle.ifs.beans.parsers.XmlParser 
oracle.ifs.beans.parsers.SimpleTextParser 

Rendering XML in 9iFS

By default, the 9iFS XML renderer reconstructs the original file, including the XML attribute tags. When you double-click the file, 9iFS reconstructs it, then opens it in whatever XML editor you use.

It is important to be able to reconstruct the file, but you can more creative things with the file. For example, if you parse the XML-based insurance claim, you may want to show only some sections of the original file to customers when they access it through a web-based self-service application. You may also want to calculate values, such as totals, counts, and averages, from the contents of the file, then add the results of these calculations to the file. Or you may want to change the format of the file, displaying it as RTF or HTML instead of less-readable XML.

All these tasks can be accomplished through the 9iFS renderer. The parsed contents of an XML file are waiting in 9iFS for dynamic reassembly, showing whatever range, format, or type of information you need for your users or your applications. By writing and registering a new renderer for a certain class of XML file, you can change how 9iFS displays those files.

See Also:

http://otn.oracle.com/products/iFS. Select "The XSL Custom Renderer Sample Application" then select "technical brief", for a detailed application how to write an 9iFS Custom Renderer. 

XML and Business Intelligence

Since parsed XML files store each attribute's data in a separate, identifiable column in the 9iFS schema, Oracle 9iFS makes it possible for your data mining applications to tap into the business intelligence previously locked in your XML files.

To return to the insurance claim example, business intelligence is stored in each claim, and the aggregate value of all the information in all claims stored in the system is greater than the sum of the parts. Managers can track trends in real time as agents insert or update claim files? This is possible using 9iFS file parsing files and feeding the parsed file contents to data mining tools.

Configuring 9iFS with XML Files

To configure 9iFS, you can write XML to customize the file system. For example, a feature of Oracle 9iFS SDK is the ability to subclass files and folders. If you need to identify your XML-based purchase orders as a separate type of file for your applications, you can define an 9iFS subclass. Creating this subclass is as simple as:

  1. Writing an XML file that follows the 9iFS syntax for defining subclasses

  2. Dragging and dropping this XML file into any folder in 9iFS

These types of configuration files remove the need to write complicated scripts to deploy an application. Instead, you drag and drop all the necessary files, including the XML configuration files, into the new 9iFS instance.


Go to previous page Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index