Sunday, December 27, 2009

Automating User Registrations with OpenID and Spring Security 3.0 - Part 1

Having a few days of vacation is nice. Besides spending some precious time with my family, it also gave me some time to work on jRecruiter. I upgraded Spring Security to the final 3.0.0 version, which was released just a few days ago.

The upgrade process was relatively painless, though it is not a simple Jar drop-in as the packages of many of the classes changed. But it was fairly straight-forward.

The biggest hassle, was upgrading Jasypt as the latest released version is not playing nice with Spring Security 3.0, yet. But the code is already committed to Jasypt's source code repository, and with minor modifications, I was able to compile a custom version.

But while I was looking through the changes of Spring Security 3, I started reading a little bit more about its support for OpenID.Which then let to the question, whether there is a good use case for OpenID in my home project.

Places where I saw the use of OpenID are:
Here is actually a pretty good blog post regarding OpenID:

http://www.codinghorror.com/blog/archives/001121.html


Security Concerns

Then of course, there are also a few security concerns regarding allowing for OpenID authentication:
 If that's not enough:
Thus, while I probably wouldn't use OpenID for a banking application, I feel it is a nice fit for my home project, it is used by local recruiters to post job postings. Up to this point every account holder had to provide her own username (email) and a password.

None of the information stored by jRecruiter is extremely sensitive and thus, OpenID might actually help improve the user experience of people posting jobs through the system.  Over the past few years I saw a common issue that account holder are unable to remember their password, or even their username (which made me to change over to more of a email-based username approach). Ultimately, there were quite a few duplicate registrations in the past.

An interesting question though is, is it advisable to restrict access to a limited amount of OpenID providers? (Such as myOpenID, Google or Yahoo)

Use Case

Well, this is were things are getting interesting, OpenID does not only define the notion of pure authentication but it can also gives you access to various pieces of your OpenID profile (e.g. first name, last name, email address etc.). This feature seems to vary, though, between providers (Have to see how that works out)

Thus, for jRecruiter I envision the following use case. When a user starts the login process:
  1. she or he has a choice of either loggin in the traditional way using a username/password combination or 
  2. by selecting the OpenID route. 
  3. If the user logs in via OpenID and the authentication succeeds, but the user account within jRecruiter does not exists, yet, then the potential user is redirected to the registration pages and the fields of the registration form shall be pre-populated (as much as possible) using inforamtion from the user's OpenID profile. 

In my next blog installment I would like to give you some insights of how I created a first draft implementation using Spring Security 3.0. Keep in mind that this is an ongoing (learning) process...Thus, if you see issues, let me know.

Continue with part 2.

Tuesday, December 8, 2009

Warbler and JRuby on Netbeans

Have been brushing up my Rails skills last night. I installed the latest Netbeans version (NetBeans IDE 6.8 Release Candidate 2)

Everything looked great but during project setup, I selected the option to use Warbler ('Add Rake Targets to Support App Server Deployment (.war)'). As it turns out, setting up Warbler during project setup just 'breaks'. I have been using the "Built-in JRuby 1.4.0". It seems to be a path issue on my Mac running Snow Leopard (there were some indications on the web).

Ultimately, I was able to solve that issue by installing a dedicated JRuby version that had a nice shorter path.


Before:

"/Applications/NetBeans/NetBeans 6.8 RC2.app/Contents/Resources/NetBeans/ruby2/jruby-1.4.0/bin/jruby" -S gem unpack warbler
rake aborted!
Command failed with status (127): ["/Applications/NetBeans/NetBeans 6.8 RC2.a...]
/Applications/NetBeans/NetBeans 6.8 RC2.app/Contents/Resources/NetBeans/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:995:in `sh'
(See full trace by running task with --trace)

After:

/Users/hillert/_APPS/jruby-1.4.0/bin/jruby -S gem unpack warbler
Unpacked gem: '/Users/hillert/NetBeansProjects/DX2010/vendor/plugins/warbler-0.9.14'

I haven been running into a few other issues to finally get a simple Rails deployment working on my Tomcat instance, but that is a new blog post to come...

Friday, December 4, 2009

Great Time at the Scala Meeting

I had a great time at the Scala meeting here in Atlanta, tonight. This was the first time for the Scala group to meet in a central location (Same place as the AJUG meetings) and the group was able to double their attendance to almost 20 attendees.

For me it was also very nice to meet Lex Spoon, co-author of 'the book' on Scala 'Programming in Scala'. Also, this is a small world - As a Java Posse fan, it was interesting to realize that John Weathers, the organizer for the Scala Meetup Group and Dick Wall worked together in Atlanta. Besides being a big advocate for Java, Dick is also very involved with the Scala scene in the Bay Area.

Anyway, seeing the potential of Scala combined with the talent we are having here in Atlanta, there is a great bright future for the Scala community, and with it the larger JVM community. These are exciting times!

Wednesday, November 25, 2009

Scala Meetup in Atlanta (3 Dec 2009)

Just updated the AJUG website. recognizing that various JVM languages are gaining popularity, we will be starting to sponsor the Atlanta Scala Meetup (With meeting space). The next meeting is on December 3rd, 2009 at the usual AJUG location (Holiday Inn Select)

For more details, please visit: http://www.ajug.org/ and http://www.meetup.com/atlanta-scala/.

¡Viva La JVM!

Friday, November 20, 2009

Oracle, Flex and MOS - a sign for Java FX?

Ok, while we are still waiting for the Oracla/Sun purchase to go through, there is also lots of speculating about what might happen with Sun's technology portfolio moving forward.

Since the world is moving towards richer UI interfaces for the browser, I am always in the struggle to assess which technology stacks are most appropriate to learn (GWT, Flex, plain HTML + your choice of JavaScript library such as JQuery, YUI etc.). Thus, particularly as a Java developer I am of course interested in the outlook of JavaFX - I certainly "wish" it be successful, but it still seems to be lacking in various areas (Component libraries, JVM modularization, 'community'). Furthermore, there has not been any Oracles/Sun statements about the future of JavaFX as far as I know (Please comment if I am wrong)

There was a higher-level article in InfoWorld yesterday discussing the future of Sun's technologies:
http://www.infoworld.com/d/developer-world/java-what-does-its-future-hold-978

Oracles involvmen into Flex

This brings me to the main trigger point that caused me to this blog entry. A few days back, I read a news article at Heise Online, a large German IT news portal, stating that Oracle has some major issues while switching over to their new support system 'My Oracle Support' (MOS):  


http://www.heise.de/ix/meldung/Oracles-neues-Support-Portal-aergert-Kunden-856450.html

You can read more the issues here:
The more interesting fact, though, is that their entire new support system is implemented in Adobe Flex. Unfortunately, I was unable to find more technical details via Google, but that is a fairly substantial deployment.

I found another interesting little piece of information on stackoverflow:

http://stackoverflow.com/questions/1601444/flex-oracle-open-world-2009

According to James Ward (Flex evangelist at Adobe), Oracle showed more Flex-based applications this year at Oracle OpenWorld 2009 including: My Oracle Support, Social CRM, Siebel Gadgets and Enterprise Manager.

Can you draw any conclusions out of this regarding the future of JavaFX? Probably (hopefully) not, but it shows that Oracle has already made a significant investment into Adobe Flex. 


Adobe Flex and JavaFX in Atlanta

To give you some idea of how the market looks like here in Atlanta, Ga:

At the last meeting of the Atlanta Java Users Group (November 2009), Burr Sutter our group's president asked the group (80+ attendees) whether they use Adobe Flex and a considerable amount of hands went up (I guess at least 1/3).  Nobody in the rooms did anything with JavaFX...

* * * *

PS: On a more frustrating side-note: While writing this blog post I visited http://www.javafx.com/ and my browsers froze (FF on Mac), causing me to re-type a good portion of my blog entry (Sigh). 

Sunday, November 8, 2009

Geeking out with Adobe Flex

Just some quick notes...I had some extra time this weekend and watched several excellent online presentations mostly about Adobe Flex. Adobe is doing a really good job of making their conference presentations freely available.

I worked my way through the following Adobe Max 2009 presentations:
Also, in the past I must have seriously overlooked Adobe TV. Seems to be a pretty neat educational resource. There I watched: Using the Flex Charting Components

Lastly, I ended the weekend by watching Data Visualization and Dashboards by Thomas Gonzales (from 360|Flex Conference). By the way you should also seriously check out his blog: http://www.twgonzalez.com/blog/. There is some good stuff there.

In his presentation, Thomas showed some need examples. This one causes some serious drooling: http://www.brightpointinc.com/flexdemos/googlefinance.html




And just in case you need a gauge on your dashboards: http://www.twgonzalez.com/blog/?p=34 Oh, yeah.

Saturday, November 7, 2009

Rich Charting Options for your RIA/Webapps

I started revisiting my charting solution in jRecruiter. For this fairly basic Java web application, I have been using JFreeChart to provide basic charts (E.g. to illustrate the number of posted jobs over time).

While JFreeChart works great, and it pretty much provides all the charting features you may ever want, it has one disadvantage: It is static. Compared to all the interactive goodness that is possible with RIAs such as Flex, JFreeChart lacks the sugary icing on the top (Mouse overs, AJAX interaction, dynamic drill-down etc.). Therefore, I was investigating my options to add some richness.

Additionally, at work, I am using Google Web Toolkit (GWT) and thus wanted to get an overview about the charting capabilities I have using GWT. One of the options there is gchart. It looks okay, alas not great. What's worse, the project owner abandoned his project; see: http://code.google.com/p/gchart/.

Another option is flot which comes along as a jQuery plugin and uses the HTML canvas tag to do charting.  There is a also a GWT wrapper for flot available called gflot.

The most interesting alternative for GWT, I came across is ofcgwt. It uses Open Flash Chart 2 under the hood and looks pretty good. You could argue that if you use Flash-based charting for your GWT app, why not just implement the entire app in Flex ;-).

On the pure Flash/Flex side, there are first of all the charting components that come with Flexbuilder. In contrast to the open-sourced Flex SDK, the charting components are not free, though. 

While, I was googling for some other options, I saw Axiis - Simply beautiful! Yet, another option is IBM ILOG Elixir, which is free for free sites. They have a very nice compilation of examples: http://www.ilog.com/products/ilogelixir/demos/.

On a low level, you also may want to look at Degrafa (Even if it is just for the gorgeous examples). You can find one interesting charting example at this blog: Nike+ graph using Degrafa/Flex 3.

Lastly, if you don't mind spending some money, you may also look at FusionCharts. At one of my prior engagements we used used in very successfully in a Struts2-based web application. Fusion Charts also comes along in a flavor for Flex - see the samples. There is also a Google Code hosted GWT wrapper available.

This, concludes my little 30k-feet overview/list of 'Rich' charting options. If I missed a good one, please leave a comment!

Sunday, October 25, 2009

NFJS Conference Atlanta 2010 - Day 3

The last day is over. It's been a great conference. Without a doubt, JVM language alternatives dominated the conference sessions. Since I won a book on Scala yesterday, I will checkout that language out next :-)

Today, I attended two sessions by Ken Sipe: "Architecture and Scaling" and "So you want to be an Architect". I particularly enjoyed the latter one, as Ken gave a very pragmatic overview of his view on what the qualifications of an architect ought to be. I had to smile when somebody from the audience asked Ken how as an architect you can possibly keep up with the constant technical innovations and the sheer breath of required knowledge and Ken responded that he doesn't watch any TV. Well, I catch myself weekly listening to the Java Posse, SE Engineering Radio, Parleys.com etc. while doing the dishes, cleaning up etc. And with planning for AJUG meetings, the next Devnexus conference etc. there is not much time left for TV either (Although I still leave some space for my weekly dose of Southpark ;-)

I guess you really have to like what you're doing in order to fulfill the requirements of an Architect.    

During the Birds of Feather (BOF) session I asked the panelists on their opinion about Python, which was never even mentioned at the conference but which at the same time is heavily used in computer science teaching at colleges in Georgia. Their opinion was, that it's white-space issue is just too much of a limiting factor for using it in HTML scripting, using it as a DSL etc. and also that there are some issues with the user community itself. And thus, they said, there were just better alternatives at this point.

During the afternoon I attended 2 sessions by Ted Neward
  • The Busy Java Developer's Guide to Advanced Collections
  • The Busy Java Developer's Guide to Hacking with the JDK 
Both sessions were interesting but I wish Ted had given some more real world examples for use cases of Apache Commons Collections and the Google Collections Library. In his latter talk he showed an example of how to add functionality to core JVM classes. Interesting, but talking about "experimental and highly hacky stuff".

Overall, this was an absolutely wonderful conference. Looking forward to the next one! As always: Jay keep up the good work!

Saturday, October 24, 2009

Don't use Java for New Projects - NFJS Day 2

Day 2 of the No Fluff Just Stuff (NFJS) conference here in Atlanta is over - It's been a good day. It has been another day of excellent speakers and topics. One thread you can see clearly throughout the presentations is:

Java's days are numbered as a language for new development - Viva la JVM!!

I got the sense that you should at least start thinking about an exit strategy. Stuart Halloway was even more outspoken: "Don't use Java for new greenfield development." (Saying that any of the talked about alternatives are better - Scala, Clojure, Ruby and Groovy).

After going to a few sessions that dealt with concurrency, I am certainly not inclined (border-lined scared) to do that kind of stuff in Java. The two languages most talked about at the conference were Scala and Clojure.

The nice thing is, that both language run on the JVM, so you can use the new language features, but are also able to use the vast power of Java libraries, if needed. Once drawback I saw is the fact that both Scala and Clojure can be fairly cryptic, which was an issue that was raised repeatatly by the audience and as well during conversations with fellow developers in between session breaks. Scala at least gives you the ability to write Java like code and then later on as you gain proficiency, you can make your code more concise . From a "power perspective", Scala looks awesome, though.

The sessions I atended to today were:
  1. Tackling Concurrency on the JVM (Venkat Venkat Subramaniam)
  2. Advanced Topics in JMS (Mark Richards)
  3. Java.next: Clojure, Groovy, JRuby, and Scala (Stuart Halloway)
  4. What's New in Spring 3 (Ken Sipe)
Onto the last day now...

NFJS Conference Atlanta 2010 - Day 1

Today was the first day of the NFJS conference here in Atlanta. It's my third time and it is always a great experience in terms of sessions but it is also a good opportunity to network.

First I went to two sessions of Venkat Subramaniam: "Effective Java" and "Programming Scala", both excellent sessions. I get the feeling, it is really time to look beyond Java, particularly if you do anything around concurrency. Not sure if Scala will be it, there seemed to be some contention in the crowd regarding Scala's more cryptic syntax. Although, it looked manageable in my opinion. Nevertheless, I need to check out the Clojure talk tomorrow.

The third session I attended was "Transaction Pitfalls and Strategies" by Mark Richards. At first I was a bit hesitant attending the session but I was glad I did. A related article can be found at IBM DeveloperWorks. The presentation contained some really good stuff.

The first day ended with a very good keynote by Ted Neward on Iconoclasm. Oh well, it is 1am already...better get some sleep for day two of the conference.