Archive for March, 2006
Calling a Servlet in Java Code through a Post Request – or: how Service Oriented we Are
Mar 25th
For one of our current Java development efforts – a Web application based on JSP, Struts, Oracle ADF technologies – we had to develop functionality to transforms HTML documents into PDF files. Wrapping a previously built set of classes in a well defined interface, we quickly had the job done. Then we started to integrate these classes into the project where the functionality was needed. We ran into several issues with versions of the libraries used. Then we stepped back, and started to rethink.
Why did we try to completely integrate the Html2Pdf converter in the Web Application itself? Why not think much more service oriented? Why not make this facility available in a more generic fashion? So we decided to create a Servlet frontend for our Html2Pdf converter component and package and deploy it as a web application in its own right. At this point, the web application we were building that needed this conversion functionality – with XSL-FO and Apache FOP inside – could simply call on the servlet, sending in the HTML document and receiving back an output stream that held the PDF document. And anyone else could also call upon this service. It can even run in an entirely different servlet container. The interface is as simple as a URL, accessed through a post-request with a single parameter.
Read the rest of this entry »
Profiling PL/SQL met het package dbms_profiler (dutch)
Mar 24th
Oracle biedt sinds Oracle 8i via het package DBMS_PROFILER ondersteuning voor profiling. In dit artikel, dat ook in Optimise zal verschijnen, zal dit package onder de loep genomen worden en zal het pldbg package geoptimaliseerd worden waarbij het gebruik van dynamisch PL/SQL wordt verbeterd en conditionele compilatie wordt gebruikt om de veranderingen te testen.
Zie voor documentatie en code: PLDBG version 2.0.0
Introduction to ASP.NET, ADO.NET – dead ringer for Oracle ADF?
Mar 22nd
After quite a few encounters with .NET in recent years, primarily up against Java/J2EE technology – and some with VB before the release of .NET in 2002 – yesterday I had my first real immersion in .NET technology. Our Knowledge Center (database) Server Development and Programming Languages had organized a session on .NET, to let a group of seasoned Oracle and Java/J2EE developers get a first glimpse of what all the buzz is about.
Read the rest of this entry »
AMIS goes Spring
Mar 22nd
What’s the resemblance between Tai Chi and the Spring Framework? Nothing. …Hmm, it might be noted that both support in gaining an healthy architecture, the first regarding the human body, the latter regarding a Java application. The two different worlds of an ancient art and modern Java programming, has been brought together by Amis by developing an administrative system for the International Taoist Tai Chi Society (ITTCS). This Canadian based association, is the largest non-profit tai chi organization in the world. It is spread over more than 20 countries. The application is called Fred after a cat who lived at a ITTCS site (untill a more meaningfull name would come up). More about ITTCS can be found here: www.taoist.org.
Read the rest of this entry »
Converting Word documents to XSL-FO (and onwards to PDF)
Mar 22nd
In the not too distant past, I have had to implement solutions for generating PDF documents, based on dynamic data and a document template to be defined by the end-user. The approach we took was to allow the end user to create the document layout in MS Word, embedding simple tags to indicate the position of dynamic data elements. The Word document had to be saved as HTML, was cleansed into proper XHTML by JTidy was subsequently turned into an XSLT stylesheet that consisted largely of XSL-FO statements with small pieces of XSLT embedded to inject the dynamic data elements. The resulting proper XSL-FO document was finally transformed into PDF using Apache FOP. The XSLT that turned XHTML into XSLT-with-a-lot-of-XSL-FO was really the essence of the solution. Translating HTML into XSL-FO was key.
Yesterday I came across a very interesting article on MSDN, discussing a way of turning Word Document directly into an XSL-FO document: Transforming Word Documents into the XSL-FO Format (feb 2005). It shows how you can save a Word document as XML and specify a stylesheet to be applied when saving. I had not known before that my Word 2003 also was an XSLT processor! The article introduces a stylesheet – Word2FO.xsl – that can be used for the transformation into XSL-FO. I decided to give it a spin.
Read the rest of this entry »
Java 5 Annotations – Creating your own Annotation Type
Mar 18th
One of the new features in Java 5 that clearly stands out is called: Annotations (JSR-175). Through Annotations, we can add metadata to our Java sources, not just as custom tags in JavaDoc comments – as we used to do with simple annotations such as @author or @deprecated or more advanced annotations used by XDoclet or AspectJ – but as constructs that are supported by IDEs and checked by compilers. In a recent workshop in session of our Web & Java Knowledge Center, we implemented a very simple AnnotationType, called Descriptor Annotation, that had a direct impact on the toString() method. In a few simple steps, we define the Annotation Type, use it to annotate a class and write the runtime code to leverage the annotation, through Reflection. This article illustrates this process.
What a week – sessions on Advanced Java, SOA, BPEL and the AMIS Crossroads project
Mar 18th
Some weeks are relatively quiet, some are more hectic. This past week leans towards the latter catagory. Apart from the normal every-day routine, there was our Knowledge Center session on Advanced Java Programming in Java 5 on Tuesday, the SOA, Integration presentation and BPEL Workshop on Thursday and to top it off we had on Friday the first brainstorm session in the AMIS Crossroads process where we collectively decide on the tools, components and technology that we – AMIS – prefer and recommend to use for Application Development. It were all valuable sessions. And especially yesterday’s four our marathon on application development – with representatives from our Sales teams, the Technical Specialists, the three Expertise Managers for Project Management, Business Consultancy and Technology as well as one of the People Managers responsible for Recruitment covering all angles for choosing methodology, technology, frameworks and tools – was very fruitful as well as enjoyable. Three more sessions are to come, discussing Containers – such as Database, Application Server, Operating System and Browser, BI, SOA and Integration; discussing Project Management, Development Methodology and Software Engineering; discussing Analysis, Functional and Technical Design and Business Consultancy. Read the rest of this entry »
JDeveloper and Subversion
Mar 15th
I am happy to see that a subversion extension is available for JDeveloper (10.1.3). Although it is still an early access version, it seems to work properly. Currently it relies on an installed subversion client, hopefully it will be build in into JDeveloper in the future.
Use the update manager to install the extension. Then follow the instructions as described in the JDeveloper Help Center. It involves the following steps (on windows):
1 – install a subversionclient form http://subversion.tigris.org
2 – install a Java helper library. Two options are available, but the subversion one is advised. Download it from the subversion site and place the dll in the subversion bin directory
3 – (re)start JDeveloper
4 – Check the installation in the preferences -> Versioning -> Subversion.
Unfortunately, this didn’t work for me so I installed the JavaSVN library from http://tmate.org/svn/ in the JDev subversion extension directory.
When I selected subversion as versioning system I received a few errors and warnings, but the installation seems to be succesfull.
A new view (SVN navigator) is now available to define the subversion repositories.
This version supports most basic functions like update, commit, remove, version history, import and little icons to show the status, and it also supports refactoring like renaming and moving. Although these functions suffice most of the time, I am looking forward to the implementation of the other subversion features.
More Jonathan Lewis
Mar 14th
A little while ago, Jonathan Lewis presented a three day seminar in The Netherlands. You may have read other blogs on this site about this seminar. AMIS had sent six people to attend. And yes, I was one of the lucky ones too.
Although the seminar should be for developers and DBA’s, most of its content was aimed at DBA’s. As a developer I don’t think undo, redo and latches are very interesting. But there were enough nice things to make the seminar very useful. For instance
- A nice example of how the way/order which records are inserted into a table can have impact on the performance of retrieving the data, due to differences in the clustering factor of the data/indexes.
- An other example of querying simular datasets (in the same way), but with huge performance differences, if you are unlucky with some internal hash functions of Oracle.
- A working example of the "go_faster" hint
- A nice trick to get the DBA-role, see http://www.red-database-security.com/exploits/oracle_sql_injection_oracle_dbms_metadata.html
- and much more
Anton
Table must have one row minimum and 1 row maximum. (singularity check)
Mar 11th
Imagine that you have to implement a table which must contain one row minimum and
may not have more than one rows. So, on insert of a row you can check if there’s
already a row in the table by joining the table to itself, like the next statement
select 1from table t1, table t2where t1.id != t2.id
The obvious way to do this is to create a set
Read the rest of this entry »

