Monday, November 23, 2015

AIOUG Sangam 15 - My Experience

This time once again I attended Sangam15 - Largest Oracle User Group Conference in India which is organized every year. This time it was in Hitec City in Hyderabad at Hyderabad International Convention Center on 21-22 Nov 2015.

It was very nice to see and meet old friends as well as meet new professionals. The event was very well managed by @AIOUG Team and volunteers from different regional chapters of AIOUG. The venue was perfect with large halls and rooms and logistics/facilities very nicely handled by the convention center staff.

I flew in to Hyderabad from Singapore a night before rather 21st morning 2.30am. So I was unable to had a complete sleep which made me unwell and I went late on the venue. Nevertheless I was all set for my session on Oracle Mobile Application Framework.

Friday, November 13, 2015

Connecting Oracle PDB on Cloud using SQL Developer

In this post we will see how we can connect to Pluggable Database which is hosted on Oracle PaaS Cloud : Database as a Service.

As we know Pluggable databases is a new features in Oracle 12c Database so we will be using Oracle 12c Database on Oracle Database Cloud.

Pre Requisites :


  • Oracle Public Cloud environment Access.
  • Oracle Database as a Service subscription.
  • Oracle 12c Database Instance created on OPC.
  • Combination of Public key(required to create 12 instance in above step) and private key to access 12c DB instance using client - Putty and SQL Developer.
  • Passcode of keys.
  • Putty
  • SQL Developer.

Once we have all the information available we are all set to make a connection to PDB on cloud from local SQL Developer.


To connect to PDB, first we need to have a user created if not created already which has access to PDB.

For this connect to DCS cloud environment using putty. 

Enter the public IP in the putty.


Wednesday, October 14, 2015

Oracle Public Cloud : Create Public/Private keys for secure access

For accessing Oracle Cloud Services securely and for authorized access, combination of Public and Private Keys are required. So before the process of creating a new Database Instance public and private keys should be generated. Below is the process for generating public/private key.

Tools Required: PuttyGen.


Follow below steps to use PuttyGen to generate keys.

Open Putty Key Generator.


Accept the defaults with SSH-2 RSA and 2048. Click on Generate.





Now next step is important one. One needs to move mouse in the empty area freely till time the message “Please generate some randomness by moving the mouse over blank area” is flashing on the bar.

Sunday, August 30, 2015

Create Oracle Database Cloud connection in SQL Developer

One of the most basic things to start working on Database Cloud Service offered by Oracle (PAAS) is to create a connection to Database Cloud service from local SQL Developer and browse through the schema and database objects.

The most important and foremost step for using cloud service is to have all the information of the cloud service instance.

Once you logon to the service dashboard by logging into cloud.oracle.com you can see all the services allocated to your account in the dashboard.


Monday, June 15, 2015

Unable to install Jdev - Couldn't rename temporary file - Copy

Recently I encountered a very strange problem while installing Jdeveloper 12.1.3 on new laptop. While installing using windows installer (64-bit) , at the copy operation it throws below exception.


[2014-06-30T22:32:11.916-04:00] [sysman] [NOTIFICATION] [] [oracle.sysman.oii.oiio.oiiol.OiiolTextLogger] [host: Chandra] [nwaddr: 192.168.1.79] [tid: 46] [userId: Chandra] [ecid: 0000KRjkrdsFc5WFLzYROA1JgXn^000006,0] java.io.IOException: java.io.IOException: com.oracle.cie.common.util.crlf.CRLFException: Failed to transform D:\Oracle\Middleware\Oracle_Home\oui\bin\viewInventory.cmd to D:\Oracle\Middleware\Oracle_Home\oui\bin\viewInventory.cmd. Couldn't rename temporary file: D:\Oracle\Middleware\Oracle_Home\oui\bin\fixcrlf535545165763140000
[2014-06-30T22:32:11.917-04:00] [sysman] [NOTIFICATION] [] [oracle.sysman.oii.oiic.OiicAPIInstaller] [host: Chandra] [nwaddr: 192.168.1.79] [tid: 39] [userId: Chandra] [ecid: 0000KRjkotUFc5WFLzYROA1JgXn^000004,0] oracle.sysman.oii.oiif.oiifb.OiifbEndIterateException: java.io.IOException: java.io.IOException: com.oracle.cie.common.util.crlf.CRLFException: Failed to transform D:\Oracle\Middleware\Oracle_Home\oui\bin\viewInventory.cmd to D:\Oracle\Middleware\Oracle_Home\oui\bin\viewInventory.cmd. Couldn't rename temporary file: D:\Oracle\Middleware\Oracle_Home\oui\bin\fixcrlf535545165763140000


There are some posts on OTN which tells about providing the correct (Full permisions) to the jdev installer exe file.

But the actual problem was due to Anti Virus. On disabling the antivirus, the Installation is smooth. So if anyone encounters the above exception , try disabling the antivirus and perform the installation.

Thanks

Saturday, May 9, 2015

Change Default JSESSION ID Name for ADF Application

By Default, every ADF Application writes a JSESSIONID Cookie which maintains the session across the ADF application.

The name JSESSIONID is default and can be seen in browser cookies.

Use Case : There might be scenario where this default name required to be changed. One example can be that there is a requirement for running two applications , one ADF Application and other might be existing application. The existing application already use JSESSIONID as cookie name for session management. In that case there will be a conflict between the two applications. In order to solve this we need to give different name of SessionId for ADF Application.

Created a simple ADF application



Wednesday, April 29, 2015

Consuming websevice in ADF with change in WSDL URLs between different Environments.

In projects where Web Services are consumed, most of the problems come when webservcies are deployed on different environments and url of Service/WSDL gets changed. In consuming application proxys are generated using on environment Service/WSDL and when application moves to another environments, the poxys need to consume the services deployed on that particular environment.

To achieve this requirement, there needs to be some mechanism or way where we can configure the environment Service URL in the consuming application and deploy the same to use the correct environment service.


Created a Simple Web Service and deployed it on both Local Integrated Server and Stand Alone server.



Tuesday, April 21, 2015

ADF Logging in Different Applications Deployed on Managed Server

There are many detailed useful blogs on ADF Logging which provide full details on understanding the details and how to implement and configure it.

This post is for my future reference as how to enable/configure ADF Logging for multiple applications deployed on Weblogic Managed Server.

Use Case : Enable ADF Logging for multiple applications deployed on Weblogic Managed Server.

Lets Get Started.

Important thing to understand here is that for ADF Logging to be implemented correctly Package Structure for the application plays a very important role. So as a common/best practice , package structures should be defined correctly for all the Managed Beans/Java Classes in the application. Also packages structures should be able to differentiate the ManagedBeans/Java Classes in different applications.

Ideally a unique root package name for the application should be given at project creation time in Jdeveloper.

Sunday, April 12, 2015

ADF BC Web Service - Return List of Complex Types

ADF Business Components can be exposed as SOAP Services. Application Module provides Service Interfaces as a way to define operations for the services to be exposed. Custom methods written in AMImpl class can also be exposed as operation of web services.

But one of the limitation is that there is restriction on return types from the services exposed as service interface from Application Module.

In this post we will see how easily we can develop a web service using ADF BC Service Interface and can tweak/use one of the given returnType List<ViewRowImpl>  to return list of complex type object.

Use case here is to create an operation in ApplicationModuleImpl class to return List of Object consiting of three variables -  DepartmentName,ManagerId,IsManagerFlag and expose the operation as ADF BC Service Interface SOAP Service. (Jdeveloper 11.1.1.7)


So Lets get started

Created a simple ADF Web Application using HR Schema and created DepartmentsEO , VO and AM and there respective Java Classes.

Create a Programmatic VO - WSResultPVO which will be returned from the operation of the WebService.

Wednesday, March 11, 2015

IFrame in ADF Application - Menu and Show Page in IFrame

ADF Applications uses power of reusable task flows to be embed as regions in the page, which can be refreshed based on the use cases.

But there are some requirements by the clients which still emphasize on using Iframe to display different applications inside one application.

Suppose there is a requirement where there are 3 applications A,B and Consuming Application. All three applications A,B and Consuming needs to be deployed as separate EAR(Applications) and Consuming App needs to display the A and B Applications pages inside its main page.

Portal architecture can also fit for this requirement but if there is only ADF you need to implement this, the only choice to do is using Iframe.

In this post I will explain you how we can create a menu and show another application in IFrame in ADF Application.

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).

Friday, January 23, 2015

Custom Selection Listener for ADF Table

In this post I will be describing how we can  have a custom selection listener for ADF Table. By default when we drag and drop a ADF Table Component, it gives us the option to select a row. If that option is selected, it creates a default selectionListener for the table component that is
#{bindings.VO.currentModel.makeCurrent"} where Iterator is VO iterator. This operation synchronizes the current selected row with the Iterator to which this Tree Binding is pointing to.

In Addition to this it also adds a attribute selectedRowKeys which has a value
#{bindings.VO.collectionModel.selectedRow}. This makes the selected row from the collection.

But when you change this to your custom selection handler of your managed bean, then the operation which are performed by {bindings.Iterator.currentModel.makeCurrent"} and selectedRowKeys needs to be done programmatically.

One way is to invoke #{bindings.VO.currentModel.makeCurrent"} programmatically in the selectionListener of the managed bean. This has been explained very clearly by my friend Ashish Awasthi :- Custom Selection Listener

Monday, January 19, 2015

Get SelectOneChoice Code/Values in Managed Bean - ADF

The repeated question on OTN is how to get the code or value  of the selected item from SelectOneChoice. One of my post explains how we can achieve this using variable iterators in page definition. Here is the link for the post : http://rohanwalia.blogspot.sg/2013/09/retrieve-selected-value-from.html

Using the technique described in the above mentioned approach, we get hold of the id or value when we select the item from select one choice and we can use it on the page.

But the problem comes when this value is needed in a method of managed bean using ValueChange Listener . One scenario for this is that the code of selected item is required as an input to call a method exposed by ApplicationModule.

So our use case will be to get EmployeeId of selected Employee from LOV into valueChangeListener.

To start with lets quickly create a sample application. Used HR schema and created one jspx page selectOneChoice.jspx .

Go to the binding and create a new variable inside variable iterator.