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.

Download attached file.

Archived Comments

Comment 1 by Brian Rinaldi posted on 4/21/2006 at 6:46 AM

Excellent. Added it to the open-source list...let me know when you add a project page and I will update the listing.

Comment 2 by John Farrar posted on 4/21/2006 at 7:18 AM

Did you mean to post the calendar on this page? (Or was it sucked away by the MCP?)

Comment 3 by tony of the weeg clan posted on 4/21/2006 at 7:48 AM

where do i download it again :) ?

hah.
jk, really.

Comment 4 by Raymond Camden posted on 4/21/2006 at 2:40 PM

John, it's on the Download link.

Comment 5 by mikeD posted on 4/21/2006 at 5:52 PM

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/exten...

Comment 6 by Jeff Douglas posted on 4/21/2006 at 7:47 PM

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

Comment 7 by Raymond Camden posted on 4/21/2006 at 8:04 PM

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.

Comment 8 by Donnovan Lewis posted on 4/28/2006 at 2:15 AM

Could be a silly question, but how would you display the comments with /n in the correct positions?

Comment 9 by Donnovan Lewis posted on 4/28/2006 at 2:16 AM

and by /n i men \n

Comment 10 by Raymond Camden posted on 4/28/2006 at 2:21 AM

Replace any \n with chr(10) and it should do it.

Comment 11 by Donnovan Lewis posted on 4/28/2006 at 2:24 AM

so like this?
<cfset modifiedContent = Replace(r.content, '\n' , '#chr(10)#', 'all')>

Comment 12 by Donnovan Lewis posted on 4/28/2006 at 2:26 AM

<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

Comment 13 by Donnovan Lewis posted on 4/28/2006 at 2:27 AM

thanks!

also can i edit my comments so i dont have to send a new one everytime i think of something new

Comment 14 by Scott Fitchet posted on 4/29/2006 at 12:42 AM

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?

Comment 15 by Lachie posted on 6/8/2006 at 9:10 PM

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

Comment 16 by Raymond Camden posted on 6/9/2006 at 6:44 AM

the first line is the one you want, assuming you named the result "r".

Comment 17 by Dylan posted on 8/1/2006 at 10:01 PM

I'd love to check out your GoogleCalendar.cfc but the download link is dead - is it available anywhere?

Dylan
UCSD School of Medicine

Comment 18 by Raymond Camden posted on 8/1/2006 at 11:37 PM

All fixed now. I blame Microsoft.

For those who want to see a real example, click on the Speaking Engagement tab above.

Comment 19 by Marc Fathauer posted on 8/30/2006 at 10:38 PM

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.

Comment 20 by Raymond Camden posted on 8/30/2006 at 11:02 PM

Search my blog. I've got iCal code too. ;) I haven't played with it in a long time though.

Comment 21 by Marc Fathauer posted on 8/31/2006 at 12:07 AM

Cant find iCal searching you blogs. Can you point me in the right direction?

Thanks

Comment 22 by Raymond Camden posted on 8/31/2006 at 12:14 AM

Took me a while to find it:

http://ray.camdenfamily.com...

To be clear - this is an OLD project of mine. It isn't even listed on my projects page yet.

Comment 23 by Marc Fathauer posted on 8/31/2006 at 1:18 AM

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!

Comment 24 by Raymond Camden posted on 8/31/2006 at 1:21 AM
Comment 25 by Marc Fathauer posted on 8/31/2006 at 1:22 AM

excellent. thanks

Comment 26 by Leo posted on 9/12/2006 at 4:12 PM

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?

Comment 27 by Raymond Camden posted on 9/12/2006 at 5:27 PM

Double check the XML that was pulled down to make sure it is valid.

Comment 28 by Leo posted on 9/12/2006 at 6:35 PM

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.

Comment 29 by Raymond Camden posted on 9/12/2006 at 6:42 PM

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.

Comment 30 by Leo posted on 9/12/2006 at 7:28 PM

So where can i get the real zip file from. Sorry for bugging you like this

Comment 31 by Raymond Camden posted on 9/12/2006 at 7:30 PM
Comment 32 by Jay posted on 9/26/2006 at 11:41 PM

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?

Comment 33 by Raymond Camden posted on 9/27/2006 at 12:01 AM

Did you change the URL used? testa.cfm had a test calendar that I do not think is available anymore.

Comment 34 by Jay posted on 9/27/2006 at 12:07 AM

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/calen...",-5)>
</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!

Comment 35 by Raymond Camden posted on 9/27/2006 at 12:15 AM

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?

Comment 36 by Jay posted on 9/27/2006 at 12:17 AM

Yes, we are on MX 6.1. That is probably the problem. I will look into upgrading.

Thanks

Comment 37 by Raymond Camden posted on 9/27/2006 at 12:33 AM

Jay, while I was looking I found a bug. Watch my blog.

Comment 38 by Jay posted on 9/27/2006 at 5:34 PM

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.

Comment 39 by Raymond Camden posted on 9/27/2006 at 5:54 PM

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.

Comment 40 by Jay posted on 9/27/2006 at 6:30 PM

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.

Comment 41 by Jay posted on 9/27/2006 at 6:49 PM

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.

Comment 42 by Raymond Camden posted on 9/27/2006 at 7:09 PM

It caches the parsing for performance reasons. Recreate the CFC and it will re-fetch.

Comment 43 by Raymond Camden posted on 9/27/2006 at 7:10 PM

Oh - you can all call update() to force a refresh.

Comment 44 by Jay posted on 9/27/2006 at 7:28 PM

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?

Comment 45 by Raymond Camden posted on 9/27/2006 at 7:32 PM

Um, try -4? :)

Comment 46 by Jay posted on 9/27/2006 at 7:45 PM

Yeah, I already tried that. No change.

Comment 47 by Raymond Camden posted on 9/27/2006 at 7:50 PM

Don't forget to update() too when you change.

Comment 48 by Raymond Camden posted on 9/27/2006 at 7:51 PM

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...

A new version was released this morning.

Comment 49 by Jay posted on 9/27/2006 at 7:57 PM

I changed reload to true and it corrected the time problem. Thanks alot for all your help.

Comment 50 by Raymond Camden posted on 9/27/2006 at 7:58 PM

Ah yes - load just regets the xml, but the CFC itself was cached with the settings.

Sorry about that. :)

Comment 51 by Jay posted on 9/28/2006 at 12:57 AM

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

Comment 52 by Raymond Camden posted on 9/28/2006 at 1:03 AM

It returns a query. So you can use cfloop query= or cfoutput query=. TO see all the columns, just cfdump it.

Comment 53 by Russ posted on 1/11/2007 at 10:29 PM

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

Comment 54 by Raymond Camden posted on 1/11/2007 at 10:35 PM

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.

Comment 55 by Russ posted on 1/12/2007 at 1:09 AM

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..

Comment 56 by Raymond Camden posted on 1/12/2007 at 6:15 AM

Glad you got it working.

Comment 57 by Jay posted on 2/6/2007 at 1:17 AM

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

Comment 58 by Raymond Camden posted on 2/6/2007 at 1:47 AM

I don't know. Are you running CF7?

Comment 59 by Jay posted on 2/6/2007 at 2:18 AM

Yes CF7.

Comment 60 by Raymond Camden posted on 2/6/2007 at 2:21 AM

Are you running the code from THIS blog entry, or googlecal.riaforge.org? If from here, please get the one from RIAFOrge.

Comment 61 by Jay posted on 2/6/2007 at 3:41 AM

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?

Comment 62 by Raymond Camden posted on 2/6/2007 at 4:06 AM

Don't forget my code caches. You can run update() on the CFC to force it to refresh.

Comment 63 by Jay posted on 2/6/2007 at 7:43 PM

I have done this on my cfm page:

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

Shouldn't this be refreshing the cache?

Comment 64 by Raymond Camden posted on 2/6/2007 at 7:45 PM

Hmm. Well, maybe send me your code directly. Email it to me.

Comment 65 by joe posted on 4/10/2007 at 12:03 AM

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?

Comment 66 by joe posted on 4/10/2007 at 12:04 AM

I'm running CF MX7 and v 1.4 of gCal

Comment 67 by Raymond Camden posted on 4/10/2007 at 1:33 AM

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.

Comment 68 by joe posted on 4/10/2007 at 10:35 PM

once you test, please remove my comment with my private feed and I'll reset the private url.

thx!

Comment 69 by Raymond Camden posted on 4/11/2007 at 4:31 PM

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.

Comment 70 by Kris Night posted on 6/29/2007 at 9:28 PM

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(ClientScopePersistenceFilte...: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.WorkerThrea...(WorkerThread.java:66)

Comment 71 by Raymond Camden posted on 6/29/2007 at 9:43 PM

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.

Comment 72 by Dale Hans posted on 7/25/2007 at 8:08 AM

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>

Comment 73 by Raymond Camden posted on 7/25/2007 at 3:21 PM

Add a test before line 183. cfdump results and add a cfabort. Look at the result and see what is in the XML.

Comment 74 by Dale Hans posted on 7/25/2007 at 6:01 PM

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?

Comment 75 by Dale Hans posted on 7/25/2007 at 6:03 PM

Sorry for the premature reply. I missed the obvious and changed public to private and it worked fine it appears.

Comment 76 by Dale Hans posted on 7/26/2007 at 12:01 AM

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?

Comment 77 by Raymond Camden posted on 7/26/2007 at 1:08 AM

No, not yet. Unfortunately the Google API is a royal pain in the you know what.

Comment 78 by Dale Hans posted on 7/29/2007 at 9:00 AM

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.

Comment 79 by Raymond Camden posted on 7/29/2007 at 6:02 PM

Sounds good, Dale. Thanks.

Comment 80 by Steve-O posted on 1/10/2008 at 3:48 AM

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!

Comment 81 by Raymond Camden posted on 1/10/2008 at 4:15 AM

Did you download it here? Or the latest version here:

http://googlecal.riaforge.org/

Comment 82 by Mark posted on 1/29/2008 at 9:02 AM

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??

Comment 83 by Raymond Camden posted on 1/29/2008 at 7:12 PM

It does work with CF8. If you want to send me your code directly, I'll test, and keep your urls private.

Comment 84 by Mark posted on 1/29/2008 at 7:18 PM

Thanks Ray, it works fine! I forgot to reinit so it was cached.

Comment 85 by Mike posted on 4/10/2008 at 10:05 PM

I did not see any "System Requirements" in the documentation in the downloaded files from this page: http://www.coldfusionjedi.c...

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???

Comment 86 by Raymond Camden posted on 4/10/2008 at 10:16 PM

Please download from here instead:

http://googlecal.riaforge.org/

It requires CF7.

Comment 87 by Ann posted on 9/5/2008 at 12:43 AM

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.

Comment 88 by Raymond Camden posted on 9/5/2008 at 5:47 AM

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?

Comment 89 by Matt posted on 12/8/2008 at 5:16 AM

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.

Comment 90 by Matt posted on 12/8/2008 at 5:26 AM

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.

Comment 91 by Raymond Camden posted on 12/8/2008 at 5:37 AM

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.

Comment 92 by Matt posted on 12/8/2008 at 5:56 AM

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.

Comment 93 by Kate Juliff posted on 1/6/2010 at 9:36 PM

Re comment 92 - only getting 25 entries. I had the same problem as no matter what url parameters I gave, it defaulted to 25, Fixed by a change in the cfc
<cfoutput>

<cfhttp url="#variables.calendarURL#" method="GET">

</cfoutput>
<!--- translate to xml --->
<cfset variables.calendarXML = xmlParse(cfhttp.fileContent)>

Comment 94 by Matt posted on 1/22/2010 at 9:41 PM

Just wanted to say that the script doesn't appear to work in Railo, I think it's because of the 302 redirect here:

<cfhttp url="#curl#" result="result">
<cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#variables.authcode#">
</cfhttp>

I get an xml error because the cfhttp retrieves the 302 redirect html rather than the feed.

I don't think this is anything to do with your api though. Would be greatful if you have any ideas on how I can workaround this

Comment 95 by Raymond Camden posted on 1/22/2010 at 11:18 PM

I'm a bit confused - you are saying that when Railo uses CFHTTP it gets a different result?

Comment 96 by Matt posted on 1/26/2010 at 2:08 AM

Thats right. I think it is a problem with Railo though.

I had to create the feed on a cf8 server and read that instead so that railo didnt see the redirect that happens on the google calendar api.

the google api does a redirect before the data is returned

Comment 97 by Dan posted on 10/7/2011 at 12:20 AM

Hi. I'm having a real struggle getting started. Any help is greatly appreciated. Starting with testa.cfm, I get the error:
"Content is not allowed in prolog. The error occurred in C:\...\GoogleCalendar.cfc: line 427"

I modified 'calendar' to my own 'private' string, and set my username and password in application.gCal = createObject

Thoughts?

Comment 98 by Raymond Camden posted on 10/7/2011 at 6:11 AM

Are you using the version here or the one at RIAForge?

Comment 99 by Dan posted on 10/10/2011 at 10:42 PM

RIA Forge

Comment 100 by Raymond Camden posted on 10/10/2011 at 11:45 PM

I'll have to take a look later this week. Got another bug as well.

Comment 101 by Raymond Camden posted on 10/11/2011 at 6:05 PM

I'm not able to reproduce this. If you are comfortable with it, email me your username/password so I can reproduce locally.

Comment 102 by Dan posted on 10/12/2011 at 8:13 PM

ok. Thanks for your help.
I've run into the same error on my dev machine and on our live server. I'll see if I can get another dev machine to throw it as well.

Comment 103 by Raymond Camden posted on 10/12/2011 at 8:14 PM

Any debugging you can do - just let me know.

Comment 104 by Dan posted on 10/12/2011 at 10:25 PM

Had a small breakthrough. Upgrading to the latest CF9 patch seems to have cured the problem. Will report with more later.

Comment 105 by Murray Hopkins posted on 12/14/2011 at 4:08 AM

Hi Ray,

Am I correct in assuming that this cfc would need changing to work with OAuth2 (as per your post http://www.raymondcamden.co...

If so, is anyone doing that (before I reinvent the wheel!)

Thanks,
Murray

Comment 106 by Raymond Camden posted on 12/14/2011 at 4:12 AM

I had someone pay me to do some basic work on the new CFC. He was cool with me sharing it. It supports getCalendars and addEvent, but that's it. But the new API, _once_ you get past oauth, is pretty easy.

I'm going to release this - but not this week. Please remind me (and if you need it _right now_, email me).

Comment 107 by Murray Hopkins posted on 12/14/2011 at 4:55 AM

Thanks Ray. It would be great to get a copy of that and if you were releasing it in the next couple of weeks that would be fantastic. Once I have the basics in place I can add and extend as required (and share back).

And thanks for your oauth post - it helped greatly to get my head around the 'dance'.

Best wishes,
Murray

Comment 108 by Raymond Camden posted on 1/3/2012 at 6:37 AM

Wow, a whole year later. ;) Sorry. I've made a zip of the bits. This isn't really supported, but it works under OAUTH2 now and will - one day - become the new version.

http://www.raymondcamden.co...

Comment 109 by Sam Pinizzotto posted on 1/13/2012 at 5:10 AM

How do I sort the calendar dates/entries?

Comment 110 by Raymond Camden posted on 1/13/2012 at 6:47 AM

This version doesn't support it. You would need to use query of queries.

Comment 111 by Sam Pinizzotto posted on 1/13/2012 at 10:26 PM

OK..I'll try that. Is there a new version?

How can I get more than 25 results back from google?

Thanks!

Comment 112 by Raymond Camden posted on 1/13/2012 at 11:02 PM

Sam, there are a few new updates. The latest released version is here:

http://googlecal.riaforge.org/

The one linked to above was the beginning of a new version using Google's very latest API. I do not support it, but it is there if you would like.

The version at RIAForge supports maxevents. Google defaults to 25, but you can ask for up to 100 I believe.

Comment 113 by Muhammad Iftkhar posted on 2/10/2013 at 12:33 AM

Hi Ray,

Thanks for your useful code and continuous help to ColdFusion community. Ray, Google has released V3 and all we are waiting for your update on Google Calender. Hope soon we will see this.

Thanks

Best wishes,
Iftkhar

Comment 114 by Raymond Camden posted on 2/11/2013 at 7:49 PM

No plans for this anytime soon. Pretty swamped. :(