Archive for November, 2005
Resetting the parameters in the Headstart Report Launch Form – small but useful change
Nov 30th
I would not be offended if you were to decide to quickly skip this article. It ain’t much. However, for my current project it proved pretty important, this apparent triviality. We have a modern-tradition technology-stack: Designer 10g, WebForms 10g, 10g RDBMS and AppServer, Headstart and CDM RuleFrame supported by CVS, Jira, Repository Object Browser etc. We have a substantial number of reports that will be used on a frequent basis by our users. The Reports are handcrafted. They are all launched from the Headstart supplied Report Launch Form, qms0012f.
All reports are set up in the QMS_MODULES table. The parameters associated with each Report are defined in the QMS_MDE_PARAMS table. The generic Reports Launch Form reads the parameters for the requested module and presents them to the end user like this:

The user can provide values, sometimes by typing in the Description item, sometimes by selecting a value from a List of Values, based on a query that is stored as part of the Parameter definition. Then the report can be run, after which different values for the parameters can be set.
However, we ran into the issue that the Description "values " for the parameters can be set to another value, but they cannot be RESET, set to NULL.
Read the rest of this entry »
Oracle Lite Part 2, how to get started (continued)
Nov 30th
Yesterday I had a few mind boggling experiences with Oracle Lite. Together with our customer and my colleague Arjaan, I tried to install Oracle Lite. This is a very important project with 300 Oracle Lite snapshots in the future.
Again I experienced what I wrote in my previous post. It’s a nice product with a lot of potential, but the documentation is very poor. The installer is awkward and the packaging tool (wtgpack) is far from production ready. The Oracle Lite database itself is very good both in performance and in its SQL support.
This is what we experienced:
Read the rest of this entry »
Newsflash on JHeadstart – 10.1.3 in March 2006, 10.1.2.2 next week
Nov 29th
Triggered by Steve Muench’s weblog, I stumbled across a recent posting by the JHeadstart Team on their current and future activity: The Future of JHeadstart. The big news of course is that the ADF Faces releases of JHeadstart, based on JDeveloper 10.1.3, is currently planned for March 2006. To be frank, that is a little later than I had hoped for. Of course the ongoing slippage of the JDeveloper 10.1.3 Production Release was bound to push the jHeadstart release date backwards, but still – March is late and we all know that planned release dates tend to later rather than sooner.
Having said all that, given the work the team is putting in this new release, it is no surprise it takes them quite some time. They are rearchitecturing the framework, both the design time tools like the JAG and the runtime framework. The latter obviously is required for ADF Faces, that will completely replace UIX as View Technology. That means: UIX is no longer supported as of JHeadstart 10.1.3! And the same goes for Struts: "We will be using JSF as the Controller instead of Struts. As a result
we will generate managed bean definitions and navigation rules in the
faces-config, instead of the old struts-config generation." Also the current JSP/JSTL View technology will be substantially changed: "What is now known as View Type "JSP" will also result in .jspx pages
using JSF tags. We are still investigating what mix of JSF
implementations (RI, ADF Faces, MyFaces?) we want to use in these pages."
There does not seem to be a realistic migration path for existing UIX applications to ADF Faces. JHeadstart may be the best what Oracle has to offer in that respect. That means: when you generate your existing JHeadstart Application Structure file again, instead of UIX you will get ADF Faces – and thereby you realize a migration. You cannot take UIX pages and migrate them to ADF Faces. Any post-generation changes in your UIX pages will have to be reapplied to the generated ADF Faces pages. However, many of these post generation steps can probably be turned into generatable features, given the more enhanced functionality of the coming JHeadstart Application Generator for ADF Faces.
Generator Architecture
That design time generator is the second area of major overhaul going to JHeadstart 10.1.3:
Read the rest of this entry »
Implementing Data Validation in ADF UIX application
Nov 28th
Validation of business rules, of data oriented business logic, is one of my favorite recurring challenges. Around these rules, there are
always interesting discussions about how and especially where to implement the rules. From a robustness perspective, database
implementation is prefferable. From an end-user usability point of view, client side implementation should be provided – as well, in order
not to lose the robustness. Implementation of business logic in the -middle tier – Model, the tier in the middle between client side an
database, is heavily debated. Some validation is implicit, given the conversion from untyped String based Web-parameters to strong-typed Model parameters. Whether more complex business rules should be implemented in the middle tier, in the Model, depends on who you ask. It will slightly enhance performance and reduce the load on the database. In ADF Business Components it is fairly easy to implement, so let’s go for it. At least we will keep our database independence in tact. (tongue in cheek joke).
In this article we will discuss the ways we can use to trigger validation of business rules from UIX web-clients. The implementation of the business logic itself can still be done in several ways: server based (inside the database), in the Model – in our case ADF Business Components -, in the Webtier using Struts Validator or ADF Action validation-logic or in the Client itself.
- UIX Client Side Validation
- UIX triggered Model based Validation
Extend the JHeadstart 10.1.2.1 Application Generator to generate optional attribute as required in the client
Nov 27th
This article serves two purposes:
- it extends the JHeadstart Application Generator to set UIX items to "required" based on a new custom Mandatory property – instead of driven from the Required property of the underlying Entity Object Attribute
- it illustrates how you can make simple extensions to the functionality of the JHeadstart Application Generator (release 10.1.2 and 10.1.2.1)
When an attribute is set to required – in the Entity Object
Attribute definition – it will be shown in the Web Interface with an asterisk; furthermore, UIX will enforce validation in the Client: that means that no changes in the record can be submitted as long as the mandatory attribute does not have a value.
This new functionality is particulary useful in cases where the Entity Object actually represents several subtypes – like the EMP Entity Object that represents Salesmen and Other employees: the Attribute Commission is not allowed for Other Employees
while it is mandatory for Salesmen. Since there are therefore Employees without a value for Commission, the Attribute cannot be made Mandatory at the EO level. However, in my ViewObject Salesmen (all Employees where job =’SALESMAN’) and the screen built on top of that ViewObject, I want the Commission item to be Mandatory.
I will show in this article how I can make JHeadstart generate required items for optional Entity Object Attributes. Read the rest of this entry »
AMIS publishes a book: The Best Collected Stories of 2005 on Oracle and Java – it’s free (and in Dutch…)
Nov 24th
AMIS has just published a booklet (250 pages) with the best articles from Magazines, Conferences and this Weblog. A dozen different authors, specialists in various areas such as Oracle Database, Java/J2EE, XML/XSLT, Integration, Oracle classic development tools etc. are bundled together in this paperback. Most of the content can be found on line, either on this weblog or in the technical article library on our website. If you want to have a bed-time read, and your Dutch is up to scratch, as a substantial percentage of this book is in Dutch, you can have your own copy of this book. Go to the order form for "De Beste Werken van AMIS".
Oracle Designer – Script for verifying the privileges assigned to roles against the Module Table Usages
Nov 23rd
In my current project – with Oracle Designer 10g, WebForms, Headstart and CDM RuleFrame, Repository Object Browser, CVS, Oracle SCM and Jira for Incident Management as well as TransferWare for transferring objects from Development to Test and beyond – we are constantly working on improving the software engineering process. Part of this ongoing challenge is ensuring that (database) users are granted the required roles and – even more delicate – ensuring that the roles have been granted all the required database object privileges.
We have recorded all Modules and all Roles in Oracle Designer. We have granted access on modules to roles through Module Role Access Grants in Oracle Designer. We try to keep carefully track of all databaseobject privileges – grants on Tables and Views – to make sure that when a user can start a WebForm module from the Menu – because of the grant of that Module to a role owned by the user – he or she will actually have all necessary select, insert, update and delete privileges for that Form.
Since all information about the table and view usages by the modules is recorded in Oracle Designer itself, it should be possible to find out whether we have already created all Database Object Grants. I have taken some time and developed a PL/SQL procedure that we – and you – can use to find out whether the set of database object privileges available to a role – either directly or through nested roles – is sufficient for the modules that the Role has access to.
Sending CLOB data from Tibco (Java) to PL/SQL stored procedures
Nov 23rd
On my current assignment I am working on interfaces between Tibco and Oracle PL/SQL applications. Tibco is a middleware solution that implements a messaging based interface solution between different software systems. For the interfaces I have implemented a generic bridge between Tibco and Oracle. This PL/SQL implementation provides one stored procedure that Tibco can call. This procedure will then determine the message type based on the root element of the incoming XML message. The interface will then lookup, from it’s configuration table, a specific stored procedure that can handle the actual XML message.
The argument of my stored procedure is a CLOB holding the incoming XML message. Then I called this procedure directly from PL/SQL there was no problem. Calling this procedure from Tibco (a Java based application) the call resulted in an "ORA-24805: LOB type mismatch" error. <!–more>This looked strange and google didn’t seem very helpfull in this. The first thing I did with the CLOB data was to create an xmltype variable holding the actual XML data. This way we are able to use all XML DB functionality on the data. The actual call generating the ORA message was:
procedure handleXML(p_xml in clob)
l_XML xmltype;
begin
l_XML := xmltype.createXML(p_xml);
end;
I then looked at the description of the DBMS_LOB package and read about lob locators. You can think of a LOB locator as a pointer to the actual location of the LOB value. So it looks like Oracle’s xmtype methods cannot access the CLOB data that is provided by Tibco. The workaround was to copy the clob data in a temporary clob that is available in the stored procedure. This way the lob locator has the correct type. Of course there is some (memory) overhead, but the XML messages are not that long te be any problem. The fixed code looks like:
procedure handleXML(p_xml in clob)
l_XML xmltype;
l_temp_XML clob;
begin
DBMS_LOB.CREATETEMPORARY(l_temp_XML, false, 2); — 2 makes the temporary only available in this call
DBMS_LOB.COPY (l_temp_XML, p_xml, dbms_lob.getlength(p_xml),1,1);
l_XML := xmltype.createXML(l_temp_XML);
end;
The second example can be called perfectly from Tibco.
Have CDM RuleFrame Business Rule Design Transformer generate VALID code
Nov 22nd
Finally, I have attended to one of my long running frustrations with CDM RuleFrame: the Business Rule Design Transformer, that key Headstart utility that takes Business Rule definitions in Oracle Designer and transforms them to Business Rule Design Definitions, composed of a Table Trigger with associated PL/SQL Definition, has always generated invalid code in the PL/SQL Definition. At last, I have made the teeny weenie change that is required to have it generate code that can immediately be compiled in the database. Read the rest of this entry »
Oracle 10gR2 – Conditional PL/SQL Compilation
Nov 17th
For one of our sessions for the Knowledge Center Oracle Server Development I had to prepare a presentation and demonstration on new Oracle 10gR2 features in SQL and PL/SQL – as well as reflect on some by now somewhat more established 10gR1 features. If you are interested in this presentation, you can download it here KC_SERVERDEVELOPMENT_10gR2_R1.ppt (some small parts are in Dutch). Topics included: Crossing Boundaries with DBMS_OUTPUT, DML with Error Log – Constraint Violations allowed, SQL*Plus Autotrace based on DBMS_XPLAN, Conditional PL/SQL Compilation, 10x faster transactions – Asynchronous Commit.
More time was devoted to some 10gR1 functions such as 10g Merge enhancements, Regular Expressions, 10g Flashback improvements, Partition Outer Join and in more detail the SQL Model Clause, Expression Filters and dbms_frequent_itemset datamining (on these three topics, also see the paper Oracle 10g’s Finest – The Top 3 SQL and PL/SQL Features new in 10g.
The most surprising part of the presentation for me was Conditional PL/SQL Compilation. I had read some things on this feature, primarily stuff from Tom Kyte and Steven Feuerstein, and I had a basic understanding of what it can do. But only when I sat down with Steven Feuerstein’s classic PL/SQL Programming, the 4th Edition (September 2005) that covers versions up to Oracle 10gR2, I had a more thorough understanding of what it entails, this conditional compilation. For this session I prepared some slides, a demonstration and a brief workshop. In this post I will share some of my findings – largely Feuerstein’s findings in my own words to be specific! Note is often considered a new feature of Oracle 10g Release 2, but is actually already available in Oracle 10g Release 1 (10.1.0.4.0).
Read the rest of this entry »



