April 14, 2008

Forms 11g - Poll

After writing the last posts about Forms 11g, I'm very interested in getting your opinion, which of this new features is so important, that you directly include it into your daily work.

And: What other feature do you really need in the next patches and releases?

Please write them as comments to this post.

Thanks
Gerd

March 26, 2008

Forms 11g new features: Javascript-API

Forms 11g allows the direct communication between the generic java-applet in the browser and the world around. The new JavaScript-API implements this functionality.

In Forms 11g we have a new trigger, system-variables and built-ins for the communication with the JavaScript-API.

The trigger WHEN-CUSTOM-JAVASCRIPT-EVENT fires each time, when JavaScript raises an event to forms. In the trigger we can use the payload which is stored in two system-variables. system.javascript_event_name and :system.javascript_event_value.


Informations, which were transfered from HTML to Forms, can be easily used:


In this little example we transfer in the payload the event-name "NewForm" and in the event-value the name of a form. The data is transfered from the internet-page in this way::


< INPUT id="outside_field_id">
< SCRIPT>
function set_field (field_id, myValue) {
document.getElementById(field_id).value=myValue;
};
function clickEvent1()
{
document.forms_applet.raiseEvent("NewForm", "payload");
}
< /SCRIPT>
< INPUT id="button1" type="button" onClick="void clickEvent1();" value="NewForm">

Internally the method raiseEvent of the class forms_applet is used. The applet's name has to be assigned in the formsweb.cfg to the parameter applet_name.

applet_name=forms_applet

Forms can communicate bi-directional with the HTML. Therefore we can use the new built-ins web.javascript_eval_expr and web.javascript_eval_function.

web.javascript_eval_expr
('document.getElementById("outside_field_id").value="' ||
:control.ti_inside || '";');
web.javascript_eval_expr
('set_field("outside_field_id", "' || :control.ti_inside
|| '")');
:control.ti_get_value := web.javascript_eval_function
('document.etElementById("outside_field_id").value');

This example-code fills in the HTML-page a field named "outside_field_id" through the built-in web.javascript_eval_expr. Two techniques can be used. Direct Assignment or the call of a javascript-function, e.g. „set_field“.
You can read field through web.javascript_eval_function. The returnvalue is the value of the corresponding field in the HTML, in this case "outside_field_id".

This is another example of how important the new features in Forms 11g are. Now it's possible for forms to communicate with the world outside the browser's applet!

February 08, 2008

LOV with splitted data

I found an easy technique to visualize data in lov's like this:



Use multiple UNION ALL's to concatenate the data :


select '---new colleagues---' ename, NULL job, NULL hiredate
from dual
UNION ALL
select ename, job, to_char (hiredate, 'DD.MM.YYYY')
from emp where hiredate >= to_date ('01.07.1981', 'DD.MM.YYYY')
UNION ALL
select '---before 07/81---' ename, NULL job, NULL hiredate
from dual
UNION ALL
select ename, job, to_char (hiredate, 'DD.MM.YYYY')
from emp where hiredate < to_date ('01.07.1981', 'DD.MM.YYYY')

have fun and use it
Gerd

January 11, 2008

Hotkey F1 in Forms 10g

Since Forms 10g we have problems with F1. He doesn't work like in the older versions.

The Key-Mapping for KEY-HELP e.g. is now Ctrl+H instead of the good old F1.

If you want to have it work like in Forms 6i, then you can change the fmrweb.res:

The internal ID of F1 is 112, the ID of KEY-HELP-Trigger is 30:


...
113 : 0 : "F2" : 95 : "List Tab Pages"
112 : 0 : "F1" : 30 : "Help"
72 : 2 : "Ctrl+H" : 30 : "Help"

have fun
Gerd

December 13, 2007

The new german Talk2Gerd

Today I learned from Patrick Wolf, how easy it is to duplicate a blog into another languages. This link here is now the german version of Talk2Gerd.

And last but not least, here is a picture of my company after snowfall... and we had a lot of snow in the last years:

December 12, 2007

Libraries: PLL vs. PLX

One big problem while developing an application is the question: Should I use attached libraries as *.pll or *.plx?

Let's have a look at some cases:

A) You use pll+plx while developing the application. The Forms Builder uses the working directory C:\Forms and the FORMS_PATH has an additional path to the directory C:\Forms\Lib. The Sourcefiles have the name Lib.pll, the Menu.mmb and EMP.fmb.

If there is a generated Lib.plx in c:\forms or c:\forms\lib, then this is the version, which will be used at runtime.

This is the direction of how Forms searches for attached libraries:


1) If Lib.plx is in your working directory - take it
2) If not found, search in the FORMS_PATH for Lib.plx
3) If not found, search in the working directory for Lib.pll
4) If not found, search in the FORMS_PATH for Lib.pll
5) If the library can't be found - Forms raises an error

This is identical to menu-mmx and forms-fmx


If the plx in the local working directory is an older version than the pll, this will cause big problems while running the forms-application. Finding errors is very tricky, if the developer didn't look on the timestamps of the libraries.

B) You use only pll's in your application.

You have no problems while developing the application or at runtime. If a library in your working directory didn't exist, then the library can be found in the FORMS_PATH.

Summary:

I never use plx because I saw many projects run into the plx-trap.

Many developer say: plx is faster, but I never had performance problems with the pll's.

Other developer say: plx is only the compiled code, so nobody can steal my sourcecode or something valuable from within the code - in that case try this example:

Create a library with a package and this variable:

PACKAGE Const IS
HiddenPW CONSTANT Varchar2 (100) := 'HiddenPW';
END Const;

Generate the plx and open it in an editor. Search for "HiddenPW". You'll find the name of the variable and the string associated to the var. That's not secure in my eyes. Only the sourcecode is hidden. I think, that a pll on an Application Server is secure enough.

If the application is standard software and not for free, then you must use the plx-technique and wrapped packages in the database.

December 11, 2007

DOAG Top News: Forms 11g

The German Oracle User Group (DOAG) has launched a little Forms 11g note from me as their actual Top News.

I wrote some lines about the new features of Forms 11g and the huge capabilities in the new SOA world of tomorrow. Here is the translation:

Forms 11g unterwegs in Richtung SOA : Forms 11g's direction to SOA

After 6 years is this the first Forms Version which integrates new features into the Forms Builder. The two new important features found are:

The first one is the communication between the database and Forms via Advanced Queuing. There is a new object-typ called Event, who communicates with a queue. New data in a Queue starts an event-trigger, which runs in Forms.

The second highlight is the Javascript-API. HTML-pages can exchange data with Forms via Javascript. In the old days you could do this only using java applets. With the new technique you have WHEN-CUSTOM-JAVASCRIPT-EVENT-trigger which can be used from the developer. The communication runs in both directions and it's possible to change data in the HTML-page through Forms via Javascript

Those two new techniques are indications, that Oracle Forms is ready for the future. It is one of the main SOA-parts of the new Oracle Fusion Middleware 11g.

Additional information to Forms 11g can be found in the German Forms Community

Thanks to DOAG

December 01, 2007

New Statement of Direction, Nov. 2007

This is the actual timeline for Oracle Forms

November 26, 2007

Forms 11g new features: Events

My DOAG Conference 2007 presentation was "Forms 11g: A look behind the scenes"

The main two new features are: Advanced Queuing and Javascript-API. Today I explain the AQ-technique with Forms-Events.

Events - Interaction with Advanced Queuing

This is the first big new change in Forms Builder since 6 years. We can create Events and assign them to queues. If someone inserts new data in this AQ, the appropriate new trigger WHEN-EVENT-RAISED starts.


Allowed Properties for Events


Event Type : Data Base, User Defined
Subscription Name : AQ-Name (LOV)
Scope : Application, Form
Auto Subscribe : Yes, No
Correlation ID :
View Mode : Browse, Locked, Removed

formsweb.cfg

maxEventWait=1000

The new parameter maxEventWait is important. The value is in milliseconds and means the intervall, in which the AQ's used by forms get refreshed against the database. Without this parameter the form refreshes only, if the user interacts with the runform.

Code-Snippet

BEGIN
:CONTROL.TI_Payload := get_event_object_property ('EV_Default', Event_Payload);
IF upper (:CONTROL.TI_Payload) = 'ATTACH DEBUG' THEN
DEBUG.Attach;
...
END IF;
END;

This example is a remote control for remote debugging. You can insert a command into the queue, which is assigned to the Event EV_DEFAULT and each time, when the payload has the value ATTACH DEBUG a debug-process starts in the forms runtime.

In my Download-Section is a link to my presentation (in german).

November 22, 2007

DOAG Conference 2007

Today was the last day of this years conference. The DOAG (German Oracle User Group) is now 20 years old and so we had some slots in the conference like "Oracle 5.0 New Features)

That was a funny presentation from Dierk Lenz. He used his 20 years old slides and presented us all the new features from the database in 1988.

In the presentation he started a vmWare with DOS 6.22 and SQL*Forms 2



In this presentation we were nearly 200 people ! To have a look on the new Features of Oracle 5.0 :-)

October 01, 2007

Forms Startup (part 1)

This is the first article of a serial. Different methods of enhancing the Forms Startup-Phase are discussed here. In most projects I saw techniques, where the Browser-HTML were changed, so that the user cannot easily close the browser for example.

My first example is from Francois Degrelle. He gave me the tip with a self-hiding Internet Explorer on Forms Startup. The only parameter which has to be changed is the HTMLbodyAttrs in the formsweb.cfg:


HTMLbodyAttrs=onLoad='javascript:self.moveTo(2000,2000)'

After the forms-application-startup the browser-window moves to the x,y-position 2000, 2000. This is far behind the normal range of the visible screen. And so the user thinks, that the Browser closed hisself. The icon in the taskbar is still available, but the Browser didn't went visible, when the user clicks on the task-symbol.

pro:
- the user thinks, that the browser hides hisself
- only the forms-runtime window is visible (in separateFrame=True - mode)

contra:
- the active task of the browser is visible and can't be activated, only closed

this is actually my favorite technique

September 17, 2007

Bigger. taller. better :-)

I played a little bit with the Template-HTML and found better properties for my Blog.

The old width for example was a bit problematic, because sourcecodes were often too long for the small size of the blog. Now I have 50% more space for my snippets :-)

September 13, 2007

Easy logging and debugging in Forms

Each forms-application needs a simple way to log errors and find them. This technique can be used also to debug Forms, Reports and pure PL/SQL.

First create the table, sequence and view to store the logging-information:


CREATE TABLE Logging (
ID NUMBER(8,0) NOT NULL,
SESSION_ID NUMBER(8,0),
INSERT_DATE DATE NOT NULL,
TEXT VARCHAR2(2000) NOT NULL);

CREATE SEQUENCE Logging_SEQ;

CREATE OR REPLACE VIEW V_Logging_desc
(ID, SESSION_ID, INSERT_DATE, TEXT)
AS SELECT ID, SESSION_ID, INSERT_DATE, TEXT
FROM Logging
ORDER BY SESSION_ID DESC, ID DESC;

You need also a package with some functions to start the logging-process

CREATE OR REPLACE PACKAGE PK_DEBUG IS
FUNCTION Debug_allowed RETURN BOOLEAN;
FUNCTION Next_ID RETURN NUMBER;

PROCEDURE Disable;
PROCEDURE Enable;
PROCEDURE Destroy;
PROCEDURE Init (P_Debug_allowed IN BOOLEAN DEFAULT TRUE);
PROCEDURE Write (P_Text IN VARCHAR2,
P_Session_ID IN NUMBER DEFAULT NULL);

G_Debug_allowed BOOLEAN := TRUE;
G_Session_ID NUMBER;
END;
/
CREATE OR REPLACE PACKAGE BODY PK_DEBUG IS
FUNCTION Debug_allowed RETURN BOOLEAN IS
BEGIN
RETURN (G_Debug_allowed);
END;

FUNCTION Next_ID RETURN NUMBER IS
V_ID NUMBER;
BEGIN
SELECT Logging_SEQ.nextval
INTO V_ID
FROM DUAL;
RETURN (V_ID);
END;

PROCEDURE Disable IS
BEGIN
G_Debug_allowed := FALSE;
END;

PROCEDURE Enable IS
BEGIN
G_Debug_allowed := TRUE;
END;

PROCEDURE Destroy IS
BEGIN
Write ('----------------------stopp '
|| to_char (G_Session_ID) || '--');
G_Session_ID := NULL;
END;

PROCEDURE Init (
P_Debug_allowed IN BOOLEAN DEFAULT TRUE) IS
BEGIN
G_Debug_allowed := P_Debug_allowed;
G_Session_ID := Next_ID;
Write ('--start ' || to_char (G_Session_ID)
|| '----------------------');
END;

PROCEDURE Write (
P_Text IN VARCHAR2,
P_Session_ID IN NUMBER DEFAULT NULL) IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
IF Debug_allowed THEN
IF G_Session_ID IS NULL THEN
Init;
END IF;
INSERT INTO Logging (ID,
Session_ID, Insert_Date, Text)
VALUES (Next_ID,
NVL (P_Session_ID, G_Session_ID),
Sysdate, P_Text);
COMMIT;
END IF;
END;
END;
/

You start the debug with INIT and end it with DESTROY. Error-Messages are logged through WRITE. For example:

pk_Debug.Write ('Hello World - ' || V_Test);

Parts of your debugging can be deactivated with DISABLE and from this point on nothing will be written into the logging-table till ENABLE is called.

The view V_Logging_desc shows you the logging-data, grouped by the newest session-id.

ID Session Insert-Date Text
============================================
24 21 10.09.-12:38:48 -------stopp 21--
23 21 10.09.-12:38:48 Hello World - 42
22 21 10.09.-12:38:48 --start 21-------


Try it and have fun
Gerd

August 31, 2007

San Francisco Impressions

Here are some impressions from the city, shot in the days after the test-event

From Lombard Street to Coit Tower

17 Miles Drive

Muir Woods

Another proof: Second Life exists in reality and not in virtuality

Stone Art in Sausalito

The Golden Gate

August 24, 2007

Oracle Fusion Middleware 11g Beta Test - Last Day

Today was the last Day of the Beta-Test. After the last testings started the big Feedback-Session in Oracle's Conference Center.

All customers which tested this week and fifty Oracle experts came together, plus dozens through a Web-Conference. In the next 3 hours all products of the Fusion Middleware-Stack got feedback from us. The only tester for Oracle Forms (myself) gave this feedback to Oracle:

First of all: Forms is a really big platform in germany and this Beta 2 program showed us in the last days the first Oracle Forms, which has new functionality in the Forms Builder itself.

After that I described the new features and how important they are for the Forms Community.

In the end I had time to explain, which functionality I personally wish to have in the Forms Builder :

* an object called Web-Service at form-level
* the integration of BI-Beans
* and most important: a new PL/SQL-Editor

That was my statement and now I have to thank Oracle for the invitation to this event, Duncan and his group for the best support that you can have in such a week. It was fantastic to have the chance to work with such profis.

And the last thanks went to Rolf (my boss) who sponsored this trip, Manuela (who let me go) and Andreas, who backup'd me for this week in Krefeld. Many many thanks to you !

This must be the proof, that Duncan's career started in the NBA, before Oracle found him (I'm 6'7"):

PS: If you wonder, why I don't name the new features by name or describe, which functionality they have. Please excuse for that, but I had to sign many Documents at Oracle, which don't allow that.