예제 #1
0
 public CmsBootstrapper(UmbracoSettings settings,
                        UmbracoAreaRegistration areaRegistration,
                        InstallAreaRegistration installRegistration,
                        IEnumerable <PackageAreaRegistration> componentAreas)
 {
     _areaRegistration      = areaRegistration;
     _installRegistration   = installRegistration;
     _componentAreas        = componentAreas;
     _settings              = settings;
     _attributeTypeRegistry = new DependencyResolverAttributeTypeRegistry();
 }
예제 #2
0
 public CmsBootstrapper(UmbracoSettings settings,
                        UmbracoAreaRegistration areaRegistration,
                        InstallAreaRegistration installRegistration,
                        IEnumerable <PackageAreaRegistration> componentAreas,
                        IAttributeTypeRegistry attributeTypeRegistry)
 {
     _areaRegistration      = areaRegistration;
     _installRegistration   = installRegistration;
     _componentAreas        = componentAreas;
     _attributeTypeRegistry = attributeTypeRegistry;
     _settings = settings;
 }
예제 #3
0
        public void InitTest()
        {
            Init();


            RenderModelFactory = FakeRenderModelFactory.CreateWithApp();
            var frontEndRouteHandler = new RenderRouteHandler(new TestControllerFactory(), UmbracoApplicationContext, RenderModelFactory);

            //register areas/routes...

            RouteTable.Routes.Clear();

            var packageFolder = new DirectoryInfo(Path.Combine(Common.CurrentAssemblyDirectory, "App_Plugins", PluginManager.PackagesFolderName, "TestPackage"));

            Components = new ComponentRegistrations(new List <Lazy <MenuItem, MenuItemMetadata> >(),
                                                    GetEditorMetadata(packageFolder),
                                                    GetTreeMetadata(packageFolder),
                                                    GetSurfaceMetadata(packageFolder),
                                                    new List <Lazy <AbstractTask, TaskMetadata> >(),
                                                    new List <Lazy <PropertyEditor, PropertyEditorMetadata> >(),
                                                    new List <Lazy <AbstractParameterEditor, ParameterEditorMetadata> >(),
                                                    new List <Lazy <DashboardMatchRule, DashboardRuleMetadata> >(),
                                                    new List <Lazy <DashboardFilter, DashboardRuleMetadata> >(),
                                                    new List <Lazy <Permission, PermissionMetadata> >(),
                                                    new List <Lazy <AbstractMacroEngine, MacroEngineMetadata> >());

            var componentRegistration = new PackageAreaRegistration(packageFolder, UmbracoApplicationContext, Components);
            var areaRegistration      = new UmbracoAreaRegistration(UmbracoApplicationContext, Components);
            var installRegistration   = new InstallAreaRegistration(UmbracoApplicationContext.Settings);

            var cmsBootstrapper    = new CmsBootstrapper(UmbracoApplicationContext.Settings, areaRegistration, installRegistration, new[] { componentRegistration }, new DefaultAttributeTypeRegistry());
            var renderBootstrapper = new RenderBootstrapper(UmbracoApplicationContext, frontEndRouteHandler, RenderModelFactory);

            //bootstrappers setup the routes
            cmsBootstrapper.Boot(RouteTable.Routes);
            renderBootstrapper.Boot(RouteTable.Routes);

            new UmbracoWebApplication(null, null, null).RegisterRoutes(RouteTable.Routes);
        }