PageRenderTime 60ms CodeModel.GetById 35ms app.highlight 22ms RepoModel.GetById 2ms app.codeStats 0ms

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

http://macfuse.googlecode.com/
Objective C | 238 lines | 158 code | 59 blank | 21 comment | 3 complexity | 46ea362d646fd8d8e19f01840f161c1b 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//  GDataEntrySiteCrawlIssue.m
 18//
 19
 20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE
 21
 22#import "GDataEntrySiteCrawlIssue.h"
 23#import "GDataWebmasterToolsConstants.h"
 24
 25// private extensions
 26
 27@interface GDataSiteCrawlType : GDataValueElementConstruct <GDataExtension>
 28@end
 29
 30@implementation GDataSiteCrawlType
 31+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 32+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 33+ (NSString *)extensionElementLocalName { return @"crawl-type"; }
 34@end
 35
 36@interface GDataSiteCrawlIssueDateDetected : GDataValueElementConstruct <GDataExtension>
 37@end
 38
 39@implementation GDataSiteCrawlIssueDateDetected
 40+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 41+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 42+ (NSString *)extensionElementLocalName { return @"date-detected"; }
 43@end
 44
 45@interface GDataSiteCrawlIssueDetail : GDataValueElementConstruct <GDataExtension>
 46@end
 47
 48@implementation GDataSiteCrawlIssueDetail
 49+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 50+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 51+ (NSString *)extensionElementLocalName { return @"detail"; }
 52@end
 53
 54@interface GDataSiteCrawlIssueType : GDataValueElementConstruct <GDataExtension>
 55@end
 56
 57@implementation GDataSiteCrawlIssueType
 58+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 59+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 60+ (NSString *)extensionElementLocalName { return @"issue-type"; }
 61@end
 62
 63@interface GDataSiteCrawlIssueLinkedFrom : GDataValueElementConstruct <GDataExtension>
 64@end
 65
 66@interface GDataSiteCrawlIssueURL: GDataValueElementConstruct <GDataExtension>
 67@end
 68
 69@implementation GDataSiteCrawlIssueURL
 70+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 71+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 72+ (NSString *)extensionElementLocalName { return @"url"; }
 73@end
 74
 75@implementation GDataSiteCrawlIssueLinkedFrom
 76+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 77+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 78+ (NSString *)extensionElementLocalName { return @"linked-from"; }
 79@end
 80
 81@implementation GDataEntrySiteCrawlIssue
 82
 83+ (id)crawlIssueEntry {
 84  GDataEntrySiteCrawlIssue *obj = [self object];
 85
 86  [obj setNamespaces:[GDataWebmasterToolsConstants webmasterToolsNamespaces]];
 87
 88  return obj;
 89}
 90
 91#pragma mark -
 92
 93+ (NSString *)standardEntryKind {
 94  return kGDataCategorySiteCrawlIssue;
 95}
 96
 97+ (void)load {
 98  [self registerEntryClass];
 99}
100
101- (void)addExtensionDeclarations {
102
103  [super addExtensionDeclarations];
104
105  Class entryClass = [self class];
106
107  [self addExtensionDeclarationForParentClass:entryClass
108                                 childClasses:
109   [GDataSiteCrawlType class],
110   [GDataSiteCrawlIssueDateDetected class],
111   [GDataSiteCrawlIssueDetail class],
112   [GDataSiteCrawlIssueType class],
113   [GDataSiteCrawlIssueLinkedFrom class],
114   [GDataSiteCrawlIssueURL class],
115   nil];
116}
117
118#if !GDATA_SIMPLE_DESCRIPTIONS
119- (NSMutableArray *)itemsForDescription {
120
121  static struct GDataDescriptionRecord descRecs[] = {
122    { @"crawlType",  @"crawlType",                 kGDataDescValueLabeled },
123    { @"date",       @"detectedDate.stringValue",  kGDataDescValueLabeled },
124    { @"issueType",  @"issueType",                 kGDataDescValueLabeled },
125    { @"URL",        @"issueURLString",            kGDataDescValueLabeled },
126    { @"linkedFrom", @"issueLinkedFromURLStrings", kGDataDescArrayDescs   },
127    { nil, nil, (GDataDescRecTypes)0 }
128  };
129
130  NSMutableArray *items = [super itemsForDescription];
131  [self addDescriptionRecords:descRecs toItems:items];
132  return items;
133}
134#endif
135
136+ (NSString *)defaultServiceVersion {
137  return kGDataWebmasterToolsDefaultServiceVersion;
138}
139
140#pragma mark -
141
142- (NSString *)crawlType {
143  GDataSiteCrawlType *obj;
144
145  obj = [self objectForExtensionClass:[GDataSiteCrawlType class]];
146  return [obj stringValue];
147}
148
149- (void)setCrawlType:(NSString *)str {
150  GDataSiteCrawlType *obj = [GDataSiteCrawlType valueWithString:str];
151  [self setObject:obj forExtensionClass:[GDataSiteCrawlType class]];
152}
153
154- (GDataDateTime *)detectedDate {
155  GDataSiteCrawlIssueDateDetected *obj;
156
157  obj = [self objectForExtensionClass:[GDataSiteCrawlIssueDateDetected class]];
158  return [obj dateTimeValue];
159}
160
161- (void)setDetectedDate:(GDataDateTime *)dateTime {
162  GDataSiteCrawlIssueDateDetected *obj;
163
164  obj = [GDataSiteCrawlIssueDateDetected valueWithDateTime:dateTime];
165  [self setObject:obj forExtensionClass:[GDataSiteCrawlIssueDateDetected class]];
166}
167
168- (NSString *)detail {
169  GDataSiteCrawlIssueDetail *obj;
170
171  obj = [self objectForExtensionClass:[GDataSiteCrawlIssueDetail class]];
172  return [obj stringValue];
173}
174
175- (void)setDetail:(NSString *)str {
176  GDataSiteCrawlIssueDetail *obj;
177
178  obj = [GDataSiteCrawlIssueDetail valueWithString:str];
179  [self setObject:obj forExtensionClass:[GDataSiteCrawlIssueDetail class]];
180}
181
182- (NSString *)issueType {
183  GDataSiteCrawlIssueType *obj;
184
185  obj = [self objectForExtensionClass:[GDataSiteCrawlIssueType class]];
186  return [obj stringValue];
187}
188
189- (void)setIssueType:(NSString *)str {
190  GDataSiteCrawlIssueType *obj = [GDataSiteCrawlIssueType valueWithString:str];
191  [self setObject:obj forExtensionClass:[GDataSiteCrawlIssueType class]];
192}
193
194- (NSString *)issueURLString {
195  GDataSiteCrawlIssueURL *obj;
196
197  obj = [self objectForExtensionClass:[GDataSiteCrawlIssueURL class]];
198  return [obj stringValue];
199}
200
201- (void)setIssueURLString:(NSString *)str {
202  GDataSiteCrawlIssueURL *obj = [GDataSiteCrawlIssueURL valueWithString:str];
203  [self setObject:obj forExtensionClass:[GDataSiteCrawlIssueURL class]];
204}
205
206- (NSArray *)issueLinkedFromURLStrings {
207  // retrurns an array of URL strings
208  NSArray *array;
209
210  array = [self objectsForExtensionClass:[GDataSiteCrawlIssueLinkedFrom class]];
211  if ([array count] > 0) {
212
213    // return the URL strings, not the extension objects
214    return [array valueForKeyPath:@"stringValue"];
215  }
216  return nil;
217}
218
219- (void)setIssueLinkedFromURLStrings:(NSArray *)array {
220
221  // remove any current URLs
222  [self setObject:nil forExtensionClass:[GDataSiteCrawlIssueLinkedFrom class]];
223
224  for (NSString *str in array) {
225    [self addIssueLinkedFromURLString:str];
226  }
227}
228
229- (void)addIssueLinkedFromURLString:(NSString *)str {
230  GDataSiteCrawlIssueLinkedFrom *obj;
231
232  obj = [GDataSiteCrawlIssueLinkedFrom valueWithString:str];
233  [self addObject:obj forExtensionClass:[GDataSiteCrawlIssueLinkedFrom class]];
234}
235
236@end
237
238#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE