protected void InstallPages(SiteInitializer initializer)
        {
            var pageManager = initializer.PageManager;
            var moduleNode  = pageManager.GetPageNode(SiteInitializer.DesignNodeId);

            PageNode templateImporterNode = pageManager.GetPageNodes().Where(p => p.Id == TemplateImporterModule.TemplateImporterPageGroupID).SingleOrDefault();

            if (templateImporterNode == null)
            {
                templateImporterNode = initializer.CreatePageNode(TemplateImporterModule.TemplateImporterPageGroupID, moduleNode, NodeType.Group);

                templateImporterNode.Name                     = TemplateImporterModule.ModuleName;
                templateImporterNode.ShowInNavigation         = true;
                templateImporterNode.Attributes["ModuleName"] = TemplateImporterModule.ModuleName;
                templateImporterNode.Title                    = TemplateImporterModule.ModuleName;
                templateImporterNode.UrlName                  = TemplateImporterModule.ModuleName;
                templateImporterNode.Description              = "Module for importing Template packages";
            }

            var landingPage = pageManager.GetPageNodes().SingleOrDefault(p => p.Id == this.LandingPageId);

            if (landingPage == null)
            {
                var pageInfo = new PageDataElement()
                {
                    PageId      = this.LandingPageId,
                    Name        = "TemplateImporter",
                    MenuName    = "TemplateImporter Module",
                    UrlName     = "TemplateImporter",
                    Description = "TemplateImporterLandingPageDescription",
                    HtmlTitle   = "Template Importer",
                    //ResourceClassId = typeof(TemplateImporterResources).Name,
                    IncludeScriptManager = true,
                    ShowInNavigation     = false,
                    EnableViewState      = false,
                    TemplateName         = SiteInitializer.BackendTemplateName,
                };

                pageInfo.Parameters["ModuleName"] = TemplateImporterModule.ModuleName;

                TemplateImporterServerControl control = new TemplateImporterServerControl();

                Control[] pageControls = new Control[]
                {
                    control
                };

                initializer.CreatePageFromConfiguration(pageInfo, templateImporterNode, pageControls);
            }
        }
        /// <summary>
        /// Installs the pages.
        /// </summary>
        /// <param name="initializer">The initializer.</param>
        protected override void InstallPages(SiteInitializer initializer)
        {
            var pageManager = initializer.PageManager;
            var moduleNode  = pageManager.GetPageNode(SiteInitializer.ModulesNodeId);
            var id          = AgentsPageGroupId;
            var agentsNode  = pageManager.GetPageNodes().Where(t => t.Id == id).SingleOrDefault();

            if (agentsNode == null)
            {
                agentsNode                          = initializer.CreatePageNode(AgentsPageGroupId, moduleNode, Sitefinity.Pages.Model.NodeType.Group);
                agentsNode.Name                     = "Agents";
                agentsNode.ShowInNavigation         = true;
                agentsNode.Attributes["ModuleName"] = AgentsModule.ModuleName;
                Res.SetLstring(agentsNode.Title, ResourceClassId, "PageGroupNodeTitle");
                Res.SetLstring(agentsNode.UrlName, ResourceClassId, "PageGroupNodeTitle");
                Res.SetLstring(agentsNode.Description, ResourceClassId, "PageGroupNodeDescription");
            }

            id = this.LandingPageId;
            var landingPage =
                pageManager
                .GetPageNodes()
                .SingleOrDefault(p => p.Id == id);

            if (landingPage == null)
            {
                var pageInfo = new PageDataElement()
                {
                    PageId               = this.LandingPageId,
                    Name                 = "Agents",
                    MenuName             = "AgentsLandingPageTitle",
                    UrlName              = "AgentsLandingPageUrlName",
                    Description          = "AgentsLandingPageDescription",
                    HtmlTitle            = "AgentsLandingPageHtmlTitle",
                    ResourceClassId      = ResourceClassId,
                    IncludeScriptManager = true,
                    ShowInNavigation     = false,
                    EnableViewState      = false,
                    TemplateName         = SiteInitializer.BackendTemplateName
                };
                pageInfo.Parameters["ModuleName"] = AgentsModule.ModuleName;
                var controlPanel = new BackendContentView()
                {
                    ModuleName            = AgentsModule.ModuleName,
                    ControlDefinitionName = AgentsDefinitions.BackendDefinitionName
                };
                initializer.CreatePageFromConfiguration(pageInfo, agentsNode, controlPanel);
            }
        }
        /// <summary>
        /// Installs the pages.
        /// </summary>
        /// <param name="initializer">The initializer.</param>
        protected override void InstallPages(SiteInitializer initializer)
        {
            var moduleNode  = initializer.PageManager.GetPageNode(SiteInitializer.ModulesNodeId);
            var pageManager = initializer.PageManager;

            var fundingRequestNode = pageManager.GetPageNodes().Where(p => p.Id == FundingModule.HomePageId).SingleOrDefault();

            if (fundingRequestNode == null)
            {
                fundingRequestNode = initializer.CreatePageNode(FundingModule.HomePageId, moduleNode);

                fundingRequestNode.Name                     = FundingModule.ModuleName;
                fundingRequestNode.ShowInNavigation         = true;
                fundingRequestNode.Attributes["ModuleName"] = FundingModule.ModuleName;
                fundingRequestNode.Title                    = FundingModule.ModuleName;
                fundingRequestNode.UrlName                  = FundingModule.ModuleName;
            }

            // create the subpage
            var subPage = pageManager.GetPageNodes().Where(p => p.Id == FundingModule.ChildPageId).SingleOrDefault();

            if (subPage == null)
            {
                var pageInfo = new PageDataElement()
                {
                    PageId           = FundingModule.ChildPageId,
                    Name             = "FundingRequestList",
                    MenuName         = "FundingRequestList",
                    UrlName          = "FundingRequestList",
                    Description      = "Funding Requests List",
                    ShowInNavigation = false,
                    TemplateName     = SiteInitializer.BackendTemplateName,
                };
                pageInfo.Parameters["ModuleName"] = FundingModule.ModuleName;
                var control = new FundingRequestList();
                var node    = initializer.CreatePageFromConfiguration(pageInfo, fundingRequestNode, control);
            }
        }
        protected void InstallPages(SiteInitializer initializer)
        {
            var pageManager = initializer.PageManager;
            var moduleNode = pageManager.GetPageNode(SiteInitializer.DesignNodeId);

            PageNode TemplateImporterNode = pageManager.GetPageNodes().Where(p => p.Id == TemplateImporterModule.TemplateImporterPageGroupID).SingleOrDefault();
            if (TemplateImporterNode == null)
            {
                TemplateImporterNode = initializer.CreatePageNode(TemplateImporterModule.TemplateImporterPageGroupID, moduleNode, NodeType.Group);

                TemplateImporterNode.Name = TemplateImporterModule.ModuleName;
                TemplateImporterNode.ShowInNavigation = true;
                TemplateImporterNode.Attributes["ModuleName"] = TemplateImporterModule.ModuleName;
                TemplateImporterNode.Title = TemplateImporterModule.ModuleName;
                TemplateImporterNode.UrlName = TemplateImporterModule.ModuleName;
                TemplateImporterNode.Description = "Module for importing Template packages";
            }

            var landingPage = pageManager.GetPageNodes().SingleOrDefault(p => p.Id == this.LandingPageId);

            if (landingPage == null)
            {
                var pageInfo = new PageDataElement()
                {
                    PageId = this.LandingPageId,
                    Name = "TemplateImporter",
                    MenuName = "TemplateImporter Module",
                    UrlName = "TemplateImporter",
                    Description = "TemplateImporterLandingPageDescription",
                    HtmlTitle = "Template Importer",
                    //ResourceClassId = typeof(TemplateImporterResources).Name,
                    IncludeScriptManager = true,
                    ShowInNavigation = false,
                    EnableViewState = false,
                    TemplateName = SiteInitializer.BackendTemplateName,
                };

                pageInfo.Parameters["ModuleName"] = TemplateImporterModule.ModuleName;
              
                TemplateImporterServerControl control = new TemplateImporterServerControl();
                              
                Control[] pageControls = new Control[] { 
                   control
                };
                
                initializer.CreatePageFromConfiguration(pageInfo, TemplateImporterNode, pageControls);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Installs the pages.
        /// </summary>
        /// <param name="initializer">The initializer.</param>
        protected override void InstallPages(SiteInitializer initializer)
        {
            // code to install admin page nodes and pages
            // get page manager
            var pageManager = initializer.PageManager;
            var modulesPageNode = pageManager.GetPageNode(SiteInitializer.ModulesNodeId);

            // Create PageNode if doesn't exist
            var ProjectsModulePageGroupNode = pageManager.GetPageNodes().Where(t => t.Id == ProjectsPageGroupID).SingleOrDefault();
            if (ProjectsModulePageGroupNode == null)
            {
                // create page node under Modules node
                ProjectsModulePageGroupNode = initializer.CreatePageNode(ProjectsPageGroupID, modulesPageNode, Telerik.Sitefinity.Pages.Model.NodeType.Group);
                ProjectsModulePageGroupNode.Name = ProjectsModule.ModuleName;
                ProjectsModulePageGroupNode.ShowInNavigation = true;
                ProjectsModulePageGroupNode.Attributes["ModuleName"] = ProjectsModule.ModuleName;

                // hard-code names for now, will eventually be localized
                ProjectsModulePageGroupNode.Title = "Projects";
                ProjectsModulePageGroupNode.UrlName = "Projects";
                ProjectsModulePageGroupNode.Description = "Module for managing a list of Projects";
            }

            // create Landing Page if doesn't exist
            var landingPage = pageManager.GetPageNodes().SingleOrDefault(p => p.Id == LandingPageId);
            if (landingPage == null)
            {
                // create page
                var pageInfo = new PageDataElement()
                {
                    PageId = LandingPageId,
                    IncludeScriptManager = true,
                    ShowInNavigation = false,
                    EnableViewState = false,
                    TemplateName = SiteInitializer.BackendTemplateName,

                    // hard-code names for now, will eventually be localized
                    Name = ProjectsModule.ModuleName,
                    MenuName = "Projects Module",
                    UrlName = "Projects",
                    Description = "Landing page for the Projects Module",
                    HtmlTitle = "Projects Module"
                };

                pageInfo.Parameters["ModuleName"] = ProjectsModule.ModuleName;

                // create control panel
                var backendView = new BackendContentView()
                {
                    ModuleName = ProjectsModule.ModuleName,
                    ControlDefinitionName = ProjectsDefinitions.BackendDefinitionName
                };

                // add page
                initializer.CreatePageFromConfiguration(pageInfo, ProjectsModulePageGroupNode, backendView);
            }
        }
        /// <summary>
        /// Installs the pages.
        /// </summary>
        /// <param name="initializer">The initializer.</param>
        protected override void InstallPages(SiteInitializer initializer)
        {
            var moduleNode = initializer.PageManager.GetPageNode(SiteInitializer.ModulesNodeId);
            var pageManager = initializer.PageManager;

            var fundingRequestNode = pageManager.GetPageNodes().Where(p => p.Id == FundingModule.HomePageId).SingleOrDefault();
            if (fundingRequestNode == null)
            {
                fundingRequestNode = initializer.CreatePageNode(FundingModule.HomePageId, moduleNode);

                fundingRequestNode.Name = FundingModule.ModuleName;
                fundingRequestNode.ShowInNavigation = true;
                fundingRequestNode.Attributes["ModuleName"] = FundingModule.ModuleName;
                fundingRequestNode.Title = FundingModule.ModuleName;
                fundingRequestNode.UrlName = FundingModule.ModuleName;
            }

            // create the subpage
            var subPage = pageManager.GetPageNodes().Where(p => p.Id == FundingModule.ChildPageId).SingleOrDefault();
            if (subPage == null)
            {
                var pageInfo = new PageDataElement()
                {
                    PageId = FundingModule.ChildPageId,
                    Name = "FundingRequestList",
                    MenuName = "FundingRequestList",
                    UrlName = "FundingRequestList",
                    Description = "Funding Requests List",
                    ShowInNavigation = false,
                    TemplateName = SiteInitializer.BackendTemplateName,
                };
                pageInfo.Parameters["ModuleName"] = FundingModule.ModuleName;
                var control = new FundingRequestList();
                var node = initializer.CreatePageFromConfiguration(pageInfo, fundingRequestNode, control);
            }
        }