Tuesday, April 10, 2012

Faces generator for Oracle ADF (1.0alpha)

Introduction

Previously I was talking about this generator for ADF. It is currently in such state that it is working (kind of). So I decided to publish it and see if there are ADF developers interested in something like this.

Basic idea is automatic creation of view part of ADF Fusion Web Application using model part...well as model. I suggest that you first look at videos I prepared so you can see what it is all about, and if you like it then there are installation instructions below. Please be noted that this is alpha version and therefore it is unstable.

This extension work with all JDeveloper version greater than 11.1.1.2.0. But I recommend using it with JDeveloper version 11.1.1.4.0 and newer because in previous version there was issues with "Oracle Dynamic Tabs Shell" page template. This issues present themselves as instability (random exceptions) while running Fusion Web Application. 11.1.2.1.0 is not supported for now.

First example - Shows how generator can generate almost complete view of ADF Web application.


Second example - Shows how generator changes view when you introduce LOVs into model.


Third example - Shows how changes to model are reflected on view when you for example remove or add view instances from application module


OK. So, if you want to download and try generator, here are the steps. First and most important, generator can be downloaded from here. Installation is very simple, just copy this jar file into your <Middleware Home>/jdeveloper/jdev/exstensions and that's it.

Generation consists of four parts.

1. Create Fusion Web Application and create complete model for this application. Basic ADF stuff. I suggest that you stick with defaults when wizard ask you about project names and default packages (view for ViewController and model for Model Project)

2. Initialize your ADF view project. This is necessary, because JDeveloper need to add some libraries to view project. To do this you need to create JSF page that will use "Oracle Dynamic Tabs Shell" page template and then just drag and drop random data control (one data control is enough, just to initialize it's application module in view project) from each application module you plan to use on this page. You can create multiple JSF pages for each application module but that is not necessary.

3. You need to copy some files to this newly created view project. You need to do this, because this plugin is dependent on some Java classes and predefined bindings. You can download this files from here. When you unpack them please copy them according to this pattern:
  • public_html/images/* -> ViewController/public_html/images/
  • public_html/js/* -> ViewController/public_html/js/
  • public_html/WEB-INF/adfc-config.xml -> ViewController/WEB-INF/adfc-config.xml (you can also just edit yours adfc-config.xml file and add necessary definitions).
  • adfmscr/view/AdfFacesUtil.java -> ViewController/adfmscr/view/AdfFacesUtil.java
  • adfmscr/view/Launcher.java -> ViewController/adfmscr/view/Launcher.java
  • adfmscr/view/pageDefs/NavigationPageDef.xml -> ViewController/adfmscr/view/pageDefs/NavigationPageDef.xml 

4. Final step is to run generator by right-clicking on Model or ViewController project and choose Generate ADF Faces. Then just repeat step 4 if you change anything in model, you don't need to run steps 1 - 3 anymore.

For end I will share with you final version of  complete application I use in videos. It might come in handy. Thanks and ciao. :)

5 comments:

  1. Interesting - let us know if you would be interested in having this extension also available through the help->check for updates functionality in JDeveloper.

    ReplyDelete
    Replies
    1. Hello,

      Why not! What is proper procedure for make this extension available through Jdev?

      --
      Jan

      Delete
  2. Great!
    The required extension for me and ADF!
    Thank you!

    ReplyDelete
  3. I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

    Alena

    Diverticulitis Treatment Diverticulitis Diet

    ReplyDelete
  4. Grate Job!
    I am very interesting in your extension, could you please share the code to add some enhancement and feature.

    This is my email: mhbu50@hotmail.com

    Abukhamseen

    ReplyDelete