예제 #1
0
 public ChildrenAjaxService(Navigator navigator, VirtualNodeFactory virtualNodes, IContentAdapterProvider adapters, IUrlParser urls)
 {
     this.navigator    = navigator;
     this.virtualNodes = virtualNodes;
     this.adapters     = adapters;
     this.urls         = urls;
 }
예제 #2
0
        public override void SetUp()
        {
            base.SetUp();

            root = CreateOneItem<RootNode>(1, "root", null);
            start = CreateOneItem<RootNode>(2, "start", root);
            host = new Host(new ThreadContext(), root.ID, start.ID);

            fs = new FakeMappedFileSystem();
            fs.BasePath = AppDomain.CurrentDomain.BaseDirectory + @"\FileSystem\";

            vnf = new VirtualNodeFactory();
            config = new EditSection();

            injector = new FakeDependencyInjector();
            injector.injectors.Add(new EntityDependencySetter<IFileSystem>(fs));
            injector.injectors.Add(new EntityDependencySetter<IDependencyInjector>(injector));
            var sizeCache = new ImageSizeCache(new ConfigurationManagerWrapper { Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, config) });
            injector.injectors.Add(new EntityDependencySetter<ImageSizeCache>(sizeCache));
            //nodeProvider = new FolderNodeProvider(fs, persister, injector);
            //initializer = new VirtualFolderInitializer(host, persister, fs, vnf, new Plugin.ConnectionMonitor().SetConnected(SystemStatusLevel.UpAndRunning), config, new ImageSizeCache(new ConfigurationManagerWrapper { Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, config) }), nodeProvider);
            //nodeProvider = new FolderNodeProvider(fs, persister, injector);
            //nodeProvider = new FolderNodeProvider(fs, persister, injector);
            nodeProvider = new FolderNodeProvider(fs, persister.Repository, injector);
            initializer = new VirtualFolderInitializer(host, persister, fs, vnf, monitor = new Plugin.ConnectionMonitor().SetConnected(SystemStatusLevel.UpAndRunning), new UploadFolderSource(host, config), nodeProvider);
        }
예제 #3
0
 public ChildrenAjaxService(AjaxRequestDispatcher dispatcher, Navigator navigator, VirtualNodeFactory nodes, IUrlParser urls)
 {
     this.dispatcher = dispatcher;
     this.navigator  = navigator;
     this.nodes      = nodes;
     this.urls       = urls;
 }
예제 #4
0
        public override void SetUp()
        {
            base.SetUp();

            root  = CreateOneItem <RootNode>(1, "root", null);
            start = CreateOneItem <RootNode>(2, "start", root);
            host  = new Host(new ThreadContext(), root.ID, start.ID);

            fs          = new FakeMappedFileSystem();
            fs.BasePath = AppDomain.CurrentDomain.BaseDirectory + @"\FileSystem\";

            vnf    = new VirtualNodeFactory();
            config = new EditSection();

            injector = new FakeDependencyInjector();
            injector.injectors.Add(new EntityDependencySetter <IFileSystem>(fs));
            injector.injectors.Add(new EntityDependencySetter <IDependencyInjector>(injector));
            var sizeCache = new ImageSizeCache(new ConfigurationManagerWrapper {
                Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, config)
            });

            injector.injectors.Add(new EntityDependencySetter <ImageSizeCache>(sizeCache));
            //nodeProvider = new FolderNodeProvider(fs, persister, injector);
            //initializer = new VirtualFolderInitializer(host, persister, fs, vnf, new Plugin.ConnectionMonitor().SetConnected(SystemStatusLevel.UpAndRunning), config, new ImageSizeCache(new ConfigurationManagerWrapper { Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, config) }), nodeProvider);
            //nodeProvider = new FolderNodeProvider(fs, persister, injector);
            //nodeProvider = new FolderNodeProvider(fs, persister, injector);
            nodeProvider = new FolderNodeProvider(fs, persister.Repository, injector);
            initializer  = new VirtualFolderInitializer(host, persister, fs, vnf, monitor = new Plugin.ConnectionMonitor().SetConnected(SystemStatusLevel.UpAndRunning), new UploadFolderSource(host, config), nodeProvider);
        }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualFolderInitializer"/> class.
 /// </summary>
 /// <param name="host">The host.</param>
 /// <param name="persister">The persister.</param>
 /// <param name="fs">The fs.</param>
 /// <param name="virtualNodes">The virtual nodes.</param>
 /// <param name="editConfig">The edit config.</param>
 public VirtualFolderInitializer(IHost host, IPersister persister, IFileSystem fs, VirtualNodeFactory virtualNodes, ConnectionMonitor monitor, EditSection editConfig, ImageSizeCache imageSizes, FolderNodeProvider nodeProvider)
 {
     this.host         = host;
     this.persister    = persister;
     this.virtualNodes = virtualNodes;
     this.monitor      = monitor;
     this.folders      = editConfig.UploadFolders;
     this.nodeProvider = nodeProvider;
 }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualFolderInitializer"/> class.
 /// </summary>
 /// <param name="host">The host.</param>
 /// <param name="persister">The persister.</param>
 /// <param name="fs">The fs.</param>
 /// <param name="virtualNodes">The virtual nodes.</param>
 /// <param name="editConfig">The edit config.</param>
 public VirtualFolderInitializer(IHost host, IPersister persister, IFileSystem fs, VirtualNodeFactory virtualNodes, ConnectionMonitor monitor, UploadFolderSource folderSource, FolderNodeProvider nodeProvider)
 {
     this.host         = host;
     this.persister    = persister;
     this.virtualNodes = virtualNodes;
     this.monitor      = monitor;
     this.folderSource = folderSource;
     this.nodeProvider = nodeProvider;
 }
예제 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VirtualFolderInitializer"/> class.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="persister">The persister.</param>
        /// <param name="fs">The fs.</param>
        /// <param name="virtualNodes">The virtual nodes.</param>
        /// <param name="editConfig">The edit config.</param>
        public VirtualFolderInitializer(IHost host, IPersister persister, IFileSystem fs, VirtualNodeFactory virtualNodes, DatabaseStatusCache dbStatus, EditSection editConfig)
        {
            this.host         = host;
            this.persister    = persister;
            this.fs           = fs;
            this.virtualNodes = virtualNodes;
            this.dbStatus     = dbStatus;
            this.folders      = editConfig.UploadFolders;

            nodeProvider = new FolderNodeProvider(fs, persister);
        }
예제 #8
0
        public override void SetUp()
        {
            base.SetUp();

            root  = CreateOneItem <RootNode>(1, "root", null);
            start = CreateOneItem <RootNode>(2, "start", root);
            host  = new Host(new ThreadContext(), root.ID, start.ID);

            fs = new FakeFileSystem();
            fs.PathProvider = new FakePathProvider(fs.BasePath);

            vnf    = new VirtualNodeFactory();
            config = new EditSection();

            initializer = new VirtualFolderInitializer(host, persister, fs, vnf, new FakeStatus(), config);
        }
예제 #9
0
        public void Fallbacks_ToVirtualNodes()
        {
            ContentItem root  = CreateOneItem <AnItem>(1, "root", null);
            ContentItem item1 = CreateOneItem <AnItem>(2, "item1", root);

            var factory = new VirtualNodeFactory();

            factory.Register(new FunctionalNodeProvider("/item1/hello/", (p) => new AnItem {
                Name = p
            }));
            Navigator n = new Navigator(persister, host, factory, source);

            ContentItem navigatedItem = n.Navigate("/item1/hello/world/");

            Assert.That(navigatedItem.Name, Is.EqualTo("world/"));
        }
        public override void SetUp()
        {
            base.SetUp();

            root = CreateOneItem<RootNode>(1, "root", null);
            start = CreateOneItem<RootNode>(2, "start", root);
            host = new Host(new ThreadContext(), root.ID, start.ID);

            fs = new FakeFileSystem();
            fs.PathProvider = new FakePathProvider(fs.BasePath);

            vnf = new VirtualNodeFactory();
            config = new EditSection();

            initializer = new VirtualFolderInitializer(host, persister, fs, vnf, new FakeStatus(), config);
        }
예제 #11
0
 public ChildrenAjaxService(Navigator navigator, VirtualNodeFactory nodes, IUrlParser urls)
 {
     this.navigator = navigator;
     this.nodes     = nodes;
     this.urls      = urls;
 }