Oracle Context Option Application Developer's Guide | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
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.
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.
ctxv16 [-p file] [-w file] [-vw] [-vp] [-vb] [-o x,y]
[-d wd,ht] [-th title] [-tv title]
[-s starttag] [-e endtag]
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. |
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 ">>>"
The CTXIO16 utility can be used to perform the following operations:
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. |
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>
![]() | ![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |