Archive for July, 2011

Creating Dependent LOVs in ADFbc

Let me demo how can we create the dependent LOVs in ADFbc  here. We can define the dependent LOVs on Region, Country, Location (Country LOV depends on Region and Location LOV depends on Country LOV ) using the HR Schema.


1)      Create the EOs, VOs for the below tables of the HR schema as shown in the below screen-shots.


2)  Then goto CountryVO and goto Query tab. Add a bind variable ‘region_id’ and mark the data type as ‘Long’ and unmark the ‘Required’ check box.


3) Create a view criteria which filter only the countries for a region. To create VC, open CountryVO and  click on ‘+’ that shown against the View Criteria section.  Select the Attribute as ‘RegionId’ , Operator as ‘Equals’, Operand as ‘Bind Variable’.In the parameter dropdown, select the bindvariable ‘region_id’ and click on Ok.

4)      Goto LocationVO and  goto Query tab.Add a bind variable ‘country_id’ and mark the data type as ‘String’ and unmark the ‘Required’ check box.


5) Create a view criteria which filter only the Locations for a country.To create VC, open LocationVO and click on ‘+’ that shown against the View Criteria section.

Select the Attribute as ‘CountryId’ , Operator as ‘Equals’, Operand as ‘Bind Variable’.In the parameter dropdown, select the bindvariable ‘country_id’ and click on Ok.


6) Create a test vo called ‘TestDependentLOVVO’ by right click on your project and select ViewObject. Select ‘Read only access through SQL query’ option while creating the VO. As this is a test vo, we are creating a read-only VO.


7) Do not enter any SQL and go to Attributes section. Add the attributes Region,Country,Location by click the ‘New’ buttons. Make sure that for these attributes the type is ‘String’ and the updatable property set to ‘Always’.


8) Similarly create the Id attributes like ‘RegionId’, ‘CountryId’, ‘LocationId’. Make sure that the type of ‘RegionId’ and ‘LocationId’ is ‘Long’ and the datatype for the ‘CountryId’ is ‘String’. The updatable property should be set to ‘Always’.


9) In the ‘ApplicationModule’ window of the ‘Create View Object’ wizard, select the ApplicationModule check box and create a new ApplicationModule called ‘TestDependentLOVAM’ and then click on ‘Finish’.


10) Now create the view accessors for the Regions,Countries,Locations in the ‘TestDependentLOVVO’. Open the VO and goto ‘View Accessors’ tab and click on ‘+’. In the View Accessors window, select the RegionVo from the available view object and shuttle to ‘View Accessors’ section. Similary, shuttle CountryVO, LocationVOs to the ViewAccessors section and press ‘Ok’ button.


11)Now edit the ‘CountryVA’ and shuttle the view criteria ‘CountryVOCriteria’ and pass the ‘RegiondId’ value of the VO to the bind variable of the ‘CountryVA’.

12) Similarly, edit the ‘LocationVA’ and shuttle the view criteria ‘LocationVOCriteria’ and pass the ‘countryId’ value of the VO to the bind variable of the ‘LocationVA’.

13) Now create LOVs on Region, Country, Locations in the ‘TestDependentLOVVO’. Select the Region attribute from the Attributes tab and goto ‘List-of-values’ section and click on ‘+’. In the create LOV window, select the ListDataSource as ‘RegionVA’ and the ListAttribute as ‘RegionName’. In the ListReturnValues’ section retrun RegionId,RegionNames.


14) Then goto ‘UI Hints’ tab of the ‘Create LOV’ window, select DefaultType as ‘Choice List’ or ‘Combo box with List of values’. Select the attributes you want to dispaly in the LOV.

15) Similarly, create the LOVs on Country, Location attributes as shown in the below screen-shots.


16) Now run your VO in the ‘TestDependentLOVAM’ and click on ‘+’. Select the Region as ‘Europe’. The country lov shows only the countries for the selected region. Select any country and select the ‘Location’ lov. Now the Location lov shows the locations of the selected country.


Download Sample application  : DependentLOV

Categories: Blogs

Oracle ADF Interview Questions and Answers/Tips

July 30, 2011 1 comment

Here are a set of Interview Question and Answers/Tips for Oracle ADF :

Q : What is Oracle ADF?
A : Oracle ADF is an commercial java/j2ee framework, which is used to build enterprise applications.
It is one of the most comprehensive and advanced framework in market for J2EE

Q : What are the advantages of using ADF?
A : Following are the advantages of using :

  • It supports Rapid Application Development.
  • It is based on MVC architecture
  • Declarative Approach (XML Driven)
  • Secure
  • Reduces maintenance cost and time
  • SOA Enabled

Q : What are various components in ADF?
A : Oracle ADF has following components

  • ADF Business Components(Model)
  • ADF Faces (View)
  • ADF Taskflows(Controller)

Q : What is the return type of Service Methods?
A : Service Methods can return Scalar or Primitive Data types.

Q : Can Service Methods return type Void?
A : Yes, Service Methods can Return type Void

Q : Can Service Methods return Complex Data types?
A : No, service methods can return only primitive/scalar data types.

Q : Which component in ADF BC manages transaction ?
A : Application Module, manages transaction.

Q : Can an entity object be based on two Database Objects(tables/views) or two Webservices ?
A : No entity objects will always have one to one relationship with a database object or web service.

Q : Where is that we write business rules/validations in ADF and why?
A : We should be writing validations at Entity Object level, because they provide highest degree of reuse.

Q : What is Managed Bean?
A : Managed bean is a java class, which is initialized by JSF framework. It is primarily used to hold view and controller logic. It is also used to execute java code to be executed on a user action like Button Click.

Q : What are Backing Bean?
A : Backing beans are those managed beans which have 1:1 mapping with a page. They have getters and setters
for all the components in the related page.

Q : What is difference between managed and backing beans?
A : Backing bean has 1:1 relation with page whereas managed beans can be used in multiple pages.
Backing beans scope is limited to the page whereas managed beans can have other scopes too.

Q : What is a Taskflow?
A : Taskflow is the controller of an ADF application, it provides us an declarative approach to define the control flow.  It is used to define the navigation between pages and various taskflow activites.

Q : What are the different types/categories of Taskflows ?
A :  Taskflows are of two categories : Bounded and UnBounded.

Q : What is the difference between Bounded and UnBounded taskflows?
A : Differences between Bounded and UnBounded taskflows :

  • Bounded taskflows can be secured but Unbounded can’t.
  • Bounded taskflows can accept parameter and return values but unbounded taskflows don’t support parameters
  • Bounded taskflows has a single entry point or a default activity but unbounded taskflows have multiple entry points.
  • Bounded taskflows can be called from other bounded/unbounded taskflows but unbounded cannot be called or reused.
  • Bounded taskflows support transactions unbounded don’t

Q : What are the various access scopes supported by ADF?
A : ADF Faces supports the following scopes

  • Application Scope
  • Session Scope
  • PageFlow Scope
  • Request Scope
  • BackingBean Scope.

Q : Describe life cycle of a ADF Page?
A : ADF page is an extension of JSF and has following phases in its lifecycle

  1. Initialize Context: In this phase the adf page initializes the LifecycleContext with information that will be used during the Lifecycle.
  2. Prepare Model:  In this phase ui model is prepared and initialized. In this phase page parameters are set and methods in the executable section of the page definition of the ADF page are executed.
  3. Apply Input Values: This phase handles the request parameters. The values from the HTML are sent to the server  and applied to the page binding in page definitions.
  4. Validate Input Values:  This phase validates the values that were built in the Apply input values phase
  5. Update Model:  Validated values supplied from user are sent to ADF business components data model
  6. Validate Model Updates:  In this phase the business components will validate user supplied values.
  7. Invoke Application:  This phase will process the ui events stack built during the life cycle of page and also fire navigational events
  8. Prepare Render:  This is the final phase where HTML code is generated from the view tree.

Q : What is PPR and how do you enable Partial Page Rendering(PPR)?
A : PPR is a feature supported by ADF Faces, using which we can render a small portion of a HTML Page, without refreshing the complete page.
It is enabled by.

  • Setting AutoSubmit property to true on the triggering element.
  • Setting the PartialTriggers property of target component to refer to component id of the triggering element.
Categories: Blogs

How to configure Email with SOA with gmail

This Article will teach you how to configure Email configuration when using Email activity in BPEL flow

Pre-requisite :

1.  you should have SOA server running.

2.  Have gmail account.

3.  download OpenSSL for generating certificate

Read more…

Categories: Blogs

Master Detail demo using adf Table components

Let us demonstrate the master-detail application in this blog.  The application uses HR schema and the Departments and Employees tables as master and detail entities respectively.

1)      Create the EmployeeEO, DepartmentEO and the associations between them and the EmployeeVO, DepartmentVO and the view links between the VOs as described in the blog ( Follow the step-1 through step-10).

2)      Once you create the business components, the components’ package structure should look like as there in the below screenshot.

3)      Open EmployeeAM and goto DataModel tab. Remove the existing VOs if present from the datamodel and add the DepartmentVO that you created in the step-1. Also add the EmployeeVO through the viewlink that present inside the DepartmentVO.

4)      Run the EmployeeAM and the AM wizard looks like the below screenshot.

5)      Now, we will show the master-detail layout in a simple jspx page. Goto the UI project, MasterDetailUi, and right-click on it and create a jspx page.

6)      Now drop the DepartmentVO from the EmployeeAMDataControl that is available in the DataControl panel of the JDev.  Drop the DepartmentVO as the ADF Table onto the af:Form section of the jspx page.  Once you drop the VO,  a window ‘Edit table columns’ comes where you can add or delete the columns to show for the Department in the Ui. You can also enable sorting, filtering, rowSelection options in this window.

7)      Surround the department table with showDetailHeader component that will be used to show the title for the table and to put the buttons used for creating and deleting the records for departments table. To surround the showDetailHeader, right-click on af:table and select  ‘Surround with …’ and select  ‘ADF Faces’ from the dropdown and select showDetailHeader from the available list of components.

8)      Change the TEXT property of the showDetailHeader to ‘Departments’. To change this property, select the showDetailHeader component in the structure pane and open the ‘Property inspector’ from the View menu of the JDev. In the property inspector, goto Common tab and change the TEXT property. And also the change the styleClass property to ‘AFStretchWidth’ that is available in the Style tab.

9)      To stretch the table in the entire page, set the styleClass property to ‘AFStretchWidth’ that is available in the Style tab and also stretch one of the column in the table. In Departments table DepartmentName column is stretched in this application.  To stretch any column, select the af:table and goto Appearance tab in the property inspector and select the columnId for the ColumnStreching property.

10)   Similarly drag the EmployeeVO that is available inside the DepartmentVO of the EmployeeAMDataControl. Drag the EmployeeVO as ‘ADF Table’ and surround with the showDetailHeader.

11)   Set the styleClass property of the showDetailHeader and EmployeeTable to ‘AFStretchWidth’ and also set the columnStretch property for the EmployeeTable.

12)   Add the action bindings of Create and Delete for the employee and department tables.

13)   Open the jspx page and goto Bindings tab. Click on the ‘+’ icon that present in the Bindings section. Select  ‘Generic Bindings’ from the dropdown and select ‘action’  from the available list and click on OK.

14)   Click on the EmployeeAMDataControl and select DepartmentVO under it. Select the Opeation as ‘CreateInsert’ from the dropdown list and click on Ok. Now ‘CreateInsert’ action binding got created for the Departments. Follow the same steps to create the ‘Delete’ action binding for the Departments entity.

15)   Follow the same step as in step-14 to create the bindings ‘CreateInsert’ and ‘Delete’ action bindings for the Employee entity.

16)   Now, we will create the action bindings for saving and cancelling the changes for the page.  Open the jspx page and goto Bindings tab. Click on the ‘+’ icon that present in the Bindings section. Select  ‘Generic Bindings’ from the dropdown and select ‘action’  from the available list and click on OK. Click on the EmployeeAMDataControl and select the operation as  ‘Commit’ from the dropdown. Similarly, create the ‘Rollback’ binding.

17)   Now the Bindings tab of your jspx looks like as shown in the below screenshot.

18)   Goto the jspx page in the structure pane and select the f:facet-toolbar of the Department’s showDetailHeader. Right-click on it and select Insert inside à  ADF Faces.

19)   Now select the Toolbar button that is available in the component list of the Insert ADF Faces Item dialog.

20)   Change the text property of the toolbar button to ‘Create’ and keep the EL expression #{bindings.CreateInsert.execute} for the actionListener property of the button.

21)   Similarly add one more button for the Cancel. Set the text property of the second button to ‘Cancel’ and set the the actionListener property of the button to ‘#{bindings.Delete.execute}’.

22)   Follow the steps in 20 and 21 to add the two toolbar buttons inside the f:facet-toolbar of the showDetailHeader of the employees table. Add the actionListener properties as #{bindings.CreateInsert1.execute} and ‘#{bindings.Delete1.execute}’ for the Create and Delete buttons of the employee.

23)   Add another showDetailHeader inside the af:form section of your jspx and add two buttons inside the f:facet-toolbar. Set the text and actionListener properties of the first button to ‘Save’ and ‘#{bindings.Commit.execute} resp. Similarly set the text and actionListener properties of the first button to ‘Cancel’ and ‘#{bindings.Rollback.execute} resp. These two buttons are responsible for saving and cancel the changes that are made to any of the tables (Department or Employee) in this page.

24)   Now drag the showDetailHeaders of the Departments and Employees inside the showDetailHeader that we just created in the step-23.Now your page structure looks like

25)   Now save your work and run the jspx page. You can create/update/delete the departmetns and employees and save or cancel your changes from the jspx page. The page looks like

Download sample application : MasterDetailApp

Categories: Blogs

Welcome to S M Consultants

Oracle Fusion Middleware (OFM) 11g is the top most upcoming application infrastructure foundation.By maximizing the IT and full usage of modern hardware and software architectures, OFM enables businesses to create and run intelligent business link applications.
SMC is the top leading company in the domain of Oracle Fusion Middleware consulting. Our team comprises of experienced and certified OFM developers, who have sound understanding of OFM. With our strong functional, technical and analytical skills, we provide a wide range of services to our customers to meet your business demands.
Why SMC?
Exceeding our customers’ expectations is our top most priority.
All our work is done in a highly professional environment. We take the utmost care of our customers by delivering solutions which are specific, task oriented and time bound.
We consistently innovate to empower our customers to be on par with the ever growing competition across the globe. We strive hard to make your business collaborative and agile.
The high level of motivation and focus to exceed client expectation and to empower their business craft the motto of SMC team ‘…. empowering customer business’.
Categories: Blogs