Sunday, September 19, 2010

ADF Essentials Series at OTN

Hi,

This post to introduce the great ADF essentials series articles at OTN by Chris Muir and John Stegeman. Don't Miss it

Oracle ADF Development Essentials

Series: Adapting Oracle Application Development Framework and Subversion to Your Enterprise's Needs

Happy Jdeveloping,
Zeeshan Baig

Wednesday, September 8, 2010

Store Images in BLOB in Oracle ADF

Hi,
In this post we will see how to store images in BLOB type database column instead of server OS. This post also shows how to read images later from BLOB column using Image servlet.

Download the sample code

Summary of steps as follows:

1) Create table with BLOB column.

2) Create Business Components as usual make sure the type is BlobDomain is selected.

3) Create Managed Bean which process image to store in BLOB  (request scope level)

4) Create Image Servlet to read Images from database table.

Details in this video.





Happy JDeveloping,
Baig

Monday, August 30, 2010

Uploading and Downloading Images in Oracle ADF

Hi,

In this post we will see how to upload and download images in Oracle ADF application.

Note: this example does not store images in BLOB column it just copy the image from client machine to server directory.

Download the sample workspace





Happy JDeveloping,
Zeeshan Baig

Monday, August 23, 2010

How to setup Custom Authentication in Oracle APEX

Hi,
Recently on ODTUG mailing list one fellow asked about using custom authentication schemes in APEX. i thought it would be good idea for my blog post :)

In this video i will demonstrate how to create login page which authenticates username and passwords from database tables in Oracle APEX.

Note: The purpose of this post is just to show the setting up custom authentication therefore i have used a very simple db table with passwords stored as text.
In real world this password approach in not recommended you must store passwords in encrypted columns or use any procedure to convert passwords into encrypted form.

Database structure

 create table my_users
(user_name varchar2(10),
 user_pwd varchar2(10));

insert into my_users
values('Tom','Secret');

insert into my_users
values('Baig','oracle');

commit;

Authentication Function

create or replace function 
validate_user_from_db (p_username in varchar2, p_password in varchar2)
return boolean
as
    v_pw_check varchar2(1);
begin
    select 'x'
    into v_pw_check
    from my_users
    where upper(user_name) = upper(p_username)
    and user_pwd = p_password;
    
    apex_util.set_authentication_result(0);
    return true;
exception when no_data_found then
    apex_util.set_authentication_result(4);
    return false;
end validate_user_from_db;


Authentication messages

0: Normal, successful authentication
1: Unknown User Name
2: Account Locked
3: Account Expired
4: Incorrect Password
5: Password First Use
6: Maximum Login Attempts Exceeded
7: Unknown Internal Error

A little code to test our authentication function( This function for only test in SQL prompt)

declare
 vresult varchar2(10);
begin 
 if validate_user_from_db ('baig','oracle') then 
    dbms_output.put_line('OK');
 else
     dbms_output.put_line('ERROR');
 end if;
end;


And finally a video tutorial steps



Happy learning,
Zeeshan Baig

Sunday, August 22, 2010

Using Page Templates in ADF Fusion application

Hi,
I will continue my last topic which is related to building resuable components in ADF. In this post i will demonstrate how to create and use page templates to provide common look and feel in ADF application.

More info in this video and download the sample workspace



Happy JDeveloping,
Zeeshan Baig

Saturday, August 14, 2010

Sharing Business Components and Task flows between ADF Application

Hi,

Lot of my friends those are coming the Oracle Forms background and new to ADF asks this question "How to share components of one application with another" well the answer is simple by using "ADF Library Jar" deployment profiles.

Explore more in this video



Happy JDeveloping,
ZB