Showing posts with label JDeveloper. Show all posts
Showing posts with label JDeveloper. Show all posts

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

Wednesday, April 13, 2011

Faces generator for Oracle ADF (ver. 0.5)

Introduction


Hello everyone. I wish to present you one small project that I worked on in spare time (which I don't have plenty). The ultimate purpose of this "generator project" is to create JDeveloper plugin that will generate complete view controller project for Oracle ADF using just model project. This generator will enable programmer to create complete view controller (or several view controllers) project(s) in any state of application model project. So for example we can in about half an hour create model from database schema and create complete view controller based on that model. Then we can show that prototype to our customer and let him to decide what are necessary changes we need to perform.

Beside prototyping this can also help us in overcome many problems that JDeveloper programming has to offer. :) I know what you may be thinking: "Yes I think this idea is similar to existing Oracle product named HeadStart". But  this generator is flexible and can be customized to organization needs and to organization usual development methods for Oracle ADF. Also I think that programmers like (go figure) to program, so they will not just be clicking but they will create business logic and unit tests on model and that is important. You can also leverage existing skills inside your organization using generator and there is practically no learning curve as opposite to HeadStart.

You can watch how generator work by watching these two videos on youtube:


Hope you like it, full source code for project that is used in demonstration can be download from here.

Thursday, March 3, 2011

Slow JDeveloper

Speed up JDeveloper


There are times when JDeveloper slow down so much that it becomes unusable. For example you need to wait 5-30 seconds for simple text change or you wait for structure window to refresh. This can happen when you have complex .jspx pages and when all your components are binds to backing bean.

There are some serious issues with JDeveloper memory management. This can be due to Java Swing API, but this is just wild guest and I really don't know nothing about this.

Eater way, to solve this problem you have two choices:
Use external editor (This is not so good solution).
Other (much better) is to disable automatic component binding by removing binding line from your jspx page. This will rise performance to acceptable level (noting spectacular).

General tip is not to have complex Java backing bean pages and complex .jspx pages (use fragments to simplify layout).