Saturday, September 17, 2011

Google breadcrumbs - itemscope must be first attribute

I want nice breadcrumbs to show on my Google search results as defined here:

http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=185417

My web framework must use well formed XML templates so instead of the itemscope attribute (a boolean attribute which is not valid xml) I used itemscope="itemscope"

The handy Rich Snippets Testing Tool showed that my breadcrumbs were not being picked up.  After a frustrating process of elimination I realised that the itemscope attribute must be the first attribute in the element or Google will not recognise it.  Thats not very XML friendly but probably a good performance optimisation.

Wednesday, August 24, 2011

Janrain Sign-in

Have been looking at allowing users to sign in to the site I'm building using OpenId and FaceBook.  But what about hotmail users?  People I know have either Hotmail accounts, Google accounts and / or FaceBook accounts.  Perhaps Yahoo also.

Janrain seems to cover all the bases, but when I use their demo and try to login with my FaceBook account it asks for a ton of permissions that I simply do not want most websites to have.  Why the fuck do they need to write on my wall?  "Access my data anytime" just sounds creepy even though its probably a pretty basic permission.

I think a lot of people will react like me when a FaceBook connected site asks for too much - I just hit the back button and do not register.  Go to another site.  Customer lost.  Creepy bastards, wanting too much access to my shit.  Next thing they'll be sending friend requests.

Their Google account integration must be using an older Google API (not OpenId) cos the UI looks a little clunky.  The top of the page says "MYACCOUNT.rpxnow.com is asking for some information from your Google Account". Who or what is rpxnow.com???? Well I know now that it was the old name for Janrain's Engage product but it should NOT be used at the top of my login page.  My site is not rpxnow.com

Sure, if you pay Janrain then you can use your own domain name - but I am cheap and the FaceBook permissions thing is kind of a deal breaker anyway. I'll use App Engine's built in OpenId support directly (that will cover Google, Yahoo, Twitter) then use FaceBook s JavaScript API to add those chaps and maybe, just maybe, add Microsoftcocks own protocol later.

Saturday, July 23, 2011

GWT Developer mode quietly failing

I got this error message starting GWT dev server but no exception in the dev mode console.

"Plugin failed to connect to development mode server at localhost:9997"

It had been running fine last time I debugged my GWT stuff so why not now?

In the end I had old App Engine jars in my class path after upgrading to the latest and greatest.

In summary: check your app classpath and also your WEB-INF/lib folders for older versions still hanging about.

Friday, July 22, 2011

We have Citikey!

Just launched the new version of Citikey a free business listing service for the UK.

www.citikey.co.uk

Its built using the Google stack: Google App Engine, Google Web Toolkit, Google Maps.

Friday, July 1, 2011

com.google.api.client.http.HttpResponseException: 400 Bad Request

I got this error message trying to log into Google App Engine using the Eclipse plugin.  I think the error can occur with any Google API that uses OAuth.

com.google.api.client.http.HttpResponseException: 400 Bad Request

The solution was to correct my system clock.  The time had become incorrect for some weird Windows reason (time to go back to using a mac) and adjusting it fixed the problem.

Wednesday, March 23, 2011

100% height page in IE8

I set body and html to 100% height and then an inner container element to min-height: 100%

This worked in Chrome and Firefox but in IE8 the container element was not stretching to the bottom of the page.

Eventually I found that the GWT date picker widget and photo viewer on the page were not being included in the height of the page.  By setting a specific height on these elements (reserving the space) IE displays the page correctly.  It also makes the page load look smoother.

Tuesday, March 22, 2011

AppEngine logging level

I tried to change the logging level in my Google App Engine app to FINE to see what was happening in Sitebricks.  I edited the /WEB-INF/logging.properties file to read:

.level = INFO
com.google.sitebricks.level = FINE 
 But still only WARN messages were logged to the console.

Finally I realised that on the launcher dialogue panel for GWT I had to also set the level to DEBUG.  But when I did that the console was flooded with GWT compile messages.  This is due to a new bug in GAE's logging where it tries to use the same settings as GWT but gives you no control of the GWT part.

So I installed a simple logging handler to get around this:


Put this in app init
if (isDevelopment()) { Logger.getLogger("").addHandler(new WorkaroundHander()); }
public boolean isDevelopment() { return System.getProperty("com.google.appengine.runtime.environment").equals("Development"); }
private static class WorkaroundHander extends Handler { public WorkaroundHander() { setFormatter(new TextLogFormatter(false)); setLevel(Level.ALL); }
@Override public void publish(LogRecord record) { if (isLoggable(record)) { System.out.println(getFormatter().format(record)); } } 
@Override public void flush() { } @Override public void close() throws SecurityException { } }


Now I I happily see all the FINE messages that Sitebricks has for me.