Exemple #1
0
        public override void SetUp()
        {
            base.SetUp();

            CreateDefaultStructure();

            host.ReplaceSites(host.DefaultSite, new Site[] { host.DefaultSite, new Site(1, 2, "n2cms.com"), new Site(1, 4, "libardo.com") });

            base.parser = parser = new MultipleSitesParser(persister, wrapper, host, new N2.Plugin.ConnectionMonitor(), new HostSection());
            injector    = new DirectUrlInjector(host, parser, repository, TestSupport.SetupDefinitions(typeof(UrlSourcePage), typeof(DataItem)));
            injector.Start();
            Url.DefaultExtension = "/";
        }
		private void InitializeUrlParser(IServiceContainer container)
		{
			var config = container.Resolve<HostSection>();
			IUrlParser parser;
			if (config.MultipleSites)
				parser = new MultipleSitesParser(container.Resolve<IPersister>(), container.Resolve<IWebContext>(), container.Resolve<IHost>(), container.Resolve<Plugin.ConnectionMonitor>(), config);
			else
				parser = new UrlParser(container.Resolve<IPersister>(), container.Resolve<IWebContext>(), container.Resolve<IHost>(), container.Resolve<Plugin.ConnectionMonitor>(), config);

			if (config.Web.Urls.EnableCaching)
				parser = new CachingUrlParserDecorator(parser, container.Resolve<IPersister>(), container.Resolve<IWebContext>(), container.Resolve<CacheWrapper>(), new HostSection());

			container.AddComponentInstance("n2.urlParser", typeof(IUrlParser), parser);
		}
Exemple #3
0
        protected override UrlParser CreateUrlParser()
        {
            sites = new Site[] {
                host.DefaultSite,
                new Site(1, 2 /*item1.ID*/, "www.n2cms.com"),
                new Site(1, 4 /*item2.ID*/, "n2.libardo.com"),
                new Site(1, 5 /*item2_1.ID*/, "www.n2cms.com:8080")
            };
            MultipleSitesParser parser = new MultipleSitesParser(persister, wrapper, host, new StaticSitesProvider(sites), new HostSection()
            {
                MultipleSites = true, DynamicSites = true
            });

            return(parser);
        }
Exemple #4
0
        protected override UrlParser CreateUrlParser()
        {
            sites = new Site[] {
                host.DefaultSite,
                new Site(1, 2 /*item1.ID*/, "www.n2cms.com"),
                new Site(1, 4 /*item2.ID*/, "n2.libardo.com"),
                new Site(1, 5 /*item2_1.ID*/, "www.n2cms.com:8080")
            };
            new MultipleSitesInitializer(persister, host, new StaticSitesProvider(sites), new N2.Plugin.ConnectionMonitor().SetConnected(N2.Edit.Installation.SystemStatusLevel.UpAndRunning), new HostSection()
            {
                MultipleSites = true, DynamicSites = true
            }, null).Start();
            MultipleSitesParser parser = new MultipleSitesParser(persister, wrapper, host, new HostSection()
            {
                MultipleSites = true, DynamicSites = true
            });

            return(parser);
        }