Building context-aware extensions for Gmail - Deep dive on Gmail contextual gadgets
Enterprise - Dan Holevoet
How much time do your users spend in email everyday? Wouldn’t it be nice if you could seamlessly integrate your apps into the rich context offered by their email and allow them to avoid shifting to new applications for various tasks? Gmail contextual gadgets allow you to register regular expressions and insert gadgets into e-mail messages based on their content. In this session, you’ll learn how to create and distribute these powerful gadgets.
Session type: 201
Attendee requirements: Basic familiarity with gadgets and/or HTML/JS.
Tags: Enterprise, Google Apps, Gadgets, Gmail, ISV, SaaS
Hashtag: #enterprise9
Date: Thursday May 20
Time: 4:45pm-5:45pm
Room: 4
Why contextual gadgets?
- Who uses google apps and gmail?
- How much time are you in gmail?
- Often you get questoins, go into another tab, go to another document, etc.
- Lots of steps and they are incourage you to leave your inbox
- Leaving inbox takes time, context switch, unproductive
- Contextual gadgets allows you to stay in your inbox and get things done
- Match on fields like To, From, Subject, Links, Images, etc.
- Based on matches they trigger a gadget to appear
- This context gets passed to the gadget to do something useful
What makes up a contextual gadget?
- Extractor, Filter, Matches, Decision, Action
- The gadget, one or more extractors, Associated descriptions in the application manifest file (gadgets have these three things)
- What makes a contextual gadget? CML, HTML and JavaScript
- Extractors are essentially pearl compatible regular expressions … two variables: pre-canned by google, the second kind are the customer extractors (coming soon!)
- Custom takes or and makes them and …
- If you want to test custom extractors I’ll see if I can hook you up…
- Limiting pre-canned extractors … filtered to apply only on a subset of emails …
- Application manifest describes the components of the contextual gadgets
- Extractors, filters, gadgets to trigger, scopes for data access…
Version:1.0 StartHTML:0000000167 EndHTML:0000003757 StartFragment:0000000457 EndFragment:0000003741
Best Practices
Using Extractors
- use pre-canned if possible
- Select the smallest necessary scope when matching data (road blocks to be added by domain manager)
- Match on as few emails as possible
Writing your gadget UI
- If nothing to show, handle it gracefully
- Provide an option to expand or collapse your gadget ui, and remember the user’s preference
- Use gadgets.window.adjustHeight() to return unused space back to the user
Fetching Data
- get or post
- container proxies request to remote server (any site on the web)
- Server receives requested data
- Gadget gets the data
Authenticate
Caja*
*will be using Caja in the future
provides white list of safe javascript operations that can be used by untrusted applications …
TicTrac application demo
- Incoming messages are filtered by the recipient list
- The sender and time sent are extracted
- These fields ar sent to a google ap engine to pull out info about the thread
- writing rpc gagets for app enginen, good artcle on google site …
{ 0 comments }









