Sunday 17 April 2011

Eclipse, RichFaces & Google App Engine - Step by Step (draft 1.0)

This is a step-by-step tutorial how you can use Eclipse and JBoss RichFaces to develop Java Server Faces applications for Google App Engine platform.

Requirements:

1. At first we need Maven to build the RichFaces sample project for GAE. But before we do it, the JBoss valid repository has to be added to our Maven configuration. The sample of the settings.xml file can be downloaded from here.

2. The project is being built from the special archetypes called richfaces-archetype-gae. All these archetypes can be found on this Nexus website. The following command gets the maven sample project for the RichFaces 4.0 Final:

mvn archetype:generate -DarchetypeGroupId=org.richfaces.archetypes -DarchetypeArtifactId=richfaces-archetype-gae -DarchetypeVersion=4.0.0.Final -DgroupId=[put your group id here] -DartifactId=[put your artifact id here] -Dversion=1.0

The default target of the project is Java 1.5. It is recommended to change this (in the pom.xml file) to 1.6.

In the project folder, the next command can build the sample app:

mvn clean install

We have used the maven to build the sample app, because that way we can get some files which will be required by the RichFaces projects in Eclipse. Especially the static CSS skins for the RichFaces: the static-resource-mappings.properties file and the static-resources folder which includes the necessary files.

We will import the folders and files to the adequate folders of our Eclipse projects. We can use also other sample files from the maven project, like jsp and xhtml files or templates.

3. Our first step in the Eclipse environment should be the installation (if we don't have them yet) of the plugins - the Google Plugin and JBoss Tools RichFaces plugin.

4. If we have them already installed, we may start the New Project -> Google Web Application. We won't use Google Web Toolkit, so we uncheck it in the wizard.

5. For use of the JSF tools of the Eclipse, we should add JSF capabilities to our project. Right click and choose Configure -> Add JSF Capabilities. In the wizard choose any web app runtime, but after that in the project Properties uncheck it (in the Targeted Runtimes), because instead we will use the Google App Engine.

6. Now we have to import (Import -> General -> File System) all the missing dependencies (folders and files) to the project's war folder. It means Apache MyFaces Core, Apache Xalan-J, Unified Expression Language libraries, JBoss RichFaces libraries, JBoss RichFaces CDK's annotations library (optional, available after the maven compilation of the CDK), the SAC library, the CSS parser, Guava and the files which we get in the 2. step.

The sample list of the project dependency files is shown below:



7. To make the draft of the project complete, we have to take care of the configuration files as well - web.xml, appengine-web.xml and the faces-config.xml. You can download the working sample files here:
And VoilĂ !

If we have done all the necessary steps, the Eclipse/RichFaces/GAE web app will run (Run As -> Web Application).

If you need any extra, paid or free, consultancy do not hesitate to ask. Any creative, constructive comments/feedbacks/fixes are also very welcome. :-)

Tomek

Documents which have been very helpful:
 

Saturday 13 June 2009

Web Services with SOAP for PHP and C++

SOA with Web Services (SOAP, etc.) is currently very popular technology. So, how is the support of the technology in the most popular development environments - the web one (PHP) and the desktop/server one (Windows, Visual Studio)?

The PHP has got some built-in (but limited) support for SOAP. If you have a choice and possibility to install PHP extensions, probably the much better choice is the WSO2 Web Services Framework for PHP.

The strange scenario is with the Microsoft Visual Studio support for Web Services. The Microsoft has decided to abandon the SOAP Toolkit in favor of .NET's Windows Communication Foundation.

"Fortunately" the company is going to extend its native support for Web Services. In the Windows 7 there is a new Windows Web Services API which will be available also for XP and Vista. If you can't wait, the gSOAP seems to be the best solution so far, or to use the commercial components like IP*Works!.

Tomek

IDE for PHP and the frameworks

A few days ago I have been doing a quick research on the PHP frameworks and IDEs for PHP. Well, it seems there is only one most advanced IDE with a framework and the IDE is commercial - Embarcadero Delphi for PHP.

There are a few good and bad things about the IDE. The good thing is that Delphi for PHP is based on the VCL for PHP framework which is an open source project (LGPL). The bad ones are that the VCL may be not so free in the future editions and the IDE itself seems to be a bit buggy. I have also read some posts about some performance issues and in my case the IDE (the trial which I had downloaded from the Embarcadero website) has been crashing often.

So, I have decided to look around for the other tools and my choice goes to the free Eclipse PHP Development Tools. Regarding the frameworks I would choose the Zend Framework ("more commercial") or the Symfony ("more open-source" and advanced).

If you are going to use the Eclipse PDT, you may need to integrate the IDE with a PHP debugger. I did it with the xdebug (an open source) and XAMPP. XAMPP has already built-in xdebug (you don't need to download any debugger from any other vendor). Just don't forget that xdebug does not work with the Zend Optimizer or any other Zend extension (you may have to comment out the extensions in the XAMPP's php.ini).

Tomek

Tuesday 20 January 2009

Free Java competitor to .NET and MS Visual Studio

Lately I have made a quick research on the latest free Java technologies and tools for a visual web development. The obvious solution is a JSF technology with AJAX support. But I have noticed there are many component sets and not so many free visual tools. A pretty good comparison about JSF AJAX components can be found here.

There is easy to notice that the best free (the price, IDE support and distribution license) components are ICEfaces and RichFaces. Unfortunately there are a few advantages and disadvantages over each other:
  • JBoss RichFaces is more modern, more flexible and has a better support, especially in relation with such technologies like Hibernate or JBoss Seam;
  • But there is a some danger of that it will become less flexible, stuck to Redhat/JBoss commercial products, e.g. already there is no official support/project for the "competitive" Netbeans IDE and JBoss IDE has already became commercial-only JBoss Developer Studio (JBoss Tools is still free but there is no guarantee it will keep the same functionality like JBoss IDE/Developer Studio)
  • ICEfaces is less modern but not that bad competitor to RichFaces and it has a support for Eclipse, Netbeans and a few more IDEs;
  • Unfortunately Eclipse WTP Web Page Editor is poor in the visual design mode and perhaps that's why JBoss Tools has got own, better JSP/JSF editor, so currently the tools win over ICEfaces' "standard" plug-in for Eclipse;
  • However JBoss Tools with RichFaces Visual Page Editor for Eclipse Ganymede is still in a pre-release stage, while the ICEfaces has already got fully working plug-in for Ganymede;
  • ICEfaces' plug-in for Netbeans is well supported and well working with Netbeans' Visual Web Designer.

So, the final decision - which free component set and which free IDE - is not easy to make. Nowadays I would give the credit to Netbeans + ICEfaces because they are well working with each other and because Netbeans has a support from Sun, the Java creator and one of the Java leaders. Just I dont like some feature of the Netbeans' Visual Web Designer. I mean the size-fixed grid layout of the web page. Fortunately it seems the size-fixed mode can be switched off. :-)

But If I would have more time and I could make a decision in a few months, maybe I would think more about Eclipse + JBoss Tools (the final release for Ganymede), because the Eclipse is a bit faster, gets a more support from the Java community and JBoss products are very modern and well supported too.


Tomek