Copyright (c) Oracle Corporation 1998, 1999. All Rights Reserved.

      README.txt -  ORACLE8i interMedia Video Demo Information


Contents
--------
1.   INTRODUCTION
2    SQL DEMO
2.1  INTRODUCTION TO SQL DEMO
2.2  REQUIREMENTS FOR RUNNING THE SQL DEMO
2.3  RUNNING THE SQL DEMO
3.   JAVA DEMO
3.1  INTRODUCTION TO JAVA DEMO 
3.2  COMPILING THE JAVA DEMO
3.3  REQUIREMENTS FOR RUNNING THE JAVA DEMO
3.4  RUNNING THE JAVA DEMO

1. INTRODUCTION
---------------
In this readme file, a description of two demos present in the demo
directory has been provided along with the instruction to setup
and run these demos. Since the demos are written in JAVA and PL/SQL
there is no makefile for building these demos. Users can follow
the instruction in this file to execute these demos.

2. SQL DEMO
-----------

2.1 INTRODUCTION TO SQL DEMO
----------------------------
This demo is designed to allow users to write their own PL/SQL
code to access and manipulate data in the Video object. There are
some additional statements provided to aid users in verifying
the installation and using certain interfaces such as importing
data from an intranet web site. These methods are difficult to
test using automated testing mechanism therefore these are commented 
out using the following:
> ----------------------------------------------------------
> -- THE NEXT LINE HAS BEEN COMMENTED FOR AUTOMATED TESTING
> -- PLEASE UNCOMMENT IT TO TRY OUT THE COMMAND.
> ----------------------------------------------------------
Users can try out these statements in their environment
after the desired environment has been set. The SQL demo file
has comments embedded in the file for users to understand 
the processing. Users should try to read the comments before 
executing anonymous blocks.

2.2 REQUIREMENTS FOR RUNNING THE SQL DEMO
-----------------------------------------
The following is required for the SQL demo to run:

1. install oracle8i server.
2. install interMedia.
3. Create user videotest with password videotest
   If you wish to use a diferent user then update
   viddemo.sql to use correct username and password.
4. Create DIRECTORY object VIDEODIR and grant access
   to your user. If you wish to use a different DIRECTORY
   update viddemo.sql to reflect that.
5. Make sure that testvid.dat is present
   in your DIRECTORY. Again if you wish to use your own
   video file (e.g. video.au) update viddemo.sql to
   reflect that.
6. If you wish to try URL import then make sure that
   you have a valid URL pointing to valid video file and
   uncomment and update the URL and video file name to reflect
   that.
7. Reasonable amount of tablespace allocated to the user
8. DEMO plugins (fplugins.sql and fpluginb.sql) installed
   in ORDPLUGINS schema and EXECUTE privileges granted
   on ORDX_DEMO_VIDEO to public or at least to your user.

2.3 RUNNING THE SQL DEMO
------------------------
SQL demo is a collection of SQL statements and anonymous PL/SQL
blocks. The order in which these statements are executed is
important because statement higher up in the order set up
the data/object for the following statements to succeed. Users
can run this entire file or run each block in order to see
and understand the results better. It is recommended that 
first time users should try to run one block at a time to 
help debug any problems.

The SQL demo is viddemo.sql.

3. JAVA DEMO
------------

3.1 INTRODUCTION TO JAVA DEMO
-----------------------------
The Java demo has been provided to the users to help them learn how
to use the Video client side java classes to build their own applications.
In this demo, the video object is being instantiated at the client side
and a number of accessor methods are invoked. Use of getDataInFile 
method has also been demonstrated for the users who wish to download 
data on the client machine. loadData method (not present in demo) can be 
used to upload the data. Some update methods have also been demonstrated 
in this demo.

3.2 COMPILING THE JAVA DEMO
---------------------------
The demo program should be compiled using the jdk1.1.2 version of java 
package. The user needs to compile using javac compiler. They need to make sure
that the dbjava classes111.zip and ordmm.zip and jdk zip classes are in their 
CLASSPATH and javac and java are available in their PATH.

3.3 REQUIREMENTS FOR RUNNING THE JAVA DEMO
------------------------------------------
Before running the demo, users MUST have done the following:

1. install oracle8i server.
2. install interMedia.
3. create a table with one column of type OrdVideo.
4. insert a few rows in the table.

For step 3 and 4 users can use the following as an example:

      -- CREATE TABLESPACE
      CREATE TABLESPACE tabspace_1
         DATAFILE 'tabspace_file1.dbf' SIZE 100M
         MINIMUM EXTENT 64K
         DEFAULT STORAGE (INITIAL 128K NEXT 128K)
         LOGGING;

      -- CREATE THE USER AND ASSIGN THE TABLESPACE
      CREATE USER ordmediademo IDENTIFIED BY ordmediademo
               DEFAULT TABLESPACE tabspace_1;


      -- GRANT PRIVILEGES
      GRANT CONNECT, RESOURCE, CREATE LIBRARY TO ordmediademo;
      GRANT CREATE ANY DIRECTORY TO ordmediademo;
      CONNECT ordmediademo/ordmediademo;

      -- CREATE DIRECTORY TO LOAD DATA FROM
      -- FOR USERS ON WINDOWS-NT THIS STATEMENT WILL BE DIFFERENT

      -- ON UNIX
      CREATE OR REPLACE DIRECTORY VIDEODIR AS '/tmp/' ;
      -- ON WINDOWS-NT
      CREATE OR REPLACE DIRECTORY VIDEODIR AS 'C:\Temp' ;

      -- CREATE TABLE
      CREATE TABLE TVID(n NUMBER, vid ORDSYS.ORDVIDEO)
      STORAGE (initial 100K next 100K pctincrease 0);

      -- INSERT A NULL ROW
      INSERT INTO TVID VALUES( 1, ORDSYS.ORDVideo.init() );

      -- LOAD DATA FROM VIDEODIR
      DECLARE
        obj ORDSYS.ORDVideo;
        ctx RAW(4000) := NULL;
      BEGIN
        SELECT vid INTO obj FROM TVID  WHERE N=1 FOR UPDATE;
        DBMS_OUTPUT.PUT_LINE('setting and getting source');
        DBMS_OUTPUT.PUT_LINE('--------------------------');
       
        -- set source to a file
        obj.setSource('FILE','VIDEODIR','testvid.dat');
        -- get source information
        DBMS_OUTPUT.PUT_LINE(obj.getSource);
       
        -- import data
        obj.import(ctx);
        -- check size
        DBMS_OUTPUT.PUT_LINE(TO_CHAR(obj.getContentLength(ctx)));
        DBMS_OUTPUT.PUT_LINE(obj.getSource);
        UPDATE TVID SET vid=obj WHERE N=1;
        COMMIT;
      END;
      /

      NOTE:
      -----
      The above example has been provided to assist users in creating 
      a table with video data in it. Users should try modifying it to 
      setup their own database and tables.In the above example testvid.dat
      file is the media data file which needs to be in the VIDEODIR, before
      running the sql scripts.

 
3.4 RUNNING THE JAVA DEMO
-------------------------
The user can run the demo using the following command:
    java demoProgram
The Solaris user needs to make sure that the directory in which libocijdbc8.so
resides in their machine is in their LD_LIBRARY_PATH variable, and the NT user
needs to make sure that the directory in which libocijdbc8.dll resides in their
machine is in their PATH variable before running the demoProgram.
 
Once started the program will prompt the user to enter the binding parameters
which are, table name, column name, and search condition. The user needs to
enter these three parameters. If the user is using the vdemoProgram.sql
file to create their data base then these parameters could be:
table name ===> TVID
Enter your search parameters
Enter table Name
TVID     <====== users response
Enter column Name
vid      <====== users response
Enter Data Condition
N = 1    <====== users response
 
 
Then the program will go ahead and connect to the database, create a
client side video object instance and bind it to an appropriate server
side instance. Thereafter it will refresh the client side object and perform
operations on it, and finally flush it back to the database.

------------------------------------------------------------------------
