With Oracle Java Cloud available for ADF PS5 deployments, I decided to deploy all my future ADF sample apps from the blog in Oracle Cloud, source code will be provided as well as it was up till now. ADF sample applications live will help to explain and present ADF functionality even better, blog readers will be able to test described functionality straight away and provide feedback without downloading and running on their machines. Currently I'm running trial instance of Oracle Cloud for database and Java, but in future I plan to purchase permanent account - let's see how it will go.
Read more about Oracle Database Cloud and Oracle Java Cloud from official documentation. Oracle Cloud right now supports ADF PS5 with certain limitations, please check documentation - however most of the sample apps will run without issues.
I have deployed in Oracle Java Cloud and tested one of the sample apps from my blog post - Tree Table Component in Oracle ADF. This app renders hierarchical data in different levels of the tree, Master-Detail relationship between two tree tables is implemented as well. Original sample app is deployed with minimal changes described below (datasource name and login config are optimized for Oracle Java Cloud). Here you can download source code for ADF app deployed in Oracle Java Cloud - TreeComponents_cloud.zip.
This app is deployed for public access, you can open it by clicking here - Tree Components in the Cloud. Sample app will be loaded and you should see two tree tables rendered with hierarchical data from sample HR schema (see URL pointing to Oracle Java Cloud instance):
We can use Oracle Cloud Service Control for Java to see a list of deployed apps - TreeComponentsApp is one of them. You can find here JNDI Location for Data Source, we will use it in Application Module - database. ADF Application Module will be using it to retrieve data from database Oracle Cloud:
We can review ADF performance for deployed apps - AM and ADF Task Flow usage:
You can deploy ADF app directly using Oracle Cloud Service Control for Java, but same is possible from integrated JDeveloper 11g PS5 environment. You should download latest JDeveloper 11.1.1.6.0 optimized for Oracle Cloud. Apparently Oracle released two JDeveloper versions under the same release number 11.1.1.6.0, Oracle Cloud release was made public around October. So, if you have old 11.1.1.6.0 - remove it and download new one. You should see OCLOUD name in JDeveloper 11.1.1.6.0 build:
I will describe now, what changes I have made to original ADF sample app in order to be able to deploy it and run in the cloud. Firstly you should change JDBC Data Source name for AM configuration, it must be set to database JNDI name, same as it is defined for us in Oracle Cloud Java. This allows to fetch data from Oracle Cloud for database:
Next Application Server connection pointing to Oracle Cloud Java instance must be defined in JDeveloper. Choose connection type - Oracle Cloud:
Provide connection details as per Oracle Cloud documentation and you are almost done.
Almost - because there is just one additional config - ADF application login method handling. By default ADF app is protected by Oracle Cloud security, but I want to make my ADF sample apps public and accessible to everyone. For this reason, I need to include empty login configuration into web.xml - the rest will be handled by Oracle Cloud and ADF app will be public accessible:
This config was suggested by Oracle Cloud automatically, when I was trying to deploy sample app. Deployer creates optimization suggestions and lists them in the deployment log accessible from JDeveloper:
Thats all about ADF deployment to the cloud - very straightforward. Now few words about database schema in the cloud. As usual - I'm using sample HR schema for my sample ADF apps. You can access Oracle Cloud database instance directly from JDeveloper, read this white paper - Data Movement and the Oracle Database Cloud Service. Data can be imported and exported from JDeveloper. However, there is another quick way to populate Oracle Database Cloud - using SQL scripts. Open Oracle Database Cloud instance and go to SQL Scripts section:
I was using HR schema SQL scripts and generated all required tables and populated data:
HR schema data is in the cloud and ready to be accessed from ADF app deployed in Oracle Java Cloud:
I was testing ADF passivation/activation to see if PS_TXN table is automatically created in Oracle Database Cloud. Yes, table was created automatically - perfect:
Read more about Oracle Database Cloud and Oracle Java Cloud from official documentation. Oracle Cloud right now supports ADF PS5 with certain limitations, please check documentation - however most of the sample apps will run without issues.
I have deployed in Oracle Java Cloud and tested one of the sample apps from my blog post - Tree Table Component in Oracle ADF. This app renders hierarchical data in different levels of the tree, Master-Detail relationship between two tree tables is implemented as well. Original sample app is deployed with minimal changes described below (datasource name and login config are optimized for Oracle Java Cloud). Here you can download source code for ADF app deployed in Oracle Java Cloud - TreeComponents_cloud.zip.
This app is deployed for public access, you can open it by clicking here - Tree Components in the Cloud. Sample app will be loaded and you should see two tree tables rendered with hierarchical data from sample HR schema (see URL pointing to Oracle Java Cloud instance):
We can use Oracle Cloud Service Control for Java to see a list of deployed apps - TreeComponentsApp is one of them. You can find here JNDI Location for Data Source, we will use it in Application Module - database. ADF Application Module will be using it to retrieve data from database Oracle Cloud:
We can review ADF performance for deployed apps - AM and ADF Task Flow usage:
You can deploy ADF app directly using Oracle Cloud Service Control for Java, but same is possible from integrated JDeveloper 11g PS5 environment. You should download latest JDeveloper 11.1.1.6.0 optimized for Oracle Cloud. Apparently Oracle released two JDeveloper versions under the same release number 11.1.1.6.0, Oracle Cloud release was made public around October. So, if you have old 11.1.1.6.0 - remove it and download new one. You should see OCLOUD name in JDeveloper 11.1.1.6.0 build:
I will describe now, what changes I have made to original ADF sample app in order to be able to deploy it and run in the cloud. Firstly you should change JDBC Data Source name for AM configuration, it must be set to database JNDI name, same as it is defined for us in Oracle Cloud Java. This allows to fetch data from Oracle Cloud for database:
Next Application Server connection pointing to Oracle Cloud Java instance must be defined in JDeveloper. Choose connection type - Oracle Cloud:
Provide connection details as per Oracle Cloud documentation and you are almost done.
Almost - because there is just one additional config - ADF application login method handling. By default ADF app is protected by Oracle Cloud security, but I want to make my ADF sample apps public and accessible to everyone. For this reason, I need to include empty login configuration into web.xml - the rest will be handled by Oracle Cloud and ADF app will be public accessible:
This config was suggested by Oracle Cloud automatically, when I was trying to deploy sample app. Deployer creates optimization suggestions and lists them in the deployment log accessible from JDeveloper:
Thats all about ADF deployment to the cloud - very straightforward. Now few words about database schema in the cloud. As usual - I'm using sample HR schema for my sample ADF apps. You can access Oracle Cloud database instance directly from JDeveloper, read this white paper - Data Movement and the Oracle Database Cloud Service. Data can be imported and exported from JDeveloper. However, there is another quick way to populate Oracle Database Cloud - using SQL scripts. Open Oracle Database Cloud instance and go to SQL Scripts section:
I was using HR schema SQL scripts and generated all required tables and populated data:
HR schema data is in the cloud and ready to be accessed from ADF app deployed in Oracle Java Cloud:
I was testing ADF passivation/activation to see if PS_TXN table is automatically created in Oracle Database Cloud. Yes, table was created automatically - perfect: