ODA - Oracle object Dependencies Analyzer

Sunday, September 4, 2016

I always wanted to learn to use java in Oracle Forms. Oracle form is very limited on a client side and you often need to expand your possibilities by use java code.And I have, at last, a task that can not be solved without the java usage.There is my target: I need to write a form for a text template creating, where I can create such a template for example:..........Dear <<Client Name>>Please accept this purchase order <<Order number>>Once it has shipped, you will receive a Shipping Confirmation email <<Email address>>...........Our dictionary of tags is:

Client Name

Order number

Email address

The template will be created in one multi-lined item.I have few tags in my dictionary and I need to pass a tag from the dictionary to a multi-lined text item as easily as possible.Our tags list is a multi-record block. I write the template and I want to insert a tag value at the position where I am now. I want to click the row with a necessary tag and the tag will be inserted programmatically in a current position in the editable item.What's a difficulty of this action? Oracle form does not be able to insert text into an inner place of a multi-lined item if you navigate from/to the item.

To pass the tag to the template I want to do:

to edit the template item and to place a cursor to a position where I'd like to insert a tag;

to click the tag;

to copy the tag value into system clipboard(Copy);

to navigate to the template item(a focus navigates to the current position);

In Form:I add a new "Bean Area" item to control block, visible on some canvas with width=0 and height=0.I set the "Implementation class" property value com.metro.beans.CopyPasteClipBoard(the package and class name).

I create an item TEMPLATES.TEMPLATE_EDIT for a template editing.

You need to switch the template item property "Keep Cursor Position" to "Yes".(Oracle, thanks for think about). This gives us to navigate to a same position if I leave and I enter to the template item.

I create a multi-record block TEMPLATE_TAGS with an item TAG_LABEL.There's the "WHEN-MOUSE-UP" trigger's code of the tag item :RM_TEMPLATE_TAGS.TAG_LABEL

To add the jar file name to the parameter archive_jini in an appropriate section of formsweb.cfg

archive=/forms/metro_java/MetroJbeans.jar,frmall.jar

For Forms 11 you must create

For example: archive_jini = frmall_jinit.jar, CopyPasteJbeans.jar

To solve java permissions. You search the c:\Program Files\Oracle\JInitiator 1.3.1.26\lib\security\java.policy(this location for 10 version, for 11 version you need to search in %JAVA_HOME% path a file with same name) and after row

// "standard" properties that can be read by anyone

to add two rows

permission java.awt.AWTPermission "accessClipboard";

permission java.awt.AWTPermission "createRobot";

I see one problem only: where do you place your JARs. I've give directory pathes, this can help...I wish you success