PageRenderTime 34ms CodeModel.GetById 22ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/WebmasterTools/GDataFeedSiteKeyword.m

http://macfuse.googlecode.com/
Objective C | 94 lines | 52 code | 24 blank | 18 comment | 1 complexity | 02061e6211ba93a569bc0c91056fe165 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//  GDataFeedSiteKeyword.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE
21
22#import "GDataFeedSiteKeyword.h"
23#import "GDataWebmasterToolsConstants.h"
24
25@implementation GDataFeedSiteKeyword
26
27+ (GDataFeedSiteKeyword *)siteKeywordFeed {
28
29  GDataFeedSiteKeyword *feed = [self object];
30
31  [feed setNamespaces:[GDataWebmasterToolsConstants webmasterToolsNamespaces]];
32
33  return feed;
34}
35
36+ (NSString *)standardFeedKind {
37  return kGDataCategorySiteKeyword;
38}
39
40+ (void)load {
41  [self registerFeedClass];
42}
43
44- (void)addExtensionDeclarations {
45
46  [super addExtensionDeclarations];
47
48  [self addExtensionDeclarationForParentClass:[self class]
49                                   childClass:[GDataSiteKeyword class]];
50}
51
52#if !GDATA_SIMPLE_DESCRIPTIONS
53- (NSMutableArray *)itemsForDescription {
54
55  static struct GDataDescriptionRecord descRecs[] = {
56    { @"keywords", @"keywords", kGDataDescArrayDescs },
57    { nil, nil, (GDataDescRecTypes)0 }
58  };
59
60  NSMutableArray *items = [super itemsForDescription];
61  [self addDescriptionRecords:descRecs toItems:items];
62  return items;
63}
64#endif
65
66+ (NSString *)defaultServiceVersion {
67  return kGDataWebmasterToolsDefaultServiceVersion;
68}
69
70#pragma mark -
71
72- (NSArray *)keywords {
73  return [self objectsForExtensionClass:[GDataSiteKeyword class]];
74}
75
76- (void)setKeywords:(NSArray *)array {
77  [self setObjects:array forExtensionClass:[GDataSiteKeyword class]];
78}
79
80- (void)addKeyword:(GDataSiteKeyword *)obj {
81  [self addObject:obj forExtensionClass:[GDataSiteKeyword class]];
82}
83
84// convenience accessor
85- (NSArray *)keywordsWithSource:(NSString *)source {
86  NSArray *array = [GDataUtilities objectsFromArray:[self keywords]
87                                          withValue:source
88                                         forKeyPath:@"source"];
89  return array;
90}
91
92@end
93
94#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE