Archive for November, 2008

Java: Generating PDF and Previewing it as an Image – iText and PDF Renderer

Inspired by a blog article by Edwin Biemond, I decided to try it out myself: previewing an PDF document in an image. However, Edwin used jPedal (http://www.jpedal.org/), a commercial product. It is not extremely expensive – but not freely available., So I decided to look a little further for a truly open source and free product. I found PDF Renderer, published by Sun Microsystems:https://pdf-renderer.dev.java.net/ .It could easily do for me what I was looking for.

As an additional step, I also used iText – http://www.lowagie.com/iText/download.html – an open source project that support programmatic generation of PDF document from Java.

Within half an hour, I had a program running that generated the following preview of the first page of a dynamically produced PDF document:

 

Read the rest of this entry »

Bulk Operations in PL/SQL

When I was in Chicago for the OPP2008 and APEXposed event I talked to someone who seems to have trouble understanding bulk operations in PL/SQL. I helped him out by providing a test/demo script, that shows how it could be done. First of all, one of the most important rules of thumb that I got from the seminar (almost everyone talked about this):

  • If you can do it in SQL, do it in SQL
  • If you can’t, use PL/SQL
  • If you still can’t, then resort to some other tool, like Java, VB or whatever…

If you can do your update, entirely in SQL, then that is the fastest solution. But in the case described to me, there is a lot going on between the select (from table) and the update (maybe even some other table).

Read the rest of this entry »

Intercept Hide/Show column event

 

When we wrap a rich table in a panelcollection component, we get some interesting additional functionality. This includes the ability for the end user to hide and display columns. It may be useful to intercept that column hide/show event – for example to influence the query that is executed to retrieve the data for the table.=

There is no column property hideAndShow Listener, nor is there a special listener on the panelCollection component. After a little trial and error, I found out that the column show/hide event can be intercepted using an attributeChangeListener on the column component: Read the rest of this entry »

ADF 11g – Why use skinning? Why not use simple external CSS stylesheets?

Today a discussion arose with one of the UI Designers on the ADF 11g project I work on. He is used to a certain way of styling web applications. He wants to work with ‘clean’ HTML – as little styling in it as possible, very W3C compliant and preferably structured – DIVs, ULs, … – in a way that makes applying external stylesheets very easy. He would like the HTML to contain values for the (style) class at specific points. And he will then take it from there.

While this approach is fairly common for Web Designers, it is not one that works well with most component based web frameworks, such as JavaServer Faces libraries. With JSP tag libraries and JSF components, web page developers have no direct control over the HTML that is rendered. Components provide productivity and help achieve consistency in source code and in look & feel. Typically this is seen as ample compensation for the loss of control over the exact HTML rendered. Read the rest of this entry »

Dynamic and Conditional grouping in SQL queries – for flexible results from single query (oh and a useful case for the CUBE operator)

 

My challenge of the day: a query that returns aggregate values. And that can be manipulated dynamically to sometimes aggregate grouped by one dimension, sometimes along multiple or another single dimensiopn. The query will be used to build a report page on that displays a table with rows returned from the query. In this page, the user can hide/display columns. Whenever a column is hidden, the query should no longer group by the columnn. However, it should still be the same query.

In this article, we will look at a way to bring this dynamic, conditional aggregation behavior into a SQL query. How the query will perform aggregating on different levels without change to the query itself. We will use wildly interesting concepts such as the database context, the CASE statement and last but not least, the CUBE (aggregate) operator.

In a subsequent article we will also take a look at the web page that we create on top of this query. Read the rest of this entry »

(Dutch) 7Up cursus.

Op 3,4,10 en 11 december organiseert AMIS weer de 7Up training. In vier dagen worden de deelnemers wegwijs gemaakt in de nieuwe mogelijkheden die Oracle biedt. Veel mensen zijn met Oracle 7 begonnen en werken nu met een recentere versie van de database (9, 10 of 11), maar bouwen nog steeds PL/SQL code en SQL statements alsof ze tegen een Oracle 7 database aan zitten te werken. Zaken zoals de nieuwe en analytische functies in SQL worden nog nauwelijks gebruikt, terwijl hier toch hele krachtige onderdelen bij zitten. De nieuwe functies in PL/SQL zoals Invoker Rights en Autonomous Transactions worden ook nog nauwelijks gebruikt.

Je kunt je hier aanmelden voor deze cursus. Mocht het niet lukken om dit jaar nog mee te doen aan deze cursus, volgend jaar wordt deze cursus opnieuw gegeven. De data hiervoor zijn nog niet bekend. Hou daarvoor de agenda in de gaten.

Maandag 17 november – Kennismaken en aan de slag met ADF 11g

 

Aanstaande maandag – 17 november – organiseert AMIS een KC (Kennis Centrum) sessie rondom de recent uitgekomen 11g versie van ADF. Deze release is een belangrijke – voor Oracle omdat daarmee eindelijk de ontwikkelomgeving en het ontwikkelframework voor Fusion Applications beschikbaar zijn. En voor veel ADF ontwikkelaars buiten Oracle, en ook in Nederland, omdat we daarmee een krachtig, aantrekkelijk en up-to-date ontwikkelgereedschap in handen hebben.

In deze sessie laten Luc en Lucas zien wat zij de afgelopen maanden met ADF 11g uitgezocht hebben. Ze zullen de belangrijkste vier thema’s van ADF 11g gaan bespreken en demonstreren en ook gaan we er in een hands-on sessie mee aan de slag.

In een sessie van 16.30 – 21.00 passeren de vier belangrijkste thema’s van ADF 11g de revue:
 
* RichFaces Components (de brug naar Web 2.0)
* Reusability (task flows, templates)
* Declarative & Model Driven
* Data Visualization Components
 
Voor ieder van ons biedt ADF 11g ook mooie kansen om vanuit (redelijk) bekend terrein nu ook aantrekkelijke Web 2.0 applicaties te bouwen. Ik kan iedere ADF-ontwikkelaars sterk aanbevelen zo snel mogelijk met de 11g versie aan de slag te gaan. In deze sessie krijg je de eerste stappen hapklaar aangeboden! (ook als je er alleen van 16.30-18.00 of zo bij kan zijn, schuif aan – dan pak je de eerste twee thema’s alvast mee).
 
Als je er bij wilt zijn tijdens het diner, laat dat dan even weten aan het AMIS Office Management – meld je aan via http://www.amis.nl/activiteiten.php?id=668

Some sql scripts for analyzing Oracle eBS

While working in Oracle eBS it can sometimes be very helpful to have a quick overview of how and/or what is setup. Sometimes it is enough to just use what was made available to you and by clicking through the available setup screens you will simply find what you are looking for. However, in some cases you end up not having the right responsibilities to see these details or you just want to prevent scrolling and clicking through these windows or combine details from different screens. Read the rest of this entry »

Context Sensitive Resource Bundle entries in JavaServer Faces applications – going beyond plain language, region & variant locales

 

We were faced by an interesting challenge: our JSF application should display boilerplate text – titles, button labels, prompt, error messages, tool tips etc, – in a context sensitive way. Not just by language, region and variant – the well known dimensions along which the standard JSF and Java mechanism works with Resource Bundles. Beyond that simple ‘locale’ sensitivity – which we also needed – we need a more specialized context dependency. Along several dimensions.

For example when a user of younger age category approaches the web application, the text presented should be (or at least could be) different from whatever we show our senior users. Also when the application is accessed in the context of a certain brand or company the text may need to be different from other brand or company contexts. And the marketing department came up with the ability to presents some text tailored to the time of year – Winter or Summer, Holiday Season or no Christmas in sight – or the day of the week – working day or weekend. Good old marketing department – if they were to rule the world….

And so we got started. How can we cater for these various context dependencies, along various mutually orthogonal dimensions.

Read the rest of this entry »

Migrating the ADF 10g Hierarchical Table Report to JDeveloper & ADF Trinidad and onwards to 11g (RichFaces)

 

In a recent article, I discussed how to create a fairly structured hierarchical report – table style – using ADF 10g not-so-rich Faces – see creating-a-read-only-hierarchical-table-report-with-adf-10g. The temptation is very large to open the project from that article in JDeveloper 11g and see what I can do with the RichFaces components to spice it up a little.

Before even getting started,. it seems that the popup component can help make things somewhat more attractive, as probably can the chart and gauge components. Furthermore, perhaps the Tree DataBinding is somewhat more versatile in 11g than in 10g and can even further reduce the programmatic effort. And who knows what other benefits 11g RichFaces may offer…

  Read the rest of this entry »