JDeveloper 11g is production!

7 October 2008 at 12:21 CEST | In JDeveloper, Oracle, Upgrades and versions | 22 Comments

Just noticed that the long awaited JDeveloper 11g is now listed on OTN: http://www.oracle.com/technology/software/products/jdev/index.html

Update: It seems the actual download links are not working yet. They’re probably in the middle of putting it out there. Check back in a few hours and everything should be ok.

Two proposed OpenWorld sessions

23 May 2008 at 22:13 CEST | In JDeveloper, Oracle, SOA | Leave the first comment

I’ve proposed two sessions at Oracle Mix. The first one is titled “Oracle Forms as JSF components, enabling gradual migration” and the second one “Donor Organ matching with Oracle Business Rules 11g“. If you think these sessions could be of added value to the OpenWorld conference, please read the abstracts and cast your vote.

The Oracle Forms/JSF session is all about the OraFormsFaces JSF component library I developed. It allows you to re-use existing Oracle Forms as full featured JSF components in a JSF or ADF Faces page. This can be a great solution to a gradual migration from Oracle Forms to JSF/ADF. It allows you to embed all of your existing forms in JSF/ADF and then migrate/rewrite them to the new technology at your own pace and one-at-a-time.

The other session is about a proof of concept at Eurotransplant to use Oracle Business Rules 11g to implement all the rules that go into matching an available donor organ to all the patients on the waiting list. These rules are determined by democratic committees and tend to grow quite complex over the years. Using Business Rules the rules can be unambiguously specified. The specified rules can be verified by non-IT personal and allow for some great innovations. One of the best parts is that the rules can be understood, verified, and audited by other people. That’s not so easy if all the rules are embedded in complex PL/SQL, Java, or other 3GL programming language.

Get JDeveloper 11g technology preview 4

18 April 2008 at 08:08 CEST | In JDeveloper, Oracle, Upgrades and versions | 27 Comments

Watch OTN today. It is rumored that the next technology preview, number 4, will be published today. Don’t really know which timezone though.

It’s been a while since the last technology preview (Christmas 2007), so I’m curious to see how far they’ve come with this next preview. I hope they are getting closer to a finished version. The only official thing Oracle is saying about an official release of Fusion Middleware 11g is calendar year 2008.

Update 25 april 2008: Looks like my information wasn’t 100% correct as the tech preview hasn’t been released on OTN yet. Then let’s just say they’re getting very close and it can be out there any time now.

Using an af:iterator to group and insert breaks

8 April 2008 at 12:35 CEST | In Features and tips, JDeveloper, Oracle | 9 Comments

Yesterday I got a question how to create a ADF Faces JSPX page that shows all the records from a ViewObject, but inserts group headers when one of the fields (category) in the ViewObject changes. In the end, the solution lies in the use of an <af:iterator> component to iterate the rows in the ViewObject and insert breaks where necessary.

The end result looks something like this:

Read the rest of this blog to learn how I achieved this.

First, let me show the output of the SQL statement of the ViewObject:

CODE:
ID TEXT                                     BOOL CATEGORY
-- ---------------------------------------- ---- ---------------------
7  Business Intelligence Enterprise Edition N    Business Intelligence
6  Businesss Intelligence Standard Edition  Y    Business Intelligence
8  Data Integrator                          N    Business Intelligence
1  Database Enterprise Edition              Y    Database Products
2  Database Standard Edition                N    Database Products
3  Oracle Lite                              N    Database Products
4  Application Server Enterprise Edition    N    Fusion Middleware
5  Forms and Reports                        N    Fusion Middleware

I've create a default ADF Business Components Entity Object, View Object, and Application Module. To use a checkbox I need a boolean type attribute, so I added a transient attribute to the View Object:

JAVA:
public Boolean getTrueBool() {
    return "Y".equals(getBool());
}

public void setTrueBool(Boolean value) {
    setBool(value ? "Y" : "N");
}

Next thing to do is to create the ADF Faces JSPX page to iterate over all the rows in the ViewObject and include a checkbox component for each row. Whenever the category of a row changes compared to the previous row a header should be included to indicate the start of a new category. We normally use an af:table component to show multi-record stuff, but you can't use it in this case. It does not allow to output the headers in between the rows. Hence we use the af:iterator component to iterate over the rows of the ViewObject:

XML:
<af:iterator var="row"
             value="#{bindings.TestWilfredViewIterator.allRowsInRange}">

  <af:panelHeader text="Category #{row.category}"
                  rendered="#{CategoriesBean.changed}"/>

  <af:selectBooleanCheckbox text="#{row.text}"
                            value="#{row.trueBool}"/>

</af:iterator>

The af:iterator component iterators over a binding called TestWilfredViewIterator. For each iteration it creates a variable "row" that can be used in the child components of the af:iterator.

The first child component is an af:panelheader to show a header for each new category. It's text property uses an EL expression #{row.category} to get the category text from the current row. The rendered property uses an EL expression to call out to a managed bean. That bean contains the logic if the header should be shown or not. It determines this by comparing the category with the category of the previous row. If it changed, the header should be printed otherwise not.

The next child component is an af:selectbooleancheckbox to include a checkbox input element. It's text ("label") uses an EL expression to get the description from the current row. The value is bound to the TrueBool transient attribute we added earlier. The setter of that transient attribute sets the value of the Bool attribute to either "Y" or "N".

The page definition file contains the binding declarations:

XML:
<executables>
    <iterator id="TestWilfredViewIterator" Binds="TestWilfredView"
              RangeSize="-1" DataControl="AppModuleDataControl"/>

  </executables>

It declares a iterator with the ID of "TestWilfredViewIterator". It binds to the ADF BC ViewObject "TestWilfredView" from the data control named "AppModuleDataControl". The RangeSize is set to -1 so all rows are queried and no pagination is used.

The backing bean contains the code to determine if the header should be printed:

JAVA:
public void setChanged(boolean changed) {
    throw new IllegalStateException("do not call setChanged");
}

public boolean isChanged() {
    // get the key of the current row
    FacesContext context = FacesContext.getCurrentInstance();
    Application application = context.getApplication();
    Object key =
        application.createValueBinding("#{row.key}").getValue(context);
    // compare this key with the key of the previous call (bean can be
    // called multiple times for same row)
    if (!key.equals(previousKey)) {
        // new key, compare categories
        Object category =
            application.createValueBinding("#{row.category}").getValue(context);
        changed = !category.equals(previousCategory);
        // remember category for next call
        previousCategory = category;
    }
    // remember key for next call
    previousKey = key;
    return changed;
}

The managed bean needs both a setter and a getter for the boolean property. We don't really need the setter, but it has to be there to be able to reference the bean property from an EL expression. Without the setter, it is not a bean property and you cannot reference it from EL.

It turns out that this method is sometimes called multiple times for each row of the af:iterator component. This requires some additional handling in the java code. You cannot just assume that the next call of the method also represents the next row of the af:iterator.

So, the code first gets the key of the current row of the af:iterator component. The key is compared to the key from the previous cal to isChanged(). If the key has changed (or previousKey is null), we know we have found the next row of the iterator. We then continue to get the category of the current row. We compare that to the category of the previous call to isChanged(). If it is different, we set a boolean property to indicate this row has a different category than the previous row. We need to store this in a property to make sure that subsequent calls to isChanged() for the same ViewObject row return the same result as the first call for that particular row.

That's all there's to it. Just one last thing, to make the story complete. The managed bean declaration in the faces-config.xml:

XML:
<managed-bean>
    <managed-bean-name>CategoriesBean</managed-bean-name>
    <managed-bean-class>com.example.sandbox.view.beans.Categories</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
  </managed-bean>

Integrate Oracle Forms and JSF/ADF Faces with drag-and-drop

11 February 2008 at 10:57 CET | In Demos, Forms, JDeveloper, Oracle, Web components | 13 Comments

I am happy and proud to announce the public availability of OraFormsFaces, a JSF component library to integrate Oracle Forms and JSF or ADF Faces. This allows you to embed Oracle Forms in a JSF page and truly integrate the two, including passing context, events, eliminating Forms applet startup time, and many more features.

I feel this is the key ingredient that is missing from Oracle's offerings. Forms is a mature product and Oracle has a great Java stack, but unfortunately you cannot really integrate the two in a single application. This leaves many of the traditional Forms users with a dilemma. They might want to use the Java stack for new developments, but they don't want to be forced into a rewrite of there Forms application to this Java stack.

Wouldn't it be wonderful if you can use the Java stack for new developments but protect your investment in Oracle Forms? With OraFormsFaces, you can. You can build new JSF or ADF Faces based web applications and integrate your existing Forms applications in them. You can pass parameters from JSF to Forms and the other way around. Both Forms and JSF can raise events (commands or triggers) in the other technology. With the possibility of integrating Forms into JSF, you can even go one step further and integrate Oracle Forms in any other web technology, whether it is Oracle Portal, Oracle WebCenter, PHP, ASP.Net, or something else.

I've prepared two demo movies showing different ways of integrating Forms and JSF; the first one keeps the powerful multi-document interface of Oracle Forms, whereas the second one makes the Forms look like a true web application and could be used for a smooth migration from Oracle Forms to web technology.

As some of you know, I've been working on this concept since 2005. Initially it was a quest for a way to interact programmatically with the Forms applet running in the client web browser. In summer 2007 I presented a solution to the world at the ODTUG Kaleidoscope conference, and later I published the same solution in an OTN article, an Oracle OpenWorld 2007 presentation, and several other places. The solution is based on a JavaScript API that enables Forms to execute JavaScript in the browser and JavaScript in the client page to interact with the Forms applet. The concept as presented in 2007 was still very technical and required quite some work form both the Forms and the Java programmer.

Since summer 2007 a lot has happened. It took a lot of work and that's why it's been much too quiet on this blog. The same basic concept has been wrapped in a JSF component library.Now it's as simple as dropping a JAR file in your Java project and drag-and-drop a Form, FormParameter, or FormCommand component to your JSF page in a visual editor. See some other screencasts on how easy it is to get this done in JDeveloper. Also, a lot more features have been added since the proof-of-concept in 2007. For instance, making it compatible with Single Sign On basically required a complete rearchitect and rewrite of the solution.

The solution is now available for everyone as the OraFormsFaces library. You can download two running demo applications to look at the end result first. If that got you interested, you can download a trial version of OraFormsFaces and the OraFormsFaces Developer's Guide to get started for yourself. If you do run into any problems, feel free to ask at the forum or file a bug report in the issue tracker.

Good luck integrating your Oracle Forms application with your latest JSF or ADF Faces applications.

Tweak and Tune your JDeveloper

29 January 2008 at 11:10 CET | In Features and tips, JDeveloper, Oracle | 2 Comments

I just stumbled upon a very informative post on how to tweak and tune your JDeveloper installation. It shows some of the miracles that are tugged away in the jdev.conf file. Go read it!

Movie showing JSF component to integrate Oracle Forms

24 October 2007 at 08:36 CEST | In Demos, Forms, JDeveloper, Oracle, Web components | 4 Comments

I'm about to release a JSF component library to the public that can integrate Oracle Forms in a JSF/ADF Faces web application. As a sneak preview I've already put up the first screencast movie demonstrating how easy it is to embed an Oracle Form in a JSF page.

The component library not only supports the embedding of a Form like shown in the demo. It also allows you to pass parameters to the Form, pass parameters back from Forms to JSF, execute JSF navigation from Forms PL/SQL. On top of all that, it only starts the Forms applet once for your entire web session. So even when a user is switching between pages with and without an embedded Form, the user will not have to wait 5-10 secs for the Forms applet to start.

If you're interested please check back soon for more information. If you're visiting Oracle OpenWorld this year, be sure to enroll for my session on Monday. I'll be talking about the technical details of JSF-Forms integration and will also be showing the JSF component library that was used to create this demo movie.

JDeveloper 10.1.3.3 has been released

29 June 2007 at 11:38 CEST | In JDeveloper, Oracle, Upgrades and versions | 6 Comments

I just noticed that Oracle has released version 10.1.3.3 of JDeveloper. The documentation page has not been updated yet, but there is a list of bug fixes included in 10.1.3.3.

Also note that the patchset 10.1.3.3 for the Application Server has also been released earlier this week. I can't see the Windows version on Metalink yet, but you can get the Linux version. To download, go to metalink and go to the patches section.

Custom JSF converter to display minutes as hh:mm

8 May 2007 at 09:40 CEST | In Features and tips, JDeveloper, Oracle | 3 Comments

We have a database that stores elapsed time in number of minutes in a plain number field. In our JSF/ADF Faces application we wanted to have the user input these fields as hours:minutes. So, internal storage of 210 should be displayed as "3:30".

I knew this should be possible using a custom converter, but never looked into that. Yesterday I did and it turned out to be dead simple. Here are the few required steps:

First create a simple Java class that implements the javax.faces.convert.Converter interface:

package com.example.view.customConverters;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

import oracle.jbo.domain.Number;

public class hourMinutesConverter implements Converter {
    public hourMinutesConverter() {
    }

    public Object getAsObject(FacesContext facesContext,
                              UIComponent uiComponent,
                              String string) {
        try {
            String stringParts[] = string.split(":");
            int minutes =
                Integer.parseInt(stringParts[0]) * 60 +
                Integer.parseInt(stringParts[1]);
            Number numObj = new Number(minutes);
            return numObj;
        } catch (Exception e) {
            throw new ConverterException(e);
        }
    }

    public String getAsString(FacesContext facesContext,
                              UIComponent uiComponent,
                              Object object) {
        try {
            int totMinutes = (int)((Number)object).getValue();
            int hours = (totMinutes) / 60;
            int minutes = (totMinutes % 60);
            return hours + ":" + minutes;
        } catch (Exception e) {
            throw new ConverterException(e);
        }
    }
}

This class implements two methods: getAsObject() to convert a String (user input) to an actual Object and getAsString() to convert an actual Object to a String to display in the web page.

The error handling could be a lot better and you probably want to return meaningful error messages when the user input is not in a valid format. See the JavaDoc of javax.faces.convert.ConverterException on how to construct a ConverterException object with a simple String message or a nice javax.faces.application.FacesMessage object.

Next, go to WEB-INF/faces-config.xml and add the custom converter:


  demo.hourMinutesConverter
  
    com.example.view.customConverters.hourMinutesConverter
  

All this does is give the converter an ID which your going to use in the pages and specify the implementing class for this converter.

Finally go to the actual JSPX page and drag a Convert component from the JSF Core group in the Component Palette. Drop it on the inputText component used for your item. A dialog will appear asking your for the ID of the converter. Select "demo.hourMinutesConverter" from the list. You end up with the following code in your JSPX page:


  

I've misused the managerID field in a demo application and here is the result:

Force a language or locale for JDeveloper IDE

14 January 2007 at 11:18 CET | In Features and tips, JDeveloper, Oracle | 10 Comments

Since I live and work in the Netherlands, my workstation is setup with Dutch regional settings. It always annoyed me that JDeveloper used this setting and tried to run in Dutch. Since not everything is translated you end up with a mix of English and Dutch in your JDeveloper IDE. Error messages can be in Dutch which is not very useful for finding solutions through Google or forums.

Unfortunately JDeveloper does not let you set the language in a preference. But as it turns out it does adhere to settings in the JDEV_HOME/jdev/bin/jdev.conf. Just add the following two lines to the file to force the use of US English:

AddVMOption -Duser.language=en
AddVMOption -Duser.country=US

This does the trick

Next Page »

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.