Nikolay S
Guest
|
Posted:
Fri Nov 18, 2005 1:58 am Post subject:
Retrieving all recurring item instances |
|
|
Hi,
I have an application which synchronizes exchange information into the
oracle database which we are using. I am able to sync everything, except for
recurring appointments. As you know, we can create a recurring appointment
in outlook, when that happens the multiple appointments are shown in outlook
calendar, BUT only one record is created for the same on exchange server.
When I make exceptions to the individual items like change subject or time
of any of the individual items, it does not create separate records for the
same on exchange, but simply the size of the main recurrence item changes.
Till now, we have been unable to find out from which property on the main
item, I can retrieve all the recurring items. Please help us, we need this
urgently.
I am using web dav protocol
Regards,
Vijay
|
|
Blair Nygren
Guest
|
Posted:
Thu Dec 01, 2005 5:58 pm Post subject:
RE: Retrieving all recurring item instances |
|
|
There is a recurring pattern class in the CDOEX or CDO object. Outlook
manufactures the appointments on the fly from the Recurring patterns. It
doesn't acutally create unique appointments. The pattern values are somewhat
complex to understand.
When you retrieve the appointment item on the exchange server
AppointmentClass RecurrencePatterns you'll see all kinds of stuff.
Here is a snippet of what I retrieved in C# into an XML document.. We store
the recurring pattern in our database and then through the another interface
recreate the appointments that recurr.
if (iAppt.RecurrencePatterns.Count >= 1)
{
writer.WriteStartElement("recurringpatterns");
foreach(interop.CDOEX.IRecurrencePattern rPat in
iAppt.RecurrencePatterns)
{
writer.WriteStartElement("recurringpattern");
interop.CDOEX.IIntegers bypos = rPat.ByPosition;
// // Trace.WriteLineIf(false,DateTime.Now + " ByPosition # : " +
bypos.Count,"OnSyncProcessorMethod");
double byposValue= 0;
for(int j=1; j<bypos.Count+1; j++)
{
byposValue += bypos[j];
// // Trace.WriteLineIf(false,DateTime.Now + " ByPosition Value : " +
bypos[j],"OnSyncProcessorMethod");
}
writer.WriteElementString("byposition",byposValue.ToString());
bypos = rPat.DaysOfMonth;
byposValue= 0;
for(int j=1; j<bypos.Count+1; j++)
{
byposValue += bypos[j];
// // Trace.WriteLineIf(false,DateTime.Now + " DaysofMonth Value : "
+ bypos[j],"OnSyncProcessorMethod");
}
writer.WriteElementString("daysofmonth",byposValue.ToString());
bypos = rPat.DaysOfWeek;
byposValue= 0;
// // Trace.WriteLineIf(false,DateTime.Now + " DaysOfWeek # : " +
bypos.Count,"OnSyncProcessorMethod");
for(int j=1; j<bypos.Count+1; j++)
{
byposValue += Math.Pow(2,bypos[j]);
// // Trace.WriteLineIf(false,DateTime.Now + " DaysOfWeek Value : " +
bypos[j],"OnSyncProcessorMethod");
}
writer.WriteElementString("daysofweek",byposValue.ToString());
//----
writer.WriteElementString("daysofweek",ConvertEnumerationToInteger(
rPat.DaysOfWeek.ToString(),"recurrence_daysofweek").ToString());
writer.WriteElementString("endtype",Enum.Format(typeof(interop.CDOEX.CdoPatternEndType),rPat.EndType, "d"));
writer.WriteElementString("firstdayofweek",Enum.Format(typeof(interop.CDOEX.CdoDayOfWeek),rPat.FirstDayOfWeek, "d"));
writer.WriteElementString("frequency",Enum.Format(typeof(interop.CDOEX.CdoFrequency),rPat.Frequency, "d")); //rPat.Frequency.ToString());
bypos = rPat.HoursOfDay;
byposValue= 0;
for(int j=1; j<bypos.Count+1; j++)
{
byposValue += bypos[j];
}
writer.WriteElementString("hoursofday",byposValue.ToString());
//writer.WriteElementString("hoursofday",Enum.Format(typeof(interop.CDOEX.IIntegers),rPat.HoursOfDay, "d")); //rPat.HoursOfDay.ToString());
writer.WriteElementString("recur_interval",rPat.Interval.ToString());
writer.WriteElementString("instances",rPat.Instances.ToString());
bypos = rPat.MinutesOfHour;
byposValue= 0;
for(int j=1; j<bypos.Count+1; j++)
{
byposValue += bypos[j];
}
writer.WriteElementString("minutesofhour",byposValue.ToString());
//writer.WriteElementString("minutesofhour",rPat.MinutesOfHour.ToString());
bypos = rPat.MonthsOfYear;
byposValue= 0;
for(int j=1; j<bypos.Count+1; j++)
{
byposValue += bypos[j];
}
writer.WriteElementString("monthsofyear",byposValue.ToString());
//writer.WriteElementString("monthsofyear",rPat.MonthsOfYear.ToString());
bypos = rPat.MinutesOfHour;
byposValue= 0;
for(int j=1; j<bypos.Count+1; j++)
{
byposValue += bypos[j];
}
writer.WriteElementString("minutesofhour",byposValue.ToString());
//writer.WriteElementString("minutesofhour",rPat.MinutesOfHour.ToString());
writer.WriteElementString("patternenddate",rPat.PatternEndDate.ToUniversalTime().ToString());
bypos = rPat.SecondsOfMinute;
byposValue= 0;
for(int j=1; j<bypos.Count+1; j++)
{
byposValue += bypos[j];
}
writer.WriteElementString("secondsofminute",byposValue.ToString());
//writer.WriteElementString("secondsofminute",rPat.SecondsOfMinute.ToString());
writer.WriteElementString("recurtype",rPat.Type);
//writer.WriteElementString("weekdays",rPat.WeekDays.ToString());
// interop.CDOEX.IVariants ivar = rPat.WeekDays;
// for(int j=1; j<ivar.Count+1; j++)
// {
// byposValue += bypos[j];
// }
interop.CDOEX.IVariants ivar = rPat.WeekDays;
writer.WriteStartElement("weekdays")
;
writer.WriteStartElement("array")
;
for(int j=1; j<ivar.Count+1; j++)
{
System.Array iVal = (System.Array)ivar[j];
int dimen = 0;
for(int k=0;k<iVal.GetLength(dimen);k+=2)
{
writer.WriteElementString("byposition", iVal.GetValue(k).ToString());
writer.WriteElementString("daysofweek",
iVal.GetValue(k+1).ToString());
// // Trace.WriteLineIf(false,DateTime.Now + " ByPosition : " +
iVal.GetValue(k).ToString(),"OnSyncProcessorMethod");
// // Trace.WriteLineIf(false,DateTime.Now + " DaysofWeek : " +
iVal.GetValue(k+1).ToString(),"OnSyncProcessorMethod");
}
}
writer.WriteEndElement(); // Array
writer.WriteEndElement(); // Weekdays
bypos = rPat.WeeksOfYear;
byposValue= 0;
for(int j=1; j<bypos.Count+1; j++)
{
byposValue += bypos[j];
}
writer.WriteElementString("weeksofyear",byposValue.ToString());
//writer.WriteElementString("weeksofyear",rPat.WeeksOfYear.ToString());
writer.WriteElementString("classtype","APT");
writer.WriteEndElement();
}
writer.WriteEndElement();
}
--
Blair Nygren
Client Profiles Inc.
"Nikolay S" wrote:
| Quote: | Hi,
I have an application which synchronizes exchange information into the
oracle database which we are using. I am able to sync everything, except for
recurring appointments. As you know, we can create a recurring appointment
in outlook, when that happens the multiple appointments are shown in outlook
calendar, BUT only one record is created for the same on exchange server.
When I make exceptions to the individual items like change subject or time
of any of the individual items, it does not create separate records for the
same on exchange, but simply the size of the main recurrence item changes.
Till now, we have been unable to find out from which property on the main
item, I can retrieve all the recurring items. Please help us, we need this
urgently.
I am using web dav protocol
Regards,
Vijay
|
|
|