Hello,

It's not very clear in the docs, but at
http://code.google.com/apis/calendar/docs/2.0/developers_guide_java.html#GettingStarted,
in the third bullet point it says;

"sample.calendar.feedUrl should have the value
http://www.google.com/calendar/feeds/default/private/full if you want the
client to use your primary calendar.

If you'd like to use another calendar, you can find the calendar's address
in the Google Calendar UI. Click the arrow next to the calendar's name in
the left sidebar, and choose *Calendar settings* from the drop-down menu.

Then copy and paste the "XML" URL for the Calendar Address seen on the
"Calendar Details" tab. Please replace the suffix /public/basic with
/private/full in the URL, as the sample will be authenticating using the
provided credentials."

So you end up with something like;

http://www.google.com/calendar/feeds/qwe2dk374m5hns%40group.calendar.google.com/public/basic<http://www.google.com/calendar/feeds/c2e2pdufgotdqctbdk374m5hns%40group.calendar.google.com/public/basic>

which you change to

http://www.google.com/calendar/feeds/qwe2dk374m5hns%40group.calendar.google.com/private/full<http://www.google.com/calendar/feeds/c2e2pdufgotdqctbdk374m5hns%40group.calendar.google.com/public/basic>

You can now add to the calendar :)

On a side note, if you want to find a calendar programmatically, the above
URL *should* be available. The only way I've found to be able to do it, it
to search the CalendarEntry.getLinks for an "alternative" link of type
"application/atom+xml". Not sure if its the strictly correct way to do it,
but it'd look like this;

service.insert(new URL(calendar.getLink("alternate",
"application/atom+xml").getHref()), ...);

Hope that helps,
Toby




2008/11/27 Kuroro <[EMAIL PROTECTED]>

>
> Hi,
>
> I'm trying to use the java google calendar API, but it semmes that i
> have some troubles.
>
> I tried to insert an event in a calendar which is not the deflaut one,
> but i car, whatever  i try, everythig  produce en Exception :s
>
> I searched in the doc, but it adds the event only in the main
> calendar.
>
> So i want to know how to add an event in an other calendar (i'm still
> the owner of this calendar)
>
>
> the code i tried to edit is this one :
>
> URL postUrl =
>  new URL("http://www.google.com/calendar/feeds/[EMAIL PROTECTED]/private/
> full");
> CalendarEventEntry myEntry = new CalendarEventEntry();
>
> myEntry.setTitle(new PlainTextConstruct("Tennis with Beth"));
> myEntry.setContent(new PlainTextConstruct("Meet for a quick
> lesson."));
>
> DateTime startTime = DateTime.parseDateTime
> ("2006-04-17T15:00:00-08:00");
> DateTime endTime = DateTime.parseDateTime
> ("2006-04-17T17:00:00-08:00");
> When eventTimes = new When();
> eventTimes.setStartTime(startTime);
> eventTimes.setEndTime(endTime);
> myEntry.addTime(eventTimes);
>
> // Send the request and receive the response:
> CalendarEventEntry insertedEntry = myService.insert(postUrl, myEntry);
>
>
> I'd be pleased if you can edit this code to make it add the event int
> the second (or third or other one) calendar
>
> (PS : Excuse my english , i'm french )
>
> >
>


-- 
Toby

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