Sunday, 10 February 2008

JDev 11g Declarative Components meet Designer Audit Columns

A client has asked me to demonstrate JDeveloper 11g TP3 Declarative Components and how they could be used to show the created_by, created_datetime, updated_by, updated_datetime Oracle Designer audit columns in a standard fashion.

You can download the demonstration application workspace I wrote from here.

To create this I pretty much followed section 17.6 Declarative Components from the draft Oracle Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework 11g Release 1 from Oracle. At this time I don't think there is anything useful I can document in this post beyond the guide besides some instructions on the demonstration below.

To install unzip the application workspace and open it in JDeveloper. Under the Schema project the createSchema.sql creates the necessary database objects for the demonstration. The application depends on a connection SageConn that you can change to connect to your favourite database account.

On running the ViewController editTable1.jspx or editTable2.jspx web pages, you'll note that clicking on the Show Audit button will display a standardised popup dialog for viewing the audit columns, all provided by a declarative component. You'll also note how the usage of the component within the web pages effectively inject the values from #{bindings.createdBy.inputValue} ... createdDatetime ... updatedBy ... updatedDatetime into the declarative component to show. This technique pops up in JSF Page Templates too and is very useful.

The declarative component was created in the SageAuditDecComponents project, exported as an ADF Library JAR, and added to the ViewController as a separate JAR file via the project properties. The declarative component then becomes available to drag and drop from the component palette into our consuming web pages.

No comments: