Hello community,
here is the log from the commit of package evolution-mono-providers for openSUSE:Factory
checked in at Mon Jan 12 12:03:54 CET 2009.
--------
--- GNOME/evolution-mono-providers/evolution-mono-providers.changes 2008-12-05 09:36:53.000000000 +0100
+++ /mounts/work_src_done/STABLE/evolution-mono-providers/evolution-mono-providers.changes 2009-01-12 09:25:11.465531000 +0100
@@ -1,0 +2,6 @@
+Mon Jan 12 09:28:15 CET 2009 - pchenthill@suse.de
+
+- bnc-449900-display-attendees.diff: Displays attendees for sharepoint
+ meetings.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
bnc-449900-display-attendees.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ evolution-mono-providers.spec ++++++
--- /var/tmp/diff_new_pack.f16336/_old 2009-01-12 12:03:48.000000000 +0100
+++ /var/tmp/diff_new_pack.f16336/_new 2009-01-12 12:03:48.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package evolution-mono-providers (Version 0.1.1)
#
-# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -33,7 +33,7 @@
AutoReq: on
Requires: evolution-sharp
Version: 0.1.1
-Release: 3
+Release: 4
Summary: Evolution backends written using mono
Url: http://go-evolution.org/
Source: %{name}-%{version}.tar.bz2
@@ -43,6 +43,7 @@
Patch3: bnc-456400-all-day-crash.diff
Patch4: dice-api-changes.diff
Patch5: bnc-449905-crash-on-start-up1.diff
+Patch6: bnc-449900-display-attendees.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: %{name}-devel = %{version}-%{release}
@@ -63,6 +64,7 @@
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
%build
autoreconf -f -i
@@ -92,6 +94,9 @@
%{_libdir}/evolution-data-server-1.2/extensions/mono/*
%changelog
+* Mon Jan 12 2009 pchenthill@suse.de
+- bnc-449900-display-attendees.diff: Displays attendees for sharepoint
+ meetings.
* Fri Dec 05 2008 pchenthill@suse.de
- bnc-456400-all-day-crash.diff: Fixes the crash in all day events.
- dice-api-changes.diff: Incoporates api changes in dice. Fixes
++++++ bnc-449900-display-attendees.diff ++++++
commit 4af49c561e438faaddf1caa6eb4024f2ac162c13
Author: chen
Date: Mon Jan 12 13:38:49 2009 +0530
Added support for showing attendees and implemented interfaces for
accepting/declining meetings.
diff --git a/calendar/backends/sharepoint/BackGroundWorker.cs b/calendar/backends/sharepoint/BackGroundWorker.cs
index f413b7a..f8db5bf 100644
--- a/calendar/backends/sharepoint/BackGroundWorker.cs
+++ b/calendar/backends/sharepoint/BackGroundWorker.cs
@@ -30,9 +30,58 @@ namespace SharePoint
CalComponent [] comps = new CalComponent [changes.entries.Length];
for (int i = 0; i < changes.entries.Length; i++)
{
- ComponentEntry cEntry = new ComponentEntry (changes.entries [i]);
+ EventEntry entry = changes.entries [i];
+ ComponentEntry cEntry = new ComponentEntry (entry);
CalComponent comp = cEntry.EventEntryToComp ();
+
+ if (entry.WorkspaceLink == 1)
+ {
+ Console.WriteLine ("Adding atttendees " + changes.entries [i].WorkspaceUrl);
+ string meetingUrl = entry.WorkspaceUrl;
+ string url = null;
+ string instanceId = null;
+
+ if (entry.Recurrence != 1)
+ {
+ char [] splitChar = new char [1];
+ splitChar [0] = ',';
+ string [] urlSplit = meetingUrl.Split (splitChar);
+
+ splitChar [0] = '?';
+ string [] urlSplit1 = urlSplit [0].Split (splitChar);
+
+ url = urlSplit1 [0];
+
+ splitChar [0] = '=';
+ string [] splitId = urlSplit1 [1].Split (splitChar);
+
+ instanceId = splitId [1];
+ } else {
+ char [] splitChar = new char [1];
+ splitChar [0] = ',';
+ string [] urlSplit = meetingUrl.Split (splitChar);
+
+ url = urlSplit [0];
+ DateTime start = DateTime.Parse (entry.StartDate);
+ string date = String.Format ("{0}{1}{2:d2}", start.Year, start.Month, start.Day);
+ instanceId = date;
+ }
+
+ try {
+ EventEntry mentry = deskIceDaemon.GetMeetingEvent (String.Empty, url, instanceId);
+ comp = cEntry.UpdateMeetingDetails (mentry, spBackend.emailId);
+ comp.SetXProp ("X-SP-EVENT-UID", mentry.EventUid);
+ comp.SetXProp ("X-SP-MEETING-URL", url);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine ("Gettting meeting details failed :( ");
+ Console.WriteLine ("Exception occurred is " + ex.Message);
+ Console.WriteLine (ex.StackTrace);
+ }
+ }
+
comps [i] = comp;
}
diff --git a/calendar/backends/sharepoint/ComponentEntry.cs b/calendar/backends/sharepoint/ComponentEntry.cs
index 150fe2e..20f335f 100644
--- a/calendar/backends/sharepoint/ComponentEntry.cs
+++ b/calendar/backends/sharepoint/ComponentEntry.cs
@@ -5,6 +5,7 @@
//
using System;
+using System.Runtime.InteropServices;
using Novell.IceDesktop;
using Evolution;
@@ -142,8 +143,6 @@ namespace SharePoint
comp.Location = eentry.Location;
- Console.WriteLine ("All day" + eentry.AllDayEvent);
-
CalComponentDateTime dt = new CalComponentDateTime ();
Icaltimetype icalt = new Icaltimetype ();
DateTime eventDate = DateTime.Parse (eentry.StartDate);
@@ -171,6 +170,8 @@ namespace SharePoint
comp.RRules = rrules;
}
+
+ Console.WriteLine ("Workspace url " + eentry.WorkspaceLink);
comp.Commit ();
return comp;
@@ -230,6 +231,90 @@ namespace SharePoint
return TaskStatus.NotStarted;
}
+ private icalparameter_role GetIcalRole (RecipientRole role)
+ {
+ switch (role)
+ {
+ case RecipientRole.Optional:
+ return icalparameter_role.OptParticipant;
+ case RecipientRole.Required:
+ return icalparameter_role.ReqParticipant;
+ case RecipientRole.Organizer:
+ return icalparameter_role.Chair;
+ default:
+ return icalparameter_role.None;
+ }
+ }
+
+ private icalparameter_partstat GetIcalPartstat (RecipientStatus status)
+ {
+ switch (status)
+ {
+ case RecipientStatus.Accepted:
+ return icalparameter_partstat.Accepted;
+ case RecipientStatus.Declined:
+ return icalparameter_partstat.Declined;
+ case RecipientStatus.NeedsAction:
+ return icalparameter_partstat.NeedsAction;
+ case RecipientStatus.Tentative:
+ return icalparameter_partstat.Tentative;
+ default:
+ return icalparameter_partstat.None;
+ }
+ }
+
+
+ private void SetAttendees (Recipient [] recipients, string emailId)
+ {
+ CalComponentAttendee [] attendees = new CalComponentAttendee [recipients.Length];
+
+ Console.WriteLine ("Recipient length " + recipients.Length);
+ int i = 0;
+ foreach (Recipient recipient in recipients)
+ {
+ CalComponentAttendee att = new CalComponentAttendee ();
+
+ att.cn = recipient.Name;
+ att.value = recipient.EmailId;
+ att.role = GetIcalRole (recipient.Role);
+ att.status = GetIcalPartstat (recipient.Status);
+
+ Console.WriteLine ("Adding attendee " + att.cn + " " + att.value);
+
+ if (recipient.Role == RecipientRole.Organizer)
+ {
+ CalComponentOrganizer org = new CalComponentOrganizer ();
+
+ org.cn = recipient.Name;
+ org.Value = recipient.EmailId;
+
+ comp.Organizer = org;
+ }
+
+ if (att.value.Contains (emailId))
+ {
+ comp.SetXProp ("X-SP-ATT-CREATION-DATE", recipient.creationDate);
+ }
+
+ attendees [i] = att;
+ i++;
+ }
+
+ comp.Attendees = attendees;
+ }
+
+ public CalComponent UpdateMeetingDetails (EventEntry mentry, string emailId)
+ {
+ Recipient [] recipients = mentry.Recipients;
+
+ SetAttendees (recipients, emailId);
+ comp.SetXProp ("X-SP-EVENT-UID", mentry.EventUid);
+ comp.Commit ();
+ comp.Sequence = 1;
+
+ return comp;
+ }
+
public CalComponent TaskEntryToComp ()
{
comp.Uid = tentry.ID;
@@ -313,11 +398,19 @@ namespace SharePoint
Icaltimetype icalTime = dt.IcalTime;
icalTime.Zone = zone;
eentry.StartDate = icalTime.AsDateTimeUtc.ToString ();
-
- dt = comp.DtEnd;
- icalTime = dt.IcalTime;
- icalTime.Zone = zone;
- eentry.EndDate = icalTime.AsDateTimeUtc.ToString ();
+
+ if (comp.HasRRules == false)
+ {
+ dt = comp.DtEnd;
+ icalTime = dt.IcalTime;
+ icalTime.Zone = zone;
+ if (comp.IsAllDay != true)
+ eentry.EndDate = icalTime.AsDateTimeUtc.ToString ();
+ else {
+ DateTime end = icalTime.AsDateTimeUtc.AddDays (-1);
+ eentry.EndDate = end.ToString ();
+ }
+ }
if (String.IsNullOrEmpty (comp.Summary) == false)
eentry.Title = comp.Summary;
@@ -344,6 +437,11 @@ namespace SharePoint
SetCalRecurrenceToEntry (rRule, ref eentry);
eentry.EventType = 1;
+
+ string end = comp.GetXProp ("X-SP-RECUR-ENDDATE");
+ long endt = Convert.ToInt64 (end);
+ DateTime endDate = GLibUtil.Unixtime_tToDateTime ((int) endt);
+ eentry.EndDate = endDate.ToString ();
}
return eentry;
diff --git a/calendar/backends/sharepoint/Sharepoint.cs b/calendar/backends/sharepoint/Sharepoint.cs
index 0b4a3e7..e132d3f 100644
--- a/calendar/backends/sharepoint/Sharepoint.cs
+++ b/calendar/backends/sharepoint/Sharepoint.cs
@@ -26,6 +26,7 @@ namespace SharePoint {
public CalBackendCache cache;
public CalMode mode;
public CalBackend backend;
+ public string emailId;
public string hostUrl;
public string workspaceid;
public string folderid;
@@ -102,6 +103,9 @@ namespace SharePoint {
AccountInfo aInfo = DaemonConnection.deskIceDaemon.GetDefaultAccountInfo ();
hostUrl = aInfo.hostUrl;
+ User user = DaemonConnection.deskIceDaemon.GetCurrentUser ();
+ emailId = user.EmailAddress;
+ Console.WriteLine ("Email id is " + emailId);
} catch (Exception ex)
{
NotAuthenticatedException nax = new NotAuthenticatedException ();
@@ -130,7 +134,6 @@ namespace SharePoint {
return BackendStatus.OtherError;
Evolution.Source source = backend.Source;
- string user = source.GetSourceProperty ("username");
workspaceid = source.GetSourceProperty ("workspaceid");
folderid = source.GetSourceProperty ("Id");
@@ -168,6 +171,9 @@ namespace SharePoint {
backend.NotifyReadonly (readOnly);
AccountInfo aInfo = DaemonConnection.deskIceDaemon.GetDefaultAccountInfo ();
+ User user = DaemonConnection.deskIceDaemon.GetCurrentUser ();
+ emailId = user.EmailAddress;
+
hostUrl = aInfo.hostUrl;
}
@@ -205,7 +211,8 @@ namespace SharePoint {
public BackendStatus BackendGetCalAddress (out string address)
{
- address = "";
+ address = emailId;
+
return BackendStatus.Success;
}
@@ -269,7 +276,9 @@ namespace SharePoint {
public BackendStatus BackendReceiveObjects (string calobj)
{
- return 0;
+ BackendStatus status = absBackend.BackendReceiveObjects (calobj);
+
+ return status;
}
public BackendStatus BackendSendObjects (string calobj, ref string [] users, out string modifiedObj)
diff --git a/calendar/backends/sharepoint/SharepointAbstractBackend.cs b/calendar/backends/sharepoint/SharepointAbstractBackend.cs
index ca4f6f9..8c94096 100644
--- a/calendar/backends/sharepoint/SharepointAbstractBackend.cs
+++ b/calendar/backends/sharepoint/SharepointAbstractBackend.cs
@@ -23,5 +23,6 @@ namespace SharePoint
public abstract BackendStatus BackendRemoveObject (string uid, string rid, CalObjModType mod, out string oldObject,
out string calobj);
+ public abstract BackendStatus BackendReceiveObjects (string calobj);
}
}
\ No newline at end of file
diff --git a/calendar/backends/sharepoint/SharepointCal.cs b/calendar/backends/sharepoint/SharepointCal.cs
index 03137b3..620d9bd 100644
--- a/calendar/backends/sharepoint/SharepointCal.cs
+++ b/calendar/backends/sharepoint/SharepointCal.cs
@@ -8,11 +8,88 @@ namespace SharePoint
public class SharePointCalBackend : SharePointAbstractBackend
{
BackendGroundWorker bgw;
+
+
+ private CalComponentAttendee GetCompAttendee (CalComponentAttendee [] attendees)
+ {
+ foreach (CalComponentAttendee attendee in attendees)
+ {
+ if (String.IsNullOrEmpty (attendee.value) || String.IsNullOrEmpty (spBackend.emailId))
+ continue;
+
+ if (attendee.value.Contains (spBackend.emailId))
+ return attendee;
+ }
+
+ CalComponentAttendee att = new CalComponentAttendee ();
+
+ return att;
+ }
+
+ RecipientStatus GetRecipientStatus (icalparameter_partstat stat)
+ {
+ switch (stat)
+ {
+ case icalparameter_partstat.Accepted:
+ return RecipientStatus.Accepted;
+ case icalparameter_partstat.Declined:
+ return RecipientStatus.Declined;
+ case icalparameter_partstat.Tentative:
+ return RecipientStatus.Tentative;
+ default:
+ return RecipientStatus.NeedsAction;
+ }
+ }
public SharePointCalBackend (SharePointBackend backend) : base (backend)
{
bgw = new BackendGroundWorker (spBackend);
}
+
+ public override BackendStatus BackendReceiveObjects (string calobj)
+ {
+ CalComponent comp = new CalComponent (calobj);
+
+ // Check the method and handle VCalendar events
+
+ CalComponentAttendee [] attendees = comp.Attendees;
+
+ if (attendees.Length <= 0)
+ return BackendStatus.Success;
+
+ CalComponentAttendee att = GetCompAttendee (attendees);
+
+ if (String.IsNullOrEmpty (att.value))
+ return BackendStatus.InvalidObject;
+
+ RecipientStatus status = GetRecipientStatus (att.status);
+
+ if (status == RecipientStatus.NeedsAction)
+ return BackendStatus.Success;
+
+ string url = comp.GetXProp ("X-SP-MEETING-URL");
+ string eventUid = comp.GetXProp ("X-SP-EVENT-UID");
+ string attendeeDateChange = comp.GetXProp ("X-SP-ATT-CREATION-DATE");
+ uint sequence = (uint) comp.Sequence;
+
+ try {
+ DaemonConnection.deskIceDaemon.SetAttendeeResponse (String.Empty, url, spBackend.emailId, 0, eventUid, sequence,
+ attendeeDateChange, attendeeDateChange, status);
+ Console.WriteLine ("Status Updated!!");
+ CalComponent cacheComp = spBackend.cache.GetComponent (comp.Uid, comp.RecurId);
+ spBackend.cache.PutComponent (comp);
+ spBackend.backend.NotifyObjectModified (cacheComp.GetAsString (), comp.GetAsString ());
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine ("Exception in Receive objects " + ex.Message);
+ Console.WriteLine (ex.StackTrace);
+
+ return BackendStatus.OtherError;
+ }
+
+ return BackendStatus.Success;
+ }
public override void BackendStartQuery (IntPtr query, string sexp)
{
diff --git a/calendar/backends/sharepoint/SharepointTask.cs b/calendar/backends/sharepoint/SharepointTask.cs
index 2e74c31..debe7bb 100644
--- a/calendar/backends/sharepoint/SharepointTask.cs
+++ b/calendar/backends/sharepoint/SharepointTask.cs
@@ -14,6 +14,11 @@ namespace SharePoint
bgw = new BackendGroundWorker (spBackend);
}
+ public override BackendStatus BackendReceiveObjects (string calobj)
+ {
+ return BackendStatus.Success;
+ }
+
public override void BackendStartQuery (IntPtr query, string sexp)
{
diff --git a/calendar/backends/sharepoint/sharepoint.userprefs b/calendar/backends/sharepoint/sharepoint.userprefs
index 4b20245..26ddfbd 100644
--- a/calendar/backends/sharepoint/sharepoint.userprefs
+++ b/calendar/backends/sharepoint/sharepoint.userprefs
@@ -1,25 +1,20 @@
<Properties>
-
+
<Files>
- <File FileName="Welcome" />
- <File FileName="SharepointTask.cs" Line="104" Column="72" />
- <File FileName="SharepointCal.cs" Line="31" Column="57" />
- <File FileName="DaemonConnection.cs" Line="6" Column="21" />
- <File FileName="ComponentEntry.cs" Line="145" Column="55" />
- <File FileName="BackGroundWorker.cs" Line="131" Column="1" />
- <File FileName="Sharepoint.cs" Line="86" Column="6" />
+ <File FileName="BackGroundWorker.cs" Line="1" Column="1" />
+ <File FileName="SharepointCal.cs" Line="130" Column="1" />
+ <File FileName="ComponentEntry.cs" Line="411" Column="39" />
</Files>
<Pads>
<Pad Id="ProjectPad">
<State expanded="True">
<Node name="sharepoint" expanded="True">
- <Node name="References" expanded="True" />
- <Node name="Sharepoint.cs" selected="True" />
+ <Node name="ComponentEntry.cs" selected="True" />
</Node>
</State>
</Pad>
<Pad Id="ClassPad">
- <State expanded="True" />
+ <State expanded="True" selected="True" />
</Pad>
</Pads>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org