And this:

> The XML looks fine to me, and passes validation.  I've tried it
> without the feed tags, without any of the options for an entry, and
> with all of them, and any other combination I thought made sense, and
> none of it works.

was the last paragraph of the email.  The <feed> element was necessary
to make the xml validate, but I have tried it without it as well (and
without the <?xml> tag too, so it was exactly the same as the example)
but none of that worked.  The addition of a <feed> tag certainly
doesn't make it the same xml as a new event though.  In fact, the
example for creating a new event ALSO leaves off the <feed> tag, so I
fail to see how you make that association.

Now can anyone give me an actual answer to my query?  Preferably
someone who's given more than a cursory glance at the original mail?
Or even someone who understands the API?

Rich
Sent from London, Eng, United Kingdom


On Fri, Aug 7, 2009 at 16:45, Ray Baxter<[email protected]> wrote:
> That is not the xml that you posted yesterday and assigned to the newCal
> variable.
> The xml that you posted yesterday was a <feed> element, not an <entry>
> element.
> Ray
>
> On Thu, Aug 6, 2009 at 11:36 PM, Phyrefly <[email protected]> wrote:
>>
>> the xml in that example is this:
>> <entry xmlns='http://www.w3.org/2005/Atom'
>>       xmlns:gd='http://schemas.google.com/g/2005'
>>       xmlns:gCal='http://schemas.google.com/gCal/2005'>
>>  <title type='text'>Little League Schedule</title>
>>  <summary type='text'>This calendar contains the practice schedule
>> and game times.</summary>
>>  <gCal:timezone value='America/Los_Angeles'></gCal:timezone>
>>  <gCal:hidden value='false'></gCal:hidden>
>>  <gCal:color value='#2952A3'></gCal:color>
>>  <gd:where rel='' label='' valueString='Oakland'></gd:where>
>> </entry>
>>
>> All I've done to it was to add the <xml> tag and the <feed> tag (both
>> of which I've tried without).  Is the xml in the example incorrect?
>> Can you tell me exactly what's wrong with my xml?
>>
>> Rich
>>
>>
>>
>> On Fri, Aug 7, 2009 at 07:08, Ray Baxter<[email protected]> wrote:
>> > You are POSTing the xml for creating an event. You should POST the xml
>> > for
>> > creating a calendar.
>> > Follow the example here:
>> >
>> > http://code.google.com/apis/calendar/docs/2.0/developers_guide_protocol.html#CreatingCalendars
>> > Ray
>> >
>> > On Thu, Aug 6, 2009 at 8:07 AM, phyrefly <[email protected]>
>> > wrote:
>> >>
>> >> I am writing an iGoogle gadget, which calls the calendar API to add
>> >> and read events from its own calendar within a user's collection.  So
>> >> far, I've managed to get OAuth working, and retrieved a list of
>> >> calendars, now I'm trying to create the requested calendar name if it
>> >> doesn't exist.
>> >>
>> >> I create an xml string, and send it to the url as documented in the
>> >> Calendar API, but no luck...  I get an error:
>> >> com.sun.syndication.io.ParsingFeedException: Invalid XML
>> >> every time.  I don't get any more detail than that.  Can anyone help
>> >> me with this?
>> >>
>> >> Code snippets follow:
>> >>
>> >> var newCal = '<?xml version="1.0" encoding="UTF-8"?>';
>> >> newCal = newCal + '<feed xmlns="http://www.w3.org/2005/Atom";';
>> >> newCal = newCal + 'xmlns:openSearch="http://a9.com/-/spec/
>> >> opensearchrss/1.0/"';
>> >> newCal = newCal + 'xmlns:gCal="http://schemas.google.com/gCal/2005";';
>> >> newCal = newCal + 'xmlns:gd="http://schemas.google.com/g/2005";>';
>> >> newCal = newCal + '<updated>2009-08-06T12:25:03.873Z</updated>';
>> >> newCal = newCal + '<category scheme="http://schemas.google.com/g/
>> >> 2005#kind"';
>> >> newCal = newCal + 'term="http://schemas.google.com/gCal/
>> >> 2005#calendarmeta"/>';
>> >> newCal = newCal + '<entry xmlns=\'http://www.w3.org/2005/Atom\'\n';
>> >> newCal = newCal + ' xmlns:gd=\'http://schemas.google.com/g/2005\'\n';
>> >> newCal = newCal + ' xmlns:gCal=\'http://schemas.google.com/gCal/
>> >> 2005\'>';
>> >> newCal = newCal + ' <title type=\'text\'>P-Budget</title>';
>> >> newCal = newCal + ' <summary type=\'text\'>This calendar was created
>> >> for the Cal-Budget iGoogle gadget.</summary>';
>> >> newCal = newCal + ' <gCal:timezone value=\'Europe/London\'></
>> >> gCal:timezone>';
>> >> newCal = newCal + ' <gCal:hidden value=\'false\'></gCal:hidden>';
>> >> newCal = newCal + ' <gCal:color value=\'#2952A3\'></gCal:color>';
>> >> //newCal = newCal + ' <gCal:settingsProperty name=\'dateFieldOrder\'
>> >> value=\'YMD\'/>';
>> >> //newCal = newCal + ' <gCal:settingsProperty name=\'format24HourTime\'
>> >> value=\'true\'/>';
>> >> //newCal = newCal + ' <gCal:dateFieldOrder value=\'YMD\'></
>> >> gCal:dateFieldOrder>';
>> >> //newCal = newCal + ' <gCal:format24HourTime value=\'true\'></
>> >> gCal:format24HourTime>';
>> >> newCal = newCal + ' <gd:where rel=\'\' label=\'\' valueString=\'London
>> >> \'></gd:where>';
>> >> newCal = newCal + '</entry>';
>> >> newCal = newCal + '</feed>';
>> >>
>> >>  var url = 'http://www.google.com/calendar/feeds/default/owncalendars/
>> >> full';
>> >> var headers = {
>> >> "Content-Type": "application/atom+xml"
>> >> };
>> >>
>> >> fetchData(url,newCalResponse,newCal,"POST",headers);
>> >>
>> >> then in fetchData, the following code:
>> >>
>> >>  var params = {};
>> >> params[gadgets.io.RequestParameters.CONTENT_TYPE] =
>> >> gadgets.io.ContentType.FEED;
>> >> params[gadgets.io.RequestParameters.AUTHORIZATION] =
>> >> gadgets.io.AuthorizationType.OAUTH;
>> >> params[gadgets.io.RequestParameters.OAUTH_SERVICE_NAME] = "google";
>> >> params[gadgets.io.RequestParameters.OAUTH_USE_TOKEN] = "always";
>> >> params[gadgets.io.RequestParameters.METHOD] = eval
>> >> ("gadgets.io.MethodType."+pMethod);
>> >> params[gadgets.io.RequestParameters.NUM_ENTRIES] = 100;
>> >> params[gadgets.io.RequestParameters.GET_SUMMARIES] = true;
>> >> if (pData) {params[gadgets.io.RequestParameters.POST_DATA] = pData;}
>> >> if (pHeaders) {params[gadgets.io.RequestParameters.HEADERS] =
>> >> pHeaders;}
>> >>
>> >> gadgets.io.makeRequest(url, function (response) {}, params);
>> >>
>> >> (I've snipped the content of the response function for ease of
>> >> reading)
>> >>
>> >> The XML looks fine to me, and passes validation.  I've tried it
>> >> without the feed tags, without any of the options for an entry, and
>> >> with all of them, and any other combination I thought made sense, and
>> >> none of it works.
>> >>
>> >> Please help!
>> >>
>> >> Thanks,
>> >> Rich
>> >>
>> >>
>> >
>> >
>> > >
>> >
>>
>>
>
>
> >
>

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