Friday, March 21, 2008

Using Ofbiz and Wicket - Part I

This article is the first article and probably more to follow on how to use Wicket with Ofbiz.

Both Wicket and Ofbiz are from ASF (Apache Software Foundation) but unfortunately not many ppl seem to have used them together.

Primary reason for me to use them together was complexity and amount of configuration required to use existing Ofbiz frontend frameworks such as screen widget and learning additional technologies such as freemarker, beanshell etc. That lead me to look for a framework which would replace that and provide more - hence Apache Wicket.

Apache Wicket falls into already crowded MVC UI Frameworks consisting of struts, seam amongst others. You can get an entire list from Wicket website :). Yes, it has AJAX support builtin in the framework and yes it has rich set of components both AJAX and otherwise as Wicket extensions and at with integration with popular Javascript AJAX libraries DOJO, YUI and JQuery and few others.

Now that we have some background, lets see what you need to get started and use Wicket "inside" Apache Ofbiz.

  • Ofbiz comes with embedded Tomcat at the time of writing Ofbiz 4.0 came with Tomcat 5.5.23 and fortunately Wicket can be deployed in any standard web container
  • Download wicket binaries from Apache Wicket site, copy them over to your Ofbiz application lib directory where you have your application and other 3rd party jars. I chose to put it under hot-deploy/myapp/webapp/myapp/WEB-INF/lib
  • Add WicketFilter entry to your web.xml file (Note: Both WicketFilter and Ofbiz ContextFilter will be listening on /* requests - so initially there will be chaining of those filters, but for this first article I will ignore that) - Make sure to put WicketFilter entry before ContextFilter so WicketFilter gets called first
  • Write your first Hello World in Wicket by creating your WebApplication and WebPage classes - access the URL (http://localhost:8080/yourappcontext) and see it in action, where yourappcontext is whatever you configured it to be in your ofbiz-component.xml file
In the following articles I will try to cover things like using Ofbiz Entity Engine, Service Engine from wicket and may be how to translate Ofbiz ecommerce application using entirely Wicket. On the way will try to quickly cover some cool UI components both SEO friendly and otherwise.


Roodie said...

Hello, just found this article... Any plans to continue with part 2? :-)

JµGÅL ÐË ©øøL˧T said...

Nice article please write the part 2 of this.. Eagarly waiting for that article