integration of apex and oracle forms
DESCRIPTION
Presentation on how to Integrate the old and new Oracle technologies. Communicate from Forms to APEX and v.v. (Demo movie at the end of the presentation)TRANSCRIPT
![Page 1: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/1.jpg)
How to integrate APEX and Oracle Forms?
Roel Hartman
![Page 2: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/2.jpg)
Who am I?
![Page 3: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/3.jpg)
Who am I – somewhat more serious
roelhartman.blogspot.com
• Presenter at UKOUG (2x), OOW, ODTUG• APEX 3.2 EAR• OTN Forum• Articles• Blogger• Working for
![Page 4: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/4.jpg)
Introduction
APEX 3.2 : Forms conversion
The challenge of converting Simple Forms (60%) Moderate Forms (30%) (Very) Complex Forms (10%)
Top 10 %
projectstart
projectfinish
![Page 5: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/5.jpg)
The concept comes from…
OraFormsFaces
Thank you Wilfred!
![Page 6: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/6.jpg)
Embed a Form in APEX• Insert HTML• PL/SQL Procedure • URLhttp://localhost:7778/forms/frmservlet?config=apex&module=orders
![Page 7: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/7.jpg)
Embed a Form in APEX
![Page 8: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/8.jpg)
APEX PAGEAPEX REGION
Embed a Form in APEX
ORACLE FORM
![Page 9: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/9.jpg)
Visual Integration• Embed Forms HTML within two DIVs• Modify & Set• OuterDiv Width & Height• InnerDiv Width & Height• Applet Width & Height• Applet Margins• Address Applet by adding an
ID="formsapplet" line• Settings browser dependent
• Use same background color
<div id="outerdiv" style="overflow:hidden; border-style:none;"> <div id="innerdiv" style="overflow:scroll; border-style:none;"> #BODY# </div></div>
![Page 10: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/10.jpg)
Visual Integration
![Page 11: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/11.jpg)
Communicate from Forms to APEX• Use web.show_document( URL, target )• Attach a common library to your Form• Create procedure runJavascript
Requirement :When I move through a list of Products (Oracle Form), I want to see who bought it and where the customer is located.
web.show_document( ‘javascript:showOnMap()’, ‘_self’);PROCEDURE runJavascript( pScript varchar2) ISBEGIN web.show_document('javascript:'||pScript, '_self'); END;
![Page 12: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/12.jpg)
Communicate from Forms to APEX• Call procedure from WHEN-NEW-RECORD-
INSTANCE• Create procedure TriggerApex
TriggerApex('WHEN-NEW-RECORD-INSTANCE');PROCEDURE TriggerApex( pTrigger varchar2 ) ISBEGIN if name_in('system.current_form') = 'PRODUCTS' then if pTrigger = 'WHEN-NEW-RECORD-INSTANCE' then -- Requery APEX Reports region with parameter on Page 9 -- & Show the data on the Map runJavascript('refreshReport('|| name_in('PRODUCTS.PRODUCT_ID')|| ', ''P9_PRODUCT_ID'');showOnMap();'); end if; end if;END;
![Page 13: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/13.jpg)
Communicate from Forms to APEX
![Page 14: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/14.jpg)
Communicate from Forms to APEX
APEX PAGEAPEX REGION
ORACLE FORM
APEX REGIONAPEX Form
APEX Report
APEX Chart
web.show_document
![Page 15: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/15.jpg)
Communicate from APEX to Forms
Requirement :When I click on a customer in a report, I should be able to edit the customer data – using our current (very complex) Form. When I save the changes the report should be updated immediately.
![Page 16: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/16.jpg)
Communicate from APEX to Forms• Read Forms-as-Web-Components-Step-by-
Step.pdf• raiseEvent procedure – extend the Forms runtime
• CommunicatorBean – receive external events
• Add PJC to your Form
![Page 17: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/17.jpg)
Communicate from APEX to Forms• Define column link as : javascript:queryCustomer(#ID#);
• raiseEvent triggers (Bean’s) WHEN-CUSTOM-ITEM-EVENT• WHEN-CUSTOM-ITEM-EVENT calls execEvent• execEvent handles the request• Add code to TriggerApex procedure in library to refresh report
PROCEDURE execEvent IS BeanEventDetails ParamList; ParamType number := text_parameter; Event varchar2(1000); Payload varchar2(1000);begin BeanEventDetails := get_parameter_list(name_in('system.custom_item_event_parameters')); get_parameter_attr(BeanEventDetails, 'Event', ParamType, Event); get_parameter_attr(BeanEventDetails, 'Payload', ParamType, Payload); if name_in('system.current_form') = 'CUSTOMERS' then if upper(event)='EXECUTE_QUERY' then set_block_property('DEMO_CUSTOMERS' , DEFAULT_WHERE, 'WHERE CUSTOMER_ID = '||payload ); execute_query; end if; end if;end;
function queryCustomer( pCustId ){ //Setting Customer Id in Form and Requery execFormAction( 'execute_query', pCustId)}function execFormAction(pAction, pParam){ //Raising an event in Forms //Execute the Action (like 'execute query') $x('formsapplet').raiseEvent(pAction, pParam );}
if pTrigger = 'POST-DATABASE-COMMIT‘then -- Requery APEX Reports region with pValue, pField parameters runJavascript('refreshReport('''', '''')');end if;
![Page 18: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/18.jpg)
Communicate from APEX to Forms
APEX PAGEAPEX REGION
ORACLE FORM
APEX REGIONAPEX Form
APEX Report
APEX Chart
web.show_document
PJC
APEX REGION
Extended Forms Applet : raiseEvent
CommunicatorBean / PJC
WHEN-CUSTOM-ITEM-EVENT
Library
![Page 19: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/19.jpg)
Using the Applet Life Cycle• Prevent multiple frmweb processes• HTML must be 100% identical• Start up the same Form every time (landing)• Pass the ‘real’ Form name to the landing form• Use WHEN-APPLET-ACTIVATED event to call that Form• Details are in Wilfred’s doc!!
if upper(event) = 'WHEN-APPLET-ACTIVATED‘then while true loop -- get the form name set_custom_property('BLK_PJC.PJC', 1,'EvalExpression','$v("CALL_FORM_NAME")'); formName := get_custom_property('BLK_PJC.PJC', 1, 'EvalResult'); call_form(formName); appletActive := get_custom_property('BLK_PJC.PJC', 1, 'AppletActive'); if appletActive = 'FALSE‘ then exit; end if; end loop;end if;
![Page 20: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/20.jpg)
Some additional remarks• Forms 10.1.2.0 • other versions tested by Oracle Support (incl
F11)
• SUN JRE version (1.6.05) • < 10 or • switch off “Enable next-generation Java Plug-
In
• Focus and Sticky Cursor Issues • Metalink Note 730581.1
![Page 21: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/21.jpg)
Some additional remarks• Forms 11g• web.javascript_eval• WHEN-CUSTOM-JAVASCRIPT-EVENT• legacy lifecycle• rebuild the jar file with new class files
![Page 22: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/22.jpg)
Some additional remarks• Authentication• ‘fixed’ user in formsweb.cfg• pass APEX credentials (DB Auth.) to the Form• use SSO• login into Forms (once)
http://localhost:7778/forms/frmservlet?config=apex&userid=&APP_USER./&P101_PASSWORD.@XE
![Page 23: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/23.jpg)
Conclusions
The challenge of converting Simple Forms (60%) Moderate Forms (30%) (Very) Complex Forms (10%)
Top 10 %
projectstart
projectfinish
![Page 24: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/24.jpg)
Conclusions
Convert the major part at once Convert the rest when
necessary/possible So reducing
effort – (re)build and test money risk
But you still need the Forms Server ($)
Top 10 %
projectstart
projectfinish
![Page 25: Integration of APEX and Oracle Forms](https://reader033.vdocument.in/reader033/viewer/2022061122/546fa586af79595f478b4570/html5/thumbnails/25.jpg)
Coming soon….
Whitepaper on OTN In cooperation with Iloon Ellen (@
Oracle)