public Feed CreateEditionList(string publicationName, UmbracoHelper umbracoHelper)
        {
            var parentName = m_context.Application.Hive.QueryContent()
                .Where(x => x.ContentType.Alias == "iBookEdition").First().ParentContent().Name;

            var editions = m_context.Application.Hive.QueryContent()
                .Where(x => x.ContentType.Alias == "iBookEdition")
                .ToList();
            editions = editions.Where(x => x.ParentContent().Name == publicationName).ToList();

             LogHelper.TraceIfEnabled<PugpigRepository>("We found {0} editions for {1}.",() => editions.Count, () => publicationName);

            Feed feed = new Feed();
            feed.Entries = new List<Entry>();

            foreach (var edition in editions)
            {
                var imageUrl = umbracoHelper.GetMediaUrl(edition.Id, "coverImage");
                feed.Entries.Add(new Entry()
                                     {
                                         AuthourName = edition.DynamicField(ContentFields.AUTHOUR_NAME),
                                         Id = edition.Id.ToFriendlyString(),
                                         Summary = edition.DynamicField(ContentFields.SUMMARY),
                                         Title = edition.Name,
                                         Updated = DateTime.Now,
                                         Image = new Image() {Url = imageUrl}

                });
            }

            return feed;
        }
        public XmlDocument GenerateXml(Feed feed)
        {
            var element = new XElement("feed",
                                       new XElement("id", m_feedInfo.PublicationName),
                                       GetLinkElement(m_feedInfo.PublicationName),
                                       new XElement("title", feed.Title),
                                       new XElement("updated", feed.LastUpdated.ToString("yyyy-MM-ddTH:mm:sszzz")),
                                       GetEntries(feed.Entries));

            XmlReader xmlReader = element.CreateReader();
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(xmlReader);

            SetNamespaces(xmlDoc);

            return xmlDoc;
        }
 private Feed GetFeed(int numberOfEntries)
 {
     var feed = new Feed();
     feed.Title = "All Editions";
     feed.LastUpdated = new DateTime(2011, 8, 8, 15, 0, 0, 0);
     feed.Entries = new List<Entry>();
     int i = 0;
     while(i < numberOfEntries)
     {
         feed.Entries.Add(new Entry
                              {
                                  AuthourName = "Lee Cook",
                                  Id = (i + 1).ToString(), Summary = "summary",
                                  Title = "My First Edition" + (i + 1),
                                  Updated = new DateTime(2011, 8, 8, 15, 0, 0, 0),
                                  Image = new Image { Url = "img/cover.jpg" }
                              });
         i++;
     }
     return feed;
 }