Friday, February 27, 2015

ADF Bindings & Data Controls - NIAIOUG Webinar

Presented ADF Bindings and Data Controls webinar session for February event. Below is the presentation.

Friday, February 13, 2015

Deploy ADF Library Jar as shared library and refer it from Consuming App

In this post I will explain a way to create an ADF application consisting of task flows as ADF Library jar and deploy it as shared library and then refer it in your Consuming Application. In this scenerio, we will not be creating a WAR, rather we will be deploying ADF Library Jar as shared library.
In this case we dont need to create weblogic.xml . We will use weblogic-application.xml which is already there in META-INF folder when we create ADF Application.

Created an ADF Application TaskFlowFirstApp.

The TaskFlowFirstApp is just having a TaskFlow with one fragment which displays Departments table out of DepartmentsVO.



The Task Flow application is deployed as a ADF Library Jar.  While creating the deployment profile for ADF Library Jar, need to add the MANIFEST.MF File like below.


ADF Shared Library - Deploying ADF War as Shared Lib

In Oracle ADF Applications , mostly the architecture is like there are task flow applications which can be based on module and then there is one main consuming application.

In this post we will see how we can deploy the ADF applications as Shared Library. ADF Application consisting of task flow will be packed as WAR and will be deployed as shared library to weblogic. Then The Main Consuming Application will refer the Task Flow App and use the task flow from shared library.

Lets get started.

Created a simple ADF Application and created DepartmentsEO/VO out of HR Schema in Model project. ViewController project consist of Task Flow with one page fragment which has an output text and a ADF Table out of DepartmentsVO.  Also created a DataSource jdbc/HRDS in weblogic console and Application Module is referring to this DS.


Monday, February 9, 2015

JpsAnonymousRoleImpl Issue for Custom Login page Using Managed Bean in ADF

While implementing Custom Login page using Bean Custom Login Page using Login Bean in ADF, once you do all the steps and run the login you get a nasty exception below:

This example was created using Jdev 11.1.1.7
 oracle.security.jps.JpsException: java.lang.IllegalArgumentException: oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl


Hmm we did all the steps correctly but face this exception while running the CustomLogin Page.

So while troubleshooting the problem, figured out that there is some problem with jazn-data.xml.

First lets removed the annonymous-role which is been given to CustomLogin.jspx.


Sunday, February 8, 2015

Custom Login Page using Login Bean in ADF

In most of the Oracle ADF Applications, applications have a customized login page which is specific to the application.

While configuring ADF Security, it generates a default Login and Error page which is good for testing the environment. But for actual applications , Customized Login page is required for the application. In this post we will be looking at it.

Use Case
Creating a customized login page and login the user programmatically using Managed Bean.

Lets get started.

Created a simple ADF Application CustomLoginApplication.

It consist of two JSPX pages. Custom Login and Landing page. Below is the code for custom login page.



Saturday, January 31, 2015

Preselected CheckBox - SelectBooleanCheckBox in ADF Table

In this post, I will be extending the application from the post CheckBox in ADF Table and retrieve selected rows .

The use case is very common. When the table with checkbox (SelectBooleanCheckBox) in the rows is rendered, there should be preselected checkbox in the rows depending on some condition. To make it simple to understand in this post ,when the Departments Table is loaded on the page, the checkbox should be ticked for Departments IT and Marketing.


Lets get into the implementation.

For this use case, lets add a method in AMImpl class which has the logic to tick or pres elect the checkboxes for rows having department name as IT and Marketing. Below is the code in AMImpl class. Note that VOImpl and VORowImpl classes has been generated for DepartmentsVO.

CheckBox in ADF Table and retrieve selected rows

In this post I will explain a way to implement checkbox in the rows of ADF Table component. This is a generic approach and can also be used in other components but we will take example of table component for this post.

This is common requirement in many features e.g. Multiple Delete or assigning multiple things by selecting checkbox.

Lets dive into the implementation.

Created a simple ADF app with HR Schema using Departments Table. Created DepartmentsEO,VO and AM.

First since we need a checbox in every row of the Departments table, we need to add a transient attribute in DepartmentVO of Type Boolean. The value of this boolean (false or true) will render the checkbox as (checked or unchecked).