Wednesday, April 22, 2009

Retrieving client machine information in Oracle Applications Form

Overview

This document provides step by step approach of using a Javabean component to retrieve client machine information in Oracle Applications Form.

Oracle has provided an approach for Forms 6i (check reference below) but for implementating similar javabean in Oracle Applications, a different setup/configuration is required.

The reason is when the Form is registered in Oracle Applications and run from there, the configuration file that is read is not formsweb.cfg. Instead, a appsweb.cfg(or a custom .cfg file) is read.

This configuration file is set as $FORMS60_WEB_CONFIG_FILE and can be found at $COMMON_TOP/html/bin.

Forms configuration

Configuration for GetClientInfo on Application Server

· Connect to Application Server

· FTP the attached "GetClientInfo.jar.sig" file in BINARY mode to the "$OA_JAVA/oracle/apps/fnd/jar" directory on Application Server

Note: This file can be downloaded fron Oracle Technology Network (check reference below)

· Make sure the file size is 6324 bytes. If the file size is not 6324, that means it was not transferred in BINARY mode.

· Modify $FORMS60_WEB_CONFIG_FILE ($COMMON_TOP/html/bin) on Application Server as follows:

Find out archive tag and add " GetClientInfo.jar.sig " file at the end
Example: (archive=/OA_JAVA/oracle/apps/fnd/jar/fndforms.jar,....., OA_JAVA/oracle/apps/fnd/jar/GetClientInfo.jar.sig)

How to implement this bean in your own form

The fully qualified name for this JavaBean is oracle.forms.demos.GetClientInfo (note that Java is case sensitive).

This JavaBean must be added to a Form application using the BeanArea item. Place the BeanArea item on a canvas and then set the implementation class property to be the fully qualified name for the GetClientInfo JavaBean. You do not need to add the .class suffix.

The JavaBean must be set to visible in your application otherwise it will not be initialized and therefore will not work. You can hide the JavaBean by making it 1x1 in size and setting the background property to the same color as the canvas on which it is placed.





This JavaBean supports the following properties which can be programatically manipulated to modify the behavior of the Rollover Button.

With Oracle Forms Server 6i, the JavaBean can be directly queried and return data directly to the Form through the use of the GET_CUSTOM_PROPERTY builtin. This builtin will send a predefined property to the JavaBean for which it wishes to know the value. The JavaBean returns the data value directly as the return value of the builtin. There is no need to create and dispatch a CustomEvent to return the data. This is a far simpler approach and will make the use of JavaBeans far easier and more flexible.


USERNAME
This property is used to indicate to the JavaBean that it should return the value of the USERNAME property to the running Form application.



Forms Usage

username := GET_CUSTOM_PROPERTY(hBean,1,'USERNAME');


HOSTNAME
This property is used to indicate to the JavaBean that it should return the value of the HOSTNAME property to the running Form application.


Forms Usage

hostname := GET_CUSTOM_PROPERTY(hBean,1,'HOSTNAME');

IPADDRESS
This property is used to indicate to the JavaBean that it should return the value of the IPADDRESS property to the running Form application.


Forms Usage

username := GET_CUSTOM_PROPERTY(hBean,1,'IPADDRESS');



Verify that your bean is working correctly
Verify that the customization has been properly installed by following steps:
· Login to oracle apps application with appropriate username and password..
· Go the responsibility and open the form
(Note: If a java permission screen appears, choose “Grant Always”)
· Click Java Consol (coffee mug icon) in tool barJava Consol window will open.

· Make sure ‘GetClientInfo.jar.sig’ is loaded



Troubleshooting

1) Remember to use signed copy of the class file.

2) Remember to put file in correct directory in "binary" mode.

3) Verify that the file is listed in correct .cfg file.

4) Problems with Java Plug-in

It has been observed that the javabean may not work properly if you are using Java Plug-in instead of Jinitiator.

In that case, get a patch from Oracle.

They have a patch# 8402746 if you are using Forms 6.0.8.28.0 and Java Plug-in 1.6.0_12 (JRE version 1.6.0_12 Java HotSpot(TM) Client VM).



Reference
http://www.oracle.com/technology/sample_code/products/forms/extracted/getclientinfo/readme.html

Let's try

It is a good idea to spend available time to write your ideas in your own blog. There is nothing like sharing information in the world of IT.
My blog will mostly have technical information on Oracle databases and applications.
Sometimes I may even wander in subjects of common sense :)