Oracle forms developer 10g vol1

24,433 views

Published on

Published in: Technology
3 Comments
12 Likes
Statistics
Notes
No Downloads
Views
Total views
24,433
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
1,611
Comments
3
Likes
12
Embeds 0
No embeds

No notes for slide

Oracle forms developer 10g vol1

  1. 1. Oracle Forms Developer 10g:Build Internet ApplicationsInstructor Guide • Volume 1D17251GC10Edition 1.0June 2004D39560®
  2. 2. Copyright © 2004, Oracle. All rights reserved.This documentation contains proprietary information of Oracle Corporation. It isprovided under a license agreement containing restrictions on use and disclosure andis also protected by copyright law. Reverse engineering of the software is prohibited.If this documentation is delivered to a U.S. Government Agency of the Department ofDefense, then it is delivered with Restricted Rights and the following legend isapplicable:Restricted Rights LegendUse, duplication or disclosure by the Government is subject to restrictions forcommercial computer software and shall be deemed to be Restricted Rights softwareunder Federal law, as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013,Rights in Technical Data and Computer Software (October 1988).This material or any portion of it may not be copied in any form or by any meanswithout the express prior written permission of Oracle Corporation. Any other copyingis a violation of copyright law and may result in civil and/or criminal penalties.If this documentation is delivered to a U.S. Government Agency not within theDepartment of Defense, then it is delivered with “Restricted Rights,” as defined inFAR 52.227-14, Rights in Data-General, including Alternate III (June 1987).The information in this document is subject to change without notice. If you find anyproblems in the documentation, please report them in writing to Education Products,Oracle Corporation, 500 Oracle Parkway, Redwood Shores, CA 94065. OracleCorporation does not warrant that this document is error-free.Oracle and all references to Oracle Products are trademarks or registered trademarksof Oracle Corporation.All other products or company names are used for identification purposes only, andmay be trademarks of their respective owners.AuthorPam GamerTechnical Contributorsand ReviewersAlena BugarovaPurjanti ChangLaurent DereacPunita HandaMark PareJasmin RobayoBryan RobertsDivya SandeepRaza SiddiquiJohn SoltaniLex van der WerffEditorsNishima SachdevaElizabeth TreacyPublisherGiri Venugopal
  3. 3. PrefaceI IntroductionObjectives I-2Course Objectives I-3Course Content I-51 Introduction to Oracle Forms Developer and Oracle Forms ServicesObjectives 1-2Internet Computing Solutions 1-3Plugging into the Grid 1-4Oracle Enterprise Grid Computing 1-5Oracle 10g Products and Forms Development 1-7Oracle Application Server 10g Architecture 1-8Oracle Application Server 10g Components 1-9Oracle Forms Services Overview 1-10Forms Services Architecture 1-11Benefits and Components of Oracle Developer Suite 10g 1-12Oracle Developer Suite 10g Application Development 1-13Oracle Developer Suite 10g Business Intelligence 1-14Oracle Forms Developer Overview 1-15Oracle Forms Developer: Key Features 1-16Summit Office Supply Schema 1-17Summit Application 1-18Summary 1-202 Running a Forms Developer ApplicationObjectives 2-2Testing a Form: OC4J Overview 2-3Testing a Form: Starting OC4J 2-4Running a Form 2-5Running a Form: Browser 2-6The Java Runtime Environment 2-7Starting a Run-Time Session 2-8The Forms Servlet 2-11The Forms Client 2-12The Forms Listener Servlet 2-13The Runtime Engine 2-14What You See at Run Time 2-15Identifying the Data Elements 2-17Navigating a Forms Developer Application 2-18Modes of Operation: Enter-Query Mode 2-20Modes of Operation: Normal Mode 2-21Retrieving Data 2-22Retrieving Restricted Data 2-23Query/Where Dialog Box 2-25Inserting, Updating, and Deleting 2-27Contentsiii
  4. 4. Making Changes Permanent 2-29Displaying Errors 2-30Summary 2-31Practice 2 Overview 2-343 Working in the Forms Developer EnvironmentObjectives 3-2Forms Builder Key Features 3-3Forms Builder Components: Object Navigator 3-4Forms Builder Components: Property Palette 3-5Forms Builder Components: Layout Editor 3-6Forms Builder Components: PL/SQL Editor 3-7Getting Started in the Forms Builder Interface 3-8Forms Builder: Menu Structure 3-10Blocks, Items, and Canvases 3-12Navigation in a Block 3-14Data Blocks 3-15Forms and Data Blocks 3-17Form Module Hierarchy 3-19Customizing Your Forms Builder Session 3-21Saving Preferences 3-23Using the Online Help System 3-24Forms Developer Executables 3-25Forms Developer Module Types 3-27Defining Forms Environment Variables for Run Time 3-29Defining Forms Environment Variables for Design Time 3-30Environment Variables and Y2K Compliance 3-32Forms Files to Define Run-Time Environment Variables 3-34Testing a Form: The Run Form Button 3-35Summary 3-37Practice 3 Overview 3-394 Creating a Basic Form ModuleObjectives 4-2Creating a New Form Module 4-3Form Module Properties 4-6Creating a New Data Block 4-8Navigating the Wizards 4-10Launching the Data Block Wizard 4-11Data Block Wizard: Type Page 4-12Data Block Wizard: Table Page 4-13iv
  5. 5. Data Block Wizard: Finish Page 4-14Layout Wizard: Items Page 4-15Layout Wizard: Style Page 4-16Layout Wizard: Rows Page 4-17Data Block Functionality 4-18Template Forms 4-19Saving a Form Module 4-20Compiling a Form Module 4-21Module Types and Storage Formats 4-22Deploying a Form Module 4-24Text Files and Documentation 4-25Summary 4-26Practice 4 Overview 4-275 Creating a Master-Detail FormObjectives 5-2Form Block Relationships 5-3Data Block Wizard: Master-Detail Page 5-5Relation Object 5-7Creating a Relation Manually 5-8Join Condition 5-9Deletion Properties 5-10Modifying a Relation 5-11Coordination Properties 5-12Running a Master-Detail Form Module 5-13Modifying the Structure of a Data Block 5-14Modifying the Layout of a Data Block 5-15Summary 5-17Practice 5 Overview 5-186 Working with Data Blocks and FramesObjectives 6-2Managing Object Properties 6-3Displaying the Property Palette 6-4Property Palette: Features 6-5Property Controls 6-6Visual Attributes 6-8How to Use Visual Attributes 6-9Font, Pattern, and Color Pickers 6-10Controlling Data Block Behavior and Appearance 6-11Navigation Properties 6-12v
  6. 6. Records Properties 6-13Database Properties 6-15Scroll Bar Properties 6-18Controlling Frame Properties 6-19Displaying Multiple Property Palettes 6-21Setting Properties on Multiple Objects 6-22Copying Properties 6-24Creating a Control Block 6-26Deleting a Data Block 6-27Summary 6-28Practice 6 Overview 6-297 Working with Text ItemsObjectives 7-2Text Item Overview 7-3Creating a Text Item 7-4Modifying the Appearance of a Text Item: General and Physical Properties 7-6Modifying the Appearance of a Text Item: Records Properties 7-7Modifying the Appearance of a Text Item: Font and Color Properties 7-8Modifying the Appearance of a Text Item: Prompts 7-9Associating Text with an Item Prompt 7-10Controlling the Data of a Text Item 7-11Controlling the Data of a Text Item: Format 7-12Controlling the Data of a Text Item: Values 7-13Controlling the Data of a Text Item: Copy Value from Item 7-15Controlling the Data of a Text Item: Synchronize with Item 7-16Altering Navigational Behavior of Text Items 7-17Enhancing the Relationship Between Text Item and Database 7-18Adding Functionality to a Text Item 7-19Adding Functionality to a Text Item: Conceal Data Property 7-20Adding Functionality to a Text Item: Keyboard Navigable and Enabled 7-21Adding Functionality to a Text Item: Multi-line Text Items 7-22Displaying Helpful Messages: Help Properties 7-23Summary 7-24Practice 7 Overview 7-268 Creating LOVs and EditorsObjectives 8-2Overview of LOVs and Editors 8-3LOVs and Record Groups 8-6Creating an LOV Manually 8-8vi
  7. 7. Creating an LOV with the LOV Wizard: SQL Query Page 8-9Creating an LOV with the LOV Wizard: Column Selection Page 8-10Creating an LOV with the LOV Wizard: Column Properties Page 8-11Creating an LOV with the LOV Wizard: Display Page 8-12Creating an LOV with the LOV Wizard: Advanced Properties Page 8-13Creating an LOV with the LOV Wizard: Assign to Item Page 8-14LOV Properties 8-15Setting LOV Properties 8-16LOVs: Column Mapping 8-17Defining an Editor 8-19Setting Editor Properties 8-20Associating an Editor with a Text Item 8-21Summary 8-22Practice 8 Overview 8-239 Creating Additional Input ItemsObjectives 9-2Input Items Overview 9-3Check Boxes Overview 9-4Creating a Check Box 9-5Converting an Existing Item into a Check Box 9-6Creating a Check Box in the Layout Editor 9-7Setting Check Box Properties 9-8Check Box Mapping of Other Values 9-10List Items Overview 9-11Creating a List Item 9-13Converting an Existing Item into a List Item 9-14Creating a List Item in the Layout Editor 9-15Setting List Item Properties 9-16List Item Mapping of Other Values 9-17Radio Groups Overview 9-18Creating a Radio Group 9-19Converting Existing Item to Radio Group 9-20Creating Radio Group in Layout Editor 9-21Setting Radio Properties 9-22Radio Group Mapping of Other Values 9-23Summary 9-24Practice 9 Overview 9-2510 Creating Noninput ItemsObjectives 10-2Noninput Items Overview 10-3vii
  8. 8. Display Items 10-4Creating a Display Item 10-5Image Items 10-6Image File Formats 10-8Creating an Image Item 10-9Setting Image-Specific Item Properties 10-10Push Buttons 10-12Push Button Actions 10-13Creating a Push Button 10-14Setting Push Button Properties 10-15Calculated Items 10-16Creating a Calculated Item by Setting Properties 10-17Setting Item Properties for the Calculated Item 10-18Summary Functions 10-19Calculated Item Based on a Formula 10-20Rules for Calculated Item Formulas 10-21Calculated Item Based on a Summary 10-22Rules for Summary Items 10-23Creating a Hierarchical Tree Item 10-24Setting Hierarchical Tree Item Properties 10-25Bean Area Items 10-26Creating a Bean Area Item 10-27Setting Bean Area Item Properties 10-28The JavaBean at Run Time 10-29Summary 10-30Practice 10 Overview 10-3211 Creating Windows and Content CanvasesObjectives 11-2Windows and Canvases 11-3Window, Canvas, and Viewport 11-4The Content Canvas 11-5Relationship Between Windows and Content Canvases 11-6The Default Window 11-7Displaying a Form Module in Multiple Windows 11-8Creating a New Window 11-9Setting Window Properties 11-10GUI Hints 11-11Displaying a Form Module on Multiple Layouts 11-12Creating a New Content Canvas 11-13Setting Content Canvas Properties 11-15viii
  9. 9. Summary 11-16Practice 11 Overview 11-1712 Working with Other Canvas TypesObjectives 12-2Overview of Canvas Types 12-3The Stacked Canvas 12-4Creating a Stacked Canvas 12-6Setting Stacked Canvas Properties 12-8The Toolbar Canvas 12-9The MDI Toolbar 12-10Creating a Toolbar Canvas 12-11Setting Toolbar Properties 12-12The Tab Canvas 12-13Creating a Tab Canvas 12-14Creating a Tab Canvas in the Object Navigator 12-15Creating a Tab Canvas in the Layout Editor 12-16Setting Tab Canvas, Tab Page, and Item Properties 12-17Placing Items on a Tab Canvas 12-18Summary 12-19Practice 12 Overview 12-2113 Introduction to TriggersObjectives 13-2Trigger Overview 13-3Grouping Triggers into Categories 13-4Defining Trigger Components 13-6Trigger Type 13-7Trigger Code 13-9Trigger Scope 13-10Specifying Execution Hierarchy 13-12Summary 13-1414 Producing TriggersObjectives 14-2Creating Triggers in Forms Builder 14-3Creating a Trigger 14-4Setting Trigger Properties 14-7PL/SQL Editor Features 14-8The Database Trigger Editor 14-10Writing Trigger Code 14-11ix
  10. 10. Using Variables in Triggers 14-13Forms Builder Variables 14-14Adding Functionality with Built-In Subprograms 14-16Limits of Use 14-18Using Built-In Definitions 14-19Useful Built-Ins 14-21Using Triggers: When-Button-Pressed Trigger 14-23Using Triggers: When-Window-Closed Trigger 14-24Summary 14-25Practice 14 Overview 14-2715 Debugging TriggersObjectives 15-2The Debugging Process 15-3The Debug Console 15-4The Debug Console: Stack Panel 15-5The Debug Console: Variables Panel 15-6The Debug Console: Watch Panel 15-7The Debug Console: Form Values Panel 15-8The Debug Console: PL/SQL Packages Panel 15-9The Debug Console: Global/System Variables Panel 15-10The Debug Console: Breakpoints Panel 15-11The Debug Console 15-12Setting Breakpoints in Client Code 15-13Setting Breakpoints in Stored Code 15-14Debugging Tips 15-15Running a Form in Debug Mode 15-16Stepping Through Code 15-17Debug Example 15-18Summary 15-20Practice 15 Overview 15-2116 Adding Functionality to ItemsObjectives 16-2Item Interaction Triggers 16-3Coding Item Interaction Triggers 16-5Interacting with Check Boxes 16-7Changing List Items at Run Time 16-8Displaying LOVs from Buttons 16-9LOVs and Buttons 16-11Populating Image Items 16-13x
  11. 11. Loading the Right Image 16-15Populating Hierarchical Trees 16-16Displaying Hierarchical Trees 16-18Interacting with JavaBeans 16-19Summary 16-25Practice 16 Overview 16-2717 Run Time Messages and AlertsObjectives 17-2Run-Time Messages and Alerts Overview 17-3Detecting Run-Time Errors 17-5Errors and Built-Ins 17-7Message Severity Levels 17-9Suppressing Messages 17-11The FORM_TRIGGER_FAILURE Exception 17-13Triggers for Intercepting System Messages 17-15Handling Informative Messages 17-17Setting Alert Properties 17-19Planning Alerts 17-21Controlling Alerts 17-22SHOW_ALERT Function 17-24Directing Errors to an Alert 17-26Causes of Oracle Server Errors 17-27Trapping Server Errors 17-29Summary 17-30Practice 17 Overview 17-3318 Query TriggersObjectives 18-2Query Processing Overview 18-3SELECT Statements Issued During Query Processing 18-5WHERE Clause 18-7ONETIME_WHERE Property 18-8ORDER BY Clause 18-9Writing Query Triggers: Pre-Query Trigger 18-10Writing Query Triggers: Post-Query Trigger 18-11Writing Query Triggers: Using SELECT Statements in Triggers 18-12Query Array Processing 18-13Coding Triggers for Enter-Query Mode 18-15Overriding Default Query Processing 18-19Obtaining Query Information at Run Time 18-22xi
  12. 12. Summary 18-25Practice 18 Overview 18-2719 ValidationObjectives 19-2The Validation Process 19-3Controlling Validation Using Properties: Validation Unit 19-5Controlling Validation Using Properties: Validate from List 19-7Controlling Validation Using Triggers 19-9Example: Validating User Input 19-11Using Client-Side Validation 19-13Tracking Validation Status 19-16Controlling When Validation Occurs with Built-Ins 19-18Summary 19-20Practice 19 Overview 19-2220 NavigationObjectives 20-2Navigation Overview 20-3Understanding Internal Navigation 20-5Using Object Properties to Control Navigation 20-7Mouse Navigate Property 20-9Writing Navigation Triggers 20-10Navigation Triggers 20-11When-New-<object>-Instance Triggers 20-12SET_<object>_PROPERTY Examples 20-13The Pre- and Post-Triggers 20-15Post-Block Trigger Example 20-17The Navigation Trap 20-18Using Navigation Built-Ins in Triggers 20-19Summary 20-21Practice 20 Overview 20-2321 Transaction ProcessingObjectives 21-2Transaction Processing Overview 21-3The Commit Sequence of Events 21-6Characteristics of Commit Triggers 21-8Common Uses for Commit Triggers 21-10Life of an Update 21-12Delete Validation 21-14xii
  13. 13. Assigning Sequence Numbers 21-16Keeping an Audit Trail 21-18Testing the Results of Trigger DML 21-19DML Statements Issued During Commit Processing 21-21Overriding Default Transaction Processing 21-23Running Against Data Sources Other than Oracle 21-25Getting and Setting the Commit Status 21-27Array DML 21-31Effect of Array DML on Transactional Triggers 21-32Implementing Array DML 21-33Summary 21-34Practice 21 Overview 21-3822 Writing Flexible CodeObjectives 22-2What Is Flexible Code? 22-3Using System Variables for Current Context 22-4System Status Variables 22-6GET_<object>_PROPERTY Built-Ins 22-7SET_<object>_PROPERTY Built-Ins 22-9Referencing Objects by Internal ID 22-11FIND_ Built-Ins 22-12Using Object IDs 22-13Increasing the Scope of Object IDs 22-15Referencing Objects Indirectly 22-17Summary 22-20Practice 22 Overview 22-2223 Sharing Objects and CodeObjectives 23-2Benefits of Reusing Objects and Code 23-3What Are Property Classes? 23-5Creating a Property Class 23-6Inheriting from a Property Class 23-8What Are Object Groups? 23-10Creating and Using Object Groups 23-11Copying and Subclassing Objects and Code 23-13Subclassing 23-14What Are Object Libraries? 23-16Benefits of the Object Library 23-18Working with Object Libraries 23-19xiii
  14. 14. What Is a SmartClass? 23-20Working with SmartClasses 23-21Reusing PL/SQL 23-22What Are PL/SQL Libraries? 23-24Writing Code for Libraries 23-25Creating Library Program Units 23-26Attach Library Dialog Box 23-27Calls and Searches 23-28Summary 23-30Practice 23 Overview 23-3224 Using WebUtil to Interact with the ClientObjectives 24-2WebUtil Overview 24-3Benefits of the WebUtil Utility 24-4Integrating WebUtil into a Form 24-11When to Use WebUtil Functionality 24-13Interacting with the Client 24-14Example: Opening a File Dialog on the Client 24-15Example: Reading an Image File into Forms from the Client 24-16Example: Writing Text Files on the Client 24-17Example: Executing Operating System Commands on the Client 24-18Example: Performing OLE Automation on the Client 24-19Example: Obtaining Environment Information about the Client 24-22Summary 24-23Practice 24 Overview 24-2425 Introducing Multiple Form ApplicationsObjectives 25-2Multiple Form Applications Overview 25-3Multiple Form Session 25-4Benefits of Multiple Form Applications 25-5Starting Another Form Module 25-6Defining Multiple Form Functionality 25-8Conditional Opening 25-10Closing the Session 25-11Closing a Form with EXIT_FORM 25-12Other Useful Triggers 25-13Sharing Data Among Modules 25-15Linking by Global Variables 25-16Global Variables: Opening Another Form 25-17Global Variables: Restricted Query at Startup 25-18xiv
  15. 15. Assigning Global Variables in the Opened Form 25-19Linking by Parameter Lists 25-20Linking by Global Record Groups 25-23Linking by Shared PL/SQL Variables 25-24Summary 25-26Practice 25 Overview 25-28Appendix A: Practice SolutionsAppendix B: Table DescriptionsAppendix C: Introduction to Query BuilderAppendix D: Locking in FormsAppendix E: Oracle Object FeaturesAppendix F: Using the Layout Editorxv
  16. 16. Preface
  17. 17. Oracle Forms Developer 10g: Build Internet Applications Preface - 2
  18. 18. Oracle Forms Developer 10g: Build Internet Applications Preface - 3ProfileBefore you begin this courseBefore you begin this course, you should be able to:• Create SQL statements.• Create PL/SQL constructs, including conditional statements, loops, procedures and functions.• Create PL/SQL stored (server) procedures, functions, and packages.• Use a graphical user interface (GUI).• Use a Web browser.PrerequisitesEither• Oracle Database 10g: SQL Fundamentals I• or the following CBT Library:– Oracle SQL: Basic SELECT statements– Oracle SQL: Data Retrieval Techniques– Oracle SQL: DML and DDL• or Introduction to Oracle Database 10g for Experienced SQL Users (InClass)• or Oracle Database 10g: Introduction to SQL (InClass)And either• Oracle Database 10g: Program with PL/SQL (InClass)• or the following CBT Library:– PL/SQL: Basics– PL/SQL: Procedures, Functions, and Packages– PL/SQL: Database Programming• Or both:– Oracle Database 10g: PL/SQL Fundamentals (InClass)– Oracle Database 10g: Develop PL/SQL Program Units (InClass)Suggested prerequisites• Oracle Database 10g: SQL Fundamentals II (InClass) (if you attended the Oracle Database 10g:SQL Fundamentals I (InClass))• Oracle Database 10g: Advanced PL/SQL (InClass)• Oracle Forms Developer 10g: Move to the Web (eStudy)How this course is organizedOracle Forms Developer 10g: Build Internet Applications is an instructor-led course featuring lectureand hands-on exercises. Online demonstrations and written practice sessions reinforce the concepts andskills introduced.
  19. 19. Oracle Forms Developer 10g: Build Internet Applications Preface - 4Related PublicationsOracle publicationsTitle Part NumberOracle Forms Developer, Release 6i:Getting Started (Windows 95/NT) A73154-01Oracle Forms Developer and Reports Developer, Release 6i:Guidelines for Building Applications A73073-02Oracle Application Server Forms Services Deployment Guide B10470-0110g (9.0.4)Additional publicationsRelease notes: <ORACLE_HOMEdocwelcomerelease_noteschap_forms.htm
  20. 20. Oracle Forms Developer 10g: Build Internet Applications Preface - 5Typographic ConventionsTypographic conventions in textConvention Element ExampleBold italic Glossary term (if there isa glossary)The algorithm inserts the new key.Caps andlowercaseButtons,check boxes,triggers,windowsClick the Executable button.Select the Can’t Delete Card check box.Assign a When-Validate-Item trigger to theORDERS block.Open the Master Schedule window.Courier new,case sensitive(default islowercase)Code output,directory names,filenames,passwords,pathnames,URLs,user input,usernamesCode output: debug.set (‘I”, 300);Directory: bin (DOS), $FMHOME (UNIX)Filename: Locate the init.ora file.Password: User tiger as your password.Pathname: Open c:my_docsprojectsURL: Go to http://www.oracle.comUser input: Enter 300Username: Log on as scottInitial cap Graphics labels(unless the term is aproper noun)Customer address (but Oracle Payables)Italic Emphasized words andphrases,titles of books andcourses,variablesDo not save changes to the database.For further information, see Oracle7 Server SQLLanguage Reference Manual.Enter user_id@us.oracle.com, whereuser_id is the name of the user.QuotationmarksInterface elements withlong names that haveonly initial caps;lesson and chapter titlesin cross-referencesSelect “Include a reusable module component”and click Finish.This subject is covered in Unit II, Lesson 3,“Working with Objects.”Uppercase SQL column names,commands, functions,schemas, table namesUse the SELECT command to view informationstored in the LAST_NAMEcolumn of the EMP table.
  21. 21. Oracle Forms Developer 10g: Build Internet Applications Preface - 6Typographic Conventions (continued)Typographic conventions in text (continued)Typographic conventions in codeConvention Element ExampleRight arrow Menu paths Select File > Save.Brackets Key names Press [Enter].Commas Key sequences Press and release keys one at a time:[Alternate], [F], [D]Plus signs Key combinations Press and hold these keys simultaneously:[Ctrl]+[Alt]+[Del]Convention Element ExampleCaps andlowercaseOracle FormstriggersWhen-Validate-ItemLowercase Column names,table namesSELECT last_nameFROM s_emp;Passwords DROP USER scottIDENTIFIED BY tiger;PL/SQL objects OG_ACTIVATE_LAYER(OG_GET_LAYER (‘prod_pie_layer’))Lowercase italic Syntax variables CREATE ROLE roleUppercase SQL commandsand functionsSELECT useridFROM emp;
  22. 22. Copyright © 2004, Oracle. All rights reserved.IntroductionSchedule: Timing Topic15 minutes Lecture15 minutes Total
  23. 23. Oracle Forms Developer 10g: Build Internet Applications I-2I-2 Copyright © 2004, Oracle. All rights reserved.ObjectivesAfter completing this lesson, you should be able to dothe following:• Identify the course objectives• Identify the course content and structureIntroductionOverviewThis lesson introduces you to the Oracle Forms Developer 10g: Build InternetApplications course:• The objectives that the course intends to meet• The topics that it covers• How the topics are structured over the duration of the course
  24. 24. Oracle Forms Developer 10g: Build Internet Applications I-3I-3 Copyright © 2004, Oracle. All rights reserved.Course ObjectivesAfter completing this course, you should be able to dothe following:• Create form modules including components fordatabase interaction and GUI controls.• Display form modules in multiple windows and avariety of layout styles.• Test form modules in a Web browser.• Debug form modules in a three-tier environment.Course ObjectivesCourse DescriptionIn this course, you will learn to build, test, and deploy interactive Internet applications.Working in a graphical user interface (GUI) environment, you will learn how to createand customize forms with user input items such as check boxes, list items, and radiogroups. You will also learn how to modify data access by creating event-related triggers,and you will display Forms elements and data in multiple canvases and windows.
  25. 25. Oracle Forms Developer 10g: Build Internet Applications I-4I-4 Copyright © 2004, Oracle. All rights reserved.Course Objectives• Implement triggers to:– Enhance functionality– Communicate with users– Supplement validation– Control navigation– Modify default transaction processing– Control user interaction• Reuse objects and code• Link one form module to another
  26. 26. Oracle Forms Developer 10g: Build Internet Applications I-5I-5 Copyright © 2004, Oracle. All rights reserved.Course ContentDay 1• Lesson 1: Introduction to Oracle Forms Developerand Oracle Forms Services• Lesson 2: Running a Forms Builder Application• Lesson 3: Working in the Forms DeveloperEnvironment• Lesson 4: Creating a Basic Form Module• Lesson 5: Creating a Master-Detail Form• Lesson 6: Working with Data Blocks and FramesCourse ContentThe lesson titles show the topics that is covered in this course, and the usual sequence oflessons. However, the daily schedule is an estimate, and may vary for each class.
  27. 27. Oracle Forms Developer 10g: Build Internet Applications I-6I-6 Copyright © 2004, Oracle. All rights reserved.Course ContentDay 2• Lesson 7: Working with Text Items• Lesson 8: Creating LOVs and Editors• Lesson 9: Creating Additional Input Items• Lesson 10: Creating Noninput Items
  28. 28. Oracle Forms Developer 10g: Build Internet Applications I-7I-7 Copyright © 2004, Oracle. All rights reserved.Course ContentDay 3• Lesson 11: Creating Windows and ContentCanvases• Lesson 12: Working with Other Canvas Types• Lesson 13: Introduction to Triggers• Lesson 14: Producing Triggers• Lesson 15: Debugging Triggers
  29. 29. Oracle Forms Developer 10g: Build Internet Applications I-8I-8 Copyright © 2004, Oracle. All rights reserved.Course ContentDay 4• Lesson 16: Adding Functionality to Items• Lesson 17: Run-time Messages and Alerts• Lesson 18: Query Triggers• Lesson 19: Validation• Lesson 20: Navigation
  30. 30. Oracle Forms Developer 10g: Build Internet Applications I-9I-9 Copyright © 2004, Oracle. All rights reserved.Course ContentDay 5• Lesson 21: Transaction Processing• Lesson 22: Writing Flexible Code• Lesson 23: Sharing Objects and Code• Lesson 24: Using WebUtil to Interact with theClient• Lesson 25: Introducing Multiple Form Applications
  31. 31. Copyright © 2004, Oracle. All rights reserved.Introduction to Oracle Forms Developerand Oracle Forms ServicesSchedule: Timing Topic30 minutes Lecture30 minutes Total
  32. 32. Oracle Forms Developer 10g: Build Internet Applications 1-21-2 Copyright © 2004, Oracle. All rights reserved.ObjectivesAfter completing this lesson, you should be able to dothe following:• Define grid computing• Explain how Oracle 10g products implement gridcomputing• Describe the components of Oracle ApplicationServer 10g and Oracle Developer Suite 10g• Describe the features and benefits of OracleForms Services and Oracle Forms Developer• Describe the architecture of Oracle FormsServices• Describe the course applicationIntroductionOverviewThis course teaches you how to build effective and professional form applications using OracleForms Developer.This lesson identifies the key features of Oracle Application Server 10g, Oracle Developer Suite10g, Oracle Forms Services, Oracle Forms Developer, and the course application model andcontents.There are many terms used in this course that may be unfamiliar to you. For a glossarycontaining definitions of many of these terms, see http://www.oracle.com/glossary.
  33. 33. Oracle Forms Developer 10g: Build Internet Applications 1-31-3 Copyright © 2004, Oracle. All rights reserved.Internet Computing SolutionsApplication Typeand AudienceEnterprise applications,Business developersJava components,Component developersProductApproachRepository-basedmodeling & generation,DeclarativeOracleProductsOracle Designer,Oracle Forms Developer,& Oracle Forms ServicesTwo-way coding,Java and JavaBeansOracle JDeveloperOracle Application Server 10gBrowser-based,Dynamic HTMLSelf-service applications &content management,Web site developersOracle PortalOracle Database ServerDynamic Webreporting, Drill,Analyzing, ForecastingReporting andanalytical applications,MIS & business usersOracle Reports Developer,Oracle Reports Services,Oracle Discoverer, &Oracle ExpressInternet Computing SolutionsOracle offers a range of tools and deployment options for Internet computing. Different types ofdevelopers and applications require different toolsets.• Enterprise application developers need a declarative model-based approach. OracleDesigner and Oracle Forms Developer provide this solution. This course focuses on howyou can use Oracle Forms Developer to rapidly build scalable, high-performanceapplications for the Internet and then deploy the applications with Oracle Forms Services.• Component developers need different tools and methods. For these developers, Java is thelanguage of choice. Oracle’s solution is JDeveloper.• For Web site developers and content publishers who want to build self-service dynamicHypertext Markup Language (HTML) applications for Web sites, Oracle Portal provides aneasy-to-use development environment that resides entirely inside an Oracle database. Portalprovides a browser-based environment from development through deployment of anapplication.• For Management Information System (MIS) developers and end users, there is the OracleBusiness Intelligence toolset. Oracle Reports Developer, Oracle Reports Services, OracleDiscoverer, and Oracle Express provide the whole range for reporting, analysis, andtrending facilities.
  34. 34. Oracle Forms Developer 10g: Build Internet Applications 1-41-4 Copyright © 2004, Oracle. All rights reserved.Plugging into the GridGrid computing is:• Software infrastructure that uses low-cost serversand modular storage to:– Balance workloads– Provide capacity on demand• Made possible by innovations in hardware• Powered by softwarePlugging into the GridWhen you plug in a lamp, you have no knowledge of the source of the electricity that powers thelamp. You dont know, or even care, where the generator is or how the electric grid is wired. Youonly know that the bulb lights up on demand.Grid computing is a concept similar to that of electricity. Its aim is to make computing power asreliable, pervasive, and transparent as a utility.Enterprise grid computing builds a critical software infrastructure that can run on large numbersof small networked computers at a lower cost than running on large servers. Costs ofmanagement and administration are also reduced. The workload is balanced among themachines, and capacity can be added on demand, thus providing for efficient resource sharing.This is made possible by recent hardware innovations, such as low-cost powerful processors,blade servers, networked storage, and network interconnect technologies. But software powersthe grid by creating a single logical entity, such as a database or an application server, from acluster of machines, and by managing and administering groups of such systems as one.
  35. 35. Oracle Forms Developer 10g: Build Internet Applications 1-51-5 Copyright © 2004, Oracle. All rights reserved.Oracle Enterprise Grid ComputingOracles grid infrastructure products:• Oracle Database 10g• Oracle Application Server 10g• Oracle Enterprise Manager 10gGrid ControlOracle Enterprise Grid ComputingIn recognition of the significant new capabilities required to power grid computing, Oracle hasnamed its new technology products Oracle 10g, the first major name change since addingInternet capabilities to Oracle8i. Oracle 10g provides the first complete, integrated softwareinfrastructure to power grid computing through every element of the grid—storage, databases,application servers, and applications:• Oracle Database 10g provides:Real Application Clusters (RAC), which enables a single database to run acrossmultiple clustered nodes in a grid and features Cluster Workload Management toquickly respond to fluctuations in grid workloadsAutomatic Storage Management (ASM), which abstracts the details of managingstorage to provide sophisticated data provisioning and enables DBAs to manage diskgroups rather than many database filesInformation provisioning, providing access to information when and where it isneededA self-managing database, thus reducing the maintenance and tuning tasks of DBAs
  36. 36. Oracle Forms Developer 10g: Build Internet Applications 1-6Oracle Enterprise Grid Computing (continued)• Oracle Application Server 10g provides:Application Server Clusters that can pool and virtualize run-time services; all servicescan be distributed across multiple machines in a grid, and new application serverinstances can be automatically added and started to deliver capacity on demandInteraction with Oracle RAC to improve application reliabilityIdentity management features that provide centralized user administration, which iseven more important in a grid environmentEase of application deployment: Enterprise applications do not need to be redesigned,because when they are deployed on the Oracle Application Server 10g in a grid, theapplications benefit immediately from the transparent workload distribution, loadbalancing, and scheduling necessary to coordinate work across multiple servers.JDeveloper 10g, available in Oracle Developer Suite 10g, enables applications toexpose their behavior to other applications and to management tools throughstandardized interfaces, so that they can communicate with other applications andheterogeneous resources across a grid.• Oracle Enterprise Manager 10g Grid Control is the complete, integrated, centralmanagement console and underlying framework that automates administrative tasks acrosssets of systems in a grid environment. It enables:Grouping of multiple hardware nodes, databases, application servers, and othertargets into single logical entitiesSoftware provisioning that automates installation, configuration, and cloning ofOracle Application Server 10g and Oracle Database 10g across multiple nodes,making it it possible to add capacity as needed or to easily patch and upgrade existingsystemsEase of application deployment: Applications can be deployed once to a singleapplication server instance, registered with the central repository, then automaticallydeployed to all relevant nodes on the grid, with nodes being synchronized as changesare made.Application Service Level Monitoring by viewing the availability and performance ofthe grid infrastructure as a unified whole so that performance or availability issuescan be traced throughout the entire application, and the root cause can be determinedby drilling down into the infrastructureNote: For additional information about Oracle’s enterprise grid computing solution, see the GridTechnology Center on OTN: http://otn.oracle.com/tech/grid/index.html.
  37. 37. Oracle Forms Developer 10g: Build Internet Applications 1-71-7 Copyright © 2004, Oracle. All rights reserved.Oracle 10g Products and FormsDevelopmentForms Services Forms DeveloperOracle 10g Products and Forms DevelopmentOracle Database: Manages all of your information, such as Word documents, Excelspreadsheets, XML, and images. Oracle tools such as Forms can automatically reuse thedatabase structure and its integrity constraints, which reduces the amount of manual coding.Oracle Application Server: Runs all of your applications, including Java, wireless, portals, andbusiness intelligence. Using Oracle Application Server, you can deploy and manage in a singleapplication server all applications developed with Oracle Developer Suite. The OracleApplication Server contains Oracle Forms Services, which you use to deploy your Formsapplications.Oracle Developer Suite: Leverages the infrastructure offered by Oracle Application Server andOracle Database, enabling developers to quickly and easily build scalable, secure, and reliable e-business applications. The suite provides a complete and highly productive developmentenvironment for building applications. Oracle Forms Developer, which you use to build Formsapplications, is part of Oracle Developer Suite.
  38. 38. Oracle Forms Developer 10g: Build Internet Applications 1-81-8 Copyright © 2004, Oracle. All rights reserved.Oracle Application Server 10gArchitectureOracle Application Server 10g ArchitectureOracle Application Server 10g has a layered architecture including the following services:• Communication Services: Communication management for a variety of protocols• Application Runtime Services: J2EE Container that provides a common runtimeenvironment for Applications developed as JSPs, Servlets,EJBs, and Web Services• System Services: A common set of runtime services that are necessary for J2EEApplications and Web Services, such as request dispatch and scheduling, resourcemanagement, resource pooling,clustering, fault monitoring, transaction management, andmessaging• Management Services: A common set of systems management services to monitor thestatus, performance and faults of the system; to monitor resource consumption and usage;to manage a single instance or cluster of instances; to centrally administer security for usersand applications; and to provide a comprehensive directory service framework to manageusers• Connectivity Services: Provide connectivity to a variety of systems• Solutions: A comprehensive set of solutions all built on the infrastructure described aboveincluding Enterprise Portals, Enterprise Integration, Business Intelligence, Wireless, andISV Solutions
  39. 39. Oracle Forms Developer 10g: Build Internet Applications 1-91-9 Copyright © 2004, Oracle. All rights reserved.Oracle Application Server 10gComponentsOracle Application ServerForms ServicesOracle Application Server ComponentsWith the components of Oracle Application Server, you can:• Extract and analyze business intelligence: Clickstream, Personalization, ReportsServices, Discoverer• Integrate your business: InterConnect, Workflow, Unified Messaging, Internet FileSystem• Create personalized portals: Oracle Portal• Deploy dynamic Web applications: XDK, Web Services, Forms Services, OC4J, HTTPServer• Manage and secure your Web infrastructure: Enterprise Manager, Security, InternetDirectory.Instructor NoteThe overviews of Oracle Application Server and Oracle Developer Suite should not be presentedin detail, but merely to show where Forms Services and Forms Developer fit into the product set.For further information on Oracle Application Server architecture and components, see theOracle Application Server products page on OTN: http://otn.oracle.com/products/ias/index.html.
  40. 40. Oracle Forms Developer 10g: Build Internet Applications 1-101-10 Copyright © 2004, Oracle. All rights reserved.Oracle Forms Services OverviewA component of OracleApplication Server thatdeploys Forms applicationsto Java clients in a WebenvironmentOracle Application ServerForms ServicesWhat Is Oracle Forms Services?Oracle Forms Services is a component of Oracle Application Server for delivering Oracle FormsDeveloper applications to the Internet. Oracle Forms Services automatically provides theinfrastructure that is needed to successfully deliver applications on the Internet through built-inservices and optimizations.Oracle Forms Services uses a three-tier architecture to deploy database applications:• The client tier contains the Web browser, where the application is displayed and used.• The middle tier is the application server, where the application logic and server softwarereside.• The database tier is the database server, where enterprise data is stored.
  41. 41. Oracle Forms Developer 10g: Build Internet Applications 1-111-11 Copyright © 2004, Oracle. All rights reserved.Forms Services ArchitectureJREApplicationlogic layerData manager/PL/SQL engineUser interfacelayerForms ListenerServletForms ServletForms RuntimeClient Tier Database TierMiddle Tier:Application ServerIncrementallydownloadedFile containingapplication codeNetServicesJava appletDBForms Services ArchitectureForms Services consists of four major components: the Java client (Forms Client), the FormsListener Servlet, the Forms Servlet, and the Forms Runtime Engine. You learn about thesecomponents in Lesson 2, Running a Forms Developer Application.When a user runs a forms session over the Web, a thin, Java-based Forms applet is dynamicallydownloaded from the application server and automatically cached on the Java client machine.The same Java applet code can be used for any form, regardless of size and complexity.Although Forms Services uses a Java applet for displaying the form on the client browser, thedeveloper does not need to know Java in order to develop and deploy a Forms application.Instructor NoteSee Oracle Application Server Forms 10g (9.0.4) Technical Overview for additional informationon Forms Services.
  42. 42. Oracle Forms Developer 10g: Build Internet Applications 1-121-12 Copyright © 2004, Oracle. All rights reserved.Benefits and Components of OracleDeveloper Suite 10g•OWB•Discoverer•Reports•JDeveloper•Forms•Designer•SCMBusiness IntelligenceApplication DevelopmentBenefits of Oracle Developer Suite 10gThe Oracle Developer Suite:• Combines the power of Oracle application development tools and Oracle businessintelligence tools.• Provides a standards-based, Java and XML integrated development environment andsupports the full application development life-cycle.• Provides flexible and scalable solutions for data warehousing and business Intelligence.• Optimized for Oracle Database and Oracle Application Server 10g
  43. 43. Oracle Forms Developer 10g: Build Internet Applications 1-131-13 Copyright © 2004, Oracle. All rights reserved.Oracle Developer Suite 10gApplication DevelopmentApplication Development Features of Oracle Developer Suite 10gOracle Developer Suite provides the following features for application development:• Modeling: Oracle Designer provides visual modeling, reverse engineering, and codegeneration tools. Oracle Developer Suite also supports UML (Unified Modeling Language)by utilizing visual tools for Activity and Class modeling within the JDeveloper component.• Rapid Application Development (RAD): RAD capabilities in Oracle Developer Suitefeature integrated builders, re-entrant wizards, live previewers, and property inspectors.The JDeveloper component provides additional productivity through Business Componentsfor Java (BC4J), a built-in J2EE framework.• J2EE and Web Services: Oracle Developer Suite supports the latest J2EE 1.2 APIs,including Enterprise JavaBeans (EJB), Java Server Pages (JSP), and Servlets. Web servicessupport SOAP (Simple Object Access Protocol), WSDL (Web Service DefinitionLanguage), and UDDI (Universal Description, Discovery, and Integration).• Team Support: Oracle Software Configuration Management provides versioning,dependency management, and impact analysis for all objects and file types.
  44. 44. Oracle Forms Developer 10g: Build Internet Applications 1-141-14 Copyright © 2004, Oracle. All rights reserved.Oracle Developer Suite 10gBusiness IntelligenceBusiness Intelligence Features of Oracle Developer Suite 10gOracle Developer Suite 10g provides the following Business Intelligence features:• Extract, transformation, and load (ETL): Oracle Warehouse Builder provides agraphical interface for mapping and transformation. It also provides an extensibleframework for integrating a diverse set of data sources and integration with BusinessIntelligence Tools.• End user query and analysis: With Oracle Discoverer Administrator, you can create andmaintain a business-oriented view of the data that supports the Discoverer client tools:Discoverer Plus and Discoverer Viewer (in Oracle Application Server), and DiscovererDesktop (in Oracle Developer Suite).• Enterprise Reporting: Oracle Reports Developer enables the developer to access anydata, to publish it in any format, and to send it anywhere. Supported formats includeHTML with CSS, PDF, RTF, Postscript, and XML.Instructor NoteFor further information on Oracle Developer Suite and components, see the Oracle DeveloperSuite products page on OTN: http://otn.oracle.com/products/ids/index.html.
  45. 45. Oracle Forms Developer 10g: Build Internet Applications 1-151-15 Copyright © 2004, Oracle. All rights reserved.Oracle Forms Developer OverviewOracle Forms Developer:• Is a productive development environmentfor Internet business applications• Provides for:– Data entry– QueriesWhat Is Oracle Forms Developer?Oracle Forms Developer is a productive development environment for building enterprise-class,scalable database applications for the Internet. Oracle Forms Developer provides a set of toolsthat enable business developers to easily and quickly construct sophisticated database forms andbusiness logic with a minimum of effort.Oracle Forms Developer uses powerful declarative capabilities to rapidly create applicationsfrom database definitions that leverage the tight integration with the Oracle database. The toolsetleverages Java technology, promotes reuse, and is designed to allow developers to declarativelybuild rich user interfaces. Developer productivity is further increased through a single integrateddevelopment environment that enables distributed debugging across all tiers, utilizing the samePL/SQL language for both server and client.Oracle Forms Developer’s tight integration with Oracle Designer enables you to use a productivemodel-driven development approach. Oracle Forms Developer applications can be automaticallygenerated from business requirements designed in the Oracle Designer modeling environment.These models are stored in the Oracle Repository. Code-level changes made within the OracleForms Developer environment can be automatically reverse engineered back into the models,preserving the integrity between the models and the application.
  46. 46. Oracle Forms Developer 10g: Build Internet Applications 1-161-16 Copyright © 2004, Oracle. All rights reserved.Oracle Forms Developer: Key Features• Tools for rapid application development• Application partitioning• Flexible source control• Extended scalability• Object reuseOracle Forms Developer 10g: Key FeaturesTools for Rapid Application Development: You can create and modify applications with littleor no code. Productivity is enhanced with wizard-based rapid application development and built-in commands that perform common functions.Application Partitioning: You can place individual PL/SQL program units on the databaseserver or in the application, whichever is most suitable. You can drag-and-drop objects betweenmodules and the database server.Flexible Source Control: Oracle Software Configuration Manager (SCM) is integrated directlyin Forms Developer to provide source control options, such as checkin and checkout capability,versioning, diff and merge utilities, and impact analysis.Extended Scalability: The multi-tiered architecture enables you to scale applications from asingle user to tens of thousands of users, with no changes to the application. You can use serverfunctionality, such as array DML, database cursors, or bind variables, to improve scalability.Object Reuse: Oracle Forms Developer offers an inheritance model that facilitates theinheritance of attributes and code from one object to another and from one application toanother, through subclassing and object libraries.
  47. 47. Oracle Forms Developer 10g: Build Internet Applications 1-171-17 Copyright © 2004, Oracle. All rights reserved.Summit Office Supply SchemaOrder EntryApplicationIntroducing the Course ApplicationThe Summit Office Supply SchemaThe simplified table diagram shows the tables that are used throughout the course to build theForms application. These same tables are used in other Oracle courses as well.Summit Office Supply is a company that sells office products to customers. Summit has anumber of employees in several departments. Some employees are sales representatives whohave a relationship with specific customers.Customers place orders. Each order consists of one or more line items. Each line item representsa product.Many products have an associated image, in the form of an image file.The company products are stored in a number of warehouses. The contents of the warehouses aremanaged in the inventory.
  48. 48. Oracle Forms Developer 10g: Build Internet Applications 1-181-18 Copyright © 2004, Oracle. All rights reserved.Summit ApplicationCV_Customer CanvasCUSTOMERS BlockCV_Order CanvasORDERS BlockORDER_ITEMS BlockCV_Inventory CanvasINVENTORIESTableCUSTOMERSTableORDERSTableORDER_ITEMSTableCustomersFormOrders FormINVENTORIES BlockThe Summit Office Supply ApplicationThe following example of a Forms Builder application will familiarize you with the main run-time facilities of the product. You will also build your own version of this application during thepractices in this course.The Summit company produces a range of office supplies that they sell to businesses andindividuals (their customers). The Summit application is an order-entry system that maintainscustomer details, their orders, and the available stock (inventory).The application consists of two main forms:• Customers form: The Customers facilitates queries on existing customers and theinsertion, update, or deletion of customer records. When a customer is selected, the usercan open the Orders form to enter or view orders for that customer. The form consists of asingle block, the Customers block, a single record block, whose base table is Customers.
  49. 49. Oracle Forms Developer 10g: Build Internet Applications 1-19The Summit Office Supply Application (continued)• Orders form: Opened from the Customers form, the Orders form displays orders for acustomer and the line items that belong to each order. Orders may also be created,modified, or deleted in this form. You can also display the stock available on the orderedproducts. The form consists of three blocks:Orders block: The Orders block is a single record master block for the form The basetable is Orders, but the block also displays associated information from other tables,such as the name of the customer.Order_Items block: The Order_Items block is the related detail block for an order,showing its line items and the products ordered. This is a multirecord block whoseitems are on the same canvas as those in the Orders block. The base table of theOrder_Items block is Order_Items, but the block displays information from othertables, such as the product description.Inventories block: The Inventories block is a multirecord block showing warehousestock for a product. Its items are on a separate canvas, which is assigned to its ownwindow. This block is linked to the current product in the Order_Items block, but thetwo blocks can operate independently.Instructor NoteExplain to students that the concepts of blocks, windows, canvases, and so on are presented inlater lessons. The descriptions above are just to give an overview of the application. Studentsmay want to refer back to this overview later when the concepts are presented.
  50. 50. Oracle Forms Developer 10g: Build Internet Applications 1-201-20 Copyright © 2004, Oracle. All rights reserved.SummaryIn this lesson, you should have learned that:• Grid computing makes computing power availablewithout regard to its source• Oracle 10g products provide the software toimplement enterprise grid computing• Oracle Application Server 10g provides servicesfor building and deploying Web applications• Oracle Developer Suite 10g includes componentsfor application development and businessintelligenceSummaryGrid computing seeks to make computing power available on demand, without regard to wherethe data or application resides or which computer processes the request. Oracle 10g products(Database, Application Server, and Enterprise Manager Grid Control) provide the softwareinfrastructure to power enterprise grid computing.Oracle Application Server provides a variety of services for building and deploying Webapplications, including the Oracle HTTP Server (OHS), Oracle Containers for J2EE (OC4J),Reports Services, and Forms Services.Oracle Developer Suite includes components for application development (JDeveloper,Designer, Software Configuration Manager, and Forms Developer) and for business intelligence(Warehouse Builder, Discoverer, and Reports).
  51. 51. Oracle Forms Developer 10g: Build Internet Applications 1-211-21 Copyright © 2004, Oracle. All rights reserved.Summary• Benefits of Oracle Forms Services include:– Optimized Web deployment of Forms applications– Rich Java UI without Java coding– Generic Java applet to deploy any Formsapplication• Oracle Forms Services consists of the Formsclient, the Forms Servlet, the Forms ListenerServlet, and the Forms Runtime Engine.• Benefits of Oracle Forms Developer include rapidapplication development, application partitioning,flexible source control, extended scalability, andobject reuse.• The course application is a customer and orderentry application for Summit Office Supply.Summary (continued)Oracle Forms Services, a component of Oracle Application Server 10g, provides for the Webdeployment of Forms applications with a rich Java user interface. It uses the same generic appletfor any form.The components of Oracle Forms Services all play a role in running an application. Thesecomponents are the Forms client (Java applet), the Forms Servlet, the Forms Listener Servlet,and the Forms Runtime Engine.Oracle Forms Developer is the component of Oracle Developer Suite 10g that enables you todevelop Forms applications. Benefits of Oracle Forms Developer include:• Rapid application development: Create and modify applications with little or no code• Application partitioning: Drag objects between modules and the database server• Flexible source control: Integration with Software Configuration Manager (SCM)• Extended scalability: Use of server functionality such as array DML, database cursors, orbind variables• Object reuse: Subclassing, object libraries
  52. 52. Copyright © 2004, Oracle. All rights reserved.Running a FormsDeveloper ApplicationSchedule: Timing Topic50 minutes Lecture25 minutes Practice75 minutes Total
  53. 53. Oracle Forms Developer 10g: Build Internet Applications 2-22-2 Copyright © 2004, Oracle. All rights reserved.ObjectivesAfter completing this lesson, you should be able to dothe following:• Start OC4J• Describe the run-time environment• Describe the elements in a running form• Navigate a Forms application• Describe the two main modes of operation• Run a form in a Web browser– Retrieve both restricted and unrestricted data– Insert, update, and delete records– Display database errorsIntroductionOverviewIt is essential that you understand the environment of the form operator before designingand building your own applications. In this lesson you run an existing application on theWeb in order to familiarize yourself with the run-time interface of the Oracle FormsDeveloper.
  54. 54. Oracle Forms Developer 10g: Build Internet Applications 2-32-3 Copyright © 2004, Oracle. All rights reserved.Testing a Form: OC4J OverviewOracle Application Server Containers for J2EE (OC4J)is:• Preferred to run Forms applications• Included with Oracle Developer Suite to enabletestingTesting a Form with OC4JWhat Is OC4J?Oracle Application Server Containers for J2EE (OC4J) is Oracle’s Java 2 EnterpriseEdition (J2EE) container that executes on any Java Virtual Machine (JVM), which is theJava interpreter that is provided on each operating system and hardware platform. It isimplemented completely in Java, making it lightweight and easy to install. At the sametime, it provides complete support for J2EE applications, including servlets, EnterpriseJavaBeans, JavaServer Pages, and so on.OC4J is ideally suited to run Forms applications. It is included in Oracle Developer Suiteto enable you to test your applications, if desired, on the same machine where you arerunning Forms Builder. In other words, you do not need to install Oracle ApplicationServer to test your applications.
  55. 55. Oracle Forms Developer 10g: Build Internet Applications 2-42-4 Copyright © 2004, Oracle. All rights reserved.Testing a Form: Starting OC4J• On NT, run batch file to startOC4J: startinst.bat.• OC4J starts in DOS window:– Minimize window– Closing window aborts OC4J• Run batch file to stop OC4J: stopinst.bat.Testing a Form: Starting OC4JTo use OC4J on Windows, start it by executing the batch file provided, calledstartinst.bat. This file is located in the j2eeDevSuite subdirectory of theDeveloper Suite home directory. If you will be testing your applications on your clientmachine, it is a good idea to set up a shortcut to this batch file, and also to the batch filecalled stopinst.bat, which stops the OC4J instance. Alternatively, you can call thesebatch files from the Windows Start menu: Programs > Oracle Developer Suite – iDS10g >Forms Developer > Start [Shutdown] OC4J Instance.The batch file executes in a separate window; you can minimize this window if desired.Do not close this window, or you will abort the OC4J instance.When you no longer need to run OC4J you can execute the batch file calledstopinst.bat to stop the OC4J instance.
  56. 56. Oracle Forms Developer 10g: Build Internet Applications 2-52-5 Copyright © 2004, Oracle. All rights reserved.Running a FormOracle Forms Services deployment:Browser URLJava AppletRunning a FormDeploying form applications to the Web is implemented by the three-tier architecture ofOracle Application Server. Application logic and the Forms Services Runtime Enginereside on the middle-tier application server. All trigger processing occurs on database andapplication servers, while user interface processing occurs on the Forms client. End userscan run Forms Developer applications in a Web browser.Users request an application in their Web browsers by entering a URL that points to theapplication. Forms Services then generates an HTML file that downloads a Java applet tothe client machine. This small applet is capable of displaying the user interface of anyform, while the application logic is executed on the middle tier.
  57. 57. Oracle Forms Developer 10g: Build Internet Applications 2-62-6 Copyright © 2004, Oracle. All rights reserved.Running a Form: Browserhttp://summit.com:8889/forms90/f90servlet?form=customers.fmx&userid=username/password@database&buffer_records=NO&debug_messages=NO&array=YES&query_only=NOhttp://summit.com:8889/forms90/f90servlet?form=customers.fmx&userid=How do Iaccess thisapplication?Running a Form: BrowserThe URL to invoke an application must have the following format:http://host[:port]/forms servlet or html file[parameters] (optional portions of URLenclosed in brackets)Summit’s URL consists of the following components:Instructor NoteMention to students that it is common to provide an HTML front end to allow the user tochoose the application to start, then construct the URL based on the user’s choice.Protocol httpDomain summit.comPort for HTTP Serveror OC4Jxxxx default for HTTP Server8889 default for OC4JForms Servlet Aliasor static html file/forms90/f90servletParameters: this section begins with“?”; parameters separated by “&”(can be specified in the URL ortaken from configuration file)form=customers.fmxuserid=username/password@databasebuffer_records=NOdebug_messages=NO....
  58. 58. Oracle Forms Developer 10g: Build Internet Applications 2-72-7 Copyright © 2004, Oracle. All rights reserved.The Java Runtime Environment• The Forms applet runs in a Java RuntimeEnvironment (JRE) on the client machine.• Types of JREs:– Java-enabled browser (native)– JInitiator (Oracle-supplied plug-in to Web browser)that provides:Incremental Java archive (JAR) file downloadingJAR file cachingApplet instance cachingAutomatic Java security configurationThe Java Runtime EnvironmentThe Web browser can run a Java applet because it provides a Java Runtime Environment(JRE). However, not all Web browsers are able to natively run the Forms client. OnWindows platforms, Oracle provides a plug-in called JInitiator that provides an alternativeJRE capable of running the Forms applet.JInitiator provides several benefits:• It is able to incrementally download the Java ARchive files (JAR files) needed forthe Forms client, providing faster application startup.• It caches the JAR files locally, so that they do not need to be downloaded again.• It improves application performance within a browser session by applet instancecaching. When a user navigates from the current page in the browser, the runningForms application is cached. When the user comes back to the page containing theapplet, the applet that was running is automatically fully restored, including all ofthe data entered in the application.• It is automatically configured to run the Forms application in trusted mode. Thisenables the application to have access to resources that the Java sandbox modelnormally prohibits it from using, such as print services.
  59. 59. Oracle Forms Developer 10g: Build Internet Applications 2-82-8 Copyright © 2004, Oracle. All rights reserved.Starting a Run-Time SessionURL http://summit.com:8889/forms90/f90Static HTML filesOC4Jor HTTP ServerForms ServletForms Listener ServletForms Runtime EngineWeb Browser123DBPLX filesMMX filesForms Application ExecutablesFMX filesWeb ServerForms ServicesClient Tier Middle Tier: Application ServerStarting a Run-Time SessionStarting a Run-time session involves the following steps:1. The user accesses the URL that indicates that a Forms application should be run.2. The Oracle HTTP Server or OC4J receives an HTTP request from the browser clientand contacts the Forms Servlet.3. The Forms Servlet dynamically creates an HTML page containing all theinformation to start the Forms session.
  60. 60. Oracle Forms Developer 10g: Build Internet Applications 2-92-9 Copyright © 2004, Oracle. All rights reserved.Static HTML filesOC4Jor HTTP ServerForms ServletForms Listener ServletForms Runtime EngineURL http://summit.com:8889/forms90/f90Web BrowserStarting a Run-Time Session45Applet started 6DBPLX filesMMX filesForms Application ExecutablesFMX filesWeb ServerForms ServicesMiddle Tier: Application ServerClient TierStarting a Run-Time Session (continued)4. The Oracle HTTP Server or OC4J downloads a generic applet to the client afterchecking that it has not already been downloaded. The client caches the applet sothat it can run future Forms applications without downloading it again.5. The client applet contacts the Forms Listener Servlet to start the session. The FormsListener Servlet starts an instance of the Forms Runtime Engine on the Forms Server(middle tier). If included in the HTML file, Forms Runtime command-lineparameters (such as form name, user ID and password, database SID, and so on) andany user-defined Forms Builder parameters are passed to the process by the FormsListener Servlet.6. The Forms Listener Servlet establishes a connection with the Runtime Engine,which connects to the database if needed and loads application executable files.
  61. 61. Oracle Forms Developer 10g: Build Internet Applications 2-102-10 Copyright © 2004, Oracle. All rights reserved.Web ServerStatic HTML filesOC4Jor HTTP ServerForms ServletForms Listener ServletForms Runtime EngineForms Services8URL http://summit.com:8889/forms90/f90Web BrowserStarting a Run-Time SessionMiddle Tier: Application Server87DBPLX filesMMX filesForms Application ExecutablesFMX filesClient TierStarting a Run-Time Session (continued)7. The Forms applet displays the user interface of the application in the main windowof the user’s Web browser.8. The Forms Listener Servlet, working through OC4J or the HTTP Server, managescommunication between the Forms applet and the Runtime Engine.Technical NoteMore information about the Oracle Forms Listener Servlet is available in the Oracle whitepaper: Oracle Application Server Forms 10g (9.0.4) Technical Overview.Instructor NoteExplain the process of using FTP to move a form from NT to the middle-tier server,compiling the form, and then running it from a browser. As you present the next fewslides, explain to the students that the Forms Services run on the middle tier, and that thisis where the run time environment variables are set.
  62. 62. Oracle Forms Developer 10g: Build Internet Applications 2-112-11 Copyright © 2004, Oracle. All rights reserved.Forms ClientBase HTML filesForms ServletForms Listener ServletForms Runtime EngineApplication ServerStatic HTML filesHTTP Server or OC4JThe Forms ServletDynamicHTML file iscreatedDesktop ClientURL PARAMETERS:?form=customers.fmx&userid=un/pw@db&buffer_records=NO...URL Pointing to Forms Servletbasejini.htmlformsweb.cfghttp://summit.com:8889/forms90/f90servlet?form=customers.fWeb ServerForms ServicesThe Forms ServletThe Forms Servlet is a Java servlet that creates a dynamic HTML file by merginginformation from the following sources:• The Forms Web configuration file• The Forms base HTML file• The application’s URL parameters
  63. 63. Oracle Forms Developer 10g: Build Internet Applications 2-122-12 Copyright © 2004, Oracle. All rights reserved.The Forms Client• Generic Java applet• Responsibilities:– Displays the form’s user interface– Processes user interaction back toForms Services– Processes incoming messagesfrom Forms Services GenericJava appletForms ClientDesktop ClientThe Forms Client?The Forms Client is a generic Java applet. Forms Services dynamically downloads thisapplet and automatically caches it on the client machine. The Forms Client consists of aset of Java classes. At startup, only those Java classes that are necessary to initialize theapplication are downloaded. Additional class files are downloaded dynamically, asneeded, to support additional user interface activity.You do not have to deploy a separate Java applet for each application. The same genericapplet is used to run any Forms Services application, regardless of its size and complexity.Responsibilities of the Forms ClientThe Forms Client represents the user interface layer and has three primary functions:• To render the Forms Services application display for the user• To efficiently process user interaction back to Forms Services• To process incoming messages from Forms Services and translate them intointerface objects for the end user efficiently
  64. 64. Oracle Forms Developer 10g: Build Internet Applications 2-132-13 Copyright © 2004, Oracle. All rights reserved.The Forms Listener ServletJava Servlet that:• Creates FormsRuntime processfor each client• Stops the Runtime process at session end• Manages network communications between clientand Forms Runtime process• Communicates through Web server processHTTP ServerorOC4JMiddle TierHTTP/HTTPSFormsListenerServletFormsRuntimeProcessThe Forms Listener Servlet?The Forms Listener Servlet is a Java servlet that runs in a Web server equipped with aservlet engine, such as OC4J. The Web server directs HTTP requests for the FormsListener Servlet directly to the servlet instances.The Forms Listener Servlet is in charge of:• Managing the creation of the Forms Runtime process for each client• Managing the network communications that occur between the client and itsassociated Forms Runtime process, through the Web serverThis means that the client sends HTTP requests and receives HTTP responses from theWeb server process itself. Since the Web server acts as the network endpoint for theclient, there is no need to expose additional server machines and ports at the firewall.
  65. 65. Oracle Forms Developer 10g: Build Internet Applications 2-142-14 Copyright © 2004, Oracle. All rights reserved.The Runtime EngineThe Forms Runtime Engine:• Is a process (ifweb90) that runs on theApplication Server• Manages application logic and processing• Communicates with the client browser and thedatabaseThe Forms Runtime Engine?The Forms Runtime Engine is a process on the Application Server that is started by theForms Listener Servlet. You cannot start the runtime engine directly.The Forms Runtime Engine handles all the application logic and Forms functionality andexecutes the code written into the application. It manages requests from the Forms Clientand sends metadata to the client to describe the user interface. It connects to andcommunicates with the Oracle database via Oracle Net Services, the replacement for Net8and SQL*Net.
  66. 66. Oracle Forms Developer 10g: Build Internet Applications 2-152-15 Copyright © 2004, Oracle. All rights reserved.What You See at Run Time1345 2What You See at Run TimeAt run time, you will see the following components:1. Browser window2. Java applet (contained within browser window)3. Default menu (contained within applet)4. Menu toolbar (contained within applet)5. Console (contained within applet)What is the Default Menu?The Default menu, which is part of all Oracle Forms Developer applications, is analternative to keystroke operations. You can replace or customize the Default menu tointroduce your own functionality into a form module.What is the Menu Toolbar?The Menu toolbar contains buttons corresponding to menu items. At run time, it appearsabove any user-defined toolbars. It executes the same code as menu items, and it is ashortcut to menu commands that does not duplicate code or effort.
  67. 67. Oracle Forms Developer 10g: Build Internet Applications 2-16What You See at Run-Time (continued)What is the Console?The console is the generic name for the standard features that provide information at runtime. The console is displayed at the bottom of the window and consists of:• The message line that displays both Forms and application-specific messages.• The status line that displays a variety of indicators to reflect the current state of theform module.Instructor NoteDemonstrationStart an OC4J instance. In Forms Builder, open the form module Customers and run itwith the Run Form button. Point out the Browser window, Java applet, Default menu,Menu toolbar, and Console components. Describe the elements of the URL in thebrowser.Select Help > Keys from the menu. Execute an unrestricted query. Execute a restrictedquery to retrieve information about the customer with the ID of 212.Leaving this browser session open, start another browser session; copy the URL from thefirst session into the second. Add the following to the end of URL:&lookAndFeel=generic (the default Look and Feel is “oracle”). Point out thedifferent appearance of the user interface, especially the rounded appearance of thebuttons and the new look of the Menu toolbar.Terminate these run-time sessions by exiting the forms, and then closing the browserwindows. Be sure to advise students to always exit the form to terminate the applet beforeclosing the browser window.Indicator DescriptionRecord: n/m The nth record retrieved and displayed so far, out of m number oftotal records that can be retrieved by the query.Until the last record is fetched, m displays as “?”; after that, itdisplays the number corresponding to the last record.Enter-Query The current block is in Enter Query mode and no records have beenretrievedList of Values A list of values (LOV) is associated with the current item.
  68. 68. Oracle Forms Developer 10g: Build Internet Applications 2-172-17 Copyright © 2004, Oracle. All rights reserved.Identifying the Data Elements51 2 7 864 93 10Identifying the Data ElementsA Forms application may contain many different kinds of data elements:1. Prompts2. Text Items3. Boilerplate graphics4. Check boxes5. Boilerplate text6. Display items7. List items8. Push buttons9. Image items10. Radio groupsNot Pictured:• Hierarchical tree items• Chart items• Custom items
  69. 69. Oracle Forms Developer 10g: Build Internet Applications 2-182-18 Copyright © 2004, Oracle. All rights reserved.Navigating a Forms Developer ApplicationMethods of Navigation:• Default menu• Menu toolbar• Mouse• Buttons• Function keysNavigating a Forms ApplicationThe Default MenuThe Default menu is automatically available in a form, unless it is disabled or replacedwith a customized menu. Select options from the menu by using the mouse or functionkeys. At run time, use the menu to perform the following tasks:• Move the cursor and navigate between data blocks, records, and items.• Save or clear all changes.• Execute queries.• Insert new records or delete existing records.• Invoke Help.The Menu ToolbarYou can use the Default menu toolbar buttons to perform the following operations alsoavailable through the Default menu:• Save all changes.• Exit the form.• Execute queries.• Navigate between data blocks or records.
  70. 70. Oracle Forms Developer 10g: Build Internet Applications 2-19Navigating a Forms Application (continued)The Menu Toolbar (continued)• Insert new records or delete existing records.• Invoke Help to see properties of an item.The MouseYou can use the mouse to navigate and to perform many user operations in a bitmappedenvironment without needing to learn the function keys. Use the mouse to perform thefollowing actions:• Move the cursor.• Select from a menu.• Select from an LOV.• Select or clear a check box.• Select a button, including a radio button.• Switch to an open window.• Respond to an alert.• Scroll records or lines by using a data block or item scroll bar.• Manipulate a custom item.ButtonsWeb applications often use buttons as a means of navigation. You can click buttons withthe mouse. Use buttons to perform the following tasks:• Move input focus.• Display a list of values.• Invoke an editor.• Invoke another window.• Commit data.• Issue a query.• Perform calculations.• Exit the form.Function KeysIn addition to navigating with the mouse, you can move from item to item in sequencewith function keys. Use function keys to perform the following tasks:• Navigate between data blocks, records, and items.• Execute queries.• Insert new records or delete existing ones.• Invoke Help.To view a list of keys and the functions they perform, select Help > Keys, or press[Ctrl]+K.Instructor NoteDemonstration: From Forms Builder, run the ORDERS form. Point out the main dataelements. Show the different means of navigation.
  71. 71. Oracle Forms Developer 10g: Build Internet Applications 2-202-20 Copyright © 2004, Oracle. All rights reserved.Modes of Operation: Enter-Query ModeAllows:• Unrestricted andrestricted queries• Query/Where dialogbox• Record count by usingQuery > Count HitsDoes not allow:• Navigation out ofcurrent data block• Exiting run-timesession• Certain functions• Insert, update, deleteModes of OperationForms Builder has two main modes of operation: Enter-Query mode and Normal mode.The third mode of operation, Query mode, occurs while Forms is processing a query; theuser cannot interact with the form while processing is taking place.Enter-Query ModeUse Enter-Query mode to enter search criteria for a database query. In Enter-Query mode,your keystrokes are interpreted as search criteria for retrieving restricted data.What you can do in Enter-Query mode• Retrieve all records• Retrieve records by using selection criteria• Retrieve records by using the Query/Where dialog box• Obtain the number of records that will be retrieved before fetching them from thedatabase by using Query > Count HitsWhat you cannot do in Enter-Query mode• Navigate out of the current block• Exit from the run-time session• Use certain functions, such asNext Record• Insert new records• Update existing records• Delete records
  72. 72. Oracle Forms Developer 10g: Build Internet Applications 2-212-21 Copyright © 2004, Oracle. All rights reserved.Modes of Operation: Normal ModeAllows:• Unrestricted queries• Insert, update, delete• Commit (Save)• Navigation out ofcurrent data block• Exiting run-timesessionDoes Not Allow:• Restricted queries• Query/Where dialogboxNormal ModeUse Normal mode to insert and alter records in the database. In Normal mode, yourkeystrokes are interpreted as either the entering of new records or the altering of existingones.What you can do in Normal Mode• Retrieve all records.• Insert new records.• Update records.• Delete records.• Commit (Save) records.• Rollback (Clear) records.• Navigate outside of the current data block.• Exit the run-time session.What you cannot do in Normal Mode• Retrieve a restricted set of records.• Invoke the Query/Where dialog box.
  73. 73. Oracle Forms Developer 10g: Build Internet Applications 2-222-22 Copyright © 2004, Oracle. All rights reserved.Retrieving Data1342A B C D12Restricted queryA B C DA B C D1234Unrestricted queryA B C D1234Retrieving DataYou can use a form module to retrieve information from the database without knowingany SQL syntax. However, if you are an experienced SQL user, you may want tosupplement Oracle Forms Developer default processing with your own SQL predicates.There are two general types of queries:Performing an Unrestricted QueryYou can retrieve unrestricted data by performing one of the following actions:• Select Query > Execute.• Press the appropriate function key.• Click the Execute Query button.Note: You cannot perform a query while you have unsaved updates, inserts, or deletes.Either save or undo the changes before you continue with the query.Query Type DescriptionUnrestricted(global query)The equivalent of selecting all the rows for all the representedcolumns from the base table for the queried data blockRestricted The equivalent of selecting a restricted set of rows for all therepresented columns from the base table for the queried data block
  74. 74. Oracle Forms Developer 10g: Build Internet Applications 2-232-23 Copyright © 2004, Oracle. All rights reserved.Retrieving Restricted Data• Do not use quotation marks with character anddate items.• The LIKE operator is implied with % or _.• Use hash (#) in front of SQL operators.• Use Query/Where for complex query conditions.• Use default date format (DD-MON-RR) inQuery/Where.• Use quotes around literals in Query/Where.Performing a Restricted QueryYou can use any one of the following methods to perform a restricted query:• Matching values• Matching patterns (wildcards)• A Query/Where dialog box for user entry of SQL predicatesValid Search CriteriaItem Criterion UsesOrder ID 2356 Exact matchCustomer ID %04 Implied LIKE operatorOrder ID #BETWEEN 2350 AND2360BETWEEN operatorOrder Status “CREDIT order paid”selected from pop-up listExact match on item value (10)Sales Rep ID :S Query Where dialog
  75. 75. Oracle Forms Developer 10g: Build Internet Applications 2-24Performing a Restricted Query (continued)How to Perform a Restricted QueryYou can perform a restricted query with the following steps:1. Perform one of the following:Select Query > Enter.Click the Enter Query button.Press the appropriate function key.2. Enter-Query displays on the status line.3. Enter search criteria into appropriate items.4. Perform one of the following:Select Query > Execute.Click the Execute Query button.Press the appropriate function key.Note: Forms Builder constructs a select statement by using the AND operator for allspecified conditions.Instructor NoteThe default date format is dependent on the language/territory. In Oracle8i Release 2(8.1.6), the default date formats were modified, replacing ’YY’ with ’RR’ and ’YYYY’with ’RRRR’. For example, if NLS_LANG is set to Finland, then the default dateformat will be DD.MM.RRRR.
  76. 76. Oracle Forms Developer 10g: Build Internet Applications 2-252-25 Copyright © 2004, Oracle. All rights reserved.Query/Where Dialog Box• Invoke by:– Entering :variable_name– Executing query• Used to write:– Complex search conditions– Queries with OR predicates– ORDER BY clauseUsing the Query/Where Dialog BoxIn the Query Where dialog box you can enter complex search criteria by using raw SQL.To use the Query/Where dialog box effectively requires knowledge of SQL. UseQuery/Where to perform the following tasks:• Write complex search conditions.• Write queries with OR predicates.• Order the result of a query.Note: Forms Builder logically uses the AND operator to append the Query/Whereconditions to any other search criteria (including those imposed by the form designer) andconstructs a SELECT statement. The Query/Where dialog box does not work in an itemwhose name differs from the name of its corresponding database column.Example1. To restrict the query to orders with a Sales Rep ID (:S) of 11 or an Order ID (:O)between 100 and 200, enter the following in the Query/Where dialog box::S = 11 OR :O between 100 and 2002. To sort the data by Sales rep ID (:S), enter the following in the Query/Where dialogbox:ORDER BY :S
  77. 77. Oracle Forms Developer 10g: Build Internet Applications 2-262-26 Copyright © 2004, Oracle. All rights reserved.Query/Where Dialog Box:i:n:i = 104 OR :n BETWEEN ‘F’ and ‘H’How to Use the Query/Where Dialog BoxTo use the query/where box to enter query criteria:1. Perform one of the following:Select Query > Enter.Click Enter Query.Press the appropriate function key.2. Enter a colon (:) followed by a unique character variable name in one or more items.3. Perform one of the following: Select Query > Execute, click Execute Query, or pressthe appropriate function key.Note: You can select Query > Count Hits if you simply want to know how manyrecords will match your criteria.4. The Query/Where dialog box is displayed.5. Enter the search criteria by using variables, SQL, and logical operators. Click OK.Note: To perform a query without any variables, type only the colon (:) and executethe query. Doing so also displays the Query/Where dialog box.If you enter an ORDER BY at run time, it overrides any ordering defined by the designer.
  78. 78. Oracle Forms Developer 10g: Build Internet Applications 2-272-27 Copyright © 2004, Oracle. All rights reserved.Inserting, Updating, and DeletingForm moduleDeletesUpdatesInsertsMemoryInserting, Updating, and Deleting RecordsUpon entering a typical form module you are in Normal mode. This means that FormsBuilder regards anything that you type into a blank record as an insert and anything thatyou type over an existing record as an update.How to Insert a RecordTo insert a record, perform the following steps:1. Ensure that you have the cursor positioned on a blank record by performing one ofthe following steps:Scroll down until you find a blank record (always the last in the block).Select Record > Insert.Click Insert Record (green +).Press the appropriate function key.2. Enter the data into the relevant items.
  79. 79. Oracle Forms Developer 10g: Build Internet Applications 2-28Inserting, Updating, and Deleting Records (continued)How to Update a RecordTo update a record, perform the following steps:1. Select Query > Enter.2. Enter the search criteria to retrieve the appropriate record.3. Select Query > Execute to retrieve all records that satisfy your specific searchcriteria.4. Scroll through the records, stopping at the record to be updated.5. Update the record.How to Delete a RecordTo delete a record, perform the following steps:1. Select Query > Enter.2. Enter the search criteria to retrieve the appropriate record.3. Select Query > Execute to retrieve all records that satisfy your specific searchcriteria.4. Scroll through the records, stopping at the record to be deleted. Delete the record bytaking one of the following actions:Select Record > Remove to clear the record and mark it for deletion.Click Remove Record (red X) to clear the record and mark it for deletion.Press the appropriate function keys.
  80. 80. Oracle Forms Developer 10g: Build Internet Applications 2-292-29 Copyright © 2004, Oracle. All rights reserved.Making Changes Permanent• Select Action > Save tomake changespermanent.• Select Action > ClearAll to discard changes.orToolbarMenuTo commit orrollback:DeletesUpdatesInsertsMemoryMaking Inserts, Updates, and Deletes PermanentTo make any inserts, updates, or deletes permanent you must save (commit) them to thedatabase. To do this, take one of the following actions:• Select Action > Save.• Click Save in the menu toolbar.Discarding Inserts, Updates, and DeletesTo discard any inserts, updates, or deletes, you must clear the records (rollback) instead ofsaving. Perform a rollback by selecting Action > Clear All.Exiting a Run-Time SessionYou exit the run-time session by taking one of the following actions:• Select Action > Exit.• Click Exit.• Press the appropriate function keys.Note: By default, you cannot exit the form while you have unsaved updates, inserts, ordeletes. You need to either save or undo the changes before you can exit.
  81. 81. Oracle Forms Developer 10g: Build Internet Applications 2-302-30 Copyright © 2004, Oracle. All rights reserved.Displaying Errors• Use to view Oracle errors• Select Help > Display Error• Shows Database Error window:– SQL statement– Error informationDisplaying ErrorsIf an Oracle error is displayed on the message line while you are operating a formapplication, you can view the underlying SQL code by selecting Help > Display Error.ExampleHere is the SQL statement in error and its corresponding error:SELECT order_id, order_date, order_mode, order_status,customer_id, sales_rep_idFROM ordersWHERE (order_id in (a,b))ORA-01722: invalid numberNote: Selecting Help > Display Error displays only those errors where the error on themessage line is preceded by ORACLE error.
  82. 82. Oracle Forms Developer 10g: Build Internet Applications 2-312-31 Copyright © 2004, Oracle. All rights reserved.SummaryIn this lesson, you should have learned that:• You can use OC4J on the development machine torun a Forms application in a Web browser• At run time:– The Forms Client is downloaded– The Forms Servlet creates a start HTML file– The Forms Listener Servlet starts a run-timesession and maintains communication between itand the Forms Client– The Runtime Engine carries out application logicand maintains a database connection on behalf ofthe Forms ClientSummaryThis lesson introduced the operator interface of Forms Builder. The following conceptswere covered in this lesson:• Starting OC4J on the development machine• The run-time environment for Forms:Running a form in a BrowserStarting a run-time session: The Forms Servlet, the Forms Client, and theForms Listener Servlet• The data elements of a form
  83. 83. Oracle Forms Developer 10g: Build Internet Applications 2-322-32 Copyright © 2004, Oracle. All rights reserved.Summary• When you run a form you see a Java appletrunning in a browser and displaying a menu, menutoolbar, console, and several kinds of dataelements.• Users navigate a Forms application using themenu, toolbar, the mouse, buttons, or functionkeys.• The two main modes of operation are Normalmode and Enter-Query mode.• Executing a query returns all records, unless thequery is restricted by search criteria.Summary (continued)• Elements of a running form• Navigation methods• Modes of operation:Normal modeEnter-Query mode(There is also a Query mode that occurs when the form is fetching records; theoperator cannot interact with the form in Query mode.)• Retrieving data by performing:Restricted queries—you supply search criteriaUnrestricted queries—you supply no search criteria
  84. 84. Oracle Forms Developer 10g: Build Internet Applications 2-332-33 Copyright © 2004, Oracle. All rights reserved.Summary• In normal mode you can insert, update, and deleterecords and commit changes to the database.• You display database errors from the menu(Help > Display Error)Summary (continued)• Inserting, updating, and deleting records• Saving or clearing changes• Displaying database errors
  85. 85. Oracle Forms Developer 10g: Build Internet Applications 2-342-34 Copyright © 2004, Oracle. All rights reserved.Practice 2 OverviewThis practice covers the following topics:• Starting OC4J• Running the course application:– Querying records– Inserting a record– Updating a record– Deleting a record– Displaying a database errorPractice 2 OverviewIn this practice session, you start OC4J to function as a Web server on your local machine.You run the course application in a browser and execute both unrestricted and restrictedqueries. You navigate through the application and use it to insert, update, and deleterecords.Note: For solutions to this practice, see Practice 2 in Appendix A, “Practice Solutions.”Instructor NoteStress to students that they would normally be running an application that is deployed to amiddle-tier application server. However, for this course the Oracle Application Server isnot installed, so they will use OC4J on their local machines to run the application.
  86. 86. Oracle Forms Developer 10g: Build Internet Applications 2-35Practice 21. Start an instance of OC4J.2. Invoke Internet Explorer and enter the following URL:http://<machine>:<port>/forms90/f90servlet?form=customers.fmxYour instructor will tell you the machine name and port number to use.3. Select Help > Keys from the menu.4. Click OK to close the Keys window. Browse through the records that were returnedby the unrestricted query that executed automatically when the form started.5. Execute a restricted query to retrieve information about the customer with the ID of212.6. Execute a restricted query to retrieve the customer whose first name is “Meenakshi”.7. Try each of these restricted queries:a. Retrieve all cities starting with San.b. Retrieve all customers based in the USA with a low credit limit.8. Display the customer details for Harrison Sutherland and click Orders to invoke theOrders form module.9. Click Image Off and notice that the image item is no longer displayed. Click ImageOn and notice that the image item is displayed.10. Query only those orders that were submitted online.11. Move to the fourth record (Product ID 2322) in the Item block of Order 2355 andclick Stock.The Inventory block is displayed in a separate window with stock information forthat item.12. Close the Stock Levels window. For the customer Harrison Sutherland, insert a newrecord in the ORDER block, as detailed below.Notice that some items are already populated with default values. Enter thefollowing:13. Insert a new record in the ITEM block with the following values:Item ValueOnline UncheckedStatus New Credit Order (poplist)Sales Rep ID 151 (Enter the ID, or click the Listbutton and select David Bernstein)Item ValueProduct ID 2289 (Enter the ID, or click the Listbutton and select KB 101/ES.Quantity 2
  87. 87. Oracle Forms Developer 10g: Build Internet Applications 2-36Practice 2 (continued)14. Save the new records.15. Update the order that you have just placed and save the change.Note: You may receive a message indicating that there are no changes to save. Thismessage is generated by the Customers form, because both forms are saved at thesame time. Changes to the Orders form should be saved successfully, so you canacknowledge the message and then ignore it.16. Attempt to delete the order that you have just placed. What happens?17. Delete the line item for your order and save the change.18. Now attempt to delete your order and save the change.19. Exit the run-time session and close the browser window.
  88. 88. Copyright © 2004, Oracle. All rights reserved.Working in the FormsDeveloper EnvironmentSchedule: Timing Topic45 minutes Lecture40 minutes Practice85 minutes Total
  89. 89. Oracle Forms Developer 10g: Build Internet Applications 3-23-2 Copyright © 2004, Oracle. All rights reserved.ObjectivesAfter completing this lesson, you should be able to dothe following:• Describe Forms Builder components• Navigate the Forms Builder interface• Identify the main objects in a form module• Customize the Forms Builder session• Use the online help facilities• Identify the main Forms executables• Describe the Forms module types• Set environment variables for design and run time• Run a form from within Forms BuilderIntroductionOverviewThis lesson provides you with an overview of Forms Builder, including a high-leveldescription of its components and object hierarchy. Using this knowledge, you can planand implement the structure of your form applications.
  90. 90. Oracle Forms Developer 10g: Build Internet Applications 3-33-3 Copyright © 2004, Oracle. All rights reserved.Forms Builder Key FeaturesWith Forms Builder you can:• Provide an interface for users to insert, update,delete, and query data• Present data as text, image, and custom controls• Control forms across several windows anddatabase transactions• Use integrated menus• Send data to Oracle ReportsForms Builder Key FeaturesForms Builder is a major component of Oracle Forms Developer. You can use FormsBuilder to quickly develop form-based applications for presenting and manipulating datain a variety of ways.Users of Forms Builder applications can:• Insert, update, delete, and query data by using a variety of interface items• Present data by using text, image, and custom controls, including JavaBeans andPluggable Java Components• Control forms across several windows and database transactions• Access comprehensive facilities by using integrated menus• Send data directly to Oracle ReportsAs the designer of Forms Builder applications, you can:• Design forms that use a number of data sources, including Oracle databases• Build applications quickly and easily by using powerful GUI development tools• Design applications for Internet deployment• Copy and move objects and their properties easily between applications• Use design features such as wizards, the Layout Editor, Object Navigator, andPL/SQL Editor
  91. 91. Oracle Forms Developer 10g: Build Internet Applications 3-43-4 Copyright © 2004, Oracle. All rights reserved.Forms Builder Components:Object Navigator• Client-side andserver-sideobjectsdisplayedhierarchically• Toolbarto create,delete orunload, expandor contract• Icons torepresentobjects• FastsearchfeatureForms Builder Components: Object NavigatorThe interface components of the Forms Builder tool help to provide the flexibility andproductivity of the Oracle Forms Developer development environment.The Object Navigator is a hierarchical browsing and editing interface. You can use theObject Navigator to locate and manipulate application objects quickly and easily. Featuresinclude:• A hierarchy represented by indentation and expandable nodes(Top-level nodes show module types, database objects, and built-in packages. Allother nodes and the objects they contain are indented to indicate that they belong tothese higher-level nodes.) 

×