Thursday, November 20, 2008

Gmail Terminal Theme



I am a big fan of separation of concerns in my projects. Good implementations are so successful when they adhere to this simple concept. Think about the seven layers of the OSI Model or the MVC pattern applied to Web applications.

I simply liked too much GMail Console Theme to miss it here as a good example of how flexible a web application becomes when the concerns are handled in different layers.


Saturday, November 01, 2008

Picasa Slideshow: Creating a Google Gadget

A Google Gadget can be any HTML fragment and so it can contain any logic provided you use Javascript.

As soon as I got a couple of Gadgets in action I felt the necessity to play myself with them. Then I decided to build one which I think could be useful for others.

It is inspired in a good explanation[1] about how to embed a "Picasa Slideshow" (and others picture sharing sites) in a web page.

Take a look at the html page generated from the page that will be included in the XML file specifying a Google Gadget.

Sniff into the code.

Take a closer look to the whole URL. It starts with http://www.nestorurquiza.com/googlegadgets/picasaslideshow. I have hosted a simple Python script there which just accepts a GET parameter (see below) containing an RSS Picasa Album Feed to create a Slide show.

As mentioned above, you need to provide a parameter called rss which is basically the RSS link you can get from your preferred Picasa album. For the example I have used the same from [1]

After you have customized the URL including your own RSS and confirm it works like expected you need to URL Encode the whole customized URL (You can use one of the zillions of Online URL Encoding pages you can find in the WEB. Just Google it!)

Now you need to host an XML file with a similar format like the one you can find at http://localhost:8081/googlegadgets/xml/picasaslideshow.xml. Note the "href" attribute of the "Content" node which contains the custom encoded URL.

The XML URL from above will be used now from the "Add any Gadget From URL" Gadget as I explained in a previous post[2]

Now you can enjoy a slide show (or many since you just need to produce an XML file per album) of your favorite Picasa album in the left pane of your GMail WEB interface.

Of course if you get serious about Gadget programming you could use the official catalog directory[3] from Google to publish them, join the Google Gadget team and so on.


[1] http://philippe.chappuis.googlepages.com/slide-show-media-rss
[2] http://thinkinginsoftware.blogspot.com/2008/10/google-gadgets-everywhere.html
[3] http://www.google.com/ig/directory

Wednesday, October 29, 2008

Google Gadgets Everywhere

Portlets, Mashups, Gadgets are on top of the greatest Web components reusability nowadays.

A Google Search Gadget is perhaps one of those that are on the top of demand for custom websites. But the list is getting bigger opening serious possibilities to increase once again productivity and why not FUN.

Adding a Google Gadget to your personalized Google page or iGoogle is just a matter of browsing Google Gadgets [1] and clicking on the button "Add it now".

But now gadgets are starting to be supported in other personal google pages like GMail. The process is not that straight forward though and I think the "Add it Now" button will pretty soon change to a select box to allow users to include the Gadget in GMail, their own web pages and more! (Desktop perhaps ;-) For now those officially available Gadgets you can use from your own websites are listed in [2].

Here is how you get your Google Gadgets in GMail or other places capable of parsing XML defined modules (Google Gadgets specified by XML resources) Please be advise that not all XML defined modules will work from GMail. It will depend on how generic the final markup is.

1. Locate your "New Gadget URL". It is an XML file which so far can be found somewhere as part of the gadget main page. For example a good place to look for gadgets is of course the official Google Gadgets directory[1]. Locate the "View Source" link to get the URL of the XML file (Gadget URL). Just as a reminder, you can copy the link right clicking in your browser BTW.
2. To add your "Gadget URL" to Gmail be sure you have available a Gadget called "Add any gadget by URL". To get it follow path: Settings|Labs|"Add any gadget by URL"|Enable|Save Changes"
3. Follow path "Settings|Gadgets". Locate "Add any gadget by URL". Insert your new Gadget URL in the text box ...|Add".

[1]
http://www.google.com/ig/directory?type=gadgets
[2] http://www.google.com/ig/directory?synd=open

Sunday, October 26, 2008

Hosting Custom Domains in Google (GAE)

Google Application Engine allows for free hosting of (so far) Python Web applications. I was trying to map my GAE application to my domain nestorurquiza.com which I bought from godaddy.com when I found it was not that straightforward.

Google by the time of this writing is not accepting domain transfers neither mapping "naked" domains [1] which means I cannot host my external bought domain using either of these possibilities.

However if your domain account provider allows for URL Forwarding [2] like godaddy.com does then you can solve your problem as follows:

1. From http://appengine.google.com/ access your application to be mapped. Go to Versions, Add Domain. Click on "Sign up for Google Apps" Complete the form there (Remember your account admin information). Add your domain (for example nestorurquiza.com) and follow instructions in your email or from the web clicking on the link to verify your domain ownership. You might have to add a CNAME for your domain.

2. From your Google Application Engine Control Panel (in my case https://www.google.com/a/nestorurquiza.com) go to "Dashboard" "Service settings" "Add more services" and Enter your appId for "Google App Engine". Add as a Web Address "http://www..."

3. You might want to set up email delivery through Google. In order to make Google your email host follow the steps from "Dashboard|Set up Email" adding the proper MX records as directed there.

4. From your provider DNS admin page (godaddy.com for example) create a CNAME record for www (CNAME www ghs.google.com)

5. Your app should be accessible from www. now. So go to your provider DNS admin page and forward http://your-domain to http://www.your-domain

6. After some minutes your site will be accessible both from naked (just FQDN) domain (http://nestorurquiza.com) or www domain (http://www.nestorurquiza.com)

7. You can configure email, domains and more from your partner page (in my case http://partnerpage.google.com/nestorurquiza.com)

References:
[1] http://www.google.com/support/a/bin/answer.py?answer=91080&hl=en
[2] http://www.google.com/support/a/bin/answer.py?hl=en-in&answer=61057

Monday, October 06, 2008

Using free Services instead of maintaining your site

I have no time to maintain my own site (at least I have not find it so far) so everytime I have a need (Source Code, WIKI, blog, RSS) I look for some free service to host my personal stuff. Of course it also means that I am restricted in security but so far it works for me. Below a list of some of those free services I am currently using:

Blog
RSS/Atom
Source Code
WIKI

Tuesday, September 23, 2008

Friday, September 12, 2008

Should I learn Spring Framework?

I am in the process of migrating an existing Model 1 JSP application to a modern MVC architecture and for several reasons I have picked SpringMVC for that matter.

For my proposal I need not only to justify the move (which is not hard) but be able to use the current workforce (several developers) which is not that familiar with Spring.

I came across a good SpringMVC tutorial that can be used as starting point for beginners ( http://maestric.com/en/doc/java/spring ) and someone posted a question that inspired me to come back and write my opinion about Spring Framework.

SpringMVC is just part of the Spring Framework. Spring is good because it tries as application framework to solve many different problems using "IoC" (Inversion Of Control) or "DI" (Dependency Injection), two terms which means the same for Spring Framework.

Spring promotes the use of POJO ( Plain Old Java Objects ) over EJB ( Enterprise Java Beans) found in J2EE ( Java 2 Enterprise Edition ). This POJO idea is important to eliminate wiring and make your code more testable and less dependent. Thanks to that idea Spring runs in any Application Server and even in simple J2EE Servlet Containers like Tomcat.

Spring is the framework picked by Grails, an attempt to bring more convention over configuration to Java. It is that "convention over configuration" what made "Ruby On Rails" such a well accepted WEB framework.

Programming to Interfaces is crucial in OOP and Spring encourages you to do so. The Spring container will take from you concerns that will allow you as developer concentrate in the specific domain of your application instead of things that are provided out of the box like testing, security, URL mapping, Database Access and much more.

AOP ( Aspect Oriented Programming ) is an important provided capability, another important Ruby On Rails feature that allows you to take care of things like logging from a single point in your application. Spring uses IoC and AOP to inject behaviors to your not animated Objects, keeping them unaware from each other existence while making them reusable from a business perspective.

The future seems to be DSL (Domain Specific languages) and Groovy has proven to be good at it with Grails making web development easier. Ruby has proven the same through Rails. It is Spring the Framework that makes things happen in Grails.

Whether you "should" learn Spring or not I really cannot say. What I can say is that Spring provides a good alternative to J2EE and the ideas behind the Framework are well accepted as a correct way to build Enterprise Applications while applying well known Software Patterns.

Followers