PageRenderTime 34ms CodeModel.GetById 18ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Blogger/GDataServiceGoogleBlogger.m

http://macfuse.googlecode.com/
Objective C | 107 lines | 49 code | 25 blank | 33 comment | 1 complexity | 7a00ffd2e3b0c9b89884ca592da8a4ee MD5 | raw file
  1/* Copyright (c) 2009 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//
 17//  GDataServiceGoogleBlogger.m
 18//
 19
 20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_BLOGGER_SERVICE
 21
 22#import "GDataServiceGoogleBlogger.h"
 23
 24#import "GDataBloggerConstants.h" // for namespaces
 25
 26
 27@implementation GDataServiceGoogleBlogger
 28
 29+ (NSURL *)blogFeedURLForUserID:(NSString *)userID {
 30  NSString *encodedUserID = [GDataUtilities stringByURLEncodingForURI:userID];
 31
 32  NSString *const templateStr = @"%@%@/blogs";
 33
 34  NSString *rootURLStr = [self serviceRootURLString];
 35
 36  NSString *urlString = [NSString stringWithFormat:templateStr,
 37                         rootURLStr, encodedUserID];
 38
 39  return [NSURL URLWithString:urlString];
 40}
 41
 42#pragma mark -
 43
 44// warn the user off of the wrong method calls
 45- (GDataServiceTicket *)fetchFeedWithURL:(NSURL *)feedURL
 46                                delegate:(id)delegate
 47                       didFinishSelector:(SEL)finishedSelector {
 48
 49  // this service does not provide "kind" elements so cannot support
 50  // automatic class determination
 51  //
 52  // call fetchFeedWithURL:feedClass: instead, specifying the expected class
 53  // for the feed
 54  GDATA_DEBUG_LOG(@"GDataServiceGoogleBlogger: use fetchFeedWithURL:feedClass:");
 55  [self doesNotRecognizeSelector:_cmd];
 56  return nil;
 57}
 58
 59- (GDataServiceTicket *)fetchEntryWithURL:(NSURL *)entryURL
 60                                 delegate:(id)delegate
 61                        didFinishSelector:(SEL)finishedSelector {
 62
 63  // this service does not provide "kind" elements so cannot support
 64  // automatic class determination
 65  //
 66  // call fetchEntryWithURL:entryClass: instead, specifying the expected class
 67  // of the entry
 68  GDATA_DEBUG_LOG(@"GDataServiceGoogleBlogger: use fetchEntryWithURL:entryClass:");
 69  [self doesNotRecognizeSelector:_cmd];
 70  return nil;
 71}
 72
 73- (GDataServiceTicket *)fetchFeedWithQuery:(GDataQuery *)query
 74                                  delegate:(id)delegate
 75                         didFinishSelector:(SEL)finishedSelector {
 76
 77  // this service does not provide "kind" elements so cannot support
 78  // automatic class determination
 79  //
 80  // call fetchFeedWithQuery:feedClass: instead, specifying the expected class
 81  // of the feed
 82  GDATA_DEBUG_LOG(@"GDataServiceGoogleBlogger: use fetchFeedWithQuery:feedClass:");
 83  [self doesNotRecognizeSelector:_cmd];
 84  return nil;
 85}
 86
 87#pragma mark -
 88
 89+ (NSString *)serviceID {
 90  return @"blogger";
 91}
 92
 93+ (NSString *)serviceRootURLString {
 94  return @"https://www.blogger.com/feeds/";
 95}
 96
 97+ (NSString *)defaultServiceVersion {
 98  return kGDataBloggerDefaultServiceVersion;
 99}
100
101+ (NSDictionary *)standardServiceNamespaces {
102  return [GDataBloggerConstants bloggerNamespaces];
103}
104
105@end
106
107#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_BLOGGER_SERVICE