This directory contains sample applications to demonstrate the usage of the 
Oracle Transviewer beans. Currently, the Oracle Transviewer beans 
toolset contains XMLSourceView, XMLTreeView, XSLTransformer, DOMBuilder,
XMLTransformPanel, DBAccess, DBViewer, XMLType and XMLDiff beans.

The following are the sample Java files in this directory:

        ViewSample  - A sample visual application using the  
                      XMLSourceView bean and XMLTreeView bean.
                      It visualizes XML document files.

        AsyncTransformSample - A sample nonvisual application using 
                      XSLTransformer bean and DOMBuilder bean.
                      It applies XSLT stylesheet specified in doc.xsl 
                      on all *.xml files from the current directory.   
                      The results are in the files with extenton .log. 
 
        XMLTransformPanelSample - visual application which using 
                      XMLTransformPanel bean. This bean uses all four beans
                      from above.Applies XSL transformations on XML documents
                      and shows the result Visualizes and allows editin of
                      XML and XSL input files.

        DBViewSample - Sample visual application that uses DBViewer bean to 
                      implement a simple insurance claim handling application.

        XMLTransformPanelSample1 - This sample is similar to the 
                      XMLTransformPanelSample showing of the XSL transformation
                      on XML Documents, difference being that this sample
                      uses XMLType to store the XML documnets inside the 
                      database instead of the CLOBs.
        
        XMLDiffSample - Sample visual application that uses XMLDiff bean to 
                      diff two XML files and generate an XSL stylesheet. This
                      stylesheet can be used to transform input XML file1 into
                      input XML file2.

        compviewer   - Sample visual application that uses XMLCompress bean 
                      to compress an XML file or XML data from the database
                      obtained through SQL query or from a CLOB or an 
                      XMLType Table. The application also lets to uncompress
                      the compressed stream and view the resulting DOM tree.
                     

Installing the Transviewer beans
================================

The beans require the version of JDK 1.1.6 as minimum and can be used with any version of JDK 1.2.
The DBViewer bean and DBTransformPanel bean require JDK 1.2.2 when rendering HTML.
The lesser versions of the JDK may not render HTML in the result buffer properly.

1) You need to download and install the following components that are used
   by the Transviewer beans:

   - Oracle JDBC Driver for thin client:
       If you work with JDK 1.2 or above, use the 1.2 version of the JDBC driver
       from file classes12.zip. For JDK 1.1.6 or above, use file classes111.zip.
       Make sure that the version of the JDBC driver is the same or higher
       than the Oracle database you want to access. The databases tested
       with the beans are Oracle 8.1.5 and Oracle 8.1.6
  
   - Oracle XML SQL Utility (jar file xsu111.jar)


   - jar file containing XMLType definitions ( jar file xdb_g.jar)

   After installing these components, include classes111.zip and 
   xsu111.jar into your classpath.


2) The beans and the samples use Swing 1.1. If you use
   JDK 1.2, go to step 3. If you use JDK 1.1, you will need to
   download Swing 1.1 from Sun. After downloading Swing, add
   swingall.jar to your classpath. 

3) Change the JDKPATH in the Makefile to point to your JDK path.
   In addition, on Windows NT you need to change the file separator
   as stated in the Makefile.

4) Use "make" to generate .class files.

5) Run the sample programs using commands:
   gmake sample1
   gmake sample2 
   gmake sample3 
   gmake sample4
   gmake sample5
   gmake sample6
   gmake sample7
   

Notes:

   Sample1 runs the XMLTransViewer program. This can be used 
   to import and export XML files from Oracle 8i, keep your XSL transformation
   files in Oracle8i and apply stylesheets to XML interactively. In order
   to use the database connectivity feature in this program, you need to know the
   network name of the computer where Oracle8i runs, the port (usually 1521) and
   the name of the oracle instance (usually orcl). You would also need an account
   with create table granted. You may try the default account scott with password
   tiger if it is enabled on your Oracle 8i system.
   You can use Sample1 to apply stylesheet transformation to XML files and display
   the result. When you run the sample, you will see a panel with tabs on the top 
   and the bottom. The first two top tabs are used to switch between the XML
   buffer and the XSL buffer. The third tab (the Transform tab) performs XSL transformation
   on the XML buffer and shows the result. The first two tabs on the bottom can be used to 
   load/save data from Oracle database and from the file system. The rest of 
   the tabs on the bottom switch the display of the current content to tree view, 
   XML source, edit mode and, in case of the result view after the transformation, in HTML.

   Sample4 uses sqlplus and the default account scott/tiger on your local host.
   If this is not the case, make the corresponding changes in the Makefile.
   Sample4 also expects that the Oracle database is installed on computer
   named "localhost", the instance name is "orcl", the port is "1521" and
   the account is scott with password tiger. If your configuration is different,
   go to line 92 in DBViewClaims.java. Modify the lines
      dbPanel.setUsername("scott");
      dbPanel.setPassword("tiger");
      dbPanel.setInstancename("orcl0");
      dbPanel.setHostname("localhost");
      dbPanel.setPort("1521");
   with values that reflect your Oracle configuration. 

   Sample5 uses the new feature "XMLType" to store XML documents inside the datbase. To use 
   XMLType an Oracle 9i or higher installation is necessary along with the jar which contains 
   the definition of XMLType.class. This sample is similar to the Sample1 demo to run the 
   transviewer bean.
   
   Sample6 invokes a GUI which allows you to choose the input data files from the 'File' menu
   using 'Compare XML Files' item. The XSLT generated can be applied on input XML file1
   using 'Transform' menu. Resulting XML file (which will be the same as input file2) can be 
   saved using 'Save As' item under 'File' menu.
   
   Note: If the input XML files have a DTD which accesses a URL outside the firewall, then 
   please modify the XMLDiffSample.java to include the proxy server settings before the 
   setFiles() call:
   e.g.
    /* Set proxy to access dtd through firewall */
    Properties p = System.getProperties();
    p.put("proxyHost", "www.proxyservername.com");
    p.put("proxyPort", "80");
    p.put("proxySet", "true");
    
    You will also have to import java.util.*;



   Sample7 invokes a GUI which lets the user to compress / Uncompress XML
   files and data obtained from the Database. The loading options lets the 
   user to get the data either from a file system or a database. This 
   application does not support loading/saving compressed data from the 
   database. The compression factor indicates a rough estimate by which the
   XML data is reduced.

6) Visualize the results in .log files using the ViewSample.
  
   Use the XSLT document from './tohtml.xsl' to transform the XML document
   from './booklist.xml'. 
     
A few .xml files are provided as test cases. A XSL stylesheet 'doc.xsl'
is used by XSLTransformer.


