Wednesday, October 6, 2010

Calling Web Services using ADF 11.1.1.3

In this post I will explain you how to call a web service using ADF 11g, In my last post i explained how to create a java web service using jdeveloper 10g, i will use the same web service in this example which returns credit rating for the customers.

1) Create a new Fusion Web Application (ADF) Application and Provide an Application Name, GetCreditRating and click Next



2) From the Project Technologies move Web Services into the Selected box. Accept the defaults and click Finish.

3) Right-click the Model project and select New and In the Gallery select Web Services –> Web Service Data Control then click OK.

4) Provide a name GetCreditRatingDC and give the URL endpoint for the Web Service, then click Next.




5)
Select the web service operation you want to use for the ADF application. In my example my web service only has one operation.

6) Click Finish, Save your work, the Web service data control is now been created.



Next Step is to create the UI components.

1) Right-click the ViewController project and select New and In the Gallery select JSF --> JSF Page and Click OK



2) Provide a name for the jsp page, GetCreditRating, Also ensure that the ‘Create as XML Document (*.jspx) check box is checked. I have selected the page template, Oracle Three Column Layout but you can create a layout of your choice.


3) I only want 2 facets so I delete the last facet right-clicking the right had panel and selecting Delete


4) In this example I want to get the creditRating of the customer based on the customer ID. So I will enter a Customer ID and Submit it to get the response from web service.

5) Drag the fields you require from the web service data control to the left pannel. In my example I only require the Customer ID. When you drag to the panel select Text –>ADF Input Text w/Label.

6) In this example I want to get the Credit Rating of the customer based on the customer ID. So Once I enter the customerID I want to execute the request. To do this I need a button.
Drag the getCreditRating(Object) under the fields created in step 5. Select Methods –> ADF Button.



7) To Display the credit Rating i will use ADF Output w/Label. so drag the Object from web service data control and select Text –>ADF Output w/Label.


8) Now it is time to test, Right-click the GetCreditRating.jspx page and select Run


9) A browser should start, test for both valid and invalid values.




Tuesday, October 5, 2010

Internationalization of ADF 11.1.1.3 Applications

In this Post I will explain you how to internationalize ADF 11.1.1.3 applications. ADF supports multiple language support which will be demonstrated here.

1) Open JDeveloper 11.1.1.3 and Create an Application and View Controller Project name it as sample.jpr

2) Create a new JSPX page called sample.jspx as follows.
Right Click on sample.jpr, select new--> JSF--> JSF Page --> Click OK

3) In the Create JSF Page Step, Give File Name as Sample.jspx, Make sure the Create an XML Document (*.jspx) option is checked also Do not Automatically Expose UI components in a Managed Bean is Checked.

3) You will see an empty sample.jspx page. Lets add some of the components to jspx page. Drag and drop the PanelStrechLayout Component on the page,


4) You will see number of facets like start, end, center etc on the page

5) Drag an drop the PanelGroupLayout on the center facet of the PanelStrechLayout.

6) set the Layout property of PanelGroupLayout to scroll as shown below

7) Create Resource bundle sampleUI.properties for english langauge and sampleUI_de.properties german langauge.

a) Right click on Sample.jpr and Create new---> General--> File ---> OK


b) Give FileName as sampleUI.properties and Click OK


c) Edit the SampleUI.properties as follows:

d) Create the sampleUI_de.properties to support german language.

e) edit the sampleUI_de.properties as follows:

8) Load the ResourceBundle property files created above in the sample.jspx as follows




9) Add inputText component on the PanelGroupLayout, edit the Label property and choose the expression builder and select the JSP Objects--> res --> sample.name --> Click OK

10) Add the Button Component just below the inputText and follow the above steps to set the Label property of the button.

11) Open the faces.config.xml, Under locale-config, set default locale to en and supported locale to de and save

12) Rebuild the project and Run the sample.jspx you will see by default english locale will be loaded and the page looks as follows

13) If you are using firefox mozilla browser go to Tools-->Options-->select content-->languages--> choose--> select german (de) langauge--> ok --> move this langauge up and click OK, refresh the browser to see the change.

Saturday, July 31, 2010

Installation and Configuration of Weblogic 10.3.3 for ADF 11.1.1.3

In this post i will explain you step by step installation of Weblogic 10.3.3, We will set the environment to support ADF 11.1.1.3 applications and also we will configure the weblogic domain

Prerequisites:


1) Download Weblogic 10.3.3 from the following location.

http://download.oracle.com/otn/nt/middleware/11g/wls1033_oepe111150_win32.exe

2) Download Application Develop Framework 11.1.1.2 from the following location

http://download.oracle.com/otn/nt/middleware/11g/ofm_appdev_generic_11.1.1.2.0_disk1_1of1.zip

3) Download Application Develop Framework 11.1.1.3 from the following location

http://download.oracle.com/otn/nt/middleware/11g/ofm_appdev_generic_11.1.1.3.0_disk1_1of1.zip

Section1:

In this Section I will explain you the Installation of Weblogic 10.3.3


1) At this Step, I hope the above files are downloaded and kept in some location say C:\Softwares. double click wls1033_oepe111150_win32.exe to launch installation. you will see a welcome screen, click next



2) Select the option Create a new Middleware Home and specify the Directory where you wish to install weblogic 10.3.3, Click Next


3) In the Register for Security Updates Step, Just deselect option, I wish to receive security updates and you will get warning message just ignore it and click yes and next.



4) Select the Install Type as Typical and click Next



5) Verify the product installation directories once and click next

6) Choose the shortcut location and click next




7) In the Installation summary click Next, it will start installation



8) You can see the progress of the installation


10) Please check installation is successful and click done.


Section 2: Actually to set the Weblogic Environment to support ADF 11.1.1.3, first we need to install application development framework 11.1.1.2, followed by application development framework 11.1.1.3 which will be patch on top of 11.1.1.2. In this Section I will explain you the installation appdev 11.1.1.2 and appdev 11.1.1.3

1) Extract the Zip file ofm_appdev_generic_11.1.1.2.0_disk1_1of1.zip and you will find setup.exe under Disk1 folder. just click setup.exe to launch the installation, As a first step it will ask for the JDK location. copy the JDK location from you installed Middleware home directory and click enter



2) You will see a welcome screen, click next

3) It will run the prerequisite check and click next


4) Specify the existing Oracle Middleware Home directory and click Next



5) In the Installation Summary, Click Install to start the installation

6) You can see the progress of installation.

7) Once the Installation completed successfully click Finish



Section 3: We need to upgrade the appdev 11.1.1.2 to appdev 11.1.1.3 to support ADF 11.1.1.3 applications in weblogic 10.3.3

1) Extract the Zip file ofm_appdev_generic_11.1.1.3.0_disk1_1of1.zip and you will find setup.exe under Disk1 folder. just click setup.exe to launch the installation, As a first step it will ask for the JDK location. copy the JDK location from you installed Middleware home directory and click enter


2) you will see a welcome screen just click next


3) Specify the existing Oracle Middleware Home directory and click Next

4) In the Installation Summary, Click Install to start the installation


5) you can see the progress of installation, please wait till it finishes

6) Click finish when the installation completes.


Section 4: Configure Weblogic Domain 10.3.3 for ADF 11.1.1.3 Applications

1) Go to Start -> Oracle Weblogic -> Weblogic Server 11g R1 -> Tools -> Configuration Wizard,
will launch the configuration wizard.

2) Select the option Create a new Weblogic domain and click next


3) In the select Domain Source step: please select Oracle Enterprise Manager - 11.1.1.0 and Oracle JRF - 11.1.1.0 and click next


4) Enter the name of the domain default will be base domain and click next

5) Enter the user name as weblogic and password as weblogic123 and click next

6) In this step make sure you have selected sun SDK 1.6.0 click next


7) In the Optional Configuration Step, Please select Administration Server and Managed Servers, Clusters and Machines and click next

8) In the Configure Administration Server, Enter the Name Admin Server and Port 8001 and click next


9) Configure the Managed Server with the Port 8002 and click next


10) Configure the Cluster as shown below and click next


11) In this step, assign the Managed Server to the cluster as shown and click next


12) Skip the Configure Machines step, and in the configuration summary click create to create the base_domain


13) Make sure the domain created successfully and click done


14) Go to Command Prompt: navigate to the Oracle Middleware Home Directory and the weblogic domain just now created. for eg: D:\Oracle\Middleware\user_projects\domains\base_domain

15) Once the server starts in Running Mode, Open Mozilla Firefox and Open the Weblogic Console using http://IPAddress:Port/console