Пример #1
0
 /// <summary>Creates a new instance of the RequestLifeCycleHandler class.</summary>
 /// <param name="webContext">The web context wrapper.</param>
 public RequestLifecycleHandler(IWebContext webContext, EventBroker broker, InstallationManager installer, IRequestDispatcher dispatcher, IErrorHandler errors, AdminSection editConfig, HostSection hostConfig)
     : this(webContext, broker, installer, dispatcher, errors)
 {
     checkInstallation = editConfig.Installer.CheckInstallationStatus;
     //installerUrl = editConfig.Installer.InstallUrl;
     rewriteMethod = hostConfig.Web.Rewrite;
     _adminConfig = editConfig;
 }
Пример #2
0
        public Host(IWebContext context, HostSection config)
        {
            _context = context;

            _hostToSites = new Dictionary<string, Site>(StringComparer.OrdinalIgnoreCase);
            _sites = new List<Site>();
            foreach (SiteElement element in config.Sites)
                AddSite(config, element);
            if (!_hostToSites.ContainsKey("*"))
                throw new ConfigurationErrorsException("At least one <site> section must omit the <siteHosts> section, or <add name=\"*\"> to the <siteHosts> section.");
        }
Пример #3
0
        public UrlParser(IPersister persister, IHost host, IWebContext webContext, IItemNotifier notifier, HostSection config, ILanguageManager languageManager, CustomUrlsSection urls, GlobalizationSection globalizationConfig)
        {
            _persister = persister;
            _host = host;
            _webContext = webContext;

            _ignoreExistingFiles = config.Web.IgnoreExistingFiles;

            notifier.ItemCreated += OnItemCreated;

            _languageManager = languageManager;

            DefaultDocument = "default";

            _useBrowserLanguagePreferences = (globalizationConfig != null) ? globalizationConfig.UseBrowserLanguagePreferences : false;

            _configUrlsSection = urls;
        }
Пример #4
0
        private void AddSite(HostSection hostSection, SiteElement element)
        {
            Site site = new Site(hostSection.RootItemID, element.StartPageID, element.SiteHosts);
            site.Wildcards = hostSection.Wildcards || element.Wildcards;
            _sites.Add(site);

            if (element.SiteHosts == null || element.SiteHosts.Count == 0)
                SetFallbackSettings(site);
            else
                foreach (HostNameElement hostName in element.SiteHosts)
                {
                    if (_hostToSites.ContainsKey(hostName.Name))
                        throw new ConfigurationErrorsException("A host name can occur only once. " + hostName.Name + "in <siteHosts> has already been defined.");

                    if (hostName.Name == "*")
                        SetFallbackSettings(site);
                    else
                        _hostToSites.Add(hostName.Name, site);
                }
        }
Пример #5
0
 public MultipleSitesUrlParser(IPersister persister, IWebContext webContext, IItemNotifier notifier, IHost host, HostSection config, ILanguageManager languageManager, CustomUrlsSection urls, GlobalizationSection globalizationConfig)
     : base(persister, host, webContext, notifier, config, languageManager, urls, globalizationConfig)
 {
 }
Пример #6
0
        public UrlParser(IPersister persister, IHost host, IWebContext webContext, IItemNotifier notifier, HostSection config, ILanguageManager languageManager, CustomUrlsSection urls)
            : this(persister, host, webContext, notifier, config, languageManager, urls, null)
        {

        }