~ubuntu-branches/debian/squeeze/gnome-do-plugins/squeeze

« back to all changes in this revision

Viewing changes to BundledLibraries/libgoogle-data-mono-1.4.0.2/src/blogger/bloggerquery.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2009-06-27 16:11:49 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090627161149-b74nc297di2842u1
* New upstream release
  + Pidgin plugin now supports initial text for messages (LP: #338608)
  + Pidgin plugin opens conversations on the correct IM network (LP: #370965)
* debian/rules:
  + Update get-orig-source target.  Upstream no longer ships gdata* binaries,
    so we no longer need to strip them
* debian/patches/00_use_system_gdata
  + Drop.  Upstream now builds against system libgdata.
* debian/patches/04_fix_pidgin_dbus_ints
* debian/patches/10_fix_rhythmbox_file
* debian/patches/15_twitter_api
* debian/patches/20_twitter_overflow:
  + Drop.  Included upstream.
* debian/patches/01_firefox_iceweasel_rename:
  + Refresh for new version
* debian/patches/02_fix_banshee_plugin:
  + Drop refernce to /usr/lib/banshee-1/Banshee.CollectionIndexer.dll.
    This is unnecessary, and causes errors when Banshee isn't installed.
* debian/patches/00_debian_default_plugins:
  + Enable a bunch of useful plugins that do not require configuration from 
    the "Official" plugin set by default.  Makes Do more useful out of the 
    box.
* debian/control:
  + Bump versioned build-dep on gnome-do to 0.8.2
  + Split out gnome-do-plugin-evolution package, now that this is possible.
    libevolution5.0-cil has an annoyingly large dependency stack.
    (LP: #351535) (Closes: #524993).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2006 Google Inc.
2
 
 *
3
 
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 
 * you may not use this file except in compliance with the License.
5
 
 * You may obtain a copy of the License at
6
 
 *
7
 
 *     http://www.apache.org/licenses/LICENSE-2.0
8
 
 *
9
 
 * Unless required by applicable law or agreed to in writing, software
10
 
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 
 * See the License for the specific language governing permissions and
13
 
 * limitations under the License.
14
 
*/
15
 
 
16
 
using System;
17
 
using System.Text;
18
 
using System.Globalization;
19
 
using Google.GData.Client;
20
 
 
21
 
namespace Google.GData.Blogger
22
 
{
23
 
 
24
 
    //////////////////////////////////////////////////////////////////////
25
 
    /// <summary>
26
 
    /// A subclass of FeedQuery, to create a Blogger query URI.
27
 
    /// </summary> 
28
 
    //////////////////////////////////////////////////////////////////////
29
 
    public class BloggerQuery : FeedQuery
30
 
    {
31
 
        /// <summary>
32
 
        /// constant string for the order by updated query
33
 
        /// </summary>
34
 
        public const string OrderByUpdated = "updated";
35
 
        /// <summary>
36
 
        /// constant string for the order by published query
37
 
        /// </summary>
38
 
        public const string OrderByPublished = "published";
39
 
 
40
 
        private string orderBy;
41
 
        /// <summary>
42
 
        /// default constructor, does nothing 
43
 
        /// </summary>
44
 
        public BloggerQuery() : base()
45
 
        {
46
 
        }
47
 
 
48
 
        /// <summary>
49
 
        /// base constructor, with initial queryUri
50
 
        /// </summary>
51
 
        /// <param name="queryUri">the query to use</param>
52
 
        public BloggerQuery(string queryUri)
53
 
        : base(queryUri)
54
 
        {
55
 
        }
56
 
 
57
 
        //////////////////////////////////////////////////////////////////////
58
 
        /// <summary>You can add orderby=published or orderby=updated to a GData query 
59
 
        /// to get the posts sorted in that order. 
60
 
        /// Some notes: 
61
 
        /// - updated is the default 
62
 
        /// - This has no effect on comments feeds, whose updated and published 
63
 
        ///     dates are the same 
64
 
        /// - Pagination in the by-updated feed is limited to the most recently 
65
 
        ///     published 500 posts. </summary>
66
 
        /// <returns> </returns>
67
 
        //////////////////////////////////////////////////////////////////////
68
 
        public string OrderBy
69
 
        {
70
 
            get {return this.orderBy;}
71
 
            set {this.orderBy = value;}
72
 
        }
73
 
 
74
 
#if WindowsCE || PocketPC
75
 
#else
76
 
        //////////////////////////////////////////////////////////////////////
77
 
        /// <summary>protected void ParseUri</summary> 
78
 
        /// <param name="targetUri">takes an incoming Uri string and parses all the properties out of it</param>
79
 
        /// <returns>throws a query exception when it finds something wrong with the input, otherwise returns a baseuri</returns>
80
 
        //////////////////////////////////////////////////////////////////////
81
 
        protected override Uri ParseUri(Uri targetUri)
82
 
        {
83
 
            base.ParseUri(targetUri);
84
 
            if (targetUri != null)
85
 
            {
86
 
                char[] deli = { '?', '&' };
87
 
 
88
 
                TokenCollection tokens = new TokenCollection(targetUri.Query, deli);
89
 
                foreach (String token in tokens)
90
 
                {
91
 
                    if (token.Length > 0)
92
 
                    {
93
 
                        char[] otherDeli = { '=' };
94
 
                        String[] parameters = token.Split(otherDeli, 2);
95
 
                        switch (parameters[0])
96
 
                        {
97
 
                            case "orderby":
98
 
                                this.OrderBy = parameters[1];
99
 
                                break;
100
 
                        }
101
 
                    }
102
 
                }
103
 
            }
104
 
            return this.Uri;
105
 
        }
106
 
#endif
107
 
 
108
 
 
109
 
        //////////////////////////////////////////////////////////////////////
110
 
        /// <summary>Creates the partial URI query string based on all
111
 
        ///  set properties.</summary> 
112
 
        /// <returns> string => the query part of the URI </returns>
113
 
        //////////////////////////////////////////////////////////////////////
114
 
        protected override string CalculateQuery(string basePath)
115
 
        {
116
 
            string path = base.CalculateQuery(basePath);
117
 
            StringBuilder newPath = new StringBuilder(path, 2048);
118
 
            char paramInsertion = InsertionParameter(path); 
119
 
 
120
 
            if (this.OrderBy != null && this.OrderBy.Length > 0)
121
 
            {
122
 
                newPath.Append(paramInsertion);
123
 
                newPath.AppendFormat(CultureInfo.InvariantCulture, "orderby={0}", Utilities.UriEncodeReserved(this.OrderBy));
124
 
                paramInsertion = '&';
125
 
            }
126
 
            return newPath.ToString();
127
 
        }
128
 
    }
129
 
}