Showing posts with label ADF 11g. Show all posts
Showing posts with label ADF 11g. Show all posts

Thursday, October 4, 2012

Oracle Open World - thursday

Last day of the conference... Not a lot of sessions today (only 1 and the Java community keynote), but we've subscribed to a trip to Oracle HQ this afternoon. We're getting a tour in their usability labs.

But first things first. I started my day with the Java community keynote. It was mainly about innovation, and some cool demos of robots (by Perrone Robotics) were given. In the end, James Gosling entered the stage and showed us what he is currently doing: Liquid Robotics. Medium-sized robots that roam the seas and gather data.

Then I went to an ADF session by Eugene Fedorenko. He took us through the process of developing an ADF application. During his 'deep dive', he showed us how to programatically create entities and view objects, end display them on the screen. I found it a bit odd to do everything programatically, instead of using the declarative strength of the framework, but I'm sure that in some cases this will turn out to be the best way.

On to Redwood City then. Oracle took us on a tour in their usability labs. They showed us how their apps are tested and evaluated using some advanced eye-reading techniques. An interesting afternoon, as closure for a very interesting conference. I learned a lot, saw some very nice demos and met interesting people. All in the lovely setting of San Francisco.


Tuesday, October 2, 2012

Oracle Open World - tuesday


This day, I have done a lot of sessions on something I've been waiting for for quite a while: ADF Mobile. I won't discuss each session seperately (since it's all on the same topic), but I'll just give my general view.

First, it's worth noting that ADF Mobile really looks promising. The idea that you develop 1 application and then deploy it to different platforms, is really good. You build an app, then deploy it to Apple's App Store or Google's Play. Or both. Without having to deal with either Android specific stuff or Objective C. Pretty neat. Also, ADF Mobile makes sure your app is future proof. If Windows 8 turns out to be a huge hit, or any other OS that might appear in the future, ADF Mobile will have support for it.

All of this is possible because of an HTML5-based user interface. Below that, ADF Mobile uses PhoneGap to acces the device specific services. Build once, deploy everywhere. I did an hands-on session today, where we built a simple ADF Mobile app and deployed it to both iOS and Android, and I must say it works pretty good. The look and feel is generally the same and all of the functionality you build in is available in both versions.

Apart from that, I've seen quite a few demos on ADF Mobile. Or rather: demo. All presentations use the same demo app. I must admit, it looks definitely great, but seeing the same stuff over and over again gets dull after a while. Therefore I was very happy to see a real-world application demo by Infosys. They have built a mobile app using ADF Mobile for one of their customers. It's good to see the theory also appears to work in a real business usescase. The app also looked good, so I'm even more eager to get started with ADF Mobile myself now!

Monday, October 1, 2012

Oracle Open World - monday

This year, I have the privilege of going to one of the biggest conferences in the world: Oracle Open World. If you look at the numbers... they're pretty huge! During this week, I'll try to keep you posted on the most interesting sessions I followed. There'll be a short summary, and my personal thoughts and views.

Why should you switch to Java 7 (David Keenan, Staffan Friberg)

Summary

The presentation was a summary of, as the title says, why you should switch to Java 7. I'll just sum them up again!

JCommands
Garbage First
Runtime compiler improvements
Sockets Direct Protocol
Performance benefits to
  •    Date
  •    BigDecimal
  •    Crypto
  •    String to byte conversion
  •    concurrency API
  •    Hotspot JVM
  •    PermGen
  •    Internal strings
  •    XML API
Backwards compatibility (source, binary, behavioural)
Heap retuning

My thoughts

Not really a very innovating session, just a sum up of what's new in Java 7 and what's to come in Java 8. A good review, though, and makes you think of upgrading.

Future of development for Oracle Fusion (Chris Tonas)

Summary

Chris gave a demo using ADF Faces. It was a  typical ADF application with fancy graphs and components. Then he showed us the same app, but on an iPad. It had the same functionality, but HTML5 instead of Flash. It also had a slightly different layout and supported gestures and touch. The pagination in tables we so liked in ADF 10g has returned (in an  im:proved way), to avoid scrollbars.

He then talked about the iOS and Android SDK support in JDeveloper, and the visual preview of the app you're building. Apparantly, you build an ADF app once, and then deploy it to Android and/or iOS (and any other vendor Oracle decides to support). Pretty convenient! Further, Chris discussed offline support and gave an ADF Mobile demo. This time, it was a native iOS app, which I thought was pretty impressive.

To end the Mobile part, Thomas Quilligan presented a real-life case. He is from Accenture, an ADF Mobile Beta Program Partner. It was nice to see the Oracle ADF Mobile technology being used in a real-life project.

After that, we moved on to the Cloud part of the talk., with a strong focus on Developer Cloud Service. These are some of the out of the box services that the Developer Cloud offers:
  • Source control
  • Maven support
  • Issue tracking
  • Continuous Integration (Hudson) 
  • Wiki




The demo of the Developer Cloud Service that followed, was very nice. It showed the full development lifecycle, all brought to the cloud, organized in neat dashboards.






My thoughts

This was a very nice presentation. The ADF Mobile still looks promising, and appears to be finally released soon. The cloud part really surprised me. I've been waiting for Oracle Cloud for quite a while now, but I didn't know they were going to offer something like the Developer Cloud. I really liked that. If it all integrates as well as in the demos, this will definitely be a product I'd want and like to use!

Oracle's public cloud strategy (Abhay Parasnis)

I'm writing an article about this session on Cloudspring. I'll update the link as soon as it gets published.

Classic mistakes with ADF (Frank Nimphius, Duncan Mills)

This was a nice light session about some of the most made errors with ADF. Driven by real examples and questions, Duncan and Frank guided us through. I'll add the slides as soon as they're available, since writing it all out seems a little pointless.

I'll just give a bit more details about one of the errors discussed. It's one we ran into as well, and Frank and Duncan categorized it as 'silent, but deadly' (as opposed to 'unforgiveable' and 'bear traps'). It's about using a bean that is not request scope, but that contains references to UI components. The problem here is that UI components only last as long as a request. They are therefore not serializable, and any bean with a scope higher than request, will want to serialize all it's variables.

Tuesday, September 25, 2012

Oracle ADF Essentials

Oracle has released ADF Essentials: a free to develop and deploy core version of their Application Development Framework.

What is included in Oracle ADF Essentials?

According to the documentation, Oracle ADF Essentials includes the following Oracle ADF components: Oracle ADF Faces Rich Client Components, Oracle ADF Controller, Oracle ADF Model and Oracle ADF Business Components.

The following functionality, however, is not included in Oracle ADF Essentials, and requires the full Oracle ADF version: Oracle ADF Mobile, Oracle ADF Desktop Integration, Oracle ADF Security, The Oracle ADF Web service data control, Oracle ADF remote taskflows, Oracle ADF Business Component’s Service Interfaces, Oracle ADF Data Controls for BI, Essbase and BAM, Integration with Oracle Fusion Middleware features such as MDS, OPSS, OWSM, Enterprise Manager and MBeans, High Availability and Clustering.

All in all a good base to start from! We now await their cloud solution, so we can develop and deploy our ADF applications in the cloud.

Wednesday, September 12, 2012

ADF analyzed by Gartner

Gartner has recently published their analysis of Oracle's Application Development Framework. And while the general feelings towards ADF are rather hesitating, the Gartner conclusion is overall very positive. Of course, ADF is tightly coupled with Oracle's Fusion Middleware stack and JDeveloper (although an Eclipse plugin is available). But just because of those reasons, you can count on Oracle to continue developing and supporting ADF in the future.

A special mention goes to the MetaData Services provided in Fusion Middleware. It's an engine that allows users to personalize their own web-experience. Much like portals intend to do, but then in 'a regular' web application. It allows runtime customization of the look-and-feel, per user, group of users or the entire application.

Further, Gartner looks forward to the much anticipated ADF Mobile. They expect it to ship with the 12c release of ADF. As you could see earlier on my blog, I'm attending OpenWorld this year, and I hope to see some more details about ADF Mobile there.

So all in all a positive review of ADF. Let's hope customers also see the added value of the framework, and at least consider adapting it. Especially when an Oracle stack is already present, the step to start using ADF is not very big.

Thursday, August 16, 2012

Free Advanced ADF course - part 2

As I mentioned earlier, Oracle provides a free advanced ADF course. Today, Jürgen Kress announced on his blog that part 2 is available! Here are the links to part one and part two.

Good luck.

Monday, July 16, 2012

ADF tip: RowIterator

An ADF tip I can give you is the following: if you need a RowIterator multiple times, store it into an object. We've had an issue with getting it 2 times. Our application didn't give an error, would would appear to be busy forever, while not returning any results.

This was our case:
SomeVORowImpl someRow= (SomeVORowImpl)baseRow.getSomeVO().createRow();
//Do something with row
baseRow.getSomeVO().insertRow(someRow);
It would execute correctly (without errors), but the application would then hang. We've replaced the duplicate call to baseRow.getSomeVO() and stored it into a RowIterator object:
RowIterator someVO = baseRow.getSomeVO();
SomeVORowImpl someRow = (SomeVORowImpl)someVO.createRow();
//Do something with row
someVO.insertRow(someRow);
This did the trick. We haven't dug to the bottom of why this happened, but if we can reproduce this in a small test application, we might file a bug.



Friday, July 13, 2012

ADF sessions at Oracle Open World

It's still more than 2 months away, but I'm already looking forward to Oracle Open World. I'm starting to look at the sessions that will be given, and I'm preparing my list. These sessions are must-see's for me!
My selection is based on both topic and speakers. For now, I've only looked into the ADF sessions. I'll look into other topics (Cloud, Java, ...) later on, and will continue to update this list.

Wednesday, June 20, 2012

ADF in Eclipse

Oracle organizes a free virtual event, to show some best practices in building rich ADF applications, based on ADF Data Controls, using standard Java technologies (EJBs, JPA, ...).

There's also a live Q&A chat with Oracle technical staff. The event takes place on July 10. You can register here.

Friday, April 13, 2012

ADF 11g: Using Application Module outside ADF Application context

Earlier this week, I had to refactor an existing project, and extract some functionality. The goal was that this code could run outside of our Weblogic server, in a crontab job. So I created a new project, containing a class with a main method. The original code was based on Business Components, so I wanted to use this Oracle ADF specific technology as well.

After all the extraction was done, I created a JAR file of my new project and tried to run my main class. The fist problem I encountered was not having all the necessary JARs on my classpath. Therefor, I created a batch-script (could be Unix as well, but I was working in a Windows environment), setting all necessary JARs on my classpath and launching my main method

set JAVA_HOME=C:\Oracle\Middleware\jdk160_18\jre

set PATH=%JAVA_HOME%\bin;%PATH%
set CLASSPATH= YOUR_CLASSPATH

java -classpath %CLASSPATH% my.MainClass


Where YOUR_CLASSPATH is a semicolon-seperated list of all JARs you need. Now the code would compile! But then I ran into the next issue: creating an application module.

I used the default way of creating an Application Module, ie. Configuration.createRootApplicationModule(). While this works inside an ADF application, running a JAR standalone does not provide you with enough context. So I tried a new approach, and manually initialized a context:

String jdbcURL = "jdbc:oracle:thin:@HOST:PORT:SID";

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);

Context ic = new InitialContext(env);


But of course, creating a Context isn't enough to use the Application Module. We need to create that as well, and I did that in the following manner:

// 'defName' is the JNDI name for the application module
// definition from which the root application module is to
// be created
String defName = "my.AppModule";

ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(defName);
ApplicationModule = (ApplicationModule)home.create();
mbApplicationModule.getTransaction().connect(jdbcURL, dbUser, dbPassword);


DefName is the JNDI name of your application module. This can be found in bc4j.xcfg. Now we can use the ApplicationModule just like we would in an ADF Application context!

Monday, March 12, 2012

ADF 11g: Tag Library

Wouldn't it be nice to have an overview of all Oracle ADF 11g components? Well, you can find them here:

http://jdevadf.oracle.com/adf-richclient-demo/faces/components/index.jspx

You can adjust parameters to see their effect and view the source code. There's also an option to change the skin, so you have an idea what skinning can do for you.

Thursday, March 8, 2012

ADF Logging

Most people use Log4J for their logging. There are a few others, like Commons Logging, SLF4J, or the default Java Logging API. But if you're working with Oracle's Application Development Framework, there is another option as well: ADF Logging.

ADF Logging is a logging mechanism, embedded in the ADF framework. It wraps the Java Logging API, but throws in a few extra methods and some JDeveloper and (Weblogic) Enterprise Manager features.

A thorough guide on how to use it can be found on Duncan Mill's blog. A 15 minute introduction presentation is also available.

Wednesday, March 7, 2012

ADF 11g: Move Task Flow to another folder

Users of JDeveloper know it: on a lot of files, you can right click, choose the option "Refactor", and select "Move". But not so for task flows (at least not in JDev 11.1.1.5). If you want to move a task flow to another folder, you have to recreate it. For new flows, this isn't too hard, but for flows that have a lot of activities, actions and method calls, this can be a lot of work. To get the job done without having to recreate the entire task flow, follow these 2 easy steps:

  • Move the task flow definition XML file (under WEB-INF ) to the correct folder
  • Move the task flow diagram files (.adfc_diagram) to the correct folder. They can be found under the model/WEB-INF folder in your ViewConrtroller project
  • Change the DataBindings.cpx file to reflect the changes
That's it!

Friday, March 2, 2012

Free Advanced ADF course

Great news! Oracle now provides free online training for ADF. According to Grant Ronald's blog, more parts of this course will be released in the coming weeks.

Get started, or sharpen your ADF skills...

ADF 11g: Select date and time

Today, I had to enable the users to not only select a date, but also a time. I remember this being a lot of work in 10g, but in 11g, it's apparantly out of the box functionality.

Thanks to Shay Shmeltzer for providing a solution!

https://blogs.oracle.com/shay/entry/a_timehour_selector_in_adf_fac

In short:
  • Make field in database of type TIMESTAMP
  • Make sure it's also a TIMESTAMP in your entity object
  • Provide a date format mask that includes hours and minutes


More information can also be found in this forum thread.

Thursday, March 1, 2012

ADF 11g: Global date format

In ADF 11g, you can define a date format on many levels. On Entity Objects, View Objects, even on UI level in your JSF pages.

But wouldn't it be convenient to make 1 configuration and have all dates display the same? Well, this is possible. Just add this line of code to your trinidad-config.xml file (located in WEB-INF):


<formatting-locale>nl-BE</formatting-locale>


Of course, the locale you use determines the formatting. This particular example, nl-BE, will display all dates as dd/MM/yyyy.

ADF @ KnowledgeBlackBelt

Ever heard of KnowledgeBlackBelt? It used to be BlackBeltFactory. Doesn't sound familiar either? Perhaps JavaBlackBelt then? I'm sure that rings a bell to a lot of Java-oriented developers. Well, it's all the same site, it just has changed name (and layout) a few times over the years.

 In short, KnowledgeBlackBelt is a Java Learning & Certification community. Everyone can join and take free exams to gain grades. There are even courses (both free and paid) that handle certain topics and prepare you to take those exams. New users start out with a white belt, and eventually, after taking courses, exams and contributing to the community, they can become a Black Belt.

 I'm a contributor to the KnowledgeBlackBelt community. I have earned a brown belt over the years, and I'm the leader and moderator of the ADF Business Components exam. Check out the exam, and the entire concept that is KnowledgeBlackBelt. Learn, gain experience and get better at what you do.

ADF 11g: Get sequence in Groovy

A lot of people use sequences to generate an ID for their records. Since Oracle doesn't have an auto-increment, you need to manually get the next value and insert it into the ID field.


This can be done by triggers, but when you use Business Components, adding a one method and a single line of groovy code is enough. First, we need a method to get the next DB value:

  public Number seqNextVal(String seqName) {
 
    Number seqNextVal;
 
    if(seqName!=null && !seqName.equals("")) {
      SequenceImpl seq = new SequenceImpl(seqName, getDBTransaction());
      seqNextVal = seq.getSequenceNumber();
    }
    else {
      seqNextVal = new Number(0);
    }
 
    return seqNextVal;
  }


In the Id-attribute of your entity, you call this method by entering this expression in the value field:

adf.source.seqNextVal("SEQ_NAME")




Don't forget to check the Expression radio!

ADF 11g: Hide table column headers

Sometimes, you want to display a table, but hide the column headers. This can easily be done with ADF Skinning. First, we need to create a skin. This can be done by creating a trinidad-skins file in your META-INF folder. Since we only want to adjust our table in this simple example, we'll extend from the default Fusion desktop skin

<?xml version="1.0" encoding="UTF-8" ?>
<skins xmlns="http://myfaces.apache.org/trinidad/skin">
 <skin>
  <id>mySkin.desktop</id>
  <family>mySkin</family>
  <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
  <extends>fusion.desktop</extends>
  <style-sheet-name>/css/mySkin.css</style-sheet-name>
 </skin>
</skins>


As you can see, we refer to a css file there. Create it, and add this line to it:

.tableNoColumnHeaders af|column::column-header-cell {display: none}

Your skin has now been created, now we need to tell our application it has to use that skin. This is done in the trinidad-config.xml file, located in your WEB-INF folder. There, refer the skin-family to your own skin

<skin-family>mySkin</skin-family>

That's it. Your skin has been created. All that is left now is configure your table to use the style you just defined. Add following attribute to your <af:table> instance:

styleClass="tableNoColumnHeaders"

Tuesday, February 28, 2012

ADF 11g: SelectOneChoice not showing

Creating a dropdownlist with a List of Values for an attribute is easy in ADF 11g: create a ViewObject, link it with a List of Values through a View Accessor and add the List of Values to your attribute. That's basically it. If you now drag-and-drop said attribute on your page, JDeveloper will ask you if you want to drop it as a 'Single Selection'. There you select 'ADF Select One Choice', and voila, there you have a dropdownlist with your List of Values.

But sometimes, and it has happened to me before, the dropdownlist is not showing. Of course, you start to check and double check, even up to the point where you just delete everything you just did, and start over. To no avail.

If you ever face this issue, bear in mind that 1 simple configuration can mess up your result. In this particular case, I had the List of Values linked to a Transient Attribute. Of course, Transient Attributes are, by default, not editable. This is quickly fixed by changing the 'Updatable'-property to 'Always'.


If you now run your application again, the dropdownlist is showing correctly! This is one of those things you actually know, but run into every now and again. Especially if it's been a while since you linked a List of Values to a Transient Attribute...