Author: fmantek
Date: Fri Oct 12 01:55:10 2007
New Revision: 292
Modified:
trunk/clients/cs/RELEASE_NOTES.HTML
trunk/clients/cs/src/gcalendar/evententry.cs
trunk/clients/cs/src/gdocuments/documentquery.cs
trunk/clients/cs/src/gdocuments/documentservice.cs
trunk/clients/cs/src/unittests/caltest.cs
Log:
Added beginning of doc list support.
Added originalevent unittest
Modified: trunk/clients/cs/RELEASE_NOTES.HTML
==============================================================================
--- trunk/clients/cs/RELEASE_NOTES.HTML (original)
+++ trunk/clients/cs/RELEASE_NOTES.HTML Fri Oct 12 01:55:10 2007
@@ -7,6 +7,9 @@
<ul>
<li>Features</li>
<ul>
+ <li>Added an EventId property to the EventEntry object. This one
+ parses the atomId URI to just provided the EventId, which
is used
+ elsewhere (e.g., for recurring events).</li>
</ul>
Modified: trunk/clients/cs/src/gcalendar/evententry.cs
==============================================================================
--- trunk/clients/cs/src/gcalendar/evententry.cs (original)
+++ trunk/clients/cs/src/gcalendar/evententry.cs Fri Oct 12 01:55:10 2007
@@ -708,6 +708,22 @@
}
}
+ /// <summary>
+ /// as eventId is a commonly used part in the calendar world,
we expose it
+ /// here. In general the EventId is the last part of the AtomId
+ /// </summary>
+ public string EventId
+ {
+ get
+ {
+ string[] elements = this.Id.AbsoluteUri.Split(new
char[] {'/'});
+ if (elements != null && elements.Length > 0)
+ {
+ return elements[elements.Length - 1];
+ }
+ return null;
+ }
+ }
/// <summary>
/// property accessor for the Comments
Modified: trunk/clients/cs/src/gdocuments/documentquery.cs
==============================================================================
--- trunk/clients/cs/src/gdocuments/documentquery.cs (original)
+++ trunk/clients/cs/src/gdocuments/documentquery.cs Fri Oct 12
01:55:10 2007
@@ -57,33 +57,91 @@
/// Label: folder-name
/// All documents inside the given folder for the
requesting user
//////////////////////////////////////////////////////////////////////
- public class DocumentsQuery : FeedQuery
+ public class DocumentsListQuery : FeedQuery
{
/// <summary>
- /// picasa base URI
+ /// document feed base URI
/// </summary>
public static string documentsBaseUri =
"http://docs.google.com/feeds/documents/private/full";
+ public static AtomCategory ATOMCATEGORY_DOCUMENTS = new
AtomCategory("document");
+ public static QueryCategory DOCUMENTS = new
QueryCategory(ATOMCATEGORY_DOCUMENTS);
+
+ public static AtomCategory ATOMCATEGORY_SPREADSHEETS = new
AtomCategory("spreadsheet");
+ public static QueryCategory SPREADSHEETS = new
QueryCategory(ATOMCATEGORY_SPREADSHEETS);
+
+ public static AtomCategory ATOMCATEGORY_PRESENTATIONS = new
AtomCategory("presentations");
+ public static QueryCategory PRESENTATIONS = new
QueryCategory(ATOMCATEGORY_PRESENTATIONS);
+
/// <summary>
/// base constructor
/// </summary>
- public DocumentsQuery()
- : base()
+ public DocumentsListQuery()
+ : base(documentsBaseUri)
{
}
-
-
/// <summary>
/// base constructor, with initial queryUri
/// </summary>
/// <param name="queryUri">the query to use</param>
- public DocumentsQuery(string queryUri)
+ public DocumentsListQuery(string queryUri)
: base(queryUri)
{
}
}
+
+
+
+ /// <summary>
+ /// a subclass setup to just retrieve all documents
+ /// </summary>
+ public class DocumentQuery : DocumentsListQuery
+ {
+
+ /// <summary>
+ /// base constructor
+ /// </summary>
+ public DocumentQuery()
+ : base()
+ {
+ this.Categories.Add(DocumentsListQuery.DOCUMENTS);
+ }
+ }
+
+
+ /// <summary>
+ /// a subclass setup to just retrieve all spreadsheets
+ /// </summary>
+ public class SpreadsheetQuery : DocumentsListQuery
+ {
+
+ /// <summary>
+ /// base constructor
+ /// </summary>
+ public SpreadsheetQuery()
+ : base()
+ {
+ this.Categories.Add(DocumentsListQuery.SPREADSHEETS);
+ }
+ }
+
+ /// <summary>
+ /// a subclass setup to just retrieve all presentations
+ /// </summary>
+ public class PresentationsQuery : DocumentsListQuery
+ {
+
+ /// <summary>
+ /// base constructor
+ /// </summary>
+ public PresentationsQuery()
+ : base()
+ {
+ this.Categories.Add(DocumentsListQuery.PRESENTATIONS);
+ }
+ }
}
Modified: trunk/clients/cs/src/gdocuments/documentservice.cs
==============================================================================
--- trunk/clients/cs/src/gdocuments/documentservice.cs (original)
+++ trunk/clients/cs/src/gdocuments/documentservice.cs Fri Oct 12
01:55:10 2007
@@ -61,7 +61,7 @@
/// </summary>
/// <param name="feedQuery"></param>
/// <returns>EventFeed</returns>
- public DocumentsFeed Query(DocumentsQuery feedQuery)
+ public DocumentsFeed Query(DocumentsListQuery feedQuery)
{
return base.Query(feedQuery) as DocumentsFeed;
}
Modified: trunk/clients/cs/src/unittests/caltest.cs
==============================================================================
--- trunk/clients/cs/src/unittests/caltest.cs (original)
+++ trunk/clients/cs/src/unittests/caltest.cs Fri Oct 12 01:55:10 2007
@@ -980,31 +980,7 @@
query.Uri = new Uri(this.defaultCalendarUri);
EventFeed calFeed = service.Query(query) as EventFeed;
- string recur =
-
"DTSTART;TZID=America/Los_Angeles:20070416T093000\n" +
- "DURATION:PT3600S\n" +
- "RRULE:FREQ=DAILY;UNTIL=20070828T163000Z\n" +
- "BEGIN:VTIMEZONE\n" +
- "TZID:America/Los_Angeles\n" +
- "X-LIC-LOCATION:America/Los_Angeles\n" +
- "BEGIN:STANDARD\n" +
- "TZOFFSETFROM:-0700\n" +
- "TZOFFSETTO:-0800\n" +
- "TZNAME:PST\n" +
- "DTSTART:19701025T020000\n" +
- "RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\n" +
- "END:STANDARD\n" +
- "BEGIN:DAYLIGHT\n" +
- "TZOFFSETFROM:-0800\n" +
- "TZOFFSETTO:-0700\n" +
- "TZNAME:PDT\n" +
- "DTSTART:19700405T020000\n" +
- "RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU\n" +
- "END:DAYLIGHT\n" +
- "END:VTIMEZONE\n";
-
-
- recur =
+ string recur =
"DTSTART;TZID=America/Los_Angeles:20060314T060000\n" +
"DURATION:PT3600S\n" +
"RRULE:FREQ=DAILY;UNTIL=20060321T220000Z\n" +
@@ -1064,12 +1040,8 @@
}
}
}
-
-
service.Credentials = null;
-
factory.MethodOverride = false;
-
}
}
@@ -1446,7 +1418,6 @@
{
EventEntry entry = ObjectModelHelper.CreateEventEntry(1);
entry.Title.Text = guid;
-
entry.Notifications = true;
calFeed.Insert(entry);
}
@@ -1545,7 +1516,88 @@
}
}
/////////////////////////////////////////////////////////////////////////////
+
+ //////////////////////////////////////////////////////////////////////
+ /// <summary>tests the extended property against the calendar</summary>
+ //////////////////////////////////////////////////////////////////////
+ [Test] public void CalendarOriginalEventTest()
+ {
+ Tracing.TraceMsg("Entering CalendarOriginalEventTest");
+
+ FeedQuery query = new FeedQuery();
+
+ CalendarService service = new
CalendarService(this.ApplicationName);
+
+ if (this.defaultCalendarUri != null)
+ {
+ if (this.userName != null)
+ {
+ service.Credentials = new
GDataCredentials(this.userName, this.passWord);
+ }
+
+ GDataLoggingRequestFactory factory =
(GDataLoggingRequestFactory) this.factory;
+ factory.MethodOverride = true;
+ service.RequestFactory = this.factory;
+
+ query.Uri = new Uri(this.defaultCalendarUri);
+
+ EventFeed calFeed = service.Query(query) as EventFeed;
+
+ string recur =
+
"DTSTART;TZID=America/Los_Angeles:20060314T060000\n" +
+ "DURATION:PT3600S\n" +
+ "RRULE:FREQ=DAILY;UNTIL=20060321T220000Z\n" +
+ "BEGIN:VTIMEZONE\n" +
+ "TZID:America/Los_Angeles\n" +
+ "X-LIC-LOCATION:America/Los_Angeles\n" +
+ "BEGIN:STANDARD\n" +
+ "TZOFFSETFROM:-0700\n" +
+ "TZOFFSETTO:-0800\n" +
+ "TZNAME:PST\n" +
+ "DTSTART:19671029T020000\n" +
+ "RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\n" +
+ "END:STANDARD\n" +
+ "BEGIN:DAYLIGHT\n" +
+ "TZOFFSETFROM:-0800\n" +
+ "TZOFFSETTO:-0700\n" +
+ "TZNAME:PDT\n" +
+ "DTSTART:19870405T020000\n" +
+ "RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU\n" +
+ "END:DAYLIGHT\n" +
+ "END:VTIMEZONE\n";
+
+ EventEntry entry = ObjectModelHelper.CreateEventEntry(1);
+ entry.Title.Text = "New recurring event" +
Guid.NewGuid().ToString();
+
+ // get rid of the when entry
+ entry.Times.Clear();
+
+ entry.Recurrence = new Recurrence();
+ entry.Recurrence.Value = recur;
+
+ EventEntry recEntry = calFeed.Insert(entry) as EventEntry;
+
+ entry = ObjectModelHelper.CreateEventEntry(1);
+ entry.Title.Text = "whateverfancy";
+
+ OriginalEvent originalEvent = new OriginalEvent();
+ When start = new When();
+ start.StartTime = new DateTime(2006, 03, 14, 15, 0,0);
+ originalEvent.OriginalStartTime = start;
+ originalEvent.Href = recEntry.SelfUri.ToString();
+ originalEvent.IdOriginal = recEntry.EventId;
+ entry.OriginalEvent = originalEvent;
+ entry.Times.Add(new When(new DateTime(2006, 03, 14, 9,0,0),
+ new DateTime(2006, 03, 14, 10,0,0)));
+ calFeed.Insert(entry);
+
+ service.Credentials = null;
+ factory.MethodOverride = false;
+ }
+ }
+
/////////////////////////////////////////////////////////////////////////////
+
}
/////////////////////////////////////////////////////////////////////////////
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google 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-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---