I updated both my GoogleCal and GoogleContacts projects tonight. GoogleCal was updated to use the new base CFC code GoogleContacts uses. I also added basic support for some of the API methods for getting events that Google supports. Both projects now support hosted Google accounts as well.
I'm considering maybe merging these two projects into one uber project, like I did for my cfYahoo package. Any opinions?
Archived Comments
one ring to rule them all
I like them separate, actually, since I am interested only in the calendar portion. You know, basing my thoughts on what is good for all of humanity by the yardstick of my own very personal needs ;).
this is a great piece, thanks for writing it and posting it!
i did run into a problem, though, that i wanted to post about in case it will help someone else. i noticed that there is a difference in default charsets between CF7 and CF8. this was causing me to get a weird prolog error on CF7 servers (tested on two to confirm), because it was coming back empty. i tested a bit of urlencoding and a snippet from ben nadel's site (he ran into a similar prolog error), and still was getting an error. then i finally realized i needed to specifiy the charset="utf-8" on the cfhttp because the server versions were different. once i did this, everything worked on both CF7 and CF8. seems so small, but took me a few hours to figure out. oh well, i am now on my way to ninja cf status for having spent time to figure it out.
thanks again.
Ray,
I've used a number of your tips and tools over the year, the googleCalendar CFC is great.
It really offered great insight.
Thank you
Glad to help, Armando.
I love this CFC! I'm very excited to implement this so I can control the way my calendars are displayed. Being new to CF, I'm having a slight problem applying this to my site, so any help would be appreciated. The issue I'm having is I have four different calendars (5 including the US Holidays calendar) that I need to incorporate in different combinations in different places on my site. My site is for my band program's three competitive ensembles, so each of them has its' own independent calendar, and then there's a separate calendar for events that apply to all three groups. Basically, I set this up so that one group's calendar wouldn't be cluttered up by another group's rehearsals and such, but I also wouldn't have to enter events that apply to all the groups three times for their three calendars. Google makes it easy to display multiple calendars together in the iframe, but obviously customizing the CSS is impossible.
What I've tried is running the GoogleCalendar CFC for each of my calendars, and then using Q of Q with UNION to combine them into one master recordset. This yields the following error:
Query Of Queries runtime error.
All resulting columns of queries in a SELECT statement that contains a UNION operator must have corresponding types.
Columns with index number equal 1 have diffent types (DATE, VARCHAR).
As near as I can tell, the issue is that some of the Date values are empty strings, and that, understandably, is fouling things up. Is there another way to combine these multiple recordsets to work around this error?
It isn't as sexy, but, build a new query by hand (queryNew), loop over each of the queries and manually add the records one by one. Not sexy, but shouldn't be terribly slow either, but you probably want to cache the results.
Although.... how in the heck do you have a calendar entry where the date is empty??
From the looks of it, the way Google codes full-day events, the StartTime and EndTime are both set to just the date (e.g. 2013-02-07), and the Date field is blank. Events with set times have timestamps as the values in all three fields, though. My original thought was that the all-day events were being saved as varchar data types since there's no specified time, and the scheduled events as timestamps, but since the error specifically called out the Date column, that doesn't seem to be the (only?) problem. It doesn't look like any of the Date fields have date-only values, they're all either empty strings or timestamps.
Seems like a strange way to do it to me, but whatever. I'll try your idea. Thanks a million!
My goal is that once I get the display set up the way I want it, I'll use your code to add events directly on my site, and then I can tell Google what to put in those fields. Unfortunately, everything that's been entered through Google's interface is a little screwy at the moment!
Jeremy - a bit late here - but it sounds like maybe then this is a bug with my CFC. Like it isn't reading those events right. Agreed?