G'day, fellow codemonkeys!

Does ANYone out there know how to write to event comments via php/
zend?  I can't find a snippet or sample anywhere to lighthouse me
through the storm, here ..

My problem originated with not being able to export comments through
the GUI when I tried to export/import (ie. move) calendars around.
All the data EXCEPT for the comments is successfully ported, but
leaving that data behind made the boss very unhappy, so now I'm trying
to programmatically move events between calendars (the project is to
consolidate several calendars into one - sounded WAY easy when i first
said that i'd take care of it).

Anyhow, it seems that when I'm saving an event with comments I need to
first create/save the event and then look it up to find the eventid,
so as to determine the comments feed url that i need to write to -
I've been able to do that much so far.  However, I'm having problems
understanding the datamodel, namespaces, refs and such for actually
writing a new entry to the comments feed.  What does a snippet of zend
writing comments to an event look like?

Any help would be much appreciated - I've emailed a few google people
about this with no joy as of yet.  I've also banged my head into the
wall for a couple days .. no joy there, either. :)

Thanks alot,
Brian.

On Feb 4, 12:22 am, Ray Baxter <[email protected]> wrote:
> I don't see that the Google JS API has methods to POST comments. I
> think that you'll have to roll your own, using the XMLHTTPRequest
> object, or maybe one of the JS libraries has some interface to the
> HTTP methods.
>
> I have posted essentially all my code for doing this. I'm using Ruby
> to POST XML strings. There's not much more to it.
>
> I am surprised that you don't see your comments. If there were a
> problem with cross site authentication, I don't think that yourcommentPOSTs 
> would succeed. I would think that you would get an error
> code.
>
> Ray
>
>
>
> On Tue, Feb 3, 2009 at 12:03 PM, Dag <[email protected]> wrote:
>
> > But how do you do the POST? is it 'insertEntry' ?
> > Could you post your code, especially the part that does the POST?
>
> > Thank you,
> > Tim
> > BTW, I have read your other postings discussing getting thecomment
> >feedetc. They were helpful. I can add acommentthrough the GUI, get
> > hold of thecommentfeedin javascript and even add to thatcomment
> >feed. I checked this by examining the entries in thecommentfield and
> > printing them to console.
>
> > console.log('entries length', entries.length);
> > console.log(entries[0].getId().getValue());
> > console.log(entries[0].getContent().getText());
> > However thecommentis gone the next time I get hold of thecomment
> >feed. NOTE: I am using a local copy of
> >http://gdata-javascript-client.googlecode.com/svn/trunk/samples/calen...
>
> > Maybe there is a problem with cross site authentication?
> > THANKS!
>
> > On Feb 2, 8:29 pm, Ray Baxter <[email protected]> wrote:
> >> You need to POST to thecommentfeedurl.
>
> >>http://www.google.com/calendar/feeds/userID/visibility/full/eventID/c...
>
> >> Also, do you know that the comments are not included in a fullfeed?
> >> To see comments, you need to request either thecommentfeedurl, or a
> >> compositefeed.
>
> >> I just created an event through the UI and added andcomment, also
> >> through the UI. Once I had that, I requested thecommentfeedfor my
> >> new event, and saw the originalcomment. Then I was able to
> >> successfully POST an number of comments to thecommentfeedurl.
>
> >> The full xml that I posted was:
>
> >> <entry xmlns="http://www.w3.org/2005/Atom";>
> >> <content type="html">Hello</content>
> >> <author><name>Calendar
> >> Maven</name><email>[email protected]</email></author>
> >> </entry>
>
> >> Thiscommentappears in thecommentfeedand in the UI. If you don't
> >> make the content type="html" then the content does not appear in the
> >> UI. I'm not sure why that is.
>
> >> Ray
>
> >> On Mon, Feb 2, 2009 at 6:47 PM,Dag<[email protected]> wrote:
>
> >> > How do you do the POST? I tried adding this function
>
> >> > function postwith(to,p) {
> >> >  var myForm = document.createElement("form");
> >> >  myForm.method="post" ;
> >> >  myForm.enctype = "application/atom+xml";
> >> >  myForm.action = to ;
> >> >  for (var k in p) {
> >> >    var myInput = document.createElement("input") ;
> >> >    myInput.setAttribute("name", k) ;
> >> >    myInput.setAttribute("value", p[k]);
> >> >    myForm.appendChild(myInput) ;
> >> >  }
> >> >  document.body.appendChild(myForm) ;
> >> >  myForm.submit() ;
> >> >  document.body.removeChild(myForm) ;
> >> > }
>
> >> > but that won't change the enctype.
>
> >> > I tried to call POST on the google.gdata.calendar.CalendarService
> >> > object but it isn't supported.
>
> >> > Also I tried:
> >> > varfeed= feedRoot.feed;
> >> > var entries =feed.entry;
> >> > console.log('entries length', entries.length);
> >> > console.log(entries[0].getId().getValue());
> >> > console.log(entries[0].getContent().getText());
> >> >  //feed.insertEntry(ce, hie, herror);
> >> >feed.addEntry(ce);
>
> >> > And the entry was inserted into thefeedbut it doesn't stay in there.
> >> > The next time I look at thefeed, the addedcommentis gone.
> >> > I know there is something tricky going on because none of google's
> >> > examples are examples of adding comments.
> >> > What is the secret?
> >> > Thanks,
> >> > Tim
>
> >> > On Jan 31, 10:20 pm, Ray Baxter <[email protected]> wrote:
> >> >> Yourcommentxml should look like the example 
> >> >> here:http://code.google.com/apis/gdata/elements.html#gdComments
>
> >> >> Ray
>
> >> >> On Wed, Jan 28, 2009 at 3:39 AM, talby101
>
> >> >> <[email protected]> wrote:
>
> >> >> > Hi there I am trying to post acommentto my event using the data api
> >> >> > but failing with a HTTP 500 error - Error addingcomment. I really
> >> >> > wish i could RTFM but the docs are pretty scant on this one (if not
> >> >> > please notify)...
>
> >> >> > (All i could find doc wise : 
> >> >> > ttp://code.google.com/support/bin/answer.py?answer=64265&topic=10365
> >> >> > )
>
> >> >> > Here is my post:
>
> >> >> > <atom:entry   xmlns:atom='http://www.w3.org/2005/Atom'
> >> >> >                        xmlns:gd='http://schemas.google.com/g/2005'
> >> >> >                        xmlns:gCal='http://schemas.google.com/gCal/
> >> >> > 2005'
> >> >> >                        xmlns:gAcl='http://schemas.google.com/acl/
> >> >> > 2007'
> >> >> >                        xmlns:batch='http://schemas.google.com/gdata/
> >> >> > batch'>
> >> >> > <atom:category scheme='http://schemas.google.com/g/2005#kind'
> >> >> > term='http://schemas.google.com/g/2005#message'/>
> >> >> > <atom:content type='text'>some text</atom:content>
> >> >> > <atom:author>
> >> >> > <atom:name>some name</atom:name>
> >> >> > <atom:email>some email</atom:email>
> >> >> > </atom:author>
> >> >> > </atom:entry>
>
> >> >> > Can anyone see anything wrong with that ? My content type is
> >> >> > application/atom+xml and method is POST.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to