Esempio n. 1
0
        public override string Execute()
        {
            var builder = new StringBuilder();

            IList <SitemapData> sitemapConfigs = sitemapService.GetAllSitemapData();

            // if no configuration present create one with default values
            if (sitemapConfigs.Count == 0)
            {
                sitemapService.Save(CreateDefaultConfig());
            }

            // create xml sitemap for each configuration
            foreach (var sitemapConfig in sitemapConfigs)
            {
                GenerateSitemaps(sitemapConfig, builder);
            }

            return("Job successfull. Generated sitemaps:" + builder);
        }