ADF - validate the username and password against a database table

Wednesday, April 09, 2008

Container-managed security allows web applications to delegate authentication and authorization decisions to the executing web container.In Oracle Containers for J2EE (OC4J) the authentication and authorization decision is handled by the OracleAS JAAS Provider.Web applications running in OC4J can be configured to authenticate users against Oracle Internet Directory (OID), third-party LDAP, CoreId, jazn-data.xml or a custom JAAS LoginModule.The benefit of container-managed security in contrast to a pure JAAS approach (Java Authentication and Authorization Service) approach is that the application logic is not mixed with authentication and authorization code, which ensures portability.

This article explains how to leverage database tables for storing account information for user authentication and authorization of Java EE applications in JDeveloper 10.1.3.2 and OC4J 10.1.3.2.

Find the article here.

Read more...

Most Commonly Used Methods in ADF Business Components

Tuesday, April 08, 2008

Steve Muench has compiled a list of Most Commonly Used Methods in ADF Business Components. It includes the methods that ADF developers write, call, and override most frequently.

The list can be found here.

Read more...

Life Cycle of an Entity Object.

When a new row is created on entity-based view object, the entity status is set as New. Transaction's list of pending changes is updated with the new row. When the transaction is committed, the row will be saved to the data base. But when a blank row is created, the user may not have entered any data. So by setting the row status to 'initialized', the new row can be forced to remove from the Transaction's list of pending changes. This prevents the system from posting the row into database, if the user never enters any data into any attribute of that initialized row. When the user enters data into any attribute of the initialized row, the row status changed to New.













When an entity is retrieved from the database, its status is set as Unmodified. When the user enters data into any attribute of the unmodified row, the row status changed to Modified. When user calls remove() on Unmodified row, the row status changes to Deleted. If the row is in New state and the user calls remove() on the row, row status changes to Dead.

When an entity is retrieved from database, the entity is assumed to be valid. When any attribute of the entity is modified or a new entity row is created, the entity is marked as invalid. Before committing the transaction, system validates all invalid entity rows in the Transaction's pending list. Then the changes are posted to database and the row status changes to Unmodified.

Read more...

Difference between setCurrentRowWithKey and setCurrentRowWithKeyValue?

setCurrentRowWithKey takes serialized value of rowKey as parameter e.g. 000200000002C20200000002C102000000010000010A5AB7DAD9
The serialized string representation of a key encodes all of the key attributes that can be conveniently passed as a single
value in a browser URL string or form parameter.

The serialized string key of a row can be accessed by referencing the rowKeyStr property of an ADF control binding (e.g. #{bindings.SomeAttrName.rowKeyStr})

setCurrentRowWithKeyValue takes literal value as parameter e.g "201"

Read more...

How to change the Oracle ADF look and feel?

Friday, April 04, 2008

Oracle supports skinning i.e. changing the look and feel of the application.
You can develop your own skin e.g. CustomSkin.css

Step 1: Put CustomSkin.css and all dependent resources at the root
of your application e.g. /skins/myskin/CustomSkin.css

Step 2: Register the custom skin
In JDeveloper, right click on the WEB-INF folder of the sample project
and create a new XML document and name it - adf-faces-skins.xml
Replace the generated code with the following:

 <skins xmlns="http://xmlns.oracle.com/adf/view/faces/skin">
  <skin>
   <id>mycompany.desktop</id>
   <family>myskin</family>
   <render-kit-id>oracle.adf.desktop</render-kit-id>
   <style-sheet-name>/skins/myskin/CustomSkin.css</style-sheet-name>
  </skin>
 </skins>

Save your work.

Step 3: Modify adf-faces-config.xml file to use the custom skin.
Open the adf-faces-config.xml file.
Replace the <skin-family>value with custom skin family name
e.g. <skin-family>myskin</skin-family>

Save your work.

Step 4: Run your application and test.

Read more...

Useful ADF Blogs

These Blogs made my life easier. Hope these will help you too.

Frank Nimphius Blogbuster

Dive into Oracle ADF

Shay Shmeltzer's Weblog

The Peninsula's Edge

The GroundBlog By Duncan Mills

Matthias Wessendorf's Weblog

Grants Blog

Tug's Blog

Chris Muir

Real World ADF

Gerard Davison's Blog

Andrejus Baranovskis's Blog - JDev/ADF Samples list

Java / Oracle SOA blog

Read more...

How to add one master and many details in Oracle ADF?

Oracle ADF helps you to define master detail regions by drag and drop. But 'drag and drop' is only possible for one master and one detail combination. For one master and many details design follow the following steps.

let us assume, you need one master and two detail.

Region Structure
---------------------------

Master1
|
|________ Detail1
|
|________ Detail2

View Objects
----------------------------
MasterVO
|
| VL1
|___________DetailVO1
|
| VL2
|___________DetailVO2


Step 1: Drag DetailVO1 from Data Control Palette.
Drop on the page design and select 'Master Detail => ADF master table, Detail Table'
This will create Master1 table and Detail1 table

Step 2: Drag DetailVO2 from Data Control Palette.
Drop on the page design and select 'Master Detail => ADF master table, Detail Table'
This will create Master2 table and Detail2 table

Step 3: Delete Master2 table

Step 4: Select Detail2 table. In the property inspector, Behavior tab, put Master1 in the Partial Triggers field. (Note: Master1 is the master table name).

Run the page and test.

Read more...

  © Blogger templates Newspaper by Ourblogtemplates.com 2008

Back to TOP