Luis -
Looks like when you're creating the AclEntry you're posting to the
wrong uri - it should be "http://www.google.com/calendar/feeds/
<calendar ID>/acl/full", not "http://www.google.com/calendar/feeds/
<calendar ID>/private/full" - the former is the uri of the ACL
resources for that calendar, the latter is the private feed for that
calendar for events and whatnot. I got mixed up on that one initially
myself - the documentation isn't clear in that regard IMO, to a
newcomer at least. Once you understand how the security works, etc...
then it makes sense.
HTH,
Matt
On Nov 19, 1:49 pm, Luís Soares <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm not being able to make a calendar public :(
> My code is the following:
>
> public void createCalendar(string calName)
> {
> CalendarEntry newCalend = new CalendarEntry();
> newCalend.Title.Text = calTitle;
> newCalend.Summary.Text = calName;
> newCalend.TimeZone = "Europe/Lisbon";
> newCalend.Hidden = false;
> newCalend.Selected = true;
> newCalend.Location = new Where("", "", "Portugal");
> // insert calendar
> Uri postUri = new Uri("http://www.google.com/calendar/
> feeds/default/owncalendars/full");
> CalendarEntry createdCalendar = (CalendarEntry)getService
> ().Insert(postUri, newCalend);
>
> // make calendar public
> var aclEntry = new AclEntry();
> aclEntry.Scope = new AclScope();
> aclEntry.Scope.Type = AclScope.SCOPE_DEFAULT;
> aclEntry.Role = AclRole.ACL_CALENDAR_READ;
> aclEntry.Update();
> getService().Insert(getCalendarUri(createdCalendar),
> aclEntry);
> }
>
> private static Uri getCalendarUri(CalendarEntry cal) {
> return new Uri("http://www.google.com/calendar/feeds/" +
> cal.EditUri.Content.Substring
> (cal.EditUri.Content.IndexOf("full/") + 5) +
> "/private/full");
> }
>
> The calendar always remains private....
> What am I doing wrong?
> Thank you in advance.
> Luís Soares
>
> On Nov 4, 1:27 am, Trevor Johns <[EMAIL PROTECTED]> wrote:
>
> > On 11/2/08, Matt Burton <[EMAIL PROTECTED]> wrote:
>
> > > Disregard - figured it out - I had AclRole.ACL_CALENDAR_ROOT instead
> > > of AclRole.ACL_CALENDAR_READ. Hitting tab completion too fast, I
> > > suppose...works like a charm now!
>
> > > Thanks,
> > > Matt
>
> > Glad to hear you got it working.
>
> > --
> > Trevor Johns
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---