HOME
SEARCH
BLOG
SCRIPTS
CONTACT
SEARCH
SEARCH
Disclaimer:
Authors have full rights over their works. Reproduction of any part of the content is prohibited without prior authorization.
×
BOOK ORACLE ADF REAL WORLD DEVELOPERS GUIDE
DOWNLOAD
SUMMARY
Items Found:
516
Preface 1
Chapter 1: Getting Started with Oracle ADF 7
Introduction to Oracle ADF 7
Why Oracle ADF? 8
Oracle ADF architecture 9
View layer 11
Controller layer 11
Model layer 11
Business services layer 12
Comparing the Fusion web application technology stack to
the Java EE web application 12
View layer 13
Controller layer 13
Data binding layer 14
Business service layer 14
Developing with ADF 15
Setting up the development environment 15
Picking up the tool for development 15
Setting up the Software Configuration Management tool 16
Build tool 16
Team collaboration 17
Taking a quick tour of the JDeveloper IDE 18
Your first Fusion web application 20
Starting JDeveloper IDE for the first time 20
Picking up the right application template 21
Analyzing the generated metadata files 23
Connecting to the database 25
What happens when you create a database connection? 25
Generating the data model and business services 26
Building entity objects to persist your business data 26
Building view objects to shape your business data 29
Building an application module to facade your business service implementation 30
What is there in your model project source now? 33
Building user interfaces from the model 34
What have you got in your view controller project source now? 36
Deploying and running the application 37
Running the application using an integrated webLogic server 37
Running the application on a standalone application server 38
Summary 38
Chapter 2: Introduction to ADF Business Components 39
Business service layer 40
Why ADF Business Components? 40
Overview of ADF Business Components 41
Oracle ADF Business Components feature list 41
Core building blocks 42
Entity objects 43
Associations 44
View objects 44
View links 44
Row sets 45
Query collections 45
Application modules 45
Services and service data objects 46
Building a simple business service 46
ADF Business Components configuration files 49
Oracle ADF Model Tester 50
Using the ADF Model Tester to test the CRUD operations
on business data 52
Testing business methods 52
Java test client for ADF Business Components 53
Understanding the runtime behavior of ADF Business Components 55
Roles and responsibilities of the view object, row set,
and query collection 55
A closer look at query collection 56
What happens when you execute an entity-based view object? 58
What happens when you commit a transaction? 60
Summary 62
Chapter 3: Introducing Entity Object 63
Introduction 63
Ingredients of an entity object 64
Runtime collaboration between business components 65
Core features of ADF entity objects 66
Developing entity objects 66
Creating a database connection 66
Initializing the ADF model project 67
Creating entity objects 67
Choosing the database object type 68
Generating Java classes for entity components 69
Commonly used properties of an entity attribute 70
Attribute names in an entity object 71
Attribute types in an entity object 72
Using a resource bundle to localize UI hint properties 73
Property set 74
Persistent and transient attributes 76
Specifying a default value for an entity attribute 76
Effective dated entity objects 78
Defining the primary key 79
Inheritance hierarchies in entity objects 80
Updatability of entity attributes 83
Refreshing attributes on posting changes to the database 83
Marking an attribute as mandatory 84
Checking data inconsistency by using the Change Indicator attribute 84
Queriable attributes 84
Tracking change history 85
Configuring UI hints for an attribute 86
Specifying dependency attributes 86
Commonly used properties of an entity object 86
Setting an alternate key for an entity object 86
Specifying custom properties 87
Defining entity association 88
Retaining the association accessor row set 91
Adding validation 92
Concurrent access and locking 95
Securing entity objects 98
Enabling a batch update in an entity object 98
Working with entity objects 98
Programmatically creating an entity instance 98
Entity object in a transaction post cycle 100
Summary 103
Chapter 4: Introducing View Object 105
Introduction 105
Concepts and architecture 105
Ingredients of a view object 106
Core features of ADF view objects 108
Developing view objects 108
Creating view objects 108
Using the Create View Object wizard 109
Creating a view object with entity usage mapping 110
Creating a view object with SQL query 113
Creating a view object with static list 114
Creating a programmatic view object 114
Creating a declarative SQL mode view object 114
Optionally generating Java classes for a view object 116
Commonly used properties of view objects 117
Annotate attributes using UI hints 118
Adding business rules 119
Working with view objects 120
List of values 120
Configuring the list of values 120
Linking two view objects 122
Where clause and Reverse Where clause 122
Inheritance hierarchies in view objects 123
Inheritance hierarchies in view objects with non-polymorphic entity usage 123
Inheritance hierarchies in view objects with polymorphic entity usage 123
Querying the datasource by using a view object 125
Specifying the query mode for a view object 126
Adding WHERE clause to a view object 128
Using bind variables 129
Changing the query of a view object at runtime 131
Programmatically sorting view object rows 132
In-memory filtering of row sets 132
View criteria 136
Effective dated view objects 142
Using alternate keys in a view object 143
Using findByKey() on view objects 144
Creating new rows through the view object 145
Creating child rows in composition association 145
View link consistency 147
Configuring view link consistency 147
How view link consistency works 148
Why does view link consistency fail when you add a dynamic WHERE clause? 149
What happens when you execute a view object? 151
Summary 155
Chapter 5: Advanced Concepts on Entity Objects
and View Objects 157
Taking a closer look at entity objects 157
Lifecycle of an entity object 158
Reading the current state of an entity row 161
Reading the originally retrieved attribute value 162
Retrieving all entity instances in the cache 163
Lifecycle callback methods of an entity object 163
What happens when a new entity instance is created? 164
What happens when an entity instance is modified or removed? 166
What happens when the transaction is committed? 167
Building programmatically managed entity objects 170
Generating a database independent unique ID 172
How does unique ID sequencing work 172
Using middle tier generated unique keys 172
Refreshing entity rows, forgetting the changes 173
Building custom history types 175
Taking a closer look at view objects 177
Lifecycle callback methods of a view object 177
What happens when a client invokes executeQuery() on a view object instance? 178
Count queries in a view object 180
Building programmatically managed view objects 180
Intercepting query generation for view criteria 181
Using a custom view criteria adapter 182
Overriding getViewCriteriaClause(boolean forQuery) in the view object
implementation class 183
Overriding getCriteriaItemClause(ViewCriteriaItem vci) in the view object
implementation class 184
Tips on overriding getViewCriteriaClause() and getCriteriaItemClause()
in the view object implementation 186
Customizing the query at runtime 186
Customizing the query for a row set 187
Customizing the query for a view object 187
Passing parameters to a SQL IN clause using oracle.jbo.domain.Array 188
Using oracle.jbo.domain.Array as a NamedWhereClauseParam value 189
Using oracle.jbo.domain.Array as a bind variable value for a view criteria item 190
Defining a cascading list of values 193
Switching the LOV at runtime 197
Reading and writing XML data 199
Advanced data type techniques 202
Building custom data types using domain type 202
Working with BLOB and CLOB data types 204
BLOB and CLOB support for alternate databases 207
Building business components dynamically 208
Building dynamic entity objects and view objects 208
Steps for building entity definition at runtime 210
Steps for building a view definition with entity usage at runtime 212
Personalized business components 215
Summary 217
Chapter 6: Introducing the Application Module 219
Introduction 219
Concepts and architecture 220
Ingredients of an application module 220
Additional core components 221
The core features of an application module 222
Defining an application module 223
Creating application modules 223
Optionally generating Java classes for an application module 223
Adding hierarchical view object instances to an application module 224
Overriding the default properties of an application module 225
Commonly used application module configuration properties 227
Modifying the JDBC data source name for an application module 229
Overriding properties for a view object instance 230
Declaratively applying view criteria to a view object instance 230
Sharing application module data 230
An alternative option to define a shared application module 232
Runtime behaviour of shared application modules 232
Query execution for a shared view object 233
Shared query collection cache management 233
The maximum weight of the query collection pool 234
Query collection weight 235
Consuming a shared application module 235
Accessing view objects defined in a shared application module through
a view accessor 235
Associating view criteria with shared application module instances 238
Nesting application modules 238
Accessing a nested application module from the parent 240
Working with an application module 240
Exposing the business service method through data control 241
Where do you write custom business logic in a fusion web application? 242
Invoking an application module from a Java client 243
Invoking a shared application module from a Java client 244
What you may need to know about programmatically releasing
an application module? 245
What happens when a client creates an application module instance? 245
The lifecycle of an application module 247
Passivation activation of application modules 250
Programmatic passivation and activation of custom data 250
Storing business data at user session level 251
Using a transient view object 251
Using a user session data map 252
Using a client bound session map object 253
Using JDBC APIs in an application module 253
Using save points for undo operations 256
Programmatically configuring an application module 257
Programmatically building a master-child view object 259
Using ADF Business Components with Java EE components 260
Summary 262
Chapter 7: Binding Business Services with the User Interface 263
Introduction 263
Binding model data with user interfaces 264
Building a simple data bound web page 266
Is a view object really a data collection? 268
What happens when we drop a data collection on a page? 270
Taking a closer look at the ADF Model metadata files 271
adfm.xml 272
DataBindings.cpx 273
adf-config.xml 274
adf-settings.xml 275
Browsing through the page definition file 275
Parameters 275
Executables 275
Bindings 277
Using the binding editor 278
Programmatically accessing page binding elements 279
Accessing binding container 279
Programmatically accessing the parameter binding 280
Programmatically executing method action binding 280
Accessing the list control binding 282
Accessing the attribute binding 283
Accessing the iterator binding and associated view object 283
What happens when you access a Fusion web page? 284
Invoking an application module from a Java servlet 291
Using Configuration::createRootApplicationModule() in HttpServlet 291
Using ADF binding APIs in an HttpServlet 293
Adding custom phase listeners 295
Summary 296
Chapter 8: Building Data Bound Web User Interfaces 297
Introduction 297
The art of laying out pages 298
Organizing page contents – a case study 300
Adding actions to your page 303
Choosing between the managed bean method and the data control
method as event handlers 303
Using managed bean methods as event handlers 304
Using data control methods as event handlers 304
Building data bound table UIs 307
What happens when you drop a data collection as a table on a page? 308
Commonly used attributes of iterator bindings 309
What happens at runtime in a data bound table? 311
Adding edit functionalities for a table 311
Creating a new row 311
Deleting a row 313
Committing changes 313
Programmatically accessing a selected row from a table 313
Declaratively reading the attribute value from the currently selected row 315
Building data bound master-detail UIs 316
Building a master-detail data model 316
Building a master-detail UI 316
What happens at runtime in the master-detail UI? 317
Building a data bound tree table UI 317
Building hierarchical view objects 317
Creating a tree table UI 318
What happens when you drop a data collection as a tree table on a page? 320
Decorating the tree table UI 321
What happens at runtime in a data bound tree table? 322
Synchronizing UIs using the target data source 323
What happens at runtime in the target data source? 324
Adding edit functionalities for a tree table 325
Configuring the parent view object to retain the view link accessor row set 325
Creating utility methods for reading RowIterator and selected RowKey for
the selected node 325
Implementing create and delete methods in the application module 328
Creating a new row 330
Deleting a row 330
Programmatically refreshing the tree hierarchy 331
Accessing web tier values from business components 332
Using ADFContext to access client specific scoped variables 332
How does ADFContext provide uniform access across layers? 332
The pitfalls of using ADFContext 333
Passing web tier values as parameters to business service methods 333
Establishing a channel for passing web tier values to the business service layer 333
Using the user session data map to store values passed from the client 333
When should the client invoke the method that takes web tier values? 334
Making the user session data map passivation safe 334
Building data bound query search forms 334
Building the view criteria 335
Using UI hints to control the display for a query component 337
Building a search UI 338
What happens when you drop a view criteria as a query component on a page? 338
Commonly used properties of the search region binding 339
Initializing criteria item values using web tier values 340
Programmatically controlling the display of a query component 342
Programmatically retrieving view criteria used for a query component 344
Programmatically resetting a query component 346
Search on a tree table 346
What happens at runtime in a tree table search? 348
Building a data bound multi select list 348
Programmatically accessing selected rows 349
Overriding UI hints in a view object 349
Summary 352
Chapter 9: Controlling the Page Navigation 353
Introduction 353
The navigation model in the JSF framework 354
Rule based navigation 354
Implicit navigation 355
How does implicit navigation work? 355
The navigation model in ADF 356
The ingredients of an ADF task flow 357
Task flow configuration files 357
ADF managed beans 358
What you need to know while using managed beans in JSF code? 361
Task flow activities 361
View activity 362
URL view activity 366
Method call activity 368
Router activity 370
Save point restore activity 371
Task flow call activity 376
Task flow return activity 376
Parent action 377
Building an unbounded task flow 378
Using a managed bean to return a dynamic outcome for a navigation component 380
Conditionally executing a control flow case 380
Improving the readability of control flow cases 380
Adding an exception handler 381
Customizing the default exception handler 382
Building a custom javax.faces.context.ExceptionHandler 382
Using method call activity to initialize a page 385
Building a task flow with method call activity 386
What happens at runtime? 387
Building a menu model 388
Summary 388
Chapter 10: Taking a Closer Look at the Bounded Task Flow 389
Introduction 390
The properties of a bounded task flow 390
Building a bounded task flow 394
Working with bounded task flow activities 395
Marking an activity as the default activity 395
Marking an activity as an exception handler 396
Calling a bounded task flow using the task flow call activity 396
Using dynamic task flow calls 398
Commonly used properties for a task flow call activity 399
Using remote task flow calls 400
Parameterizing a bounded task flow 403
Defining a task flow input parameter 403
Specifying input parameter values for a task flow 403
Defining the task flow return value 406
Reading a return value from a task flow 406
Consuming bounded task flows as ADF regions 408
Dynamically displaying the task flow 409
Lazy loading of an ADF region 410
Refreshing an ADF region 411
Displaying task flows using a pop up component 412
Lazy activation for a task flow when displayed in a pop up 413
Using a contextual event for communicating to an ADF region 414
Contextual event model 414
Using a contextual event 415
Defining an event publisher 416
Defining an event subscriber 418
Contextual event propagation at runtime 422
Dynamically adding multiple regions to a page 422
Distributing ADF task flow as the ADF library 426
Packaging the task flow into the ADF library 427
Consuming task flows added into an ADF library 427
Using a train component in a bounded task flow 428
Creating a train in a bounded task flow 429
Setting display names for train stops 430
Customizing the display for train stops 430
Programmatically navigating between train stops 432
Executing methods while navigating between train stops 432
Transaction management in a bounded task flow 434
What happens at runtime? 435
Programmatically managing transactions for a task flow 436
The life span of a bounded task flow 437
Summary 438
Chapter 11: More on Validations and Error Handling 439
Introduction 439
Adding validation rules in a fusion web application 440
Defining validations in the ADF view layer 441
Defining a custom ADF Faces validator 442
Defining validations in the ADF model layer 446
Defining validations in the ADF Business Components layer 447
Validations using custom domain objects 448
Where to put validation in a Fusion web application 454
Displaying validation exceptions on a page 454
Where in the page lifecycle does validation occur? 455
Client-side validation 455
Server-side validation 456
Error handling in ADF 457
Taking a closer look at DCErrorHandlerImpl 459
Programmatically throwing validation exceptions in business components 461
Localizing validation error messages 462
Resource bundle usage in entity objects and view objects 462
Resource bundle usage in the application module 462
Reading the resource bundle definition from the business component 464
Programmatically throwing validation exceptions 464
Building a validation exception using message strings from the resource bundle 465
Validation class hierarchy 466
Wrapping exceptions 467
Programmatically throwing multiple RowValException 468
Programmatically throwing AttrValException 471
Customizing default business component error messages 473
Step1: Creating and registering a custom message bundle 473
Step 2: Customizing the DCErrorHandlerImpl 474
Step 3: Registering the CustomErrorHandler 476
How does the CustomErrorHandler implementation work? 476
Skipping validation 477
Skipping validations in the ADF Faces layer 477
Skipping validations in the business components 478
Summary 479
Chapter 12: Oracle ADF Best Practices 481
Introduction 481
Setting up the project structure for your Fusion web application 482
Single application workspace comprising of multiple projects – monolithic approach 482
Multiple application workspaces controlled by a single master
application– microkernel approach 483
Guidelines for setting up the application source using the microkernel approach 484
How to avoid cyclic dependency between modules 486
The life span of ADF Business Components 488
Life span of an application module 488
How the framework allocates an application module for serving a client request 489
More configuration options for an application module 491
When an application module is removed from the pool 492
Life span of a view object, row set, and query collection in a regular application module 493
The query collection cache and view accessor row set 495
The life span of entity objects 496
What if you want to clear an entity cache at specific points in time? 496
The life span of row sets in a shared application module 497
The life span of binding objects 498
The best practices and performance tuning for Oracle ADF 499
Tuning tips for an application module 499
Tips for optimizing an application module initialization 499
Tips for optimizing resource usages in an application module 501
Tips for fine-tuning the JDBC API use 502
Coding guidelines for application modules 503
Tuning tips for view objects 505
Tips for optimizing query execution in a view object 505
Tips for optimizing database read operations 506
Tips for setting a global row fetch limit for view objects 507
Tuning view criteria in view objects 508
Tips for optimizing LOV definitions 509
General tips for tuning view objects 510
Coding guidelines for view objects 511
Tuning tips for entity objects 518
Design guidelines for entity objects 518
Tips for validating entity objects 518
General tips for tuning entity objects 519
Coding guidelines for entity objects 521
Tuning tips for ADF model 522
Tips for tuning executable bindings 522
Tips for optimizing data traffic between a binding layer and business components 524
Tips for optimizing count query executions 525
Coding guidelines for ADF binding APIs 525
Tuning tips for ADF Controller and task flows 527
Tips for optimizing resource usage in a task flow 528
General guidelines for building successful task flows 528
Coding guidelines for managed beans 530
Tuning tips for ADF Faces 530
General tips for ADF Faces pages 531
Best practices for ADF Faces UI components 532
Internationalization of Fusion web applications 533
Configuring the time zone for a Fusion web application 533
Ensuring high availability for Fusion web applications 535
How does a bean data control participate in session replication in high availability mode? 538
Summary 540
Index 541
Configuring the time zone for a Fusion web application 533
Ensuring high availability for Fusion web applications 535
How does a bean data control participate in session replication
in high availability mode? 538
Summary 540
Index 541