Closed GoogleCodeExporter closed 9 years ago
The same thing happens to me no matter when the event is created, no matter the
duration, or calendar on
which it is created. It only happens with 7 pm events.
Original comment by rabinowi...@gmail.com
on 21 Apr 2009 at 11:18
Can you post the code you are using for this to make it easier for me to repro
this?
Original comment by fman...@gmail.com
on 23 Apr 2009 at 4:06
Original comment by fman...@gmail.com
on 23 Apr 2009 at 4:07
// Get a weekly recurring event on April 3rd from 7pm
// to 9pm with no end date using the gdata calendar api's
EventEntry originalEntry = CalendarService.Get(url);
// Delete instance of the recurrence pattern
exEventItem = new EventEntry();
exEventItem.OriginalEvent = new OriginalEvent();
exEventItem.OriginalEvent.OriginalStartTime = new When();
exEventItem.OriginalEvent.OriginalStartTime.AllDay = false;
exEventItem.OriginalEvent.OriginalStartTime.StartTime = new DateTime(2009, 11,
11,
19, 0, 0);
exEventItem.OriginalEvent.OriginalStartTime.EndTime = new DateTime(2009, 11,
11, 21,
0, 0);
exEventItem.OriginalEvent.Href = originalEntry.SelfUri.ToString();
exEventItem.OriginalEvent.IdOriginal = entry.Id
exEventItem.Delete()
Original comment by dlevins...@gmail.com
on 30 Apr 2009 at 12:43
Is anyone looking into/reviewing this issue? Is this an actual defect? Was
anyone
able to confirm this issue. I can make this issue happen consistently.
Original comment by dlevins...@gmail.com
on 21 May 2009 at 12:03
Sorry, i was sick for a while. Looking at your code and the behaviour, this
looks like a service issue, the calendar
is just not allowing you to delete instances that far in the future. Report
this issue here:
http://code.google.com/p/gdata-issues/
and link this bug to it, so that they know i investigate this already.
I will resolve this as a non issue, as i do not see the .NET client code doing
anything wrong.
Original comment by fman...@gmail.com
on 22 May 2009 at 1:31
I tried above code but I get error "No Service object set"
then I changed my code and include following line
exEventItem.Service = MasterEvent.Service;
After this I get following error
"Can not update a read-only entry"
After Googling around try to find the solution , I implemented following code
EventEntry exEventItem = new EventEntry();
exEventItem.OriginalEvent = new OriginalEvent();
exEventItem.OriginalEvent.OriginalStartTime = new When();
exEventItem.OriginalEvent.OriginalStartTime.StartTime = Date of occurrence
exEventItem.OriginalEvent.Href = EventEntry.SelfUri.ToString();
exEventItem.OriginalEvent.IdOriginal = ID; // This is a EventId of the Master
Event
exEventItem.Status = EventEntry.EventStatus.CANCELED;
CalendarService.Insert(new
Uri(http://www.google.com/calendar/feeds/default/private/full), exEventItem);
but I now am getting following error
The remote server returned an error: (403) Forbidden.
Execution of request failed:
http://www.google.com/calendar/feeds/default/private/full
at Google.GData.Client.GDataRequest.Execute()
at Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
at Google.GData.Client.GDataGAuthRequest.Execute()
at Google.GData.Client.Service.EntrySend(Uri feedUri, AtomBase baseEntry, GDataRequestType type, AsyncSendData data)
at Google.GData.Client.Service.Insert(Uri feedUri, AtomEntry newEntry, AsyncSendData data)
at Google.GData.Client.Service.Insert[TEntry](Uri feedUri, TEntry entry)
Please help me solve this issue, as this is very critical for our project.
Original comment by tonydu...@gmail.com
on 28 Dec 2010 at 10:44
Hello Tony,
Can you print the body of the exception returned by the server? From my tests,
it seems that "exEventItem" does not correspond to an occurrence of the
recurring event.
If this is the case, can you give us the value of "Date of occurrence" and
check if this is not due to daylight saving time.
Also, I would advise you to use "HTTPS" instead of "HTTP" when using any of
Google Service API.
Best,
Alain
Original comment by ala...@google.com
on 29 Dec 2010 at 10:01
Thank you Alain for the reply.
How do I print the body of the exception returned by the server? All I get is a
C# exception which I have already mentioned.
I wonder if my approch is right. In other blog post
(http://www.google.com/support/forum/p/apps-apis/thread?tid=73a2189e62e7ea08&hl=
en) am63 suggested that I should use RecurrenceExcption in order to delete
single instance of recurring event.
Can one of you guys direct me to a sample code that works?
Thanks and I greatly appriciate your help.
Original comment by tonydu...@gmail.com
on 29 Dec 2010 at 4:16
I'm sorry, I don't have a MS Windows environment but by looking at the source
code, I guess you can do something like this:
Console.WriteLine(exception.ResponseString);
The way I created recurrence exception in Java was as follow:
[CODE]
String eventID = "aj9i23l498p8d695183b9aco78";
CalendarService service = new CalendarService("alainv-test-1.0");
service.setUserCredentials(<USERNAME>, <PASSWORD>);
CalendarEventEntry newEntry = new CalendarEventEntry();
newEntry.setStatus(EventStatus.CANCELED);
When originalEventTime = new When();
DateTime startTime = DateTime.parseDateTime(<START-TIME OF THE EXCEPTION>);
originalEventTime.setStartTime(startTime);
OriginalEvent originalEvent = new OriginalEvent();
originalEvent.setOriginalId(eventID);
originalEvent.setOriginalStartTime(originalEventTime);
// Set the Original Event
newEntry.setOriginalEvent(originalEvent);
service.insert(new URL("https://www.google.com/calendar/feeds/default/private/full"), newEntry);
[/CODE]
As you can see, it is very similar to the way you did it in C#. I also had a
"403 Forbidden" error and it was due to the "startTime" not properly set:
g:originalEvent [<START-TIME>] does NOT correspond to an instance of the
recurring event.
I hope this help!
Best,
Alain
Original comment by ala...@google.com
on 29 Dec 2010 at 4:32
Yes Alain you are right I was not setting the start time correctly. I fix the
problem by converting the date to localTime. But now I am having different
problem, here is the problem,
1. I created weekly recurring event starting from 12/29/2010 10:11 am
2. I delete single occurrence dated 01/05/2011 10:11am, works fine
3. I delete single occurrence dated 01/12/2011 10:11am, works fine
4. When I dele single occurrence dated 01/19/2011 10:11am, the dates from
01/05/2011 shifted to previous date. And time is also changed from 10:11am to
5:11pm
Now my calendar event looks like
12/29/2010 5:11pm
01/04/2011 5:11pm
01/11/2011 5:11pm
01/18/2011 5:11 pm
01/25/2011 5:11 pm
I am attaching a jpeg image of my calendar view
Also here is the final code
internal void DeleteOccurences(DateTime deleteDate, EventEntry masterEvent)
{
DateTime masterEventStartTime = masterEvent.Times[0].StartTime;
DateTime calculatedDeleteDate = new DateTime(deleteDate.Year, deleteDate.Month, deleteDate.Day, masterEventStartTime.Hour, masterEventStartTime.Minute, masterEventStartTime.Second);
//Delete instance of the recurrence pattern
EventEntry exEventItem = new EventEntry();
exEventItem.OriginalEvent = new OriginalEvent();
exEventItem.OriginalEvent.OriginalStartTime = new When();
exEventItem.OriginalEvent.OriginalStartTime.StartTime = calculatedDeleteDate.ToLocalTime();
exEventItem.OriginalEvent.Href = masterEvent.SelfUri.ToString();
exEventItem.OriginalEvent.IdOriginal = masterEvent.EventId;
exEventItem.Status = EventEntry.EventStatus.CANCELED;
try
{
CalendarService.Insert(new Uri("https://www.google.com/calendar/feeds/{0}/private/full"), exEventItem);
}
catch { } // occurrence not found
}
Original comment by tonydu...@gmail.com
on 29 Dec 2010 at 6:13
Attachments:
Oh, I found the problem. It was in my code. I was assigning localtime in one
location and universal time on other while reading the entry from Google.
Thanks Alain for your support and help. The above code is now working like a
charm.
Original comment by tonydu...@gmail.com
on 29 Dec 2010 at 7:56
Original comment by ccherub...@google.com
on 30 Dec 2010 at 10:15
Original issue reported on code.google.com by
dlevins...@gmail.com
on 21 Apr 2009 at 11:11