Monday, September 20, 2010

OMB*Plus extensibility - commands redefinition at startup with ombinit.tcl

There is simpler solution for defining commands during OMB*Plus startup - at startup OMB*Plus executes ombinit.tcl script located in OWB_HOME\owb\bin\admin directory.
This file contains definition of several procedures and version from OWB10g R2 also contains code for correcting of multiple path in TCLLIBPATH. In previous post (part 1 of OMB*Plus extensibility) I said that it is impossible to define more than one path in TCLLIBPATH - but with this procedure in ombinit.tcl TCLLIBPATH allow multiple paths sepparated by space.

Here is another addition to previous post - how to modify auto_mkindex to work.
As I said tcljava implementation of auto_mkindex contains a bug (it exist even in last tcljava release).
auto_mkindex is a general Tcl procedure which defined in init.tcl file (in tcljava implementation this file located in jacl.jar archive).
The first we need extract init.tcl file from archive - start command line in Windows and execute commands (suppose OWB installed in c:\oracle\owb10g_r2):

C:\>cd \oracle\owb10g_R2\owb\lib\int
C:\Oracle\owb10g_R2\owb\lib\int>..\..\..\jdk\bin\jar -xf jacl.jar tcl/lang/library/init.tcl
C:\Oracle\owb10g_R2\owb\lib\int>

As result we get file C:\Oracle\owb10g_R2\owb\lib\int\tcl\lang\library\init.tcl, we need to modify it  -
find in file line
puts $f $index nonewline
and replace it with
puts -nonewline $f $index

Now from command line move modified file back to archive

C:\Oracle\owb10g_R2\owb\lib\int>..\..\..\jdk\bin\jar -uf jacl.jar tcl\lang\library\init.tcl


Now auto_mkindex works under OMB*Plus:

OMB*Plus: Release 10.2.0.3.33
Copyright (c) 2000, 2006, Oracle. All rights reserved.
OMB+> auto_mkindex c:/oracle/tcllib myprocedure.tcl
OMB+>

No comments:

Post a Comment