These day I'm interested in this technlogy, because I think that many of our site can be "refactored" and implemented with Google Gadgets.
After reading the documentation, I suddenly focused on developing gadget with GWT, my technology of choice. And here I lost a lot of time due to many bugs that affected the GWT version of the library and GWT itself.
This create a sample application, with an EntryPoint and a test service that we'll use to experiment with our gadget.
Scanning files on local disk.
Closing update: new version is ready to start serving.
(this is the Developer Tab of iGoogle, to add it simply click "Add a Tab" and write "Development" in the appearing DialogBox). In the red highlighted bar enter the gadget url, in our case is http://gae-gadget.appspot.com/gaegadget/net.lucamasini.simplegadget.client.GaeGadget.gadget.xml, but it depends on your Google App Engine account of course.
Please remember to uncheck the "Cached" checkbox in this development Tab, so that you'll always see the last version of the Gadget.
[ERROR] No gadget manifest found in ArtifactSet.
Whaaaaat ??? But it's there, in my war\gaegadget folder, generated when I deployed on the App Engine. So what ??
I think that the problem is due to the fact that the original "GadgetLinker" was made for GWT 1.5 that has a different layout and it looks into the public folder. But know we have a real war layout, everything is inside the war folder, generated or not.
So how to fix this ?? Well, we can switch to the old layout, but is something the Eclipse Plugin for GWT doesn't manage very well, and really, I like to look forward and not ahead.
// to the module folder only using the module name.
// generated during the compile phase.
You think it'll work ??? Nope, a new Exception for us !!!!!!
But......I'm using GWT 1.7, so what ?? Also without the filed bug, I would receive the ERROR, this time saying that I passed 1.7 but it expected 1.6.......and here I decided to DISABLE this check, I took this class from gwt-dev-windows, I copied it into my project and then I commented out the check so that the method validHostedHtmlVersion now returns always true.
I know, it's not so good, but I hope that soon they will fix this in GWT version 1.7.1 or whatever and in a new release of Google Gadget.
I found that this is a known problem, Issue 220 of google-gadgets, they closed it as solved but it's still there for me.
You can put this code in any class that is called before the service. For instance I put it into the Gadget entry point itself, so that is ready before anything is executed.
The next problem that arise is the SOP violation that is done by the iGoogle container.
but then I analyzed the rpcUrl and I saw that is not that good. Infact the origin of our gadget is ig.gmodules.com, but the proxy url is calculated as www.ig.gmodules.com. This way, any browser will complain about security violation and will prevent us from actually making the call.
but the iGoogle container seems not to support POST anymore. Infact we are using a legacy layout for our gadgets, as stated in the library overview, and I found in the new documentation that the POST is proxied with a GET, passing POST data into a parameter of the GET itself.
I did some experiment with this new API and I saw that POST works great, so I decided to develop a POC.
Here we tell the container to use the POST Method (1), we put our post data into the request parameter (2) and then we call the Google Gadget makeRequest function (3). The response function (4) then is only a pass-throuh a Java method that know what to do with the returned response (Exception management code is omitted).
Of course we must comment out the code inside the initializeFeature method, that proxy URL is no more valid !!!!
It's a good idea to use GWT-RPC or can be better, for this Gadgets, to use JSON ??
Find a productive way to use GWT with this API. I can't deploy everytime on the GAE remote engine, I have a GAE on my PC !!!!