This post is the sequel to AMIS publishes a ViewObject Copy tool – JDeveloper 10g Extension (plugin) for ADF Business Components that we released last week. That post announced a ViewObject Copy extension for JDeveloper, this one discusses a tool that does almost the reverse (and more): it can Force Delete a ViewObject with all its dependencies.
Working with ADF BC reminds us very much of the declarative, very visually oriented and strongly tool-backed way of working we know from Oracle Designer. However, there are some rough edges with the JDeveloper design time environment for ADF BC. Oracle Designer has an operation called “Force Delete”. It allows the developer to remove an object, with its entire dependency network. It will nullify dependencies where it can or otherwise remove the objects with mandatory dependencies on the Force Delete object as well. It is also similar to the deletion of a master-record in the RDBMS where Cascade Delete has been specified on the Foreign Keys. JDeveloper does not provide such a powerful delete facility for ViewObjects. Instead, deleting a ViewObject can be horribly complicated. JDeveloper does not cascade such changes into all dependant objects, but instead coolly informs you that because of dependencies the operation is not allowed. You have to manually (yes, I said manually!) remove all dependencies before the delete operation can continue.
Combining our drive for high-quality and high-productivity development, the drive to push boundaries if needs be and the limitations posed to us by ADF BC in the Design Time environment as well as some earlier experience with the Extensions SDK (JDeveloper Extension SDK on OTN) provided with JDeveloper – that allows any developer to develop plugins (as the term is with some other products) or extensions for JDeveloper-, we set ourselves the challenge of creating an extension that gives us the power to really delete ViewObjects.
We completed this extension with a few days serious hard word and testing and are now ready to make it available to everyone who is interested:
Click here for a “live” demo of the AMIS Force Delete ViewObject Addin..
This Force Delete ViewObject Addin can delete a ViewObject, taking into account and dealing with all its dependencies.
Let’s take a look at a moderately complex Application Module. Focus on the ViewObject AlsBooksView and the way it is used in this ApplicationModule.
Now if we try to delete this ViewObject AlsBooksView with the normal BC4J Erase from Model operation:
is the result an all too familiar one:
The somewhat limited information JDeveloper has to offer by way of explanation of this failure is shown below. It does not offer any support to continue from here; you have to manually remove all dependencies if you want to continue with the delete operation.
Now let’s try the Force Delete extension:
Before the force delete is performed, the tool will show you a list of all objects – ViewObject, ViewLinks, ViewObject Usages and ViewLink Usages (the latter two within the Application Modules’ Models). This overview looks something like this: .
If you then decide to go through and have the force delete actually carried out, the final result could look like this:
Download and install the AMIS ViewObject Extensions (both Force Delete and Copy)
Download ViewObject Copy and Force Delete Extension (version 0.2.1, 8th November 2004). Install the extension by copying this Jar file to the JDEVELOPER_HOMEjdevlibext directory and (re)start JDeveloper. To verify whether the extension is active, you can select any ViewObject in any project and open its context (right mouse button) menu. You should see the options Copy ViewObject and Force Delete (with our logo).
If for whatever reason you want to de-install the extension, simply remove the jar-file. The next time you start JDeveloper, the option has disappeared from the ViewObject context menu.
We like to not only tell you we do interesting stuff and are good at what we do, we also like to show you this. As we share knowledge internally among AMIS-employees, we also work closely with our customers to not only do the application development tasks we are hired to do, but also transfer knowledge to staff in the organizations of our customers. We organize seminars and workshops, write articles and develop tools.
You are free to make use of this tool as you see fit. You are welcome to distribute it further. Of course we request that you do not attempt to remove our name from the tool: recognition for our work is all we ask for and we feel we deserve it. You probably will not be surprised by the following: the tool comes as is, no warranties etc. If you use it, you do so at your own risk. We do not provide support or assistance – for free. Of course we are interested to learn about your findings and we may use them to improve the tool – or create others like it – but we do not make promises. If you do not like it or do not trust it, do not use it.
You can of course acquire our services to help you with your ADF Business Components (or Java/J2EE) projects.