GoogleCalendar.cfc Version 1

I've updated my GoogleCalendar.cfc. It now correctly (I think) handles time zone offsets and recurrences. I also added a simple way to make it refresh its own cache.

I think next I'll make a few convenience functions, like getTodaysEvents, getThisMonthsEvents, getThisWeeksEvents. Suggestions are welcome. (And if you use it on your site, let me know!)

The download is attached to this entry. I'll add a project page later on.

Oh - and I actually included instructions this time, and, thanks to certain events in the past, a license file as well.

Comments

Brian Rinaldi's Gravatar Excellent. Added it to the open-source list...let me know when you add a project page and I will update the listing.
# Posted By Brian Rinaldi | 4/20/06 9:46 PM
John Farrar's Gravatar Did you mean to post the calendar on this page? (Or was it sucked away by the MCP?)
# Posted By John Farrar | 4/20/06 10:18 PM
tony of the weeg clan's Gravatar where do i download it again :) ?

hah.
jk, really.
# Posted By tony of the weeg clan | 4/20/06 10:48 PM
Raymond Camden's Gravatar John, it's on the Download link.
# Posted By Raymond Camden | 4/21/06 5:40 AM
mikeD's Gravatar Not sure if you know about this TB/SB/FF plugin;
"SyncKolab was written to add kolab functionality to thunderbird. It reads a selected Imap folder and synchronizes it with the local address book and calendar."

http://www.gargan.org/extensions/synckolab.html
# Posted By mikeD | 4/21/06 8:52 AM
Jeff Douglas's Gravatar Ray,
Thanks for the great start. I saw the Google calendar a couple of days ago and it about blew my mind. I have a customer that is trying to implement a scheduling calendar. The have been asking about dragging the appointments to different days in the calendar. That would require updating the database with the new date. Do you see a way in the Google API that when an event is moved or dropped to fire an event to a remote server to accomplish this?

Thanx
Jeff Douglas
# Posted By Jeff Douglas | 4/21/06 10:47 AM
Raymond Camden's Gravatar Not sure what you mean. You can't change what happens on Google's site obviously. If you mean doing somethign on your site, sure. My code doesnt support Add yet, but I'm hoping ot add that next week. Then it's a matter of writing the DHTML I guess.
# Posted By Raymond Camden | 4/21/06 11:04 AM
Donnovan Lewis's Gravatar Could be a silly question, but how would you display the comments with /n in the correct positions?
# Posted By Donnovan Lewis | 4/27/06 5:15 PM
Donnovan Lewis's Gravatar and by /n i men \n
# Posted By Donnovan Lewis | 4/27/06 5:16 PM
Raymond Camden's Gravatar Replace any \n with chr(10) and it should do it.
# Posted By Raymond Camden | 4/27/06 5:21 PM
Donnovan Lewis's Gravatar so like this?
<cfset modifiedContent = Replace(r.content, '\n' , '#chr(10)#', 'all')>
# Posted By Donnovan Lewis | 4/27/06 5:24 PM
Donnovan Lewis's Gravatar <cfset modifiedContent = Replace(r.content, '#chr(10)#' , '<br />', 'all')>

seemed to work. i just didnt know what chr i was to replace...i thought it was \n or \r
# Posted By Donnovan Lewis | 4/27/06 5:26 PM
Donnovan Lewis's Gravatar thanks!

also can i edit my comments so i dont have to send a new one everytime i think of something new
# Posted By Donnovan Lewis | 4/27/06 5:27 PM
Scott Fitchet's Gravatar What's the best way to sort by the Google calendar feed's date field?

Using a ColdFusion QoQ to sort on a field named "date" will throw an error.

Is there a way to rename an existing query fieldname?
# Posted By Scott Fitchet | 4/28/06 3:42 PM
Lachie's Gravatar Hi,

What a great tool. Thanks so much!

Please excuse my ignorance, I have not used cfc's at all. I can get the dump to work well from my calendar. But I am having trouble outputting a query onto my page. What code would I use to out put this.

eg

<cfoutput query="r">#author#</cfoutput> or

<cfoutput query="application.gCal.readEntries()">#author#</cfoutput>

I am sorry this is probably way basic and if I could get a nudge in the right direction I would be greatful.

Thanks

Lach
# Posted By Lachie | 6/8/06 12:10 PM
Raymond Camden's Gravatar the first line is the one you want, assuming you named the result "r".
# Posted By Raymond Camden | 6/8/06 9:44 PM
Dylan's Gravatar I'd love to check out your GoogleCalendar.cfc but the download link is dead - is it available anywhere?

Dylan
UCSD School of Medicine
# Posted By Dylan | 8/1/06 1:01 PM
Raymond Camden's Gravatar All fixed now. I blame Microsoft.

For those who want to see a real example, click on the Speaking Engagement tab above.
# Posted By Raymond Camden | 8/1/06 2:37 PM
Marc Fathauer's Gravatar Nice piece. Somehow I was hoping for an inverse version. I'd like to find a way to create a dynamic iCal (Google, Sunbird, Apple etc) formatted calendar from an events database using CFMX. There are a few PHP or Java projects out there but nothing for CFMX.
# Posted By Marc Fathauer | 8/30/06 1:38 PM
Raymond Camden's Gravatar Search my blog. I've got iCal code too. ;) I haven't played with it in a long time though.
# Posted By Raymond Camden | 8/30/06 2:02 PM
Marc Fathauer's Gravatar Cant find iCal searching you blogs. Can you point me in the right direction?

Thanks
# Posted By Marc Fathauer | 8/30/06 3:07 PM
Raymond Camden's Gravatar Took me a while to find it:

http://ray.camdenfamily.com/index.cfm?mode=entry&a...

To be clear - this is an OLD project of mine. It isn't even listed on my projects page yet.
# Posted By Raymond Camden | 8/30/06 3:14 PM
Marc Fathauer's Gravatar We're getting closer. Says "The download is in the My Tools pod" which I also can't find. Thanks for following through so quickly!
# Posted By Marc Fathauer | 8/30/06 4:18 PM
Raymond Camden's Gravatar FOund it.

ray.camdenfamily.com/downloads/ical.zip
# Posted By Raymond Camden | 8/30/06 4:21 PM
Marc Fathauer's Gravatar excellent. thanks
# Posted By Marc Fathauer | 8/30/06 4:22 PM
Leo's Gravatar hi ray,
I saw your gCal application and downloaded it but when i try browsing it, i get this error message "An error occured while Parsing an XML document.
Content is not allowed in prolog." it has something to do with parsing to XML in the file GoogleCalendar.cfc. Anyone experiencing the same thing?
# Posted By Leo | 9/12/06 7:12 AM
Raymond Camden's Gravatar Double check the XML that was pulled down to make sure it is valid.
# Posted By Raymond Camden | 9/12/06 8:27 AM
Leo's Gravatar Please what's the difference between an XML file and MXML file. I only have the MXML file. where can i download the valid XML file from.
# Posted By Leo | 9/12/06 9:35 AM
Raymond Camden's Gravatar Where did you get a MXML file? That is not in my zip. (AFAIK)

The XML comes from Google itself. Basically my CFC grabs the XML feed and parses it.
# Posted By Raymond Camden | 9/12/06 9:42 AM
Leo's Gravatar So where can i get the real zip file from. Sorry for bugging you like this
# Posted By Leo | 9/12/06 10:28 AM
# Posted By Raymond Camden | 9/12/06 10:30 AM
Jay's Gravatar How do you use this component? When I navigate to testa.cfm I get an error that says:

Attribute validation error for tag http.
The tag does not have an attribute called result. The valid attribute(s) are url, port, method, username, password, name, columns, charset, path, file, delimiter, textqualifier, resolveurl, proxyserver, proxyport, proxyUser, proxyPassword, useragent, throwonerror, redirect, firstRowAsHeaders, timeout, multipart, getAsBinary.

What am I missing?
# Posted By Jay | 9/26/06 2:41 PM
Raymond Camden's Gravatar Did you change the URL used? testa.cfm had a test calendar that I do not think is available anymore.
# Posted By Raymond Camden | 9/26/06 3:01 PM
Jay's Gravatar Yes, I changed it to my URL. I removed the results attribute from the <cfhttp> tag in the .cfc file and now get a little further. Now I get the following error:

You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members.

The error occurred in C:\Inetpub\wwwroot\NewSite\GoogleCalendar.cfc: line 184
Called from C:\Inetpub\wwwroot\NewSite\GoogleCalendar.cfc: line 19
Called from C:\Inetpub\wwwroot\NewSite\calendartest.cfm: line 3

182 :       <cfhttp url="#variables.calendarURL#">
183 :       <!--- translate to xml --->
184 :       <cfset variables.calendarXML = xmlParse(results.fileContent)>
185 :    
186 :    </cffunction>

My test page reads like this:

<cfapplication name="gCal">

<cfset reload = false>
<cfif not structKeyExists(application, "gCal") or reload>
   <cfset application.gCal = createObject("component", "GoogleCalendar").init("http://www.google.com/calendar/feeds/rollisoj@gmai...)>
</cfif>

<cfset r = application.gCal.readEntries()>
<cfdump var="#r#">

<cfset m = application.gCal.readMeta()>
<cfdump var="#m#">

Does this require a partcular version of Cold Fusion MX? We are using MX 6.1.

Thanks!
# Posted By Jay | 9/26/06 3:07 PM
Raymond Camden's Gravatar Wait a minute. Your cfhttp doesn't have a results line. It should. Did you modify it? Can you add results="results" back in? This makes it CF7 only though. Are you on CF6?
# Posted By Raymond Camden | 9/26/06 3:15 PM
Jay's Gravatar Yes, we are on MX 6.1. That is probably the problem. I will look into upgrading.

Thanks
# Posted By Jay | 9/26/06 3:17 PM
Raymond Camden's Gravatar Jay, while I was looking I found a bug. Watch my blog.
# Posted By Raymond Camden | 9/26/06 3:33 PM
Jay's Gravatar I upgraded to MX 7.1 and now it appears to be working. I do have one last(I hope) question. The following is returned from the testa.cfm page:

query - Top 0 of 0 Rows

struct
SUBTITLE Jay xxxxx
TITLE Jay xxxxx

I have events scheduled on the calendar but they are not being pulled in. How do I show the data returned from the readEntries query specified in the testa.cfm?

Thanks for all the help.
# Posted By Jay | 9/27/06 8:34 AM
Raymond Camden's Gravatar The struct is the metadata of your calendar. As for the events being zero, I'd suggest testing by requesting the URL you used for the calendar in your browser, and ensure you get valid XML back. If it still won't work, email me directly your XML url.
# Posted By Raymond Camden | 9/27/06 8:54 AM
Jay's Gravatar Thanks. I finally returned my events. I appears that there is a delay between when I update my calendar in Google and when it shows up on my end.
# Posted By Jay | 9/27/06 9:30 AM
Jay's Gravatar Any idea as to why it would be so slow to show the updates on my end? I made changes 20 min. ago that still have not shown up on my end.
# Posted By Jay | 9/27/06 9:49 AM
Raymond Camden's Gravatar It caches the parsing for performance reasons. Recreate the CFC and it will re-fetch.
# Posted By Raymond Camden | 9/27/06 10:09 AM
Raymond Camden's Gravatar Oh - you can all call update() to force a refresh.
# Posted By Raymond Camden | 9/27/06 10:10 AM
Jay's Gravatar Cool...forcing the update worked.

One last thing...I have time offset in the testa.cfm set to -5(EST) but the time is still showing 1-hour behind what my Google Calendar shows. Any ideas?
# Posted By Jay | 9/27/06 10:28 AM
Raymond Camden's Gravatar Um, try -4? :)
# Posted By Raymond Camden | 9/27/06 10:32 AM
Jay's Gravatar Yeah, I already tried that. No change.
# Posted By Jay | 9/27/06 10:45 AM
Raymond Camden's Gravatar Don't forget to update() too when you change.
# Posted By Raymond Camden | 9/27/06 10:50 AM
Raymond Camden's Gravatar Just an FYI, this is an old post. If you downloaded from the download link, you have old code. You want to download from

http://ray.camdenfamily.com/projects/googlecal

A new version was released this morning.
# Posted By Raymond Camden | 9/27/06 10:51 AM
Jay's Gravatar I changed reload to true and it corrected the time problem. Thanks alot for all your help.
# Posted By Jay | 9/27/06 10:57 AM
Raymond Camden's Gravatar Ah yes - load just regets the xml, but the CFC itself was cached with the settings.

Sorry about that. :)
# Posted By Raymond Camden | 9/27/06 10:58 AM
Jay's Gravatar This is probably a silly question, but how do I loop through the structure to return each set of events? I tried using <cfloop collection= but that did not seem to work. Thanks
# Posted By Jay | 9/27/06 3:57 PM
Raymond Camden's Gravatar It returns a query. So you can use cfloop query= or cfoutput query=. TO see all the columns, just cfdump it.
# Posted By Raymond Camden | 9/27/06 4:03 PM
Russ's Gravatar Sorry for cross posting, but this seems a more active post...
Why is it that no matter what I put in the calender url var on the testa page, it returns the Holidays calendar? It is obviously a cache issue, but I don't know how to fix it
Thanks
Russ
# Posted By Russ | 1/11/07 11:29 AM
Raymond Camden's Gravatar Russ, I did respond on the other thread. My code allows you to pass a URl variable to reinit the application scoped cfc. Just pass that variable in the query string, or just stop using the application cache and use a normal variables-scoped variable.
# Posted By Raymond Camden | 1/11/07 11:35 AM
Russ's Gravatar Ray,
Yea I couldn't remember which post I commented on, and I have a new spam filter that I haven't got control of yet, so I didn't get any reply responce...sorry:[
I did figure out the reinit variable and of course it works great!
thanks,
I will have to have a look at that wish list, I am sure I can work the costs into my next project..
# Posted By Russ | 1/11/07 2:09 PM
Raymond Camden's Gravatar Glad you got it working.
# Posted By Raymond Camden | 1/11/07 7:15 PM
Jay's Gravatar I'm back again with a new question. Just the other day I installed the latest Microsoft updates on the web server and now Cold Fusion is throwing the following error:

Local variable results on line 179 must be grouped at the top of the function body.


The error occurred in C:\Inetpub\wwwroot\Application.cfm: line 16

14 :
15 : <cfif not structKeyExists(application, "gCal") or structKeyExists(url, "reinit")>
16 :    <cfset application.gCal = createObject("component", "GoogleCalendar").init(calendar,-4)>
17 : </cfif>
18 :

Any ideas as to why this would start occuring after a simple Windows update?

Thanks
# Posted By Jay | 2/5/07 2:17 PM
Raymond Camden's Gravatar I don't know. Are you running CF7?
# Posted By Raymond Camden | 2/5/07 2:47 PM
Jay's Gravatar Yes CF7.
# Posted By Jay | 2/5/07 3:18 PM
Raymond Camden's Gravatar Are you running the code from THIS blog entry, or googlecal.riaforge.org? If from here, please get the one from RIAFOrge.
# Posted By Raymond Camden | 2/5/07 3:21 PM
Jay's Gravatar Well I downloaded the new code. I am past the error now. But now it is not pulling in all my events on the calendar. If I do a readentries() and then dump them using cfdump I only get 25 entries and none for today. I am also doing an update prior to the readentries. Any ideas?
# Posted By Jay | 2/5/07 4:41 PM
Raymond Camden's Gravatar Don't forget my code caches. You can run update() on the CFC to force it to refresh.
# Posted By Raymond Camden | 2/5/07 5:06 PM
Jay's Gravatar I have done this on my cfm page:

<cfset u = application.gCal.update()>

Shouldn't this be refreshing the cache?
# Posted By Jay | 2/6/07 8:43 AM
Raymond Camden's Gravatar Hmm. Well, maybe send me your code directly. Email it to me.
# Posted By Raymond Camden | 2/6/07 8:45 AM
joe's Gravatar I can't get the GoogleCalendar.cfc to work. I tried setting the calendar variable in testa.cfm to 1) my public xml url and then 2) my private xml url. It threw an error at <cfthrow message="Unable to load #variables.calendaruRL# - Invalid XML returned.">. Any ideas?
# Posted By joe | 4/9/07 3:03 PM
joe's Gravatar I'm running CF MX7 and v 1.4 of gCal
# Posted By joe | 4/9/07 3:04 PM
Raymond Camden's Gravatar You want to use your private url, and modify it as the docs say. Please send me your url directly if you want and I can test locally.
# Posted By Raymond Camden | 4/9/07 4:33 PM
joe's Gravatar once you test, please remove my comment with my private feed and I'll reset the private url.

thx!
# Posted By joe | 4/10/07 1:35 PM
Raymond Camden's Gravatar When I ran your calendar, it worked fine. It parsed the metadata of your calendar ok, but returned no events. I viewed your XML directly (w/o gcal) and I can confirm that there are no events for this calendar showing up. Are you sure you have stuff scheduled? Because according to the XML (again, totally outside of my code) there are no events.
# Posted By Raymond Camden | 4/11/07 7:31 AM
Kris Night's Gravatar I get the following when trying to run your unmodified code with my data supplied in the test file.

The request has exceeded the allowable time limit Tag: cfhttp


The error occurred in C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc: line 181
Called from C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc: line 19
Called from C:\CFusionMX7\wwwroot\ows\Calendar\testa.cfm: line 5

179 :       
180 :       <!--- download xml --->
181 :       <cfhttp url="#variables.calendarURL#" result="results">
182 :       <!--- translate to xml --->
183 :       <cfset variables.calendarXML = xmlParse(results.fileContent)>



--------------------------------------------------------------------------------

Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.


Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)
Remote Address 127.0.0.1
Referrer
Date/Time 29-Jun-07 12:22 PM

Stack Trace (click to expand)
at cfGoogleCalendar2ecfc117159695$funcLOAD.runFunction(C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc:181) at cfGoogleCalendar2ecfc117159695$funcINIT.runFunction(C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc:19) at cftesta2ecfm1528332162.runPage(C:\CFusionMX7\wwwroot\ows\Calendar\testa.cfm:5)


coldfusion.runtime.RequestTimedOutException: The request has exceeded the allowable time limit Tag: cfhttp
   at coldfusion.tagext.net.HttpTag.checkTimeout(HttpTag.java:1905)
   at coldfusion.tagext.net.HttpTag.doEndTag(HttpTag.java:1005)
   at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1916)
   at cfGoogleCalendar2ecfc117159695$funcLOAD.runFunction(C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc:181)
   at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:344)
   at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
   at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:290)
   at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:254)
   at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
   at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:207)
   at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:169)
   at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1807)
   at cfGoogleCalendar2ecfc117159695$funcINIT.runFunction(C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc:19)
   at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:344)
   at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
   at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:290)
   at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:254)
   at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
   at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:207)
   at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:169)
   at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:194)
   at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:146)
   at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:1634)
   at cftesta2ecfm1528332162.runPage(C:\CFusionMX7\wwwroot\ows\Calendar\testa.cfm:5)
   at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
   at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
   at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
   at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:225)
   at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
   at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
   at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
   at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
   at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
   at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
   at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
   at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
   at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
   at coldfusion.CfmServlet.service(CfmServlet.java:107)
   at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
   at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
   at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
   at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
   at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
   at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
   at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
   at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
   at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
   at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
# Posted By Kris Night | 6/29/07 12:28 PM
Raymond Camden's Gravatar Is your server on a network that can hit Google? Did you have some network issues? As the error says, CFHTTP timed out, so it could be any of that. Does your CF server kill requests longer than N seconds? If so, considering adding a cfsettinng to up the timeout a bit.
# Posted By Raymond Camden | 6/29/07 12:43 PM
Dale Hans's Gravatar I downloaded your CFC, changed the URL to my calendar and tried to run the testa.cfm file. I get an error:

An error occured while Parsing an XML document.
Content is not allowed in prolog.

The error occurred in C:\Inetpub\wwwroot\_Gcal\GoogleCalendar.cfc: line 183
Called from C:\Inetpub\wwwroot\_Gcal\GoogleCalendar.cfc: line 19
Called from C:\Inetpub\wwwroot\_Gcal\testa.cfm: line 5

181 :       <cfhttp url="#variables.calendarURL#" result="results">
182 :       <!--- translate to xml --->
183 :       <cfset variables.calendarXML = xmlParse(results.fileContent)>
184 :    
185 :    </cffunction>
# Posted By Dale Hans | 7/24/07 11:08 PM
Raymond Camden's Gravatar Add a test before line 183. cfdump results and add a cfabort. Look at the result and see what is in the XML.
# Posted By Raymond Camden | 7/25/07 6:21 AM
Dale Hans's Gravatar Oops, I had not made my calendar public and it was notifying me of that fact.

But, that brings up the question, is there a way to identify myself to Google in the request so that the calendar can remain private and yet I can get my own results via your cfc?
# Posted By Dale Hans | 7/25/07 9:01 AM
Dale Hans's Gravatar Sorry for the premature reply. I missed the obvious and changed public to private and it worked fine it appears.
# Posted By Dale Hans | 7/25/07 9:03 AM
Dale Hans's Gravatar I see from the notes that you were considering doing a mofification to allow uploading of events to Google. Is that still in the works?
# Posted By Dale Hans | 7/25/07 3:01 PM
Raymond Camden's Gravatar No, not yet. Unfortunately the Google API is a royal pain in the you know what.
# Posted By Raymond Camden | 7/25/07 4:08 PM
Dale Hans's Gravatar I have the upload of a single event working now. So far, it only writes to the primary calendar for the user. It does an authentication using the e-mail / password for the user.

I am continuing to work to add Creation of reoccuring events and possibly, create to a secondary calendar. I will send you my complete version of the GoogleCalendar.cfc when I get reoccuring done for your critique.
# Posted By Dale Hans | 7/29/07 12:00 AM
Raymond Camden's Gravatar Sounds good, Dale. Thanks.
# Posted By Raymond Camden | 7/29/07 9:02 AM
Steve-O's Gravatar I was looking at the cfc to see if it would work for our needs. However, upon changing the url to our calendar location and running the test page, we get the following error:

Error Executing Database Query.

Query Of Queries runtime error.
The select column reference [starttime] is not a column in any of the tables of the FROM table list.

The error occurred in C:\CFusionMX7\CustomTags\GoogleCalendar.cfc: line 580
Called from C:\Apache2\htdocs\dev\gcal.cfm: line 14
Called from C:\CFusionMX7\CustomTags\GoogleCalendar.cfc: line 580
Called from C:\Apache2\htdocs\dev\gcal.cfm: line 14

578 :          select   *
579 :          from   q
580 :          where   starttime > <cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">
581 :          </cfquery>
582 :       </cfif>


Any ideas here? We're running CF 7

Thanks!
# Posted By Steve-O | 1/9/08 4:48 PM
Raymond Camden's Gravatar Did you download it here? Or the latest version here:

http://googlecal.riaforge.org/
# Posted By Raymond Camden | 1/9/08 5:15 PM
Mark's Gravatar Does this work with cf8? I have been trying and all that it pulls is the holiday calendar! I have been testing with my gmail account and my gmail for domains calendar, which does not have a private address! Any ideas with that??
# Posted By Mark | 1/28/08 10:02 PM
Raymond Camden's Gravatar It does work with CF8. If you want to send me your code directly, I'll test, and keep your urls private.
# Posted By Raymond Camden | 1/29/08 8:12 AM
Mark's Gravatar Thanks Ray, it works fine! I forgot to reinit so it was cached.
# Posted By Mark | 1/29/08 8:18 AM
Mike's Gravatar I did not see any "System Requirements" in the documentation in the downloaded files from this page: http://www.coldfusionjedi.com/index.cfm/2006/4/20/...

I'm assuming that is my problem... When I run on CF MX I get the error:

Local variable colNames on line 41 must be grouped at the top of the function body.

Will this only run on certain versions of coldfusion???
# Posted By Mike | 4/10/08 1:05 PM
Raymond Camden's Gravatar Please download from here instead:

http://googlecal.riaforge.org/

It requires CF7.
# Posted By Raymond Camden | 4/10/08 1:16 PM
Ann's Gravatar I downloaded the latest version from http://googlecal.riaforge.org/ and I am getting this error message:

The method 'getCalendars' could not be found in component D:\casemed_web\newhome\GoogleCalendar.cfc.
Check to ensure that the method is defined, and that it is spelled correctly.
# Posted By Ann | 9/4/08 3:43 PM
Raymond Camden's Gravatar Odd. I just redownloaded from RIAForge, and I clearly see:

<cffunction name="getCalendars" access="public" returnType="query" output="false" hint="Returns all the calendars for the user.">

Did you maybe typo the call? getCalenders?
# Posted By Raymond Camden | 9/4/08 8:47 PM
Matt's Gravatar I'm having trouble with a recurring event, i have one that runs weekly every thursday The query does return that its an event that is weekly but it doesnt put in a date or time, it appears that the parseRecurrenceDate() function doesnt return anything just an empty string. Is this something i've done wrong or not doing? or can fix
the recurring string thats returned seems very difficult to parse, in the google api docs it says about using a getTimes() function but i can't figure out how i would use it.
# Posted By Matt | 12/7/08 6:16 PM
Matt's Gravatar Me again...
I managed to get it to show a date in the date field by changing the following line
In the parseRecurrenceDate function in GoogleCalendar.cfc

I changed
<cfset datestring = reFindNoCase("DTSTART;VALUE=DATE:([0-9]+)", arguments.recurrence,1,true)>

to
<cfset datestring = reFindNoCase("DTSTART;TZID=Europe/London:([0-9]+)", arguments.recurrence,1,true)>

BUT this obviously wont work if your timezone isnt europe/London

If anyone has a cleaner nicer solution or i am doing something silly please let me know.
# Posted By Matt | 12/7/08 6:26 PM
Raymond Camden's Gravatar Matt, would you mind emailing me your login info and the name of the event in question? Obviously I won't abuse it, but it will help me test.
# Posted By Raymond Camden | 12/7/08 6:37 PM
Matt's Gravatar I just sent you a mail through your contact form.
It really is difficult to get this working actually because this type of event i need the time as well and when it does the parseRecurrenceDate function there is no time information and this is a recurring event that happens between 7pm and 9pm which i'll need to display.

The bit where you do this parsing it hurting my head i'm wondering if i can get the start time and end time in the output somehow for recurring events.
# Posted By Matt | 12/7/08 6:56 PM