- Finished a java library for authenticating to and pulling from google’s spreadsheets, the methods for querying are:
- listSpreadsheets
- listColumns
- executeQuery
- Now I’ll use these 3 methods to create methods that will be called by the client such as:
- getUniqueCounts
- or a paginated table query
- The library is mavenized but I don’t want to mavenize the actual google app engine project since it works so well with the GAE Eclipse Plugin, so I simply added a pom to the project which copies the dependencies to the correct folder. Whenever there’s a dependency change, we just have to run ‘mvn package’ and all the dependencies should be updated but it won’t actually build anything.
- Now I’m trying to bridge the gap between the 3 simple methods and the client
Category Archives: Mike
Mike 9.9.2011
- After lots of flailing I was able to query the spreadsheet service using the HTTP method detailed here and got some JSON back. Now I need to be able to convert this to objects.
- I keep thinking some google library somewhere will tie in to this query service but as far as I can tell, the only reference is on the page I just linked. I think I’m stuck writing my own http query library and result parser (obiously I’ll take advantage of some JSON library but they aren’t are easy to use as the Flex one).
Mike 9.8.11
- I was able to create and deploy a flex webapp on the google app engine and access it both from the web and from my phone. This will hopefully work as a back end for our mobile application.
- Now I need to figure out how to do what I was doing in Flex:
- Authenticate:
- The suggested method is OAuth 2.0 which is a pain for the user. You construct a URL to a google authentication site specifying your application and what services you want access to. You then open that URL for the user who enters their username and password in to googles site. The site then displays a token string for the user to copy back in to your application which you use to make calls.
- The oldest, easiest method is ClientLogin which is what I was using in Flex. The user enters their information in to you application and you use it to make requests. However, in Flex I was doing their through HTTP Requests which is much different in java.
- I implemented an OAuth 2.0 version in about 20 minutes. There were several good examples of how to do this in java.
- After many hours of trying different things I was able to implement a ClientLogin version as well. All the existing examples of ClientLogin appear to be outdated as the gdata library has under gone major changes (multiple times) since the original release.
- List Spreadsheets
- Once authenticated, this was (relatively) easy. I used the gdata spreadsheet api to connect to the spreadsheet service and list the available spreadsheets for a user. No where does it list what other jars are required dependencies so I figured it out through trial and error. However, we can only execute very limited queries from API.
- Queries
- To run any kind of decent query we need another API.
- The one I was using in Flex was the Google Query Language in the Google Visualization API but this is only available in JavaScript or via HTTP Requests. So I will probably have to write some function that make HTTP Requests like I did in Flex.
- gdata-java-client vs google-api-java-client
- gdata-java-client is the “old” version of the java implementation I have been using and will probably do everything we need and won’t be deprecated for several years. It is not mavenized, most examples are out dated and no longer work, and development has been halted.
- google-api-java-client is the brand new version. It is mavenized, has examples, and more APIs, and has plans for adding more but is in beta.
- Authenticate:
Mike 9.6.2011
- Continued working on library to access and query google spreadsheets
- Methods working to list tables, list columns, and execute a simple generic query
- Due to some limits of the google query language, we can’t execute what we need in a single query, such as list how many distinct values are in each column
- Going to investigate Google App Engine as a possible solution
Mike 8.31.2011
- Created a project and artifact called Log4Flex which contains the flex logging code / UI to start separating out FGMFlexUtils
- Started on the google-services library
- Created a general authenticator that will get a token to make authenticated http requests to any of the gdata services (tokens are service specific)
- Added some test cases for the authenticator
- Created a GoogleSpreadsheetService class which will handle executing queries on spreadsheets
- While testing it, I couldn’t get it to work like the prototype code until I realized it worked within an air app but not inside a browser. The HTTP Requests from within the browser were getting messed with and I kept getting not authenticated error messages. So apparently the authentication method I am using will only work for AIR / Mobile apps.
Mike 8.30.2011
Looking in to some difficulties we may encounter when trying to remotely access google data services with URL requests only:
- Authentication – http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html details how we may request a service token which can be used for further data requests. Each token is service specific so here’s a list of services and their (not obvious) names http://code.google.com/apis/gdata/faq.html#clientlogin
- List Spreadsheets? – once we know a spreadsheet’s name / key we can make queries against it, but how do we get a list of spreadsheets?
- column name resolution? – google identifies all their columns using ‘A’, ‘B’, ‘C’… from left to right. What we refer to as the column name they call the label. Queries are made using the identifiers and not the labels so changing column order changes the query results. We may not care though…
Mike 8.29.2011
- Created a few applications that use the phone’s accelerometers using the Flint particle system. The accelerometer API is pretty simple: there’s a constantly updated variable for for the acceleration along each axis and it is normalized (1.0 = 1 G).
- Looking in to ESRI ArcGIS library for making a flex mobile map. It’s this simple

Mike 8.25.2011
Investigating Flex mobile devlopment:
- Read through the adobe mobile devlopment pdf and several other basic guides
- Tested out Charts and scrolling
- Tested out Large Datagrids and data paging (1000 rows and 10 columns seems to respond just fine with paging)
- Looks like we’ll be writing lots of custom queries based on user interaction so I was looking for some kind object based query API instead of lots of string manipulation, not much luck yet
Mike 8.18.2011
Started working on moving the report viewing flex application to the new build structure and ran in to some problems building modules with maven. So I decided to find out why the files built with maven differ so much from those built with flash builder. It turns out to be quite a rabbit hole. Here’s the best article I’ve found so far:
http://workflowflash.com/122648/make-flex-mojos-maven-project-behave-like-flashbuilder.php
Basically you have to add the following command to your ‘additional compiler arguments’ in flash builder, ‘-dump-config filename.xml’, and add the following to your maven build, ‘<configurationReport>true</configurationReport>’. These will output files detailing all compiler arguments, linked libraries, etc. Then the name of the game is make one look like the other. Each file of compiler arguments in only about 700 lines long… so how hard could it be.
Here’s the latest pom:
Mike 8.12.2011
- Mavenized the webdesk-examples project and added it to the hierarchy.
- Added an ‘all’ profile to the webdesk maven build since the skins and examples project can take awhile (over 1 minute each) to build, the default is not to build these but instead use existing artifacts. You must run something like ‘mvn clean package -P all’ in order to rebuild everything.
- Also, by default, the examples are not included in the final war, you must again use the all profile
- I noticed Hudson hasn’t been rebuilding my stuff as I check it in, apparently you have to turn SCM polling on and give it a schedule. I set webdesk suite to check svn every 5 minutes after the hour
Mike 8.11.2011
- Worked with Phil to create a document detailing how to set up a new m2eclipse project
- Figured out to to compile CSS files to SWFs using maven, then how to do multiple ones in one maven project, then how to copy them to the WAR
- Added a webdesk-skins project to the webdesk hierarchy
- Moved the webdesk configuration files and other client assets in to the webdesk-webapp project so they are all in one place instead of duplicated in 2
Mike 8.9.2011
Continuing to work on the m2Eclipse workspace / project setup:
- Now going with a combination of flat and hierarchical: a hierarchical project containing webdesk and it’s unique projects, then common libraries as separate flat projects like FlexUtils and JavaUtils
- Got a working version of this compiling on Phil’s machine
- Moving more actual code in to the build instead just prototype stuff
Need to do / figure out the following:
- Put new version in Hudson
- Figure out how to compile css files in to skin swfs with maven
- figure out how to compile and include modules
- Add in or rewrite the server code to logging in
- Figure out how to share configuration files in the maven and flex builds (the same file needs to end up in different places)
Mike 8.3.2011
- Went over the prototype project structure with Phil, decided to change from hierarchical to flat
- Restructured the build, fixed a few errors, set up eclipse files, and checked it in, waiting to try it out on Phil’s machine
Mike 8.2.2011
- Completed the prototype build structure of a multimodule flex web app
- Created a set of instructions for setting up a workspace and checking out / building, ran through it once with a fresh eclipse
- Fixed a memory issue with the Hudson server
- put the new webdesk build on Hudson
Mike 7.22.2011
Working on prototyping a multi-module Flex / Java webapp project that is mavenized, easy to check out and build, and works in eclipse. Starting out with a ‘Hello World’ type Flex webapp. The projects are structured something like this:
- Parent Project
- Flex Projects
- Flex Utils
- WebDesk Core
- WebDesk Client
- Other Clients…
- Java Projects
- Java Utils
- User Service
- Data Service
- etc…
- WebApp Wrapper
- Flex Projects
So far it works pretty well. Every project is empty but it all builds and everything ends up in the WAR and deploys to Tomcat in 1 command. Working on adding the Log4J logger and displaying the log screen in the flex app which will be the real test.

You must be logged in to post a comment.