Introduction: Book Review – Developing Web Applications with Oracle ADF Essentials


I’ve been doing a lot of practical exercises for the past few weeks regarding  JSF, specifically using the Seam Framework. Yet what I’m more intrigue about is the Oracle’s own Implementation of JSF called Oracle ADF (application development framework).

screenshot-oraclefreeadf-2012

Experience with it?

I had some hands on experience with it in the past. I was trained for Oracle WebCenter Portal (basically the Enterprise Portal Solution of Oracle) and it uses Oracle ADF extensively in its core.  I was tasked back then to spearhead the implementation of Oracle WebCenter – I created the initial framework, setup, tech archiecture as well as the environment for Oracle WebCenter development. Its such a shame though that it did not push through. Although I wasn’t able to use the technology, I did find it very amusing and interesting – I even tried to create a Portal app of my own and create tutorial slides, but of course it was never really close to being one of my course skill.

A lull came when a particular publishing company contacted me to review their Book regarding Oracle ADF essentials. It was one of my goals to review and publish books of my expertise and this is a great start for me to do that.

So with the topic itself, for the new few days, I’ll try to document everything I learn and found out so far when reviewing the book. Hopefully, it will turn out great. Hopefully, this will be the key to my publisher / book author career. 🙂

The Book itself!

The Books is titled: Developing Web Applications with Oracle ADF Essentials by PACKT publishing – Author is Sten E. Vesterli

11-10-2013 2-19-03 PM

I read the introductory part of the book and I would say that there’s a lot of motivation behind the creation of this book. The author is a self proclaimed ADF Enthusiast and consider it as his core skill in his career. It was reviewed by number of peers that are highly regarded in their respective field – Eugene Fedorenko – Senior Analyst, Amr Gawish – Senior Oracle Fusion Middleware Consultant and Dimitrios Stasinopoulos – a Certified ADF implementation specialist. From their title alone, you can see that the very reason of the books existence. It was reviewed by technical expert of the field and the technology itself. Much like any other technical books (at least the majority of which), it came with a support files (ebooks, discount offers, downloadable samples). These support files will entirely help any person who uses and wish to learn the technology.

The Chapters!

By looking at the table of contents and chapters – users who wishes to learn the technology will ultimately be interested from the get go. It tackles real world examples as well as beginners journal / entry to the technology. It uses Open source software such as MySQL, GlassFish and the most stable JDK as of this writing, Java 7.

  1. Chapter 1: Basics – Develop your first ADF Essential Application
  2. Chapter 2: Creating business services – using JDeveloper and ADF underlying technological components.
  3. Chapter 3: Creating Task flows – essential for creating process driven applications
  4. Chapter 4: Addition the business logic – Tackles the essentials of creating business logic using the pre-defined set of rules of governance to create such components.
  5. Chapter 5: Building Enterprise Applications – build the structure of your code, apply design patterns, use ADF controls to create an enterprise grade applications. This chapter tackles on the activities (preferred ones) on building Enterprise Applications.
  6. Chapter 6: Debugging ADF Applications – the means of debugging is a general activity for every developer. One must know how to debug, set breakpoints and modify the controls to create the ultimate, valued solution.
  7. Chapter 7: Security – Enterprise applications must be secured since it can be used to manage highly sensitive data. This chapter will focus on implementing security controls on your application.
  8. Chapter 8: Build and Deploy – Finally, build your application and deploy them to a live environment. This chapter will help you create a build and deploy scheme to successfully run the application on a live environment.

I’ll try to be informative as I progress with the review  and put some of my example up here!

Oracle Portlet Development – Consuming RSS Feeds


Looking back at the tutorial I posted last September 22, 2011, it was a very neat  tutorial that really showcases the power of Oracle Portlet Development using JDeveloper and the flexibility of WebCenter for consuming remote portets.  With that I created my own version of the tutorial just for fun!

Although, this isn’t a video, its just a power point presentation and I never got the WebCenter installation part (I don’t have EM in my laptop and besides, I don’t have that powerful machine yet). Here it is!

Screenshot of the JSP page with RSS Feed Data.

Download the Project Here.

Enjoy!

Oracle ADF – End to End Simple Application Tutorial


I find this video very nice and easy to catch up with. Very detailed and straight to the hands-on exercise.

http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/JDevExperience/JDevExperience112flv.html

The demonstrator uses Oracle JDeveloper to develop a simple Enterprise solution that uses Oracle ADF Framework.

Key notes:

  1. JDeveloper supports both Declarative and Narrative development.
  2. Developers can create EJB / JPA Business components and expose it through Data Controls.
  3. Data Controls are created to expose functionalities to Oracle ADF.
  4. Once Data Controls are created, this can be used to create ADF based form components like Manager Forms and Graphs

Review: The tutorial is more of a declarative way of developing ADF applications. It first creates a Database Connection, then create an EJB Diagram to create Session Beans and JPA Entities. This beans will be the back bone (model) of our application for database transactions. Next, create Data Controls to expose EJBs for Oracle ADF. Then after exposing these, we can now use the ADF framework to create pages and combine very useful ADF components (accordion, data grids, graphs etc.)

This tutorial really showcased the power of Oracle ADF + the use of JDeveloper. Its completely a new way of developing Java EE applications. JDeveloper brings another level of development scheme as showed on the tutorial, its a very flexible IDE that support both declarative and narrative development method.  The addition of full support on Oracle ADF sums up the whole package as it allows developers to drag and drop exposed ADF data controls and create components for it (graphs, forms, etc.).

Oracle ADF/JSF – Page Template Development


Templating is the commonly used approach when building the presentation layer of a Web Application. It is never wise for a developer to not consider templating in their design, especially when a lot of users will view your side on a daily basis and a lot of page will be develop for the solution.

Efficiency is the term in doing templates, its somehow eases the developer and designer of their workload by developing a constant body of page template that can be used globally. it is by far, the most accurate form of “re-usability”.

Though there are a lot of templating technology for Java EE. I find only two of them very flexible and easy to learn (of course, excluding Velocity since its more of a presentation generator api). Apache – Tiles and JSF Templating.

Example of Struts Tiles Templating.

http://www.vaannila.com/struts/struts-example/struts-tiles-example-1.html

Example of JSF Templating

http://www.mkyong.com/jsf2/jsf-2-templating-with-facelets-example/

For this post, I will try to create a ADF Template using Oracle JDeveloper 11g. ADF templating is different a bit different from JSF templating.

1st: Create the Page Template

Right Click on a Folder > New > JSP Page

The Page Template creation dialog is shown. Now Tick on the Use quick start layout to customize our Template.

Choose from a variaty of default layouts.

Ticked on “Apply Themes” to apply default skins. We will ticked this one for this tutorial.

Click OK to create the actual template.

The files where updated to comply with the template we just created: faces-config.xml – the new render kit (fusion render kit) was introduce to server as the overall render kit for any pages developed. The trinidad-config is where the skin family is indicated and web.xml to add new libraries, init paramters and external source files support for the new skin and page (swf – flash).

Lets tweak the template first before using it. Lets put something on the “top”,”first” and “center” facelets. Go to Source and define faclets on the component section of the template. This section is where all the facelets should be defined.

 
      <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
        <display-name>sample_adf_template</display-name>
        <facet>
                <facet-name>centerDetail</facet-name>
                <description>This child draws out the detailed forecast</description>
         </facet>
          <facet>
                <facet-name>centerTop</facet-name>
                <description>This child draws out the detailed forecast</description>
         </facet>
         <facet>
                <facet-name>centerFirst</facet-name>
                <description>This child draws out the detailed forecast</description>
         </facet>
      </component>

Put Facelets in the Template Page.

<af:facetReg facetName="centerTop"/>
<af:facetReg facetName="centerFirst"/>
<af:facetReg facetName="centerDetail"/>

2nd: Use the Page template

Lets create the page using the page template. Click on Pages folder (create one) > New > JSF Page. Choose the JSF Template we created.

Create the Page.

        <af:pageTemplate viewId="/pagetemplates/sample_adf_template.jspx" id="pt1">
            <f:facet name="centerDetail">
            <af:panelGroupLayout layout="vertical">
                <f:verbatim>THIS IS JUST A STRING</f:verbatim>
            </af:panelGroupLayout>
          </f:facet>
          <f:facet name="centerTop">
            <af:panelGroupLayout layout="vertical">
              <af:outputText value="HELLO WORLD"/>
            </af:panelGroupLayout>
          </f:facet>
          <f:facet name="centerFirst">
            <af:panelGroupLayout layout="vertical">
              <af:outputText value="HELLO WORLD"/>
            </af:panelGroupLayout>
          </f:facet>
        </af:pageTemplate>

3rd: Run the Page that uses the Page Template.

Result:

Download the source here.

Review: Oracle ADF really puts a lot to the table. Arrays of components and custom tools plus, a great IDE to build enterprise applications with it. Page Templating is not very far from JSF templating, it uses the same concept of inserting ui components (for ADF’s case, facelets) to get page fragments for consistency.