Exemplo n.º 1
0
        /// <summary>
        /// With this method we subscribe for the Sitefinity Bootstrapper_Initialized
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
        {
            if (e.CommandName != "RegisterRoutes" || !Bootstrapper.IsDataInitialized)
            {
                return;
            }

            if (e.CommandName == "RegisterRoutes")
            {
                var configManager               = ConfigManager.GetManager();
                var virtualPathConfig           = configManager.GetSection <VirtualPathSettingsConfig>();
                var jobsModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath      = "~/SoftwareDesign/*",
                    ResolverName     = "EmbeddedResourceResolver",
                    ResourceLocation = "SoftwareDesign"
                };
                if (!virtualPathConfig.VirtualPaths.Contains(jobsModuleVirtualPathConfig))
                {
                    virtualPathConfig.VirtualPaths.Add(jobsModuleVirtualPathConfig);
                    configManager.SaveSection(virtualPathConfig);
                }
            }

            InstallWidgets();

            PageCustomFields.CreateCustomFieldFluentAPI("EpiserverPageId", typeof(PageNode), typeof(Lstring), UserFriendlyDataType.ShortText);
            PageCustomFields.CreateCustomFieldFluentAPI("EpiserverUrlPath", typeof(PageNode), typeof(Lstring), UserFriendlyDataType.LongText);
            PageCustomFields.CreateCustomFieldFluentAPI("EpiserverPageId", typeof(NewsItem), typeof(Lstring), UserFriendlyDataType.ShortText);



            // Vince McNamara, Dahu ([email protected])
            // Start of Dahu changes - register Custom InboundPipes

            PublishingSystemFactory.UnregisterPipe(ContentInboundPipe.PipeName);
            PublishingSystemFactory.RegisterPipe(ContentInboundPipe.PipeName, typeof(CustomContentInboundPipe));
            PipeSettings contentPipeSettings = ContentInboundPipe.GetTemplatePipeSettings();

            contentPipeSettings.PipeName = "Dahu CustomContentInboundPipe";
            contentPipeSettings.Title    = "Dahu CustomContentInboundPipe";
            PublishingSystemFactory.RegisterPipeSettings("CustomContentInboundPipe", contentPipeSettings);


            PublishingSystemFactory.UnregisterPipe(PageInboundPipe.PipeName);
            PublishingSystemFactory.RegisterPipe(PageInboundPipe.PipeName, typeof(CustomPageInboundPipe));
            PipeSettings pagePipeSettings = PageInboundPipe.GetTemplatePipeSettings();

            pagePipeSettings.PipeName = "Dahu CustomContentInboundPipe";
            pagePipeSettings.Title    = "Dahu CustomPageInboundPipe";
            PublishingSystemFactory.RegisterPipeSettings("CustomPageInboundPipe", pagePipeSettings);

            PublishingSystemFactory.UnregisterPipe(DocumentInboundPipe.PipeName);
            PublishingSystemFactory.RegisterPipe(DocumentInboundPipe.PipeName, typeof(CustomDocumentInboundPipe));



            //  End Dahu Changes
        }
        private static void RegisterVirtualPath()
        {
            var virtualPathConfig           = Config.Get <VirtualPathSettingsConfig>();
            var jobsModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
            {
                VirtualPath      = "~/CustomSitefinity/*",
                ResolverName     = "EmbeddedResourceResolver",
                ResourceLocation = "Custom.Sitefinity"
            };

            virtualPathConfig.VirtualPaths.Add(jobsModuleVirtualPathConfig);
        }
        public void Install(Telerik.Sitefinity.Abstractions.SiteInitializer initializer, Version upgradeFrom)
        {
            var config       = initializer.Context.GetConfig <ToolboxesConfig>();
            var pageControls = config.Toolboxes["PageControls"];

            var section = pageControls.Sections
                          .Where <ToolboxSection>(e => e.Name == "Login")
                          .FirstOrDefault();

            // recaptcha control
            string controlName = typeof(RecaptchaStsLoginFormPanel).Name;

            if (!section.Tools.Any <ToolboxItem>(e => e.Name == controlName))
            {
                var recaptchaPanel = new ToolboxItem(section.Tools)
                {
                    Name        = controlName,
                    Title       = controlName,
                    Description = controlName,
                    ControlType = typeof(RecaptchaStsLoginFormPanel).AssemblyQualifiedName
                };
                section.Tools.Add(recaptchaPanel);
            }

            // default control
            string controlNameDefault = typeof(StsLoginFormPanel).Name;

            if (!section.Tools.Any <ToolboxItem>(e => e.Name == controlNameDefault))
            {
                var recaptchaPanelDefault = new ToolboxItem(section.Tools)
                {
                    Name        = controlNameDefault,
                    Title       = controlNameDefault,
                    Description = controlNameDefault,
                    ControlType = typeof(StsLoginFormPanel).AssemblyQualifiedName
                };
                section.Tools.Add(recaptchaPanelDefault);
            }

            var virtualPathConfig = initializer.Context.GetConfig <VirtualPathSettingsConfig>();

            if (!virtualPathConfig.VirtualPaths.Elements.Any(vp => vp.VirtualPath == "~/recaptchaLogin/*"))
            {
                var moduleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath      = "~/recaptchaLogin/*",
                    ResolverName     = "EmbeddedResourceResolver",
                    ResourceLocation = "RecaptchaBackendLogin"
                };
                virtualPathConfig.VirtualPaths.Add(moduleVirtualPathConfig);
            }
        }
 private void InstallCustomVirtualPaths(SiteInitializer initialzer)
 {
     var virtualPathConfig = initialzer.Context.GetConfig<VirtualPathSettingsConfig>();
     ConfigManager.Executed += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(this.ConfigManager_Executed);
     var TemplateImporterModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
     {
         VirtualPath = TemplateImporterModule.TemplateImporterVirtualPath + "*",
         ResolverName = "EmbeddedResourceResolver",
         ResourceLocation = "TemplateImporter"
     };
     if (!virtualPathConfig.VirtualPaths.ContainsKey(TemplateImporterModule.TemplateImporterVirtualPath + "*"))
         virtualPathConfig.VirtualPaths.Add(TemplateImporterModuleVirtualPathConfig);
 }
 private void InstallCustomVirtualPaths(SiteInitializer initializer)
 {
     var virtualPathConfig = initializer.Context.GetConfig<VirtualPathSettingsConfig>();
     ConfigManager.Executed += new EventHandler<ExecutedEventArgs>(ConfigManager_Executed);
     var locationsModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
     {
         VirtualPath = "~/LocationTemplates/*",
         ResolverName = "EmbeddedResourceResolver",
         ResourceLocation = "LocationsModule"
     };
     if (!virtualPathConfig.VirtualPaths.ContainsKey("~/LocationTemplates/*"))
         virtualPathConfig.VirtualPaths.Add(locationsModuleVirtualPathConfig);
 }
        protected void Bootstrapper_Initializing(object sender, Telerik.Sitefinity.Data.ExecutingEventArgs args)
        {
            if (args.CommandName == "RegisterRoutes")
            {
                var virtualPathConfig = Config.Get<VirtualPathSettingsConfig>();
                var jobsModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath = "~/SFRealEstate/*",
                    ResolverName = "EmbeddedResourceResolver",
                    ResourceLocation = "Telerik.StarterKit.Modules.RealEstate"
                };
                virtualPathConfig.VirtualPaths.Add(jobsModuleVirtualPathConfig);

                SampleUtilities.RegisterModule<TemplateImporterModule>("Template Importer", "This module imports templates from template builder.");
            }
        }
Exemplo n.º 7
0
        protected void Bootstrapper_Initializing(object sender, Telerik.Sitefinity.Data.ExecutingEventArgs args)
        {
            if (args.CommandName == "RegisterRoutes")
            {
                var virtualPathConfig           = Config.Get <VirtualPathSettingsConfig>();
                var jobsModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath      = "~/SFRealEstate/*",
                    ResolverName     = "EmbeddedResourceResolver",
                    ResourceLocation = "Telerik.StarterKit.Modules.RealEstate"
                };
                virtualPathConfig.VirtualPaths.Add(jobsModuleVirtualPathConfig);

                SampleUtilities.RegisterModule <TemplateImporterModule>("Template Importer", "This module imports templates from template builder.");
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Installs module virtual paths.
        /// </summary>
        /// <param name="initializer">The initializer.</param>
        private void InstallVirtualPaths(SiteInitializer initializer)
        {
            var virtualPathConfig  = initializer.Context.GetConfig <VirtualPathSettingsConfig>();
            var virtualPathElement = new VirtualPathElement(virtualPathConfig.VirtualPaths)
            {
                VirtualPath      = "~/SuperForms/" + "*",
                ResolverName     = "EmbeddedResourceResolver",
                ResourceLocation = "timw255.Sitefinity.SuperForms"
            };

            if (!virtualPathConfig.VirtualPaths.ContainsKey("~/SuperForms/" + "*"))
            {
                virtualPathConfig.VirtualPaths.Add(virtualPathElement);
                Config.GetManager().SaveSection(virtualPathConfig);
            }
        }
Exemplo n.º 9
0
 private static void InstallVirtualPaths()
 {
     SiteInitializer initializer = SiteInitializer.GetInitializer();
     var virtualPathConfig = initializer.Context.GetConfig<VirtualPathSettingsConfig>();
     var virtualPathElement = new VirtualPathElement(virtualPathConfig.VirtualPaths)
     {
         VirtualPath = "~/timw255/" + "*",
         ResolverName = "EmbeddedResourceResolver",
         ResourceLocation = "timw255.Sitefinity"
     };
     if (!virtualPathConfig.VirtualPaths.ContainsKey("~/timw255/" + "*"))
     {
         virtualPathConfig.VirtualPaths.Add(virtualPathElement);
         Config.GetManager().SaveSection(virtualPathConfig);
     }
 }
        private void InstallCustomVirtualPaths(SiteInitializer initialzer)
        {
            var virtualPathConfig = initialzer.Context.GetConfig <VirtualPathSettingsConfig>();

            ConfigManager.Executed += new EventHandler <Telerik.Sitefinity.Data.ExecutedEventArgs>(this.ConfigManager_Executed);
            var templateImporterModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
            {
                VirtualPath      = TemplateImporterModule.TemplateImporterVirtualPath + "*",
                ResolverName     = "EmbeddedResourceResolver",
                ResourceLocation = "TemplateImporter"
            };

            if (!virtualPathConfig.VirtualPaths.ContainsKey(TemplateImporterModule.TemplateImporterVirtualPath + "*"))
            {
                virtualPathConfig.VirtualPaths.Add(templateImporterModuleVirtualPathConfig);
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Below you will see how virtual paths can be programmatically installed
        /// </summary>
        private static void InstallVirtualPaths()
        {
            SiteInitializer initializer              = SiteInitializer.GetInitializer();
            var             virtualPathConfig        = initializer.Context.GetConfig <VirtualPathSettingsConfig>();
            var             EventsCalendarViewConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
            {
                VirtualPath      = SampleWidget.sampleWidgetVirtualPath + "*",
                ResolverName     = "EmbeddedResourceResolver",
                ResourceLocation = typeof(SampleWidget).Assembly.GetName().Name
            };

            if (!virtualPathConfig.VirtualPaths.ContainsKey(SampleWidget.sampleWidgetVirtualPath + "*"))
            {
                virtualPathConfig.VirtualPaths.Add(EventsCalendarViewConfig);
                Config.GetManager().SaveSection(virtualPathConfig);
            }
        }
Exemplo n.º 12
0
        private void InstallCustomVirtualPaths(SiteInitializer initializer)
        {
            var virtualPathConfig = initializer.Context.GetConfig <VirtualPathSettingsConfig>();

            ConfigManager.Executed += new EventHandler <ExecutedEventArgs>(ConfigManager_Executed);
            var productsModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
            {
                VirtualPath      = ProductsModule.ProductsVirtualPath + "*",
                ResolverName     = "EmbeddedResourceResolver",
                ResourceLocation = "ProductCatalogSample"
            };

            if (!virtualPathConfig.VirtualPaths.ContainsKey(ProductsModule.ProductsVirtualPath + "*"))
            {
                virtualPathConfig.VirtualPaths.Add(productsModuleVirtualPathConfig);
            }
        }
        /// <summary>
        /// Adds the virtual path to embedded resource.
        /// </summary>
        private static void AddVirtualPathToEmbeddedRes()
        {
            Res.RegisterResource <MobileDevicePersonalizationResources>();

            var virtualPathConfig = Config.Get <VirtualPathSettingsConfig>();

            if (!virtualPathConfig.VirtualPaths.Contains(Installer.virtualPath + "*"))
            {
                var pathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath      = Installer.virtualPath + "*",
                    ResolverName     = "EmbeddedResourceResolver",
                    ResourceLocation = "MobileDevicePersonalization"
                };
                virtualPathConfig.VirtualPaths.Add(pathConfig);
                ConfigManager.GetManager().SaveSection(virtualPathConfig);
                SystemManager.RestartApplication("ConfigChange");
            }
        }
Exemplo n.º 14
0
        private static void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
        {
            if (e.CommandName == "RegisterRoutes")
            {
                var virtualPathConfig = Config.Get <VirtualPathSettingsConfig>();

                if (!virtualPathConfig.VirtualPaths.Contains("~/JXTNext/Social/*"))
                {
                    var virtaulPathElement = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                    {
                        ResourceLocation = "JXTNext.Sitefinity.Widgets.Social",
                        ResolverName     = "EmbeddedResourceResolver",
                        VirtualPath      = "~/JXTNext/Social/*"
                    };

                    virtualPathConfig.VirtualPaths.Add(virtaulPathElement);
                }
            }
        }
        private static void InstallVirtualPaths()
        {
            SiteInitializer initializer       = SiteInitializer.GetInitializer();
            var             virtualPathConfig = initializer.Context.GetConfig <VirtualPathSettingsConfig>();

            string key = "~/SitefinitySamplesUserGeneratedContent/*";

            if (!virtualPathConfig.VirtualPaths.ContainsKey(key))
            {
                var newVirtualPathNode = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath      = key,
                    ResolverName     = "EmbeddedResourceResolver",
                    ResourceLocation = "Sitefinity.Samples.UserGeneratedContent"
                };

                virtualPathConfig.VirtualPaths.Add(newVirtualPathNode);
                Config.GetManager().SaveSection(virtualPathConfig);
            }
        }
Exemplo n.º 16
0
        void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
        {
            //Use the following to register the CustomVideoThumbnailGenerator
            if (e.CommandName == "Bootstrapped")
            {
                ObjectFactory.Container.RegisterType <IVideoThumbnailGenerator, NRecoVideoConvertor.CustomVideoThumbnailGenerator>(new ContainerControlledLifetimeManager());
            }

            //Register a virtual path for the CustomWidgetDesigner
            if (e.CommandName == "RegisterRoutes")
            {
                var virtualPathConfig = Config.Get <VirtualPathSettingsConfig>();
                var customDesignerVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath      = "~/CustomPrefix/*",
                    ResolverName     = "EmbeddedResourceResolver",
                    ResourceLocation = "SitefinityWebApp"
                };
                virtualPathConfig.VirtualPaths.Add(customDesignerVirtualPathConfig);
            }
        }
Exemplo n.º 17
0
        private static string GenerateVirtualPath(string path)
        {
            var virtualPathConfig      = Telerik.Sitefinity.Configuration.Config.Get <VirtualPathSettingsConfig>();
            VirtualPathElement element = null;

            virtualPathConfig.VirtualPaths.TryGetValue("~/SFAkismet/*", out element);
            if (element == null)
            {
                var jobsModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath      = "~/SFAkismet/*",
                    ResolverName     = "EmbeddedResourceResolver",
                    ResourceLocation = "AkismetModule"
                };
                virtualPathConfig.VirtualPaths.Add(jobsModuleVirtualPathConfig);
                ConfigManager.GetManager().SaveSection(virtualPathConfig);
                VirtualPathManager.Reset();
            }

            return("~/SFAkismet/" + path);
        }
        private static void AddVirtualPathToEmbeddedRes()
        {
            //Register the resource file
            Res.RegisterResource <LeadScorePersonalizationResources>();
            var configManager     = ConfigManager.GetManager();
            var virtualPathConfig = configManager.GetSection <VirtualPathSettingsConfig>();

            using (new UnrestrictedModeRegion())
            {
                if (!virtualPathConfig.VirtualPaths.Contains(virtualPath + "*"))
                {
                    var pathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                    {
                        VirtualPath      = Installer.virtualPath + "*",
                        ResolverName     = "EmbeddedResourceResolver",
                        ResourceLocation = typeof(LeadScoreEvaluator).Assembly.GetName().Name
                    };
                    virtualPathConfig.VirtualPaths.Add(pathConfig);
                    configManager.SaveSection(virtualPathConfig);
                }
            }
        }
        public void Install(Telerik.Sitefinity.Abstractions.SiteInitializer initializer, Version upgradeFrom)
        {
            var config       = initializer.Context.GetConfig <ToolboxesConfig>();
            var pageControls = config.Toolboxes["PageControls"];

            var section = pageControls.Sections
                          .Where <ToolboxSection>(e => e.Name == "Login")
                          .FirstOrDefault();

            if (!section.Tools.Any <ToolboxItem>(e => e.Name == "OAuthLogin"))
            {
                var blogsList = new ToolboxItem(section.Tools)
                {
                    Name        = "OAuthLogin",
                    Title       = "OAuthLogin",
                    Description = "OAuthLogin",
                    ControlType = typeof(OAuthLoginForm).AssemblyQualifiedName
                };
                section.Tools.Add(blogsList);
            }



            var virtualPathConfig = initializer.Context.GetConfig <VirtualPathSettingsConfig>();

            if (!virtualPathConfig.VirtualPaths.Elements.Any(vp => vp.VirtualPath == "~/oauth/*"))
            {
                var moduleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath      = "~/oauth/*",
                    ResolverName     = "EmbeddedResourceResolver",
                    ResourceLocation = "OauthExternalAuthentication"
                };
                virtualPathConfig.VirtualPaths.Add(moduleVirtualPathConfig);
            }
        }
        public void Install(Telerik.Sitefinity.Abstractions.SiteInitializer initializer, Version upgradeFrom)
        {
            var config = initializer.Context.GetConfig<ToolboxesConfig>();
            var pageControls = config.Toolboxes["PageControls"];

            var section = pageControls.Sections
                .Where<ToolboxSection>(e => e.Name == "Login")
                .FirstOrDefault();

            if (!section.Tools.Any<ToolboxItem>(e => e.Name == "OAuthLogin"))
            {
                var blogsList = new ToolboxItem(section.Tools)
                {
                    Name = "OAuthLogin",
                    Title = "OAuthLogin",
                    Description = "OAuthLogin",
                    ControlType = typeof(OAuthLoginForm).AssemblyQualifiedName
                };
                section.Tools.Add(blogsList);
            }



            var virtualPathConfig = initializer.Context.GetConfig<VirtualPathSettingsConfig>();
            if (!virtualPathConfig.VirtualPaths.Elements.Any(vp => vp.VirtualPath == "~/oauth/*"))
            {
                var moduleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath = "~/oauth/*",
                    ResolverName = "EmbeddedResourceResolver",
                    ResourceLocation = "OauthExternalAuthentication"
                };
                virtualPathConfig.VirtualPaths.Add(moduleVirtualPathConfig);
            }


        }
        public void Install(Telerik.Sitefinity.Abstractions.SiteInitializer initializer, Version upgradeFrom)
        {
            var config = initializer.Context.GetConfig<ToolboxesConfig>();
            var pageControls = config.Toolboxes["PageControls"];

            var section = pageControls.Sections
                .Where<ToolboxSection>(e => e.Name == "Login")
                .FirstOrDefault();

            // recaptcha control
            string controlName = typeof(RecaptchaStsLoginFormPanel).Name;

            if (!section.Tools.Any<ToolboxItem>(e => e.Name == controlName))
            {
                var recaptchaPanel = new ToolboxItem(section.Tools)
                {
                    Name = controlName,
                    Title = controlName,
                    Description = controlName,
                    ControlType = typeof(RecaptchaStsLoginFormPanel).AssemblyQualifiedName
                };
                section.Tools.Add(recaptchaPanel);
            }

            // default control
            string controlNameDefault = typeof(StsLoginFormPanel).Name;

            if (!section.Tools.Any<ToolboxItem>(e => e.Name == controlNameDefault))
            {
                var recaptchaPanelDefault = new ToolboxItem(section.Tools)
                {
                    Name = controlNameDefault,
                    Title = controlNameDefault,
                    Description = controlNameDefault,
                    ControlType = typeof(StsLoginFormPanel).AssemblyQualifiedName
                };
                section.Tools.Add(recaptchaPanelDefault);
            }

            var virtualPathConfig = initializer.Context.GetConfig<VirtualPathSettingsConfig>();
            if (!virtualPathConfig.VirtualPaths.Elements.Any(vp => vp.VirtualPath == "~/recaptchaLogin/*"))
            {
                var moduleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath = "~/recaptchaLogin/*",
                    ResolverName = "EmbeddedResourceResolver",
                    ResourceLocation = "RecaptchaBackendLogin"
                };
                virtualPathConfig.VirtualPaths.Add(moduleVirtualPathConfig);
            }
        }
        /// <summary>
        /// Adds the virtual path to embedded resource.
        /// </summary>
        private static void AddVirtualPathToEmbeddedRes()
        {
            //Register the resource file
            Res.RegisterResource<CustomPersonalizationResources>();

            var virtualPathConfig = Config.Get<VirtualPathSettingsConfig>();
            if (!virtualPathConfig.VirtualPaths.Contains(virtualPath + "*"))
            {
                var pathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
                {
                    VirtualPath = Installer.virtualPath + "*",
                    ResolverName = "EmbeddedResourceResolver",
                    ResourceLocation = "DayOfWeekPersonalization"
                };
                virtualPathConfig.VirtualPaths.Add(pathConfig);
            }
        }