Author: fmantek Date: Wed Oct 10 06:02:44 2007 New Revision: 290 Added: trunk/clients/cs/src/gdocuments/ trunk/clients/cs/src/gdocuments/AssemblyInfo.cs trunk/clients/cs/src/gdocuments/documententry.cs trunk/clients/cs/src/gdocuments/documentfeed.cs trunk/clients/cs/src/gdocuments/documentquery.cs trunk/clients/cs/src/gdocuments/documentservice.cs trunk/clients/cs/src/signing/documents.sn (contents, props changed) trunk/clients/cs/src/signing/readme.txt
Log: adding boilerplate documents feed code Added: trunk/clients/cs/src/gdocuments/AssemblyInfo.cs ============================================================================== --- (empty file) +++ trunk/clients/cs/src/gdocuments/AssemblyInfo.cs Wed Oct 10 06:02:44 2007 @@ -0,0 +1,24 @@ +/* Copyright (c) 2006 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +using System.Reflection; +using System.Runtime.CompilerServices; + + +[assembly: AssemblyDelaySign(false)] +#if WindowsCE || PocketPC +#else +[assembly: AssemblyKeyFile("documents.sn")] +#endif +[assembly: AssemblyKeyName("")] Added: trunk/clients/cs/src/gdocuments/documententry.cs ============================================================================== --- (empty file) +++ trunk/clients/cs/src/gdocuments/documententry.cs Wed Oct 10 06:02:44 2007 @@ -0,0 +1,52 @@ +/* Copyright (c) 2006 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +#define USE_TRACING + +using System; +using System.Xml; +using System.IO; +using System.Collections; +using Google.GData.Client; +using Google.GData.Extensions; +using Google.GData.Extensions.MediaRss; +using Google.GData.Extensions.Exif; +using Google.GData.Extensions.Location; + + +namespace Google.GData.Documents { + + + ////////////////////////////////////////////////////////////////////// + /// <summary> + /// Entry API customization class for defining entries in an Event feed. + /// </summary> + ////////////////////////////////////////////////////////////////////// + public class DocumentEntry : AbstractEntry + { + + + /// <summary> + /// Constructs a new EventEntry instance with the appropriate category + /// to indicate that it is an event. + /// </summary> + public DocumentEntry() + : base() + { + Tracing.TraceMsg("Created DocumentEntry"); + // todo: add extensions as appropriate + } + } +} + Added: trunk/clients/cs/src/gdocuments/documentfeed.cs ============================================================================== --- (empty file) +++ trunk/clients/cs/src/gdocuments/documentfeed.cs Wed Oct 10 06:02:44 2007 @@ -0,0 +1,72 @@ +/* Copyright (c) 2006 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +using System; +using System.Collections; +using System.Text; +using System.Xml; +using Google.GData.Client; +using Google.GData.Extensions; + +namespace Google.GData.Documents { + + + ////////////////////////////////////////////////////////////////////// + /// <summary> + /// Google Documents List feed URI takes the following form: + /// http://docs.google.com/feeds/documents/visibility/projection + /// The visibility parameter has two possible values: private and public. + /// In almost all cases, your client should use private. + /// The projection parameter indicates what information is included in the representation. + /// For example, if your client specifies a projection of basic, it's requesting an Atom feed + /// without any GData extension elements. + /// Currently, in the Documents List feed, only the private/full combination + /// for visibility and projection is available. + /// </summary> + ////////////////////////////////////////////////////////////////////// + public class DocumentsFeed : AbstractFeed + { + + /// <summary> + /// default constructor + /// </summary> + /// <param name="uriBase">the base URI of the feedEntry</param> + /// <param name="iService">the Service to use</param> + public DocumentsFeed(Uri uriBase, IService iService) : base(uriBase, iService) + { + // todo: add extension elements as appropriate + } + + /// <summary> + /// this needs to get implemented by subclasses + /// </summary> + /// <returns>AtomEntry</returns> + public override AtomEntry CreateFeedEntry() + { + return new DocumentEntry(); + } + + /// <summary> + /// get's called after we already handled the custom entry, to handle all + /// other potential parsing tasks + /// </summary> + /// <param name="e"></param> + /// <param name="parser">the atom feed parser used</param> + protected override void HandleExtensionElements(ExtensionElementEventArgs e, AtomFeedParser parser) + { + base.HandleExtensionElements(e, parser); + } + } +} Added: trunk/clients/cs/src/gdocuments/documentquery.cs ============================================================================== --- (empty file) +++ trunk/clients/cs/src/gdocuments/documentquery.cs Wed Oct 10 06:02:44 2007 @@ -0,0 +1,89 @@ +/* Copyright (c) 2006 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +using System; +using System.Xml; +using System.Text; +using System.Globalization; +using System.Diagnostics; +using Google.GData.Client; + +namespace Google.GData.Documents { + + ////////////////////////////////////////////////////////////////////// + /// <summary> + /// A subclass of FeedQuery, to create an Documents query URI. + /// Provides public properties that describe the different + /// aspects of the URI, as well as a composite URI. + /// + /// Documents List supports the following standard GData query parameters: + /// alt, author, q, start-index, max-results, updated-min, updated-max, /category + /// For more information about the standard parameters, see the GData protocol reference document. + /// In addition to the standard GData query parameters, the Documents List data API uses the following parameters. + /// Parameter Meaning + /// title Specifies the search terms for the title of a document. + /// This parameter used without title-exact will only submit partial queries, not exact queries. + /// + /// title-exact Specifies whether the title query should be taken as an exact string. + /// Meaningless without title. Possible values are true and false. + /// + /// The Documents List data API supports the following categories. + /// Category: Document Type + /// Scheme: http://schemas.google.com/g/2005#kind + /// Term: http://schemas.google.com/docs/2007#type + /// Label: type + /// All documents of the corresponding type in the requesting users document list. + /// Type is currently one of (document|spreadsheet|presentation) + /// Category: Starred Status + /// Scheme: http://schemas.google.com/g/2005/labels + /// Term: starred + /// Label: starred + /// All documents that have been starred by the requesting user + /// Category: Containing Folders + /// Scheme: http://schemas.google.com/docs/2007/folders/user-email + /// Term: folder-id + /// Label: folder-name + /// All documents inside the given folder for the requesting user + ////////////////////////////////////////////////////////////////////// + public class DocumentsQuery : FeedQuery + { + + + /// <summary> + /// picasa base URI + /// </summary> + public static string documentsBaseUri = "http://docs.google.com/feeds/documents/private/full"; + + /// <summary> + /// base constructor + /// </summary> + public DocumentsQuery() + : base() + { + } + + + + /// <summary> + /// base constructor, with initial queryUri + /// </summary> + /// <param name="queryUri">the query to use</param> + public DocumentsQuery(string queryUri) + : base(queryUri) + { + } + } + +} Added: trunk/clients/cs/src/gdocuments/documentservice.cs ============================================================================== --- (empty file) +++ trunk/clients/cs/src/gdocuments/documentservice.cs Wed Oct 10 06:02:44 2007 @@ -0,0 +1,87 @@ +/* Copyright (c) 2006 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + + +using System; +using System.IO; +using System.Collections; +using System.Text; +using System.Net; +using Google.GData.Client; +using Google.GData.Extensions; + + +namespace Google.GData.Documents { + + ////////////////////////////////////////////////////////////////////// + /// <summary> + /// The Google Documents List data API allows client applications to upload + /// documents to Google Documents and list them in the form of Google data + /// API ("GData") feeds. Your client application can request a list of a user's + /// documents, and query the content in an existing document. + /// Here are some of the things you can do with the Documents List data API: + /// Upload the word processing documents and spreadsheets on + /// your computer to allow you to back them up or + /// collaborate online when editing. + /// Find all of your documents that contain specific keywords. + /// Get a list of spreadsheets which can be accessed through the Google Spreadsheets data API. + /// </summary> + ////////////////////////////////////////////////////////////////////// + public class DocumentsService : Service + { + + /// <summary>This service's User-Agent string</summary> + public const string GDocumentsAgent = "GDocuments-CS/1.0.0"; + /// <summary>The Calendar service's name</summary> + public const string GDocumentsService = "writely"; + + /// <summary> + /// default constructor + /// </summary> + /// <param name="applicationName">the applicationname</param> + public DocumentsService(string applicationName) : base(GDocumentsService, applicationName, GDocumentsAgent) + { + this.NewFeed += new ServiceEventHandler(this.OnNewFeed); + } + + /// <summary> + /// overloaded to create typed version of Query + /// </summary> + /// <param name="feedQuery"></param> + /// <returns>EventFeed</returns> + public DocumentsFeed Query(DocumentsQuery feedQuery) + { + return base.Query(feedQuery) as DocumentsFeed; + } + + ////////////////////////////////////////////////////////////////////// + /// <summary>eventchaining. We catch this by from the base service, which + /// would not by default create an atomFeed</summary> + /// <param name="sender"> the object which send the event</param> + /// <param name="e">FeedParserEventArguments, holds the feedentry</param> + /// <returns> </returns> + ////////////////////////////////////////////////////////////////////// + protected void OnNewFeed(object sender, ServiceEventArgs e) + { + Tracing.TraceMsg("Created new Documents Feed"); + if (e == null) + { + throw new ArgumentNullException("e"); + } + e.Feed = new DocumentsFeed(e.Uri, e.Service); + } + ///////////////////////////////////////////////////////////////////////////// + } +} Added: trunk/clients/cs/src/signing/documents.sn ============================================================================== Binary file. No diff available. Added: trunk/clients/cs/src/signing/readme.txt ============================================================================== --- (empty file) +++ trunk/clients/cs/src/signing/readme.txt Wed Oct 10 06:02:44 2007 @@ -0,0 +1,5 @@ +All signatures in here are created using the sn utility from the Mono runtime, using + + sn -k filename.sn + + --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
