preface iintroduction objectives i-2 course overview i-3 1oracle application development framework...

10
Preface I Introduction Objectives I-2 Course Overview I-3 1 Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE Platform 1-5 J2EE Platform: Architecture Details 1-6 Building J2EE Applications 1-7 What Is Framework-Based Application Development? 1-8 Understanding Framework-Based Application Development 1-9 Oracle Application Development Framework 1-10 Visual and Declarative Development 1-11 Design Patterns 1-12 Model-View-Controller Architecture 1-13 MVC Structure 1-14 What Is the Model? 1-15 The Model Layer 1-16 Components of the Model Layer 1-17 What Is the Controller? 1-18 Struts in JDeveloper 1-19 Controller: Summary 1-20 What Is the View? 1-21 View Concept 1-22 View Technologies in Oracle JDeveloper 10g 1-23 View: Summary 1-24 ADF Technology Stack 1-25 ADF: Summary 1-26 Summary 1-27 2 ADF Development Process Objectives 2-2 Project Technology Scopes 2-3 ADF Technology Stack 2-4 A Sample Application 2-5 Building an Application 2-6 Application Workspaces 2-7 Application Workspace Templates 2-8 Contents iii

Upload: roberta-oliver

Post on 19-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

Preface

I IntroductionObjectives I-2Course Overview I-3

1 Oracle Application Development FrameworkObjectives 1-2J2EE Platform 1-3Benefits of the J2EE Platform 1-5J2EE Platform: Architecture Details 1-6Building J2EE Applications 1-7What Is Framework-Based Application Development? 1-8Understanding Framework-Based Application Development 1-9Oracle Application Development Framework 1-10Visual and Declarative Development 1-11Design Patterns 1-12Model-View-Controller Architecture 1-13MVC Structure 1-14What Is the Model? 1-15The Model Layer 1-16Components of the Model Layer 1-17What Is the Controller? 1-18Struts in JDeveloper 1-19Controller: Summary 1-20What Is the View? 1-21View Concept 1-22View Technologies in Oracle JDeveloper 10g 1-23View: Summary 1-24ADF Technology Stack 1-25ADF: Summary 1-26Summary 1-27

2 ADF Development ProcessObjectives 2-2Project Technology Scopes 2-3ADF Technology Stack 2-4A Sample Application 2-5Building an Application 2-6Application Workspaces 2-7Application Workspace Templates 2-8

Contents

iii

Page 2: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

Creating an Application Workspace 2-9New Application Workspace 2-10Design the Business Services for the Model: ADF Business Components 2-11Design the Application Page Flow 2-13Create the Page Flow 2-14Create JSP Pages 2-15Using the Visual Editors 2-16Databinding: Example 2-17Adding HTML to Enhance the User Interface 2-18Results 2-19Summary 2-20Practice 2-1: Overview 2-21

3 Getting Started with ADF Business ComponentsObjectives 3-2ADF Technology Stack 3-3What Are ADF Business Components? 3-4ADF Business Components 3-5Benefits of ADF Business Components 3-6Business Components 3-7Business Domain Components 3-8Data Model Business Components 3-9Business Components Model 3-10Building a Business Components Model 3-11Creating a Database Connection 3-12Creating ADF Business Components: Entity Objects 3-13Creating ADF Business Components: View Objects 3-16Creating Custom Views 3-18Selecting the Attributes 3-19Creating an Application Module 3-20Testing the Business Components 3-21Summary 3-22Practice 3-1: Overview 3-23

4 Building Business LogicObjectives 4-2Business Logic Validation 4-3Implementing Validation in the Business Services Tier 4-4Entity Object: Overview 4-5Entity Object 4-6Creating an Entity Object 4-7Entity Object Wizard 4-8Files Generated for the Customers Entity Object 4-9

iv

Page 3: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

Optional Files Generated for the Customers Entity Object 4-10Using the Business Components Modeler for Entity Objects 4-11Assigning an Initial Value to an Entity Attribute 4-13Mapping an Attribute to a Database Sequence 4-14Practice 4-1: Overview 4-15Practice 4-1 4-16Adding Validation 4-19Declarative Validation Rules 4-20ListValidator: Example 4-21Adding UniqueKeyValidator to an Entity 4-22Domains 4-23Domains: Example 4-24How to Create a Domain 4-25How to Use a Domain 4-26Summary 4-27Practice 4-2: Overview 4-28

5 Exposing Business DataObjectives 5-2View Object in the ADF Architecture 5-3Overview 5-4View Objects 5-5Interaction Between Views and Entities: Retrieving Data 5-6Interaction Between Views and Entities: Updating Data 5-7Synchronization of View Objects 5-8Creating a View Object Using the View Object Wizard 5-9Classes Related to View Objects 5-10Files Generated for the LineItemView View Object 5-11Example of a View Object 5-12Practice 5-1: Overview 5-13Practice 5-1 5-14Calculated Attributes in Views 5-17View Links 5-18Traversing Links 5-19Using the Business Components Modeler for View Objects (I) 5-20Using the Business Components Modeler for View Objects (II) 5-21Application Module in the ADF Architecture 5-22Application Modules 5-24Creating an Application Module Using the Application Module Wizard 5-25Using the Business Components Modeler for an Application Module (I) 5-26Using the Business Components Modeler for an Application Module (II) 5-27Summary 5-28Practice 5-2: Overview 5-29

v

Page 4: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

6 Adding Custom ValidationObjectives 6-2Overview 6-3Adding Validation to an Entity 6-4Validating Attributes 6-5Creating a MethodValidator for an Attribute 6-6Utilizing Typesafe Methods 6-8Validating Entity Objects 6-9Call EntityImpl Methods 6-11Validation Order 6-12Associations 6-13Association Example 6-15Accessor Methods 6-16Association Types 6-17Determining the Association Type 6-18Creating Entity Associations 6-19Traversing Associations: Destination to Source 6-23Traversing Associations: Source to Destination 6-24Summary 6-25Practice 6-1: Overview 6-26

7 Providing for Efficient QueriesObjectives 7-2Overview 7-3Expert Mode View Objects 7-4Mapping Attributes in Expert Mode 7-5Maintaining Attribute Mappings in Expert Mode 7-6SQL-Based View Objects 7-7Creating a SQL-Based View Object 7-8Implementing Custom Methods 7-9Expose Methods to the Client Application 7-10Creating a Test Client 7-11Instantiating an Application Module 7-12Instantiate a View Object and Output Data 7-13Calling Custom Methods 7-14Setting Parameters for the Where Clause 7-15Assigning Values to Queries with Parameters at Run Time 7-17Creating a Test Client – Sample Code 7-18Creating a View Object at Run time 7-20Finding Data by a Row Key 7-22Summary 7-23Practice 7-1: Overview 7-24

vi

Page 5: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

8 Making the Model SecureObjectives 8-2Goals of J2EE Security Architecture 8-3Overview of J2EE Security Architecture 8-4Java Authentication and Authorization Services 8-5JDeveloper, JAAS, and Securing the ADF Model 8-8Enabling JAAS Authentication for ADF Business Components 8-9The jbo.security.enforce Application Property 8-10Setting Entity Permissions 8-11Entity Privileges 8-12Attribute Permissions 8-13Using the Business Components Browser 8-14Testing Entity and Attribute Authorization 8-15Summary 8-16Practice 8-1: Overview 8-17

9 Controlling an Application with StrutsObjectives 9-2The Controller 9-3ADF Implements MVC Using the Struts Controller 9-4Purpose of a Controller 9-5Example: Page Flow Without a Controller 9-6Example: Page Flow with a Controller 9-10What Is Struts? 9-12Struts Components 9-13Struts Components Flow 9-15Struts Components: The Controller Servlet 9-16Struts Components: The Configuration file 9-17Struts Components: Actions 9-18Struts Components: ActionForms (Form Beans) 9-19Struts Components: Tag Libraries 9-20Application Resources File 9-21Internationalizing Your Application 9-22Struts in Oracle JDeveloper 10g 9-23Struts Configuration File 9-24Defining the struts-config.xml File Content 9-25Creating a Page Flow Diagram 9-28Struts Components: Actions 9-29Struts Components: Pages and Page Forwards 9-30Struts Components: Forwards and Links 9-31ADF Components: DataAction and DataPage 9-32Summary 9-33Practice 9-1: Overview 9-34

vii

Page 6: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

10 Building ADF View ComponentsObjectives 10-2What Is a JSP? 10-3JavaServer Pages in ADF 10-4Example: JSP 10-5Basic JSP Elements 10-6JSP Directives 10-7JDeveloper and JSPs 10-10The Visual Editor 10-11What Are Custom Tags? 10-12Utilizing Tag Libraries 10-13JSP Standard Tag Library 10-14Struts Tags 10-15Data Binding Tags 10-16Utilizing the Data Control Palette 10-17How Data Is Displayed 10-18View Object Control Types 10-19View Object Item Control Types 10-20Operations 10-21Customizing Controls 10-22JSP Versus UIX 10-23Summary 10-24Practice 10-1: Overview

11 Customizing ActionsObjectives 11-2Struts Configuration File 11-3Creating the Action Class 11-4Default Code of an Action 11-5Forwards 11-6ActionForward of an Action Class 11-7Creating Global Forwards 11-8Form Beans 11-9Creating a Static Form Bean 11-11Example: Static Form Bean 11-12Dynamic Form Beans 11-13Creating a Dynamic Form 11-14Using the Bean in an Action 11-15Sample Page Flow 11-16Sample Page Flow: Struts Elements 11-17Sample Page Flow: Form Bean 11-19Sample Page Flow 11-21Sample Page Flow: Action Class 11-22

viii

Page 7: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

Sample Page Flow 11-23Form Beans, Data Actions, and Data Pages 11-24Summary 11-25Practice 11-1: Overview 11-26

12 Using ADF Struts ComponentsObjectives 12-2What Are Data Actions? 12-3What Are Data Pages? 12-4Utilizing Data Pages 12-5Creating Data Pages 12-6Creating the View Component 12-7Displaying Data 12-8Modifying the Iterator 12-10Adding Methods to Data Actions 12-11Adding Methods to Data Pages 12-12Navigating in Data Pages 12-13Data Action Life Cycle 12-14The Data Action Lifecycle 12-15Customizing Data Actions 12-16Data Action Events 12-17on<Event> Example: Built-in Events 12-19on<Event> Example: Custom Events 12-20Forwards and Events in ADF Applications 12-21Summary 12-22Practice 12-1: Overview 12-23

13 Adding Validation and Error HandlingObjectives 13-2Overview of Validation 13-3Need for Validation 13-4Client-Side Validation 13-5Form Bean Validation Method 13-6Creating the Error Message 13-7Printing Errors in the JSP 13-8Validating Actions 13-9Creating a Validation Class 13-10The execute() Method 13-11Validation Results 13-12Struts Validator 13-13Setting Up the Struts Validator 13-14Utilizing the Struts Validator 13-15validation.xml: Example 13-17

ix

Page 8: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

Struts Validator Output 13-18Exception Handling 13-19JavaScript 13-20Enhancing the View 13-21Summary 13-22Practice 13-1: Overview 13-23

14 Enhancing the User InterfaceObjectives 14-2Modifying Visual Component Properties 14-3Using the Toolbar to Format Objects 14-4Using the Property Inspector 14-5Adding Images to JSPs 14-6Using Style Sheets 14-7Editing Default Style Sheets 14-8Creating a New Style Sheet 14-9Editing Style Sheets 14-10Adding a Style Sheet to the Component Palette 14-11Applying a Style Sheet to a Page 14-12Adding Buttons to a JSP 14-13Adding Data Control Buttons 14-14Adding Navigation Buttons 14-15Adding Form Action Buttons 14-16Supplementing Button Functionality 14-17Using Expression Language 14-18Using EL Attributes 14-19Using EL Literals and Operators 14-20Using EL Implicit Objects 14-21Using EL to Customize a Page 14-22Summary 14-23Practice 14: Overview 14-24

15 Adding JAAS Security to the ClientObjectives 15-2JAAS Provider 15-3Defining Security Needs 15-4Oracle JAAS Implementation: JAZN 15-5Client Authentication 15-6Client Authorization 15-7Basic Authentication Scenario 15-8Adding JAAS Security to an Application 15-9Adding Authorization Information to Struts 15-10

x

Page 9: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

web.xml Properties 15-11web.xml Results 15-12Adding Users and Roles 15-13Adding Users 15-14Managing Roles 15-15Selecting a Specific jazn-data.xml File 15-16Running the Application 15-17Summary 15-18

16 Building ADF UIX View ComponentsObjectives 16-2Why ADF UIX Technologies? 16-3What are ADF UIX Technologies? 16-4How Do ADF UIX Technologies Work? 16-5UIX XML Page Layout 16-6Interface Nodes 16-7How Is It coded? 16-8Support for Internationalization 16-9User Interface Components 16-10Modular Declarative Design 16-11Creating a UIX XML Page 16-12Company and Product Branding 16-13Page Tabs 16-14Global Buttons 16-15Page Footers 16-16Designing with the Visual Editor 16-17Coding with the XML Editor 16-18UIX XML Page at Run Time 16-19Adding Data to the Page 16-20Design Time Data Components 16-21Data Binding in the Visual Editor 16-22Run-Time UIX XML Page with Data Binding 16-23Summary 16-24Practice 16: Overview 16-25

17 Deploying an ADF ApplicationObjectives 17-2Overview 17-3Overall Considerations for Deployment 17-4J2EE Archive Format 17-5Deploying to a Web Server 17-6Deploying to OC4J 17-7Install OC4J 17-8

xi

Page 10: Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE

Start the OC4J Server 17-9Creating an OC4J Connection 17-10Creating a Deployment Profile 17-12Deploying to OC4J 17-13Running Applications 17-14Customizing Deployment 17-15Summary 17-16Practice 17-1: Overview 17-17

Appendix A: Course Schema

Appendix B: Practice Solutions

xii