Oracle Context Option Application Developer's Guide Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index



Go to previous file in sequence

APPENDIX A. Windows 16-bit Viewing


This appendix describes how to use ConText utilities to view documents in a 16-bit Windows environment.

The following topics are covered in this chapter:

Note: The components described in this chapter are not distributed on the Oracle ConText Option CD; they are distributed as part of the Oracle ConText Option Workbench, which is available on a separate CD.

The Windows 16-bit Viewing Process

The steps to view a highlighted document (Word7 for example) in a 16-bit Windows environment are typically the following:

Note: The CTXIO16 utility can be used to automate this process.

For more information about performing these steps using CTXIO16, see the example provided in "Using the CTXIO16 Utility" in this appendix.

Using the 16-bit Viewer (CTXV16)

The Oracle ConText Option 16-bit viewer for Windows 3.1 (CTXV16) is designed to bring up two windows for viewing highlighted documents: one for viewing the ASCII text of documents and one for WYSIWYG viewing of documents.

For example, the WYSIWYG window allows a Word document to be displayed in a similar form as it appears in Microsoft Word. You can display the document with or without highlights in the WYSIWYG window.

The plain text window displays ASCII text of documents. The Next and Previous buttons enable the user to jump to occurrences of the highlighted keywords.

Supported Formats

You can use the Oracle ConText Option 16-bit viewer for Windows 3.1 to view documents in the following formats:

Command-Line Syntax

The 16-bit viewer has the following command-line syntax:

ctxv16 [-p file] [-w file] [-vw] [-vp] [-vb] [-o x,y] 
       [-d wd,ht] [-th title] [-tv title] 
       [-s starttag] [-e endtag]

Parameters

Parameter Description
-p textfile View textfile in plain text window. Text may be highlighted by using highlight markers. This will be removed before displayed (see -s/ -e).
-w wpfile View wpfile in the WYSIWYG window. This can be any format file supported by the Mastersoft viewing DLLs. See list in the "Supported Formats" section in this appendix.
-vw View document in WYSIWYG window. To view the document with highlights in the WYSIWYG window, you must also specify the associated highlighted plain text file with -p.
-vp View document in plain text window, with or without highlights.
-vb View document in both WYSIWYG and plain text windows. To use this parameter, you must also specify the plain text file with -p and the formatted file with -w.
-s stag stag specifies the character(s) used to mark the start of a highlight in the ASCII document. If stag contains spaces, enclose it in double quotes (").
-e etag etag specifies the character(s) used to mark the end of a highlight in the ASCII document. If etag contains spaces, enclose it in double quotes (").
-tv If viewing both WYSIWYG and Plain Text windows, vertically tile the windows on startup.
-th If viewing both WYSIWYG and Plain Text windows, horizontally tile the windows on startup.
-o x,y The original (x,y position in pixels) of the top left-hand edge of the application's outer frame. This is only used if both Plain Text and WYSIWYG viewing is requested.
-d wd,ht The dimensions (in pixels) of the application's outer frame. This is only used if both Plain Text and WYSIWYG viewing is requested.
-tp "title" The title of the plain text window. title must be enclosed in quotes if it is more than one word long. "%s" within title is replaced with textfile as defined by the "-p" argument.
-tw "title" The title of the WYSIWYG window. This must be enclosed in quotes if it is more than one word long. "%s" within title is replaced with textfile as defined by the "-w" argument.
Table A - 1. 16-bit Windows Viewer (CTXV16) Parameters (Page 2 of 2)



Example 1 The following example shows how to view an ASCII document in a plain text and a Word document in a WYSIWYG window. The title of the plain text window will be "ASCII FORM: sample.txt" and the title of the WYSIWYG window will be "Word doc: sample.doc".

ctxv16 -p sample.txt -tp "ASCII FORM: %s" -w sample.doc -tw "Word doc: s%"

Example 2 In this example, the viewer displays SAMPLE.TXT using the plain text window and SAMPLE.DOC using the WYSIWYG window. SAMPLE.TXT will be highlighted if it contains highlight mark-up. The outer frame of application is positioned in the top left-hand corner of the screen and is of size 1200 by 1000 pixels. The default window titles are used.

ctxv16 -p sample.txt -w sample.doc -tw -o 0,0 -d 1200,1000

Example 3 This example displays SAMPLE.DOC highlighted in the WYSIWYG window. For this to work, SAMPLE.TXT must contain highlighted markup and must be specified with -p. We must let the viewer know with the -s and -p flags that the markup tags in SAMPLE.TXT are <<< to start and >>> to end a highlight.

The title of the SDI window will default to "Oracle ConText Option (16-bit) Document Viewer [Plain text: sample.txt]"

ctxv16 -p sample.txt -w sample.doc -vw -s "<<<" -e ">>>"

Using the CTXIO16 Utility

The CTXIO16 utility enables you to automate the steps for viewing a document in a 16-bit Windows environment.

The CTXIO16 utility can be used to perform the following operations:

These four operations are performed in sequence as defined by a parameter file that is specified when the CTXIO16 utility is run.

Command-Line Syntax

The CTXIO16 utility has the following command-line syntax:

ctxio16 [-w] [-p file] [-l file] [-d connect_string]

Parameter Description
-w Display status window. Messages in the parameter file are displayed in this window during processing.
-p file Name of parameter file.
For more information about the format of the file, see "Parameter File Format" in this appendix.
-l file Name of log file. Error and debug messages, as well as any messages in the parameter file, are output to this file. No messages are reported directly to the user.
-d connect_string Database connect string.
Table A - 2. 16-bit Utility (CTXIO16) Parameters (Page 1 of 1)



Parameter File Format

Start Tag End Tag Description
<SQL> </SQL> Encloses SQL commands. You can include up to 32k of SQL split over many lines. Keep lines below 2k.
<GET> </GET> Writes a document from database table to operating system. Specify parameters line by line as follows: Line 1: Destination filename Line 2: Table containing source document Line 3: Column containing source document Line 4: WHERE CLAUSE (excluding where keyword)
<PUT> </PUT> Puts a file-system document into a database table. Specify parameters line by line as follows: Line 1: Filename of source file Line 2: Destination table name Line 3: Destination column name Line 4: WHERE CLAUSE (excluding WHERE keyword)
<EXE> </EXE> Operating System command. This can be split over many lines. If so, CRs will be removed and replaced by spaces.
<MESS> end of line Displays message in log file and, if -w option is chosen, status window.
# end of line Comment line.
Table A - 3. CTXIO16 Parameter File Format (Page 1 of 1)



Example

The file below is an example CTXIO16 parameter file. Steps 1-7 create, populate, and index a text table with two Word7 documents. Steps 6-10 correspond to Steps 1-5 as described in the section "The 16-bit Viewing Process".

The command to execute this parameter file is:

ctxio16 -p pfile.txt -l log.txt -d scott/tiger@mysun 
#
# Contents of pfile.txt:
#
# (NB: Comments only supported for v2.0.4.1+)
#
# CTXIO16 Example
#
# Remember, if there are any problems with the SQL just cut and
# paste it into SQL*Plus to get the full error stack.
#
#
# 1. Drop stuff created last time
#
<SQL>
begin 
ctxsys.ctx_ddl.drop_index('CTXIO16_TEST');
ctxsys.ctx_ddl.drop_policy('CTXIO16_TEST');
end;
</SQL>
<SQL>
drop table ctxio16_test
</SQL>
#
# 2. Create test table
#
<SQL>
create table ctxio16_test (id number, text long raw)
</SQL>
<SQL>
alter table ctxio16_test add constraint unique_ctxiotest_test
unique(id)
</SQL>
#
# 3. PUT only does an update, so make sure the rows exist in the database
#
<SQL>
insert into ctxio16_test (id) values (1)
</SQL>
<SQL>
insert into ctxio16_test (id) values (2)
</SQL>
#
# 4. Write the two Word 7 documents to the database
#
<PUT>
ospeaks.doc
ctxio16_test 
text
id=1
</PUT>
<PUT>
cat.doc
ctxio16_test 
text
id=2
</PUT>
#
# 5. Create policy using the WW6B filter as AUTOB does not recognise Word7. 
#    This filter will be used for indexing and highlighting.
<SQL>
begin 
ctxsys.ctx_ddl.create_policy(policy_name=>'CTXIO16_TEST',
colspec=>'CTXIO16_TEST.TEXT',
textkey=>'ID',
filter_pref=>'WW6B'); 
ctxsys.ctx_ddl.create_index('CTXIO16_TEST');
end;
</SQL>
#
# 6. Create output MUTAB table for ctx_query.highlight(). 
#  The MUTAB table, named HITAB in this example, will
#  contain the highlighted ASCII version of
#  the document after calling ctx_query.highlight().
<SQL>
drop table hitab
</SQL>
<SQL>
create table hitab (id number, document long)
</SQL>
#
# 7. Create highlighted ASCII version of Word7 doc in HITAB table
#
<SQL>
begin 
  ctxsys.ctx_query.highlight(CSPEC=>'CTXIO16_TEST', TEXTKEY=>1,
       query=>'Oracle,Sybase', mutab=>'hitab', ID=>999, 
       starttag=>'<***', endtag=>'***>');
end;
</SQL>
#
# 8. GET highlighted ASCII from hitab table. GET writes file 
#   to OS file named mudoc.txt
#
<GET>
mudoc.txt
hitab
document
id=999
</GET>
#
# 9. Get Word7 document from database table ctxio16_test. Names the Word7
#    document raw.doc in the operating system.
#
<GET>
raw.doc
ctxio16_test 
text
id=1
</GET>
#
# 10. Now call the 16-bit viewer to highlight document
#     -vw => only show WYSIWYG window 
#
<EXE>
ctxv16 -tp "Plain doc" -p mudoc.txt -tw "Word 7 doc" -w raw.doc -vw 
       -s "<***" -e "***>"
</EXE>                                




Go to previous file in sequence Prev Oracle
Copyright © 1996 Oracle Corporation.
All Rights Reserved.
Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index