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

http://macfuse.googlecode.com/ · Objective C · 100 lines · 55 code · 28 blank · 17 comment · 1 complexity · cb4609f819938786b67614d7cdc6fb59 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. // GDataFeedSite.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE
  19. #import "GDataFeedSitemap.h"
  20. #import "GDataWebmasterToolsConstants.h"
  21. #import "GDataSitemapMobile.h"
  22. #import "GDataSitemapNews.h"
  23. @implementation GDataFeedSitemap
  24. + (GDataFeedSitemap *)sitemapFeed {
  25. GDataFeedSitemap *feed = [self object];
  26. [feed setNamespaces:[GDataWebmasterToolsConstants webmasterToolsNamespaces]];
  27. return feed;
  28. }
  29. + (NSString *)standardFeedKind {
  30. return kGDataCategorySitemapsFeed;
  31. }
  32. + (void)load {
  33. [self registerFeedClass];
  34. }
  35. - (void)addExtensionDeclarations {
  36. [super addExtensionDeclarations];
  37. Class feedClass = [self class];
  38. [self addExtensionDeclarationForParentClass:feedClass
  39. childClasses:
  40. [GDataSitemapMobile class],
  41. [GDataSitemapNews class],
  42. nil];
  43. }
  44. #if !GDATA_SIMPLE_DESCRIPTIONS
  45. - (NSMutableArray *)itemsForDescription {
  46. NSMutableArray *items = [super itemsForDescription];
  47. [self addToArray:items objectDescriptionIfNonNil:[self sitemapMobile] withName:@"mobile"];
  48. [self addToArray:items objectDescriptionIfNonNil:[self sitemapNews] withName:@"news"];
  49. return items;
  50. }
  51. #endif
  52. - (Class)classForEntries {
  53. return kUseRegisteredEntryClass;
  54. }
  55. + (NSString *)defaultServiceVersion {
  56. return kGDataWebmasterToolsDefaultServiceVersion;
  57. }
  58. #pragma mark -
  59. - (GDataSitemapMobile *)sitemapMobile {
  60. return [self objectForExtensionClass:[GDataSitemapMobile class]];
  61. }
  62. - (void)setSitemapMobile:(GDataSitemapMobile *)obj {
  63. [self setObject:obj forExtensionClass:[GDataSitemapMobile class]];
  64. }
  65. - (GDataSitemapNews *)sitemapNews {
  66. return [self objectForExtensionClass:[GDataSitemapNews class]];
  67. }
  68. - (void)setSitemapNews:(GDataSitemapNews *)obj {
  69. [self setObject:obj forExtensionClass:[GDataSitemapNews class]];
  70. }
  71. @end
  72. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE