Abstract:
This invention facilitates the importation of data from external systems. In particular, the importation of data from XML files is employed. In a first aspect, the invention concerns a method for importing data, in a second aspect the invention concerns a computer system for importing data, and in a further aspect the invention relates to a computer program. The invention involves specifying an XML file to be imported, uploading the specified XML file, and parsing the file to provide programmatic access to the structure and content of the data being imported. For instance, a parsing servlet creates a series of values for graphically representing the structure of the data. The data and metadata values may then be stored in tables and made available to data-driven applications.

Description:
TECHNICAL FIELD  
         [0001]    This invention concerns the importation of data from external systems. In particular, the present invention concerns the importation of data from XML files. In a first aspect, the invention concerns a method for importing data, in a second aspect it concerns a computer system for importing data, and in a further aspect it concerns a computer program.  
         SUMMARY OF THE INVENTION  
         [0002]    In accordance with a first aspect, the invention relates to a method for importing data from XML files, comprising the steps of:  
           [0003]    specifying an XML file to be imported,  
           [0004]    uploading the specified XML file,  
           [0005]    parsing the file to provide programmatic access to the structure and content of the data being imported; for instance into a series of values for graphically representing the structure of the data, such as nodes of an information Document Object Model (DOM) tree, and  
           [0006]    storing the metadata and data values in tables.  
           [0007]    If necessary, the values are corrected by a user inspecting the tree, into a format suitable for passing to the information tree. The tree may be viewed by a user for this purpose.  
           [0008]    The storage may consist of four tables, i.e., ww_form-temp (metadata), ww_form_item_temp (metadata), ww_files_temp (data), and ww_objects_temp (data).  
           [0009]    The invention may be used to import and then view information from external systems. In an elementary implementation, an XML file may be imported without a Document Type Definition (DTD). Alternatively, in a more complex scenario, the attributes of a corresponding DTD may be applied along with the presentation layer provided by XSL.  
           [0010]    The information may be imported in batch or real-time mode from an external system such as Oracle Financials, SAP or Peoplesoft.  
           [0011]    The imported information may be integrated with other systems without any code changes.  
           [0012]    In another aspect, the invention relates to a computer system for importing data from XML files, comprising in data storage:  
           [0013]    an Upload Servlet to upload a specified XML file,  
           [0014]    a Parsing Servlet to provide programmatic access to the structure and content of the data being imported; for instance into a series of values for graphically representing the structure of the data. For instance each node of an information (DOM) tree, and  
           [0015]    a Saving Servlet to save the data and metadata values of the tree to storage.  
           [0016]    In a further aspect, the invention is a computer program, comprising:  
           [0017]    an Upload Servlet to upload a specified XML file,  
           [0018]    a Parsing Servlet to provide programmatic access to the structure and content of the data being imported; for instance into a series of values for graphically representing the structure of the data. For instance each node of an information (DOM) tree, and  
           [0019]    a Saving Servlet to save the data and metadata values of the tree to storage.  
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0020]    An example of the invention will now be described with reference to the accompanying drawings, in which:  
         [0021]    [0021]FIG. 1 is a flow chart showing the importation process;  
         [0022]    [0022]FIG. 2 is a table showing the effect of parsing an XML file;  
         [0023]    [0023]FIG. 3 is a table showing the structure of temporary storage tables;  
         [0024]    [0024]FIG. 4 is a representation of forms that have been identified; and  
         [0025]    [0025]FIG. 5 is a representation of documents that could be produced.  
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0026]    Setting up an importation interface involves installing server side utilities as well as a once-off client side modification. The modifications needed on the client side are simply a matter of installing the  Java Runtime Environment  1.2.2 (JRE), which includes appropriate plug-ins for both Netscape Navigator 4.6+ (Navigator) and Internet Explorer 5+ (IE5). Once this set up is accomplished, all Java 1.2.2 applets will run in IE5 and Navigator.  
         [0027]    Referring now to FIG. 1, the importation process  1  is initiated by a user calling a TrafficDirector Servlet  2  and specifying the XML file to be imported. This will typically require typing in the host address, port number and database driver to be employed. A username and password may be required to satisfy the login credentials for the external database. The TrafficDirector Servlet  2  then calls an Upload Servlet  3  and provides it with the appropriate parameters.  
         [0028]    Once login to the external source has been achieved, then the hostname and database name will appear, and a list of all the accessible tables will also be created, along with a list of all accessible columns from the selected table. This is the table from which the data is retrieved.  
         [0029]    To limit the values which are available for selection, the user can create a criteria to determine which values will be available.  
         [0030]    An XML document usually includes or contains a reference to a Document Type Definition (DTD). Essentially a DTD defines the grammar for a class of documents, that is, it contains markup declarations that describe the logical structure of the documents and the constraints within the logical structure. An example of a DTD and a valid XML document written to this DTD is as follows. This example will be referred to throughout the remainder of this document:  
       Document Type Definition  
       [0031]    [0031]                                   &lt;!ELEMENT orderlist (order*)&gt;       &lt;!ELEMENT order (datetime,notes,salesperson, customer, part*)&gt;       &lt;!ATTLIST order id ID #REQUIRED&gt;       &lt;!ELEMENT datetime (#PCDATA)&gt;       &lt;!ELEMENT notes (#PCDATA)&gt;       &lt;!ELEMENT salesperson (name,department,phone)&gt;       &lt;!ATTLIST salesperson id ID #REQUIRED&gt;       &lt;!ELEMENT customer (name,address,phone)&gt;       &lt;!ATTLIST customer id ID #IMPLIED&gt;       &lt;!ELEMENT part (name,quantity,price)&gt;       &lt;!ATTLIST part id ID #REQUIRED&gt;       &lt;!ELEMENT name (#PCDATA)&gt;       &lt;!ELEMENT department (#PCDATA)&gt;       &lt;!ELEMENT phone (#PCDATA)&gt;       &lt;!ELEMENT address (#PCDATA)&gt;       &lt;!ELEMENT quantity (#PCDATA)&gt;       &lt;!ELEMENT price (#PCDATA)&gt;                    
       Sample XML Document  
       [0032]    [0032]                                                                                                                                                                                                                                                           &lt;?xml version=“1.0” emcoding=“iso-8859-1”?&gt;                &lt;!DOCTYPE orederlist SYSTEM “orederlist.dtd”&gt;           &lt;orderlist&gt;                &lt;order id=“_5449431”&gt;                &lt;datetime&gt;Feb 1 2000 5:37PM&lt;/datetime&gt;           &lt;notes&gt;We need to hurry this order through. . .&lt;/notes&gt;           &lt;salesperson id=“37”&gt;           &lt;name&gt;Jill Smith&lt;/name&gt;           &lt;department&gt;Sales&lt;/department&gt;           &lt;phone&gt;90991234&lt;/phone&gt;                &lt;/salesperson&gt;           &lt;customer id=”909921”&gt;                &lt;name&gt;Bobs Plumbing&lt;/name&gt;           &lt;address&gt;1 George St, Sydney, 2000&lt;/address&gt;           &lt;phone&gt;90995678&lt;/phone&gt;                &lt;/customer&gt;           &lt;part id=“10987”&gt;                &lt;name&gt;Widget Flange&lt;/name&gt;           &lt;quantity&gt;100&lt;/quantity&gt;           &lt;price&gt;0.50&lt;/price&gt;                &lt;/part&gt;           &lt;part id=“10990”&gt;                &lt;name&gt;Widget Head Bolt&lt;/name&gt;           &lt;quantity&gt;100&lt;/quantity&gt;           &lt;price&gt;2.00&lt;/price&gt;                &lt;/part&gt;                &lt;/order&gt;           &lt;order id=“_5449432”&gt;                &lt;datetime&gt;Feb 1 2000 5:37PM&lt;/datetime&gt;           &lt;notes&gt;Take your time,           this customer still hasn&#39;t paid last invoice.&lt;/notes&gt;           &lt;salesperson id=“41”&gt;                &lt;name&gt;John Sparky&lt;/name&gt;           &lt;department&gt;Sales&lt;/department&gt;           &lt;phone&gt;90991235&lt;/phone&gt;                &lt;/salesperson&gt;           &lt;customer id=“909989”&gt;                &lt;name&gt;Kens Hardware&lt;/name&gt;           &lt;address&gt;99 Ken St., Sydney, 2000&lt;/address&gt;           &lt;phone&gt;90999101&lt;/phone&gt;                &lt;/customer&gt;           &lt;part id=“10969”&gt;                &lt;name&gt;Widget Rubber Seal&lt;/name&gt;           &lt;quantity&gt;200&lt;/quantity&gt;           &lt;price&gt;0.25&lt;/price&gt;                &lt;/part&gt;           &lt;part id=“10899”&gt;                &lt;name&gt;Widget Spring&lt;/name&gt;           &lt;quantity&gt;10&lt;/quantity&gt;           &lt;price&gt;4.00&lt;/price&gt;                &lt;/part&gt;                &lt;/order&gt;            &lt;/orderlist&gt;                    
         [0033]    The Upload Servlet  3  uploads the specified XML file and calls a Parser Servlet  4  which reads the file and deciphers it to produce a Document Object Model (as defined by W3C). The Document Object Model (DOM) provides programmatic access to the structure and content of the data being imported. In practice, this means converting it into a series of values representing each node of an information (DOM) tree; as shown in FIG. 2.  
         [0034]    The values are then passed to an XML-To-Data Converter Servlet  5  which ensures the values retrieved from the Parser  4  are in the correct format to pass to the information tree. The tree may then be viewed by the user using a Display Tree Servlet  6 .  
         [0035]    If the tree is to be saved, it is written to temporary storage  7 . The temporary storage areas basically consist of four tables, i.e., ww_form_temp (metadata), ww_form_item_temp (metadata), ww_files_temp (data), and ww objects temp (data). The table structure is shown in FIG. 3.  
         [0036]    Upon saving the XML tree, the metadata and data values are stored. The relationship between parent-child and individual fields on a form is elementary. All tags that appear at the same tree level are fields on the same form. If a tag is identified, then it has a parent node.  
         [0037]    Once an XML document has been received from an external source it can be fed into a data driven application comprised of:  
         [0038]    Metadata—The forms (templates) required to publish content;  
         [0039]    A Home—The folders defined to hold the published content;  
         [0040]    Search Facilities—Automatic access to search facilities specifically tailored for the structure of the content published;  
         [0041]    Content—The published content; and  
         [0042]    Workflow—A workflow process to direct published content.  
         [0043]    This task involves the following steps:  
         [0044]    1. Create new metadata (Form templates) by analyzing the structure of the DOM.  
         [0045]    Given that the XML data is hierarchical in structure, the metadata produced will also be hierarchical, that is, the forms will be built on parent/child relationships. Identifying the documentary forms required involves a traversal of the DOM tree using the following criteria:  
         [0046]    start with the root node;  
         [0047]    any node with only a single value becomes a new field on the current form; and  
         [0048]    any node with more than one child (the value of a node is represented as a child) requires a new form, a child form.  
         [0049]    This process is recursive as the DOM structure is traversed:  
                                                                                                                                             begin                node = getRootNode           createForm(node)                end           sub createForm(node)           begin                for each child of this node           if child node has more than one child of it&#39;s own                newForm = createForm(child)           thisForm.addChild(newForm)                else                newField = createField(child)           thisForm.addField(newField)                endif                endfor                end                      
 
         [0050]    Given this process and the sample XML document presented, the forms shown in FIG. 4 can been identified:  
         [0051]    2. Create a home for it and associated workflow.  
         [0052]    The home is essentially a folder structure in which each folder has a defined purpose. A home for the sample imported appears as follows:  
         [0053]    Widget Orders Folders  
         [0054]    All Folder—A folder contains all of the content published,  
         [0055]    Search Folder—A means of accessing the automatic search facility for this content, and  
         [0056]    Publish Folder—This folder contains the form required to publish the new content.  
         [0057]    In order to publish the folder content, a workflow process is also defined. At its simplest, the workflow for the content imported from an external XML source is ‘direct to repository’. That is, given generic XML it is possible to identify an individual or individuals for the workflow process.  
         [0058]    3. Populate it with content extracted from the DOM using the metadata defined in step 1.  
         [0059]    “Populating” means building a set of documents from the XML content imported, based on the forms defined in step 1.  
         [0060]    Unlike the process of creating the metadata (the forms), which was driven by the structure of the DOM, this process is driven by the structure of the new forms.  
         [0061]    Again, this process is recursive as the form structure is traversed:  
                                                                                                                                                                           begin                node = getRootNode           form = getParentForm           createDocument(node, form)                end           sub createDocument(node, form)           begin                for each field in this form                get all children of current node that have same name as           form field for each child node                newDocField = createDocField(childnode, formfield)           thisDocument.addField(newDocField)                endfor                endfor           for each child form of the current form                get all children of current node that have same name as           child form for each child node                newDocument = createDocument(childnode,           childform)           thisDocument.addChild(newDocument)                endfor                endfor                end                      
 
         [0062]    Given this process, and the sample XML document, the documents shown in FIG. 5 would be produced.  
         [0063]    Having created the building blocks, it remains to map the objects created to an underlying relational database.  
         [0064]    It will be appreciated by persons skilled in the art that numerous variations and/or modifications may be made to the invention as shown in the specific embodiments, without departing from the spirit or scope of the invention as broadly described. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive.