Dan Holevoet, Google Developer Team
Want to weigh in on this topic? Discuss on Buzz
Posted by Ryan Boyd, Google Apps Marketplace Team
<Extension id="oneBarLink" type="link"><Name>ScheduleOnce</Name><Url>http://apps.scheduleonce.com/render.aspx?source=${DOMAIN_NAME}&page=dashboard</Url></Extension>
https://www.google.com/a/${DOMAIN_NAME}/images/logo.gif?alpha=1
// Create a service for making 2LO requestsGOAuthRequestFactory requestFactory = new GOAuthRequestFactory("cl", "yourCompany-YourAppName-v1");requestFactory.ConsumerKey = <CONSUMER_KEY>;requestFactory.ConsumerSecret = <CONSUMER_SECERT>;CalendarService service = new CalendarService(requestFactory.ApplicationName);service.RequestFactory = requestFactory;
function initGadget(){//Initializing the gadget tabstabs.addTab("Pending", { contentContainer: document.getElementById("pending_id"), callback: callback });tabs.addTab("Scheduled", { contentContainer: document.getElementById("scheduled_id"), callback: callback });tabs.displayTabs(false);refresh();//Initializing the OpenSocial data requestvar idspec = opensocial.newIdSpec({ "userId" : "OWNER"});var req = opensocial.newDataRequest();req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER), "get_owner");req.send(openSocialResponse);}
function makePOSTRequest(){var url = baseURL + "GadgetHandler.aspx";var postdata = {opensocialid : openSocialID};var params = {};postdata = gadgets.io.encodeValues(postdata);params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST;params[gadgets.io.RequestParameters.POST_DATA]= postdata;params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;gadgets.io.makeRequest(url, responseHandler, params);}
// Retrieving the calendar events for a time frameEventQuery query = new EventQuery();string uriString = "https://www.google.com/calendar/feeds/" + username + "/private/full?ctz=utc";query.Uri = new Uri(uriString);query.StartTime = <time frame start>;query.EndTime = <time frame end>;EventFeed calFeed = service.Query(query);AtomEntryCollection entryColl = calFeed.Entries;
// Creating a calendarCalendarEntry calendar = new CalendarEntry();calendar.Title.Text = <calendar title>;calendar.Summary.Text = <calendar description>;calendar.TimeZone = <calendar timezone>;Uri postUri = new Uri("https://www.google.com/calendar/feeds/default/owncalendars/full");CalendarEntry createdCalendar = (CalendarEntry)service.Insert(postUri, calendar);
// Creating a meetingEventEntry entry = new EventEntry();entry.Title.Text = <meeting Title>;When eventTime = new When(<meeting startTime>, <meeting endTime>);entry.Times.Add(eventTime);Uri postUri = new Uri("https://www.google.com/calendar/feeds/" + username + "/private/full?ctz=utc");AtomEntry insertedEntry = service.Insert(postUri, entry);