protected void btnSave_Click(object sender, EventArgs args)
        {
            if (IsValid)
            {
                try
                {
                    bool   bGenerate   = checkGenerateSitemap.Checked;
                    string strFileName = txtFileName.Text;
                    if (string.IsNullOrEmpty(strFileName))
                    {
                        strFileName = Page.ResolveUrl("~/sitemap.xml");
                    }
                    if (strFileName[0] != '/')
                    {
                        strFileName = string.Format("/{0}", strFileName);
                    }

                    bool     bSitemapXmlIncludePage;
                    bool     bSitemapXmlIncludeLastMod;
                    DateTime?dtSitemapXmlLastmod;
                    bool     bSitemapXmlIncludeChangeFreg;
                    string   strSitemapXmlChangeFreq;
                    bool     bSitemapXmlIncludePriority;
                    decimal  dSitemapXmlPriority;
                    sitemapXmlEdit.GetSettings(
                        out bSitemapXmlIncludePage,
                        out bSitemapXmlIncludeLastMod,
                        out dtSitemapXmlLastmod,
                        out bSitemapXmlIncludeChangeFreg,
                        out strSitemapXmlChangeFreq,
                        out bSitemapXmlIncludePriority,
                        out dSitemapXmlPriority);

                    SitemapXmlSettings settings = new SitemapXmlSettings();
                    settings.Generate                 = bGenerate;
                    settings.FileName                 = strFileName;
                    settings.DefaultIncludePage       = bSitemapXmlIncludePage;
                    settings.DefaultIncludeLastMod    = bSitemapXmlIncludeLastMod;
                    settings.DefaultLastMod           = dtSitemapXmlLastmod;
                    settings.DefaultIncludeChangefreq = bSitemapXmlIncludeChangeFreg;
                    settings.DefaultChangefreq        = strSitemapXmlChangeFreq;
                    settings.DefaultIncludePriority   = bSitemapXmlIncludePriority;
                    settings.DefaultPriority          = dSitemapXmlPriority;
                    SitemapXmlHelper.SaveSettings(settings);

                    messageBox.ShowSuccess("Sitemap settings updated.");
                }
                catch (Exception ex)
                {
                    string strMessage = "Failed saving sitemap settings";
                    BayshoreSolutions.WebModules.WebModulesAuditEvent.Raise(strMessage, this, ex);
                    messageBox.ShowError(strMessage);
                }
            }
        }
        protected void LoadSettings()
        {
            BayshoreSolutions.WebModules.WebpageInfo        webpageInfo = new BayshoreSolutions.WebModules.WebpageInfo();
            BayshoreSolutions.WebModules.SitemapXmlSettings settings    = new SitemapXmlSettings();
            SitemapXmlHelper.LoadSettings(out settings, true);

            checkGenerateSitemap.Checked             = settings.Generate;
            txtFileName.Text                         = settings.FileName;
            webpageInfo.SitemapXml_IncludePage       = settings.DefaultIncludePage;
            webpageInfo.SitemapXml_IncludeLastmod    = settings.DefaultIncludeLastMod;
            webpageInfo.SitemapXml_LastModified      = settings.DefaultLastMod;
            webpageInfo.SitemapXml_IncludeChangefreq = settings.DefaultIncludeChangefreq;
            webpageInfo.SitemapXml_Changefreq        = settings.DefaultChangefreq;
            webpageInfo.SitemapXml_IncludePriority   = settings.DefaultIncludePriority;
            webpageInfo.SitemapXml_Priority          = settings.DefaultPriority;

            sitemapXmlEdit.WebpageInfo = webpageInfo;
        }
        public SitemapGenerator(BlogSettings blogSettings,
                                ForumSettings forumSettings,
                                IActionContextAccessor actionContextAccessor,
                                IBlogService blogService,
                                ICategoryService categoryService,
                                ILanguageService languageService,
                                IManufacturerService manufacturerService,
                                INewsService newsService,
                                IProductService productService,
                                IProductTagService productTagService,
                                IStoreContext storeContext,
                                ITopicService topicService,
                                IUrlHelperFactory urlHelperFactory,
                                IUrlRecordService urlRecordService,
                                IWebHelper webHelper,
                                LocalizationSettings localizationSettings,
                                NewsSettings newsSettings,
                                SecuritySettings securitySettings,
                                SitemapXmlSettings sitemapSettings,

                                ICommodityService commodityService)
        {
            _blogSettings          = blogSettings;
            _forumSettings         = forumSettings;
            _actionContextAccessor = actionContextAccessor;
            _blogService           = blogService;
            _categoryService       = categoryService;
            _languageService       = languageService;
            _manufacturerService   = manufacturerService;
            _newsService           = newsService;
            _productService        = productService;
            _productTagService     = productTagService;
            _storeContext          = storeContext;
            _topicService          = topicService;
            _urlHelperFactory      = urlHelperFactory;
            _urlRecordService      = urlRecordService;
            _webHelper             = webHelper;
            _localizationSettings  = localizationSettings;
            _newsSettings          = newsSettings;
            _securitySettings      = securitySettings;
            _sitemapXmlSettings    = sitemapSettings;

            _commodityService = commodityService;
        }
Ejemplo n.º 4
0
 public CommonController(CaptchaSettings captchaSettings,
                         CommonSettings commonSettings,
                         ICommonModelFactory commonModelFactory,
                         ICurrencyService currencyService,
                         ICustomerActivityService customerActivityService,
                         IGenericAttributeService genericAttributeService,
                         ILanguageService languageService,
                         ILocalizationService localizationService,
                         ILogger logger,
                         IStoreContext storeContext,
                         IThemeContext themeContext,
                         IVendorService vendorService,
                         IWorkContext workContext,
                         IWorkflowMessageService workflowMessageService,
                         LocalizationSettings localizationSettings,
                         SitemapSettings sitemapSettings,
                         SitemapXmlSettings sitemapXmlSettings,
                         StoreInformationSettings storeInformationSettings,
                         VendorSettings vendorSettings)
 {
     _captchaSettings         = captchaSettings;
     _commonSettings          = commonSettings;
     _commonModelFactory      = commonModelFactory;
     _currencyService         = currencyService;
     _customerActivityService = customerActivityService;
     _genericAttributeService = genericAttributeService;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _logger                   = logger;
     _storeContext             = storeContext;
     _themeContext             = themeContext;
     _vendorService            = vendorService;
     _workContext              = workContext;
     _workflowMessageService   = workflowMessageService;
     _localizationSettings     = localizationSettings;
     _sitemapSettings          = sitemapSettings;
     _sitemapXmlSettings       = sitemapXmlSettings;
     _storeInformationSettings = storeInformationSettings;
     _vendorSettings           = vendorSettings;
 }
Ejemplo n.º 5
0
 public CommonModelFactory(BlogSettings blogSettings,
                           CaptchaSettings captchaSettings,
                           CatalogSettings catalogSettings,
                           CommonSettings commonSettings,
                           CustomerSettings customerSettings,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           ForumSettings forumSettings,
                           IActionContextAccessor actionContextAccessor,
                           IBlogService blogService,
                           ICacheKeyService cacheKeyService,
                           ICategoryService categoryService,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IManufacturerService manufacturerService,
                           INewsService newsService,
                           INopFileProvider fileProvider,
                           IPageHeadBuilder pageHeadBuilder,
                           IPermissionService permissionService,
                           IPictureService pictureService,
                           IProductService productService,
                           IProductTagService productTagService,
                           IShoppingCartService shoppingCartService,
                           ISitemapGenerator sitemapGenerator,
                           IStaticCacheManager staticCacheManager,
                           IStoreContext storeContext,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           ITopicService topicService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           LocalizationSettings localizationSettings,
                           MediaSettings mediaSettings,
                           NewsSettings newsSettings,
                           SitemapSettings sitemapSettings,
                           SitemapXmlSettings sitemapXmlSettings,
                           StoreInformationSettings storeInformationSettings,
                           VendorSettings vendorSettings)
 {
     _blogSettings     = blogSettings;
     _captchaSettings  = captchaSettings;
     _catalogSettings  = catalogSettings;
     _commonSettings   = commonSettings;
     _customerSettings = customerSettings;
     _displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     _forumSettings           = forumSettings;
     _actionContextAccessor   = actionContextAccessor;
     _blogService             = blogService;
     _cacheKeyService         = cacheKeyService;
     _categoryService         = categoryService;
     _currencyService         = currencyService;
     _customerService         = customerService;
     _forumService            = forumService;
     _genericAttributeService = genericAttributeService;
     _httpContextAccessor     = httpContextAccessor;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _manufacturerService     = manufacturerService;
     _newsService             = newsService;
     _fileProvider            = fileProvider;
     _pageHeadBuilder         = pageHeadBuilder;
     _permissionService       = permissionService;
     _pictureService          = pictureService;
     _productService          = productService;
     _productTagService       = productTagService;
     _shoppingCartService     = shoppingCartService;
     _sitemapGenerator        = sitemapGenerator;
     _staticCacheManager      = staticCacheManager;
     _storeContext            = storeContext;
     _themeContext            = themeContext;
     _themeProvider           = themeProvider;
     _topicService            = topicService;
     _urlHelperFactory        = urlHelperFactory;
     _urlRecordService        = urlRecordService;
     _webHelper                = webHelper;
     _workContext              = workContext;
     _mediaSettings            = mediaSettings;
     _localizationSettings     = localizationSettings;
     _newsSettings             = newsSettings;
     _sitemapSettings          = sitemapSettings;
     _sitemapXmlSettings       = sitemapXmlSettings;
     _storeInformationSettings = storeInformationSettings;
     _vendorSettings           = vendorSettings;
 }