How-to: Use the new JavaScript-based GData client library within GMEJason Cooper |
|
This sample application demonstrates how to use the new JavaScript client library for GData can be used within the Google Mashup Editor.
More...
Take me there!
This sample demonstrates how the JavaScript client library can be used to extend the feature set of an application created with the Google Mashup Editor (GME). Since GME-created mashups can only create and update entries stored in built-in feeds, they can easily take advantage of the new JavaScript-based GData library which allows for editing any GData-based feed, including those from Google Calendar as this sample shows.
After signing into the mashup itself, an AuthSub sign-in screen appears, requesting account credentials to access private user feeds. The URL authenticated against in this example is http://www.google.com/calendar/feeds, which allows the library to access all calendar and event feeds associated with the authenticated user. Following this, the library pulls the owncalendars feed and displays the returned calendar names in a drop-down menu. After a calendar is selected, the events feed for that calendar is accessed. All future events associated with that calendar are then copied into a custom GME feed and displayed as a list. This list is conveniently integrated with a GME calendar module, which displays hyperlinks for dates with one or more events. Clicking one of these links will highlight the event listing associated with that day, just as clicking an event entry highlights the date of that event in the calendar module.
Above this list is a GME item module which allows for creating new events for the selected calendar. After entering a short title and start and end dates/times, the JavaScript library and GME's own JavaScript API are used together to pull this information out of the item module and into a new calendarEventEntry object, which is inserted into the GData Calendar feed. If successful, a new entry is added to the GME list as well.
|
|