Upgrading to JHeadstart 10.1.2.1 javacode 9085791

Upgrading to JHeadstart 10.1.2.1

Recently I started on a project that was partly built with JHeadstart 10.1.2 on JDeveloper 10.1.2 (build 1811). Since JHeadstart 10.1.2.1 contains so many new features and JDeveloper 10.1.2 (build 1913) was released containing several bug fixes, we decided to upgrade to these new versions and continue developing from there. During the upgrade process, both JDeveloper and JHeadstart prompted me for code upgrades that were to be carried out automatically. But I still ran into several problems. This article describes the steps I took to make generation of the (UIX) pages work again.

1) Upgrading ADF BC code.
Several new features, updates and code fixes have been implemented both in JDeveloper and JHeadstart. Upgrading to the new JDeveloper code is done automatically by JDeveloper. It’s always wise to review the code that was generated and written in an older version and in my case it turned out I didn’t need to modify any existing code related to ADF.
On the JHeadstart side, however, several classes needed modification. First of all, the oracle.jheadstart.JhsAdfConstants class was removed from JHeadstart. We only used the JHS_USER member of this class, and this member was moved to the oracle.jheadstart.model.JhsUser class and renamed to JHS_USER_KEY. Secondly, the hasAccess(String functionName, Object sessionId) method was modified to hasAccess(String functionName) so we had to modify all the occurences of this method and possibly the methods this method called.
After these changes, the Model project compiled just fine. No other modifications were found necessary.

2) Upgrading ViewController project.
Upgrading the ViewController project turned out to be not very complicated, or a lot more complicated compared to the Model project depending on the old project. Basically it turned out many new template files are used by JHeadstart to generate the pages. Moreover, many templates and other files have been modified in one way or another. In the end, this turned out to be a good upgrade process:

  • create a new Web Project with a name similar to the old one. The name isn’t very important, but it helps remembering what project you’re working on.
  • enable JHeadstart on this project.
  • create a new JHeadstart Application Structure File specifying the same View Package as the old project.
  • copy over the old Application Structure File to the new project and restart JDeveloper
  • edite the Application Structure File and make sure all pages and application parts (struts-config, tab bars etc) are set to be generated
  • generate the application

After this, we “only” need to reimplement the post-generation changes that were in the old project. The bright side of this all is that the new JHeadstart version probably will take care of some of those changes. The not so bright side is that any modified template may not work anymore, so I’ll have to dig into those again and remodify them where necessary. As far as I can tell now, our old look and feel still works so it looks like the components and their colors have not changed (much).