Sunday, June 13, 2010

Google Web Tool Kit on NetBeans IDE

http://code.google.com/webtoolkit/overview.html

Google Web Toolkit (GWT) is a development toolkit for building and optimizing complex browser-based applications. For Starting a project using GWT, you need the following:
1. You will need the Java SDK version 1.5 or later. If necessary, download and install the Java SE Development Kit (JDK) for your platform. Mac users, see Apple's Java developer site to download and install the latest version of the Java Developer Kit available for Mac OS X.
I had a Netbeans 6.8 installed so used it. This post is dedicated to using GWT on Netbeans.
2. Apache Ant is also necessary to run command line arguments. If you don't already have it, install Apache Ant.

Download the Google Web Tool Kit Software Development Kit (gwt-2.0.3.zip) and unzip it to gwt-2.0.3 in your working folder. GWT-SDK does not have an installer application. All the files you need to run and use the SDK are located in the extracted directory.

For using GWT on Netbeans, you have to download and install a plugin for netbeans : gwt4nb from https://gwt4nb.dev.java.net/. Optionally, you can download and install it directly from IDE's plugin Manager:
Chooze Tools>Plugins.
In the Dialog Box click on the available plugins tab and type gwt in the search box on the top-right side. The plugin would appear. Click on the check Box beside it. And click on the install button. The plugin gets installed. Click on close.


The next step is to Create the Source Structure of a GWT Application:
The source structure of the application you create must include the GWT JAR files, the GWT module project configuration file, as well as some standard artifacts such as the Java entry point. Since you are using an IDE, you should not need to manually create all these files. Instead, let a wizard do the work for you. Specifically, the final panel of the New Web Application wizard is very useful in the context of creating a GWT application.
1.Choose File > New Project (Ctrl-Shift-N; ⌘-Shift-N on Mac). Under Categories, select Web (or Java Web). Under Projects, select Web Application. Click Next.
2.In step 2, Name and Location, type HelloGWT in Project Name. You can also specify the location of the project by typing in a path on your computer in Project Location field. Click Next.
3.In the Server and Settings step, select any server that you have registered in the IDE. If you included Tomcat or GlassFish when installing the IDE, they display in the drop-down list.

To register a server in the IDE, click the Add button to open a wizard that guides you through the registration process.
4.Specify the Java version you are using. Click Next.
Note: This tutorial supports GWT version 1.5 and higher. GWT 1.4 does not support Java EE 5, so if you are using this version you must also set the Java EE Version to 1.4. Otherwise, for example, Java EE 5 annotations will cause compilation errors.
5.In the Frameworks step, select GWT.


When you select the GWT framework, the following fields become available:
1) GWT Installation Folder: Specify the path to the folder where you downloaded the Google Web Toolkit at the start of this tutorial. If an incorrect path is specified, a red error message displays and you are not able to complete the wizard.
2) GWT Module: Specifies the name and location of the project module that the IDE will generate when you complete the wizard. The project module is an XML file that configures a GWT application. For example, it is used to specify the class instantiated by GWT when the module is loaded. Note that this field in the wizard also determines the main package of the application. By default, the main package is org.yournamehere and the project module is Main. For purposes of this tutorial, leave the default entries unchanged.
Click Finish. The IDE creates the HelloGWT project. The project contains all of your sources, libraries, and project metadata, such as the project's Ant build script. The project opens in the IDE. You can view its file structure in the Files window and its logical structure in the Projects window.


In the Projects window, right-click the project node and choose Run. The application is built and a web archive (WAR) is created. It is deployed to the server. The server starts, if it is not running already. Your computer's default browser opens and the welcome page of the application is displayed.
Click the button and the text below it disappears.
We have got GWT working on Netbeans and have seen how a sample project can be deployed. Now you are free to play with this fantastic tool!
So Long...

Wednesday, June 9, 2010

Link 'em All!

I'd like to dedicate this post to something that had me bothered some time back.

I personally am on quite a number of social netoworking sites: Facebook, Twitter, LinkedIn, Orkut and more recently gmail has come up with a new feature called as Buzz!! There are a lot more but this post ain't about the over exploitation of the social needs of a social animal. It's an irony that the connectedness on-line is leaving rest everything disconnected, but I'd just save it for another discussion.

Managing all of accounts singlehandedly and maintaining a presence on all can drive one nuts. A great way of making this happen without losing much time and energy is "Linking 'em All".


Let's start by linking Twitter and Facebook. There are several applications using which one can do the same. The most recommended(by me ;)) is Selective Tweets. Through this one can update one's facebook status with one's latest tweet. The advantage of this application is you can control which tweet gets updated as your facebook status.

1) Click to open Selective Tweets.
2) Click Allow.
3) Enter your twitter username in the Text box.
4) Click save.
P.S. : If you're currently using the Twitter application or other application to update your status, remember to remove or disable it so that it doesn't keep updating with all your tweets.