PageRenderTime 74ms CodeModel.GetById 19ms app.highlight 51ms RepoModel.GetById 2ms app.codeStats 0ms

/Source/externals/GData/Source/Clients/WebmasterTools/GDataEntrySitemap.m

http://google-email-uploader-mac.googlecode.com/
Objective C | 300 lines | 196 code | 87 blank | 17 comment | 9 complexity | 63b72505e229187963278005e8e06433 MD5 | raw file
  1/* Copyright (c) 2008 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//  GDataEntrySitemap.m
 18//
 19
 20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE
 21
 22#import "GDataEntrySitemap.h"
 23#import "GDataWebmasterToolsConstants.h"
 24
 25@implementation GDataSitemapStatus
 26+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 27+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 28+ (NSString *)extensionElementLocalName { return @"sitemap-status"; }
 29@end
 30
 31@implementation GDataSitemapLastDownloaded
 32+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 33+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 34+ (NSString *)extensionElementLocalName { return @"sitemap-last-downloaded"; }
 35@end
 36
 37@implementation GDataSitemapURLCount
 38+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 39+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 40+ (NSString *)extensionElementLocalName { return @"sitemap-url-count"; }
 41@end
 42
 43@implementation GDataSitemapType
 44+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 45+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 46+ (NSString *)extensionElementLocalName { return @"sitemap-type"; }
 47@end
 48
 49@implementation GDataSitemapMobileMarkupLanguage
 50+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 51+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 52+ (NSString *)extensionElementLocalName { return @"sitemap-mobile-markup-language"; }
 53@end
 54
 55@implementation GDataSitemapNewsPublicationLabel
 56+ (NSString *)extensionElementPrefix { return kGDataNamespaceWebmasterToolsPrefix; }
 57+ (NSString *)extensionElementURI { return kGDataNamespaceWebmasterTools; }
 58+ (NSString *)extensionElementLocalName { return @"sitemap-news-publication-label"; }
 59@end
 60
 61@implementation GDataEntrySitemapBase
 62
 63+ (id)sitemapEntry {
 64  
 65  GDataEntrySitemapBase *obj;
 66  obj = [self object];
 67  
 68  [obj setNamespaces:[GDataWebmasterToolsConstants webmasterToolsNamespaces]];
 69  
 70  return obj;
 71}
 72
 73#pragma mark -
 74
 75
 76- (void)addExtensionDeclarations {
 77  
 78  [super addExtensionDeclarations];
 79  
 80  Class entryClass = [self class];
 81  
 82  [self addExtensionDeclarationForParentClass:entryClass
 83                                   childClass:[GDataSitemapStatus class]];  
 84  [self addExtensionDeclarationForParentClass:entryClass
 85                                   childClass:[GDataSitemapLastDownloaded class]];  
 86  [self addExtensionDeclarationForParentClass:entryClass
 87                                   childClass:[GDataSitemapURLCount class]];  
 88}
 89
 90#if !GDATA_SIMPLE_DESCRIPTIONS
 91- (NSMutableArray *)itemsForDescription {
 92  
 93  NSMutableArray *items = [super itemsForDescription];
 94  
 95  [self addToArray:items objectDescriptionIfNonNil:[self sitemapStatus] withName:@"status"];
 96  [self addToArray:items objectDescriptionIfNonNil:[self lastDownloadDate] withName:@"lastDownload"];
 97  [self addToArray:items objectDescriptionIfNonNil:[self sitemapURLCount] withName:@"URLCount"];
 98
 99  return items;
100}
101#endif
102
103+ (NSString *)defaultServiceVersion {
104  return kGDataWebmasterToolsDefaultServiceVersion;
105}
106
107#pragma mark -
108
109- (NSString *)sitemapStatus {
110  GDataSitemapStatus *obj;
111  
112  obj = [self objectForExtensionClass:[GDataSitemapStatus class]];
113  return [obj stringValue];
114}
115
116- (void)setSitemapStatus:(NSString *)str {
117  GDataSitemapStatus *obj = [GDataSitemapStatus valueWithString:str];
118  [self setObject:obj forExtensionClass:[GDataSitemapStatus class]]; 
119}
120
121- (GDataDateTime *)lastDownloadDate {
122  GDataSitemapLastDownloaded *obj;
123  
124  obj = [self objectForExtensionClass:[GDataSitemapLastDownloaded class]]; 
125  return [obj dateTimeValue]; 
126}
127
128- (void)setLastDownloadDate:(GDataDateTime *)dateTime {
129  GDataSitemapLastDownloaded *obj;
130  
131  obj = [GDataSitemapLastDownloaded valueWithDateTime:dateTime];
132  [self setObject:obj forExtensionClass:[GDataSitemapLastDownloaded class]];
133}
134
135- (NSNumber *)sitemapURLCount {
136  GDataSitemapURLCount *obj;
137  
138  obj = [self objectForExtensionClass:[GDataSitemapURLCount class]];
139  return [obj intNumberValue];
140}
141
142- (void)setSitemapURLCount:(NSNumber *)num {
143  GDataSitemapURLCount *obj = nil;
144  
145  if (num != nil) {
146    obj = [GDataSitemapURLCount valueWithNumber:num];
147  }
148  [self setObject:obj forExtensionClass:[GDataSitemapURLCount class]];
149}
150
151@end
152
153@implementation GDataEntrySitemapRegular
154
155+ (NSString *)standardEntryKind {
156  return kGDataCategorySitemapRegular;
157}
158
159+ (void)load {
160  [self registerEntryClass];
161}
162
163#if !GDATA_SIMPLE_DESCRIPTIONS
164- (NSMutableArray *)itemsForDescription {
165  
166  NSMutableArray *items = [super itemsForDescription];
167  
168  [self addToArray:items objectDescriptionIfNonNil:[self sitemapType] withName:@"sitemapType"];
169  
170  return items;
171}
172#endif
173
174- (void)addExtensionDeclarations {
175  
176  [super addExtensionDeclarations];
177  
178  [self addExtensionDeclarationForParentClass:[self class]
179                                   childClass:[GDataSitemapType class]];  
180}
181
182#pragma mark -
183
184- (NSString *)sitemapType {
185  GDataSitemapType *obj;
186  
187  obj = [self objectForExtensionClass:[GDataSitemapType class]];
188  return [obj stringValue];
189}
190
191- (void)setSitemapType:(NSString *)str {
192  GDataSitemapType *obj = nil;
193  
194  if (str != nil) {
195    obj = [GDataSitemapType valueWithString:str];
196  }
197  [self setObject:obj forExtensionClass:[GDataSitemapType class]]; 
198}
199
200@end
201
202@implementation GDataEntrySitemapMobile
203
204+ (NSString *)standardEntryKind {
205  return kGDataCategorySitemapMobile;
206}
207
208+ (void)load {
209  [self registerEntryClass];
210}
211
212- (void)addExtensionDeclarations {
213  
214  [super addExtensionDeclarations];
215  
216  [self addExtensionDeclarationForParentClass:[self class]
217                                   childClass:[GDataSitemapMobileMarkupLanguage class]];  
218}
219
220#if !GDATA_SIMPLE_DESCRIPTIONS
221- (NSMutableArray *)itemsForDescription {
222  
223  NSMutableArray *items = [super itemsForDescription];
224  
225  [self addToArray:items objectDescriptionIfNonNil:[self markupLanguage] withName:@"markupLang"];
226
227  return items;
228}
229#endif
230
231#pragma mark -
232
233- (NSString *)markupLanguage {
234  GDataSitemapMobileMarkupLanguage *obj;
235  
236  obj = [self objectForExtensionClass:[GDataSitemapMobileMarkupLanguage class]];
237  return [obj stringValue];
238}
239
240- (void)setMarkupLanguage:(NSString *)str {
241  GDataSitemapMobileMarkupLanguage *obj = nil;
242  
243  if (str != nil) {
244    obj = [GDataSitemapMobileMarkupLanguage valueWithString:str];
245  }
246  [self setObject:obj forExtensionClass:[GDataSitemapMobileMarkupLanguage class]]; 
247}
248
249@end
250
251@implementation GDataEntrySitemapNews
252
253+ (NSString *)standardEntryKind {
254  return kGDataCategorySitemapNews;
255}
256
257+ (void)load {
258  [self registerEntryClass];
259}
260
261- (void)addExtensionDeclarations {
262  
263  [super addExtensionDeclarations];
264  
265  [self addExtensionDeclarationForParentClass:[self class]
266                                   childClass:[GDataSitemapNewsPublicationLabel class]];  
267}
268
269#if !GDATA_SIMPLE_DESCRIPTIONS
270- (NSMutableArray *)itemsForDescription {
271  
272  NSMutableArray *items = [super itemsForDescription];
273  
274  [self addToArray:items objectDescriptionIfNonNil:[self publicationLabel] withName:@"pubLabel"];
275  
276  return items;
277}
278#endif
279
280#pragma mark -
281
282- (NSString *)publicationLabel {
283  GDataSitemapNewsPublicationLabel *obj;
284  
285  obj = [self objectForExtensionClass:[GDataSitemapNewsPublicationLabel class]];
286  return [obj stringValue];
287}
288
289- (void)setPublicationLabel:(NSString *)str {
290  GDataSitemapNewsPublicationLabel *obj = nil;
291  
292  if (str != nil) {
293    obj = [GDataSitemapNewsPublicationLabel valueWithString:str];
294  }
295  [self setObject:obj forExtensionClass:[GDataSitemapNewsPublicationLabel class]]; 
296}
297
298@end
299
300#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE