We talk about SAP a lot on this blog. Blathering on about Fiori and HANA and Gateway doesn’t feel like blathering to us…we actually geek out about this stuff and love to share our passions. It’s our primary area of technical expertise. I mean, it would frankly be alarming if we didn’t talk about SAP so much.
When we started brainstorming what would eventually become CloudSimple, we realized that we had a pretty significant learning journey ahead. Gluing two platforms together means knowing a lot about both platforms. We came to the table knowing a lot about the SAP side of the equation, and much much less about the Google side. Added bonus: as we searched around we realized that there was not a lot of existing material out there on the web for us to learn from. We’d have to learn by inventing.
In this entry, I’ll take you on a high-level look at the Google Apps Script add-on pieces of the CloudSimple architecture. Coming soon: an entry for the SAP pieces.
CloudSimple is built on the Google Apps Script add-ons platform. It runs user interface code in standard HTML/CSS/Javascript, includes server-side processing in Apps Script (a flavor of Javascript), and in the next release incorporates Google App Engine for processing user settings stored in Google Cloud SQL. (I’ll write more about App Engine and Cloud SQL in a later entry).
User Interface
There are two key pieces where users interact with CloudSimple:
- The settings dialog where they choose a connection and data source.
- HTML is served with HtmlService, which works in conjunction with the SpreadsheetApp class to present a UI inside the spreadsheet itself. In this case, showModalDialog() is the method of choice.
- The HTML file is created and stored in the Apps Script web IDE. I was actually shocked when I started using the Apps Script IDE – it includes a full debugger! That lives on the web! Pretty slick.
- Until recently, markup and scripts that were sent to HtmlService were sanitized and compiled by Caja, which meant that some features/libraries of javascript would not work. Google has since relaxed that constraint.
- The right-anchored sidebar where users input filters, choose fields, and execute read/updates
- Same idea as the settings dialog for HTML, except it is presented with the showSidebar() method.
- Note that the sidebar is confined – you always get the same width to place your items. You’d think this would be rather restricting, but for us it was a good example of how obstacles prompt creativity.
Back End
- The cool thing with Apps Script is that you have access to tons of APIs that Google provides into their other systems. I can make calls to fetch web data, mess around with spreadsheets, data ranges, send emails, create other Google documents, and much much more.
- (Aside) I think that this more or less reflects the modern programmer’s challenge: glue together lots of APIs into a coherent thing – which may then even become an API for something else.
- Storing non-relational data (like user settings for an individual spreadsheet) can be accomplished with the Properties service. In CloudSimple, I put together a cool mashup of the long-term Properties service and the transient (but fast) Cache service to speed up a few things in the user experience.
- If you’ve programmed in VBA for Microsoft Excel, you know that almost any programmatic changes you make to a spreadsheet appear basically instantaneously in the user interface. Not so with Apps Script. You have to remember that the code you write executes on Google’s servers and then the changes to the spreadsheet are propagated to the user’s view of the spreadsheet in their browser window. Similarly, any changes made in the user’s view of the spreadsheet may experience a brief delay before Google’s internal representation of the spreadsheet reflects those changes.