private void CreateSampleWorker(object[] args)
        {
            SampleUtilities.CreateUsersAndRoles();
            SampleUtilities.RegisterToolboxWidget("NewsRotator Widget", typeof(Rotator), "Samples");
            SampleUtilities.RegisterTheme(SamplesThemeName, SamplesThemePath);
            SampleUtilities.RegisterTemplate(new Guid(SamplesTemplateId), SamplesTemplateName, SamplesTemplateName, SamplesTemplatePath, SamplesThemeName);

            SampleUtilities.UploadImages(HttpRuntime.AppDomainAppPath + "Images", "Thumbnails");
            this.CreateNewsItems();

            var result = SampleUtilities.CreatePage(new Guid(NewsPageId), "News");

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(NewsPageId), new Guid(SamplesTemplateId));

                NewsView newsView = new NewsView();
                SampleUtilities.AddControlToPage(new Guid(NewsPageId), newsView, "Content", "News");
            }

            result = SampleUtilities.CreatePage(new Guid(NewsRotatorWidgetPageId), NewsRotatorWidgetPageName, true);

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(NewsRotatorWidgetPageId), new Guid(SamplesTemplateId));

                Rotator newsRotator = new Rotator();
                SampleUtilities.AddControlToPage(new Guid(NewsRotatorWidgetPageId), newsRotator, "Content", "NewsRotator Widget");
            }
        }
Exemple #2
0
 protected void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args)
 {
     if (args.CommandName == "Bootstrapped")
     {
         SampleUtilities.CreateUsersAndRoles();
     }
 }
Exemple #3
0
        private void CreateSampleWorker(object[] args)
        {
            SampleUtilities.RegisterFormWidget("DatePickerWidget", typeof(DatePickerField), "Samples");
            SampleUtilities.RegisterTheme(SamplesThemeName, SamplesThemePath);
            SampleUtilities.RegisterTemplate(new Guid(SamplesTemplateId), SamplesTemplateName, SamplesTemplateName, SamplesTemplatePath, SamplesThemeName);

            var result = SampleUtilities.CreatePage(new Guid(DatePickerFormWidgetPageId), DatePickerFormWidgetPageName, true);

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(DatePickerFormWidgetPageId), new Guid(SamplesTemplateId));

                var controls = new Dictionary <Control, string>();

                DatePickerField dateField = new DatePickerField();
                dateField.Title = "Date:";

                controls.Add(dateField, "Body");

                FormSubmitButton submitButton = new FormSubmitButton();
                submitButton.Text = "Submit";

                controls.Add(submitButton, "Body");

                SampleUtilities.CreateForm(new Guid(DatePickerFormId), "SampleForm", "Sample Form", "Form submitted successfully. Thank you!", controls);

                FormsControl form = new FormsControl();
                form.FormId = new Guid(DatePickerFormId);

                SampleUtilities.AddControlToPage(new Guid(DatePickerFormWidgetPageId), form, "Content", "Forms Control");
            }
        }
Exemple #4
0
        private void CreateAboutUsPage()
        {
            var result = SampleUtilities.CreatePage(new Guid(AboutUsPageId), "About Us");

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(AboutUsPageId), new Guid(SamplesTemplateId));

                var titleContentBlock = new ContentBlockBase();
                titleContentBlock.Html = "<h1>About Us</h1>";

                SampleUtilities.AddControlToPage(new Guid(AboutUsPageId), titleContentBlock, "Content", "Content block");

                var overviewContentBlock = new ContentBlockBase();
                overviewContentBlock.Html = @"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sed ligula 
										vitae est posuere congue sed pretium quam. Pellentesque at velit in massa ornare 
										sagittis at in lacus. Fusce placerat leo eu sem sagittis posuere. Cras a arcu nec 
										turpis pulvinar vehicula. Proin sed metus nec leo rutrum mattis vel vel est. Pellentesque 
										lacinia nulla id lorem cursus fringilla.</p>
										<p>Proin non commodo velit. Vestibulum ante ipsum primis in faucibus orci luctus et 
										ultrices posuere cubilia Curae; Donec elementum imperdiet volutpat. Integer sit amet felis 
										in magna iaculis molestie vel in velit. Nulla facilisi. Sed iaculis imperdiet turpis, in 
										vulputate lorem mattis non. In condimentum, neque vitae elementum sodales, metus mi congue 
										urna, a imperdiet sem massa at felis. Aliquam erat volutpat. Nullam eget lorem enim, at 
										venenatis felis. Maecenas et euismod diam.</p>
										<p>Pellentesque tortor tellus, cursus dignissim hendrerit non, ornare a tellus. Donec ut 
										consequat massa. Phasellus fermentum, justo vel congue tincidunt, metus diam sagittis eros, 
										sed ornare tellus enim sit amet sem. Duis gravida tortor eget risus varius vel ullamcorper 
										risus semper. </p>"                                        ;

                SampleUtilities.AddControlToPage(new Guid(AboutUsPageId), overviewContentBlock, "Content", "Content block");
            }
        }
Exemple #5
0
        private void CreateNewsItems()
        {
            var newsCreated = App.WorkWith().NewsItems().Get().Count() > 0;

            if (!newsCreated)
            {
                var author      = "admin";
                var newsTitle   = "Sample News Item A";
                var newsContent = @"<div id=""lipsum"">
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet nisi ac risus scelerisque fermentum non sit amet purus. Morbi dolor sapien, luctus ac commodo posuere, scelerisque eu arcu. Mauris a dolor risus, quis mattis mauris. Mauris tellus lacus, auctor quis hendrerit ut, vulputate quis est. Sed massa est, gravida eu cursus et, laoreet non risus. Praesent bibendum condimentum tellus, ut blandit lorem vehicula mattis. Nam at nisl quis lacus accumsan tempor. Mauris viverra aliquam lorem, et molestie odio mattis in. Integer non ipsum lacus. Morbi sed justo arcu. Pellentesque volutpat scelerisque ligula nec ultrices. Mauris quam ipsum, fringilla ac molestie ac, interdum ut eros. Etiam sit amet lacus orci, quis eleifend nibh. </p>
<p> Praesent mauris odio, venenatis eu suscipit vel, rhoncus eu est. Nam semper diam a massa aliquam bibendum. Mauris eget quam orci, eu gravida odio. Curabitur tellus enim, rutrum sed venenatis nec, aliquet vitae nibh. Aenean eget nisi non libero cursus sagittis. Sed pellentesque eleifend libero, sed eleifend ipsum interdum at. Mauris eget ultricies odio. Donec eget fringilla lectus. Curabitur elit lacus, aliquam in facilisis eu, laoreet faucibus sem. Fusce varius dolor at nulla facilisis id semper massa sodales. </p>
<p> Aenean placerat viverra risus hendrerit dictum. Quisque mattis, magna id egestas lobortis, dui lorem egestas orci, sit amet pulvinar felis odio quis ligula. Vivamus erat nisi, lobortis vitae tincidunt a, blandit eu lectus. Fusce vitae purus vitae sapien adipiscing molestie fringilla ut tortor. Quisque ipsum tellus, hendrerit in lobortis vitae, placerat sed dui. Maecenas vehicula vehicula nibh non ullamcorper. Nam pulvinar, dolor id mollis pretium, sem urna posuere ligula, quis facilisis dui eros non lectus. Nulla sodales venenatis quam, at molestie risus tincidunt quis. Curabitur et justo vel arcu condimentum suscipit. Aenean a odio massa. Praesent aliquam mauris sit amet lectus venenatis ac vestibulum massa egestas. Nunc in velit quam. Fusce malesuada dolor eu erat rutrum cursus in eu erat. Maecenas mi justo, interdum eget ultricies non, viverra sed libero. </p>
<p> Duis neque odio, pellentesque vitae fermentum vel, condimentum sed nisi. Nulla interdum, tortor nec ultrices congue, lectus mi tincidunt ante, et egestas massa erat vitae enim. Integer sagittis interdum elit. Suspendisse potenti. Integer a ligula nibh, ac consequat felis. Cras a magna nunc, a semper odio. Donec nulla mauris, luctus quis egestas nec, malesuada eu ligula. Vivamus malesuada lorem id massa sollicitudin in sagittis felis pellentesque. Cras vel nulla eget nunc tristique hendrerit. Ut porttitor mattis cursus. </p>
<p> Integer in mauris in eros malesuada ullamcorper. Phasellus vel nunc vel nunc malesuada tristique. Sed in felis quis nisl vehicula ultrices. Cras nec nunc eu massa imperdiet aliquam. Ut interdum, leo ut adipiscing egestas, lectus purus commodo felis, ac condimentum purus massa ut nibh. Vestibulum non nisi leo, eget faucibus nunc. In hac habitasse platea dictumst. Maecenas mauris urna, sollicitudin ac rhoncus quis, adipiscing ac massa. Duis et nisl augue. Vestibulum ullamcorper lectus egestas diam euismod ultrices. Quisque quis luctus mi. </p>
</div>";
                var summary     = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet nisi ac risus scelerisque fermentum non sit amet purus. Morbi dolor sapien, luctus ac commodo posuere, scelerisque eu arcu. Mauris a dolor risus, quis mattis mauris. Mauris tellus lacus, auctor quis hendrerit ut, vulputate quis est.";

                SampleUtilities.CreateNewsItem(newsTitle, newsContent, summary, author);

                newsTitle = "Sample News Item B";

                SampleUtilities.CreateNewsItem(newsTitle, newsContent, summary, author);

                newsTitle = "Sample News Item C";

                SampleUtilities.CreateNewsItem(newsTitle, newsContent, summary, author);
            }
        }
Exemple #6
0
        private void CreateForums()
        {
            var success = SampleUtilities.CreateForumGroup(new Guid(ForumGroupId), ForumGroupTitle, string.Empty);

            SampleUtilities.CreateForum(new Guid(ForumId), new Guid(ForumGroupId), ForumTitle, string.Empty);
            SampleUtilities.CreateForumThreadFromPost(new Guid(ForumId), new Guid(ForumThreadId), new Guid(ForumPostId), "You can post in this thread to test the Akismet sample", "This is the first post.");
        }
Exemple #7
0
        private void CreateBlogBPage()
        {
            var result = SampleUtilities.CreatePage(new Guid(BlogBPageId), "Blog B");

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(BlogBPageId), new Guid(SamplesTemplateId));

                var templateKey = SampleUtilities.GetControlTemplateKey(typeof(MasterPostsView), "Titles, dates and summaries");
                SampleUtilities.RegisterBlogPostsFrontendView("BlogPostsFrontend", templateKey, typeof(MasterPostsView), "BlogPostsFrontendBlogList");

                var blogsControl = new BlogPostView();
                blogsControl.MasterViewName = "BlogPostsFrontendBlogList";
                var parent = new List <Guid>()
                {
                    new Guid(SampleBlogBId)
                };
                ((IContentViewMasterDefinition)blogsControl.ControlDefinition.Views[blogsControl.MasterViewName]).ItemsParentsIds = parent;

                SampleUtilities.AddControlToPage(new Guid(BlogBPageId), blogsControl, "Content", "Blog B View");

                // save default page for blog posts
                App.WorkWith().Blog(new Guid(SampleBlogBId)).Do(b => b.DefaultPageId = new Guid(BlogBPageId)).SaveChanges();
            }
        }
        private void CreateSampleWorker(object[] args)
        {
            ConfigManager.Executed += this.ConfigManager_Executed;

            SampleUtilities.RegisterTheme(SamplesThemeName, SamplesThemePath);
            var result = SampleUtilities.RegisterTemplate(new Guid(SamplesTemplateId), SamplesTemplateName, SamplesTemplateName, SamplesTemplateMasterPage, SamplesThemeName);

            if (result)
            {
                var navigationControl = new NavigationControl();
                navigationControl.NavigationMode   = NavigationModes.HorizontalDropDownMenu;
                navigationControl.NavigationAction = NavigationAction.OnMouseOver;
                navigationControl.Skin             = "WebBlue";

                SampleUtilities.AddControlToTemplate(new Guid(SamplesTemplateId), navigationControl, "Menu", "Navigation");
            }

            // add aa custom events provider
            var eventsConfig = Config.Get <EventsConfig>();

            if (!eventsConfig.Providers.Elements.Any(p => p.Name == CustomEventsProviderName))
            {
                var customProvider = new DataProviderSettings(eventsConfig.Providers)
                {
                    Name         = CustomEventsProviderName,
                    Description  = "Alternate provider for storing Events data in database using OpenAccess ORM.",
                    ProviderType = typeof(OpenAccessEventProvider)
                };
                var values = new NameValueCollection();
                values.Add("applicationName", "/CustomEvents");
                customProvider.Parameters = values;
                eventsConfig.Providers.Add(customProvider);
                ConfigManager.GetManager().SaveSection(eventsConfig);
            }
            //create the default calendar for the custom events provier
            EventsManager eventsManager         = EventsManager.GetManager(CustomEventsProviderName);
            Calendar      defaultCustomCalendar = eventsManager.CreateCalendar();

            defaultCustomCalendar.Title   = "Custom Calendar";
            defaultCustomCalendar.UrlName = "custom-calendar";
            eventsManager.SaveChanges();

            this.CreateNewsItems();
            this.CreateBlogPosts();
            this.CreateEvents(string.Empty);
            this.CreateEvents(CustomEventsProviderName);

            this.CreateHomePage();
            this.CreateAboutUsPage();
            this.CreateNewsPage();
            this.CreateBlogAPage();
            this.CreateBlogBPage();
            this.CreateEventsPage();
            this.CreateCustomEventsPage();
            this.CreateContactUsPage();
        }
Exemple #9
0
        private void CreateBlogPosts()
        {
            #region Blog A

            SampleUtilities.CreateBlog(new Guid(SampleBlogAId), "Sample Blog A", "Sample Blog A");

            var postsCreated = App.WorkWith().Blog(new Guid(SampleBlogAId)).BlogPosts().Get().Count() > 0;

            if (!postsCreated)
            {
                var title   = "Blog A Sample Post A";
                var content = @"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus non lectus at sem consequat suscipit. Etiam nunc sem, condimentum a feugiat sit amet, consectetur sed justo. Nullam purus erat, tincidunt sed commodo ac, mollis vel neque. Vestibulum volutpat nulla in enim aliquet vitae ornare nunc gravida. </p>
<p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam ipsum nisl, tempor at tincidunt quis, congue vel purus. Duis sodales, est quis mollis posuere, mi mauris mollis sapien, ut rhoncus leo justo sed dolor. Etiam blandit tincidunt velit ac pellentesque. Cras nec leo lacus. Maecenas vel ipsum vitae dolor ultrices tempus. </p>
<p>Nam a erat felis, a pellentesque diam. Phasellus nibh lectus, adipiscing nec pharetra in, semper eu ipsum. Nam venenatis dignissim risus nec fringilla. Quisque placerat leo non ligula dictum sed auctor neque bibendum. Proin arcu risus, ullamcorper in dictum sed, tincidunt et odio. Praesent sed orci eget metus commodo egestas.</p>
<p>Quisque sollicitudin tellus quis est egestas nec pretium leo volutpat. Aliquam euismod viverra sollicitudin. Morbi quis leo velit, eget tincidunt nisi. Phasellus non convallis nunc. Ut ligula lorem, hendrerit eget eleifend quis, ullamcorper vel quam. Quisque ullamcorper dolor quis nunc volutpat eget elementum nunc lobortis. </p>
<p>Aenean laoreet sodales libero eget feugiat. Praesent purus nibh, blandit eu fermentum ac, pulvinar sed mi. Sed lobortis euismod tortor, vitae mattis nulla pulvinar quis. Quisque a augue a felis consectetur aliquam ac non metus. Fusce sapien erat, ultrices vitae scelerisque sed, gravida ut elit. In hac habitasse platea dictumst. Aliquam quis lectus sit amet lectus porta imperdiet. Pellentesque sed libero vitae nulla elementum venenatis nec vitae dolor. Quisque egestas purus id nulla fringilla sed malesuada ligula venenatis. In sit amet purus velit. Quisque ac aliquam urna.</p>";
                var author  = "admin";

                SampleUtilities.CreateBlogPost(new Guid(SampleBlogAId), title, content, author, string.Empty);

                title = "Blog A Sample Post B";

                SampleUtilities.CreateBlogPost(new Guid(SampleBlogAId), title, content, author, string.Empty);
            }

            #endregion

            #region Blog B

            SampleUtilities.CreateBlog(new Guid(SampleBlogBId), "Sample Blog B", "Sample Blog B");

            postsCreated = App.WorkWith().Blog(new Guid(SampleBlogBId)).BlogPosts().Get().Count() > 0;

            if (!postsCreated)
            {
                var title   = "Blog B Sample Post A";
                var content = @"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus non lectus at sem consequat suscipit. Etiam nunc sem, condimentum a feugiat sit amet, consectetur sed justo. Nullam purus erat, tincidunt sed commodo ac, mollis vel neque. Vestibulum volutpat nulla in enim aliquet vitae ornare nunc gravida. </p>
<p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam ipsum nisl, tempor at tincidunt quis, congue vel purus. Duis sodales, est quis mollis posuere, mi mauris mollis sapien, ut rhoncus leo justo sed dolor. Etiam blandit tincidunt velit ac pellentesque. Cras nec leo lacus. Maecenas vel ipsum vitae dolor ultrices tempus. </p>
<p>Nam a erat felis, a pellentesque diam. Phasellus nibh lectus, adipiscing nec pharetra in, semper eu ipsum. Nam venenatis dignissim risus nec fringilla. Quisque placerat leo non ligula dictum sed auctor neque bibendum. Proin arcu risus, ullamcorper in dictum sed, tincidunt et odio. Praesent sed orci eget metus commodo egestas.</p>
<p>Quisque sollicitudin tellus quis est egestas nec pretium leo volutpat. Aliquam euismod viverra sollicitudin. Morbi quis leo velit, eget tincidunt nisi. Phasellus non convallis nunc. Ut ligula lorem, hendrerit eget eleifend quis, ullamcorper vel quam. Quisque ullamcorper dolor quis nunc volutpat eget elementum nunc lobortis. </p>
<p>Aenean laoreet sodales libero eget feugiat. Praesent purus nibh, blandit eu fermentum ac, pulvinar sed mi. Sed lobortis euismod tortor, vitae mattis nulla pulvinar quis. Quisque a augue a felis consectetur aliquam ac non metus. Fusce sapien erat, ultrices vitae scelerisque sed, gravida ut elit. In hac habitasse platea dictumst. Aliquam quis lectus sit amet lectus porta imperdiet. Pellentesque sed libero vitae nulla elementum venenatis nec vitae dolor. Quisque egestas purus id nulla fringilla sed malesuada ligula venenatis. In sit amet purus velit. Quisque ac aliquam urna.</p>";
                var author  = "admin";

                SampleUtilities.CreateBlogPost(new Guid(SampleBlogBId), title, content, author, string.Empty);

                title = "Blog B Sample Post B";

                SampleUtilities.CreateBlogPost(new Guid(SampleBlogBId), title, content, author, string.Empty);

                title = "Blog B Sample Post C";

                SampleUtilities.CreateBlogPost(new Guid(SampleBlogBId), title, content, author, string.Empty);
            }

            #endregion
        }
 protected void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         SampleUtilities.RegisterModule <JobsModule>("Jobs", "This module presents showcases how to create a jobs module that allows users to submit jobs applications.");
     }
     if ((Bootstrapper.IsDataInitialized) && (e.CommandName == "Bootstrapped"))
     {
         var worker = new SystemManager.RunWithElevatedPrivilegeDelegate(CreateSampleWorker);
         SystemManager.RunWithElevatedPrivilege(worker);
     }
 }
 void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         SampleUtilities.RegisterModule <SiteMapModule>("SiteMap", "This sample presents showcases how to create a sitemap module which generates a search engine friendly sitemap.xml for your site.");
     }
     if ((Bootstrapper.IsDataInitialized) && (e.CommandName == "Bootstrapped"))
     {
         SystemManager.RunWithElevatedPrivilegeDelegate worker = new SystemManager.RunWithElevatedPrivilegeDelegate(CreateSampleWorker);
         SystemManager.RunWithElevatedPrivilege(worker);
     }
 }
 void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         SampleUtilities.RegisterModule <TemplateImporterModule>("Template Importer", "This module imports templates from template builder.");
     }
     if ((Bootstrapper.IsDataInitialized) && (e.CommandName == "Bootstrapped"))
     {
         SystemManager.RunWithElevatedPrivilegeDelegate worker = new SystemManager.RunWithElevatedPrivilegeDelegate(CreateSampleWorker);
         SystemManager.RunWithElevatedPrivilege(worker);
     }
 }
Exemple #13
0
 void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         SampleUtilities.RegisterModule <TestimonialsModule>("Testimonials", "A simple user-control based module for maintaining a list of testimonials that can be sumitted by users.");
     }
     if ((Bootstrapper.IsDataInitialized) && (e.CommandName == "Bootstrapped"))
     {
         SystemManager.RunWithElevatedPrivilegeDelegate worker = new SystemManager.RunWithElevatedPrivilegeDelegate(this.CreateSampleWorker);
         SystemManager.RunWithElevatedPrivilege(worker);
     }
 }
 void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         SampleUtilities.RegisterModule <LocationsModule.LocationsModule>("Locations", "A content-based module for maintaining a list of locations, such as office addresses, branch locations, etc.");
     }
     if ((Bootstrapper.IsDataInitialized) && (e.CommandName == "Bootstrapped"))
     {
         SystemManager.RunWithElevatedPrivilegeDelegate worker = new SystemManager.RunWithElevatedPrivilegeDelegate(CreateSampleWorker);
         SystemManager.RunWithElevatedPrivilege(worker);
     }
 }
Exemple #15
0
 void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         SampleUtilities.RegisterModule <EventLoggerModule>("EventLogger", "This sample describes how to log Sitefinity events in your website..");
     }
     if ((Bootstrapper.IsDataInitialized) && (e.CommandName == "Bootstrapped"))
     {
         SystemManager.RunWithElevatedPrivilegeDelegate worker = new SystemManager.RunWithElevatedPrivilegeDelegate(CreateSampleWorker);
         SystemManager.RunWithElevatedPrivilege(worker);
     }
 }
Exemple #16
0
        private void CreateBlogs()
        {
            var result = SampleUtilities.CreateBlog(new Guid(AkismetBlogId), AkismetBlogTitle, AkismetBlogDescription);

            SampleUtilities.CreateBlogPost(
                new Guid(AkismetBlogId),
                new Guid(AkismetBlogPostId),
                "Akismet Integration in Sitefinity",
                "You can submit comments to this blog post to test the Akismet integration. They will be checked through Akismet to confirm they're not spam",
                "Telerik",
                "A blog post to test comment submission");
        }
Exemple #17
0
 void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         SampleUtilities.RegisterModule <ProductsModule>("ProductsCatalog", "This is a module that provides product listings built on top of a native content-based module in Sitefinity. Content-based modules themselves are based on Generic Content and reuse much of the functionality available there. This is the most comprehensive example of a content-based module that features all built-in functionality of a native Sitefinity module.");
     }
     if ((Bootstrapper.IsDataInitialized) && (e.CommandName == "Bootstrapped"))
     {
         SystemManager.RunWithElevatedPrivilegeDelegate worker = new SystemManager.RunWithElevatedPrivilegeDelegate(CreateSampleWorker);
         SystemManager.RunWithElevatedPrivilege(worker);
     }
 }
Exemple #18
0
        private void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
        {
            if (e.CommandName == "RegisterRoutes")
            {
                SampleUtilities.RegisterModule <AkismetModule.AkismetModule>("Akismet", "Showcases Forums Akismet integration");
            }

            if ((Bootstrapper.IsDataInitialized) && (e.CommandName == "Bootstrapped"))
            {
                SystemManager.RunWithElevatedPrivilegeDelegate worker = new SystemManager.RunWithElevatedPrivilegeDelegate(this.CreateSample);
                SystemManager.RunWithElevatedPrivilege(worker);
            }
        }
Exemple #19
0
        private void CreateContactUsPage()
        {
            var result = SampleUtilities.CreatePage(new Guid(ContactUsPageId), "Contact Us", new Guid(AboutUsPageId));

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(ContactUsPageId), new Guid(SamplesTemplateId));

                var titleContentBlock = new ContentBlockBase();
                titleContentBlock.Html = string.Concat(@"<h1>Contact Us</h1>", FILLER_TEXT);

                SampleUtilities.AddControlToPage(new Guid(ContactUsPageId), titleContentBlock, "Content", "Content block");
            }
        }
Exemple #20
0
        private void CreateForumsPage()
        {
            var result = SampleUtilities.CreatePage(new Guid(ForumsPageId), "Forum");

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(ForumsPageId), new Guid(SamplesTemplateId));

                var templateKey  = SampleUtilities.GetControlTemplateKey(typeof(ForumListView), "List of forums");
                var forumControl = new ForumsView();
                forumControl.MasterViewName = "ForumListView";

                SampleUtilities.AddControlToPage(new Guid(ForumsPageId), forumControl, "Content", "Forum View");
            }
        }
        private void CreateContactUsPage()
        {
            var result = SampleUtilities.CreatePage(new Guid(ContactUsPageId), "Contact Us", new Guid(AboutUsPageId));

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(ContactUsPageId), new Guid(SamplesTemplateId));

                var titleContentBlock = new ContentBlockBase();
                titleContentBlock.Html = @"<h1>Contact Us</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed diam lectus, vel facilisis odio. Donec ac rutrum felis. Curabitur bibendum est vel elit iaculis a scelerisque massa rhoncus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>";

                SampleUtilities.AddControlToPage(new Guid(ContactUsPageId), titleContentBlock, "Content", "Content block");
            }
        }
Exemple #22
0
        private void CreateHomePage()
        {
            var result = SampleUtilities.CreatePage(new Guid(HomePageId), "Home");

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(HomePageId), new Guid(SamplesTemplateId));

                // add welcome and instructions to page
                var generalInformationBlock = new ContentBlock();
                generalInformationBlock.Html = @"<h1>Sitefinity Event Logger Module Example</h1><p>This is the home page for the SiteMap Event Logger module example website. To view the log visit <a href=""/Sitefinity/Administration/EventLogger"">Event Logger Administration</a> (requires login).</p>";

                SampleUtilities.AddControlToPage(new Guid(HomePageId), generalInformationBlock, "Content", "Content block");
            }
        }
        private void CreateHomePage()
        {
            var result = SampleUtilities.CreatePage(new Guid(HomePageId), "Home");

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(HomePageId), new Guid(SamplesTemplateId));

                // add welcome and instructions to page
                var generalInformationBlock = new ContentBlock();
                generalInformationBlock.Html = @"<h1>SiteMap Intra-Site Module Example</h1><p>This is the home page for the SiteMap Intra-Site module example website. To view the sitemap visit <a href=""sitemap.xml"">sitemap.xml</a>.</p>";

                SampleUtilities.AddControlToPage(new Guid(HomePageId), generalInformationBlock, "Content", "Content block");
            }
        }
        private void CreateSampleWorker(object[] args)
        {
            SampleUtilities.CreateUsersAndRoles();
            SampleUtilities.RegisterTheme(SamplesThemeName, SamplesThemePath);
            SampleUtilities.RegisterTemplate(new Guid(SamplesTemplateId), SamplesTemplateName, SamplesTemplateName, SamplesTemplatePath, SamplesThemeName);

            var result = SampleUtilities.CreatePage(new Guid(JobApplicationPageId), JobApplicationPageName, true);

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(JobApplicationPageId), new Guid(SamplesTemplateId));

                var jobApplicationUpload = new JobApplicationUpload();
                SampleUtilities.AddControlToPage(new Guid(JobApplicationPageId), jobApplicationUpload, "Content", "UploadJobsWidget");
            }
        }
Exemple #25
0
        private void CreateSampleWorker(object[] args)
        {
            SampleUtilities.RegisterToolboxWidget("Products Widget", typeof(ProductsView), "Samples");
            SampleUtilities.RegisterTheme(SamplesThemeName, SamplesThemePath);
            SampleUtilities.RegisterTemplate(new Guid(SamplesTemplateId), SamplesTemplateName, SamplesTemplateName, SamplesTemplatePath, SamplesThemeName);

            var result = SampleUtilities.CreatePage(new Guid(ProductsPageId), ProductsPageName, true);

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(ProductsPageId), new Guid(SamplesTemplateId));

                ProductsView productsView = new ProductsView();
                SampleUtilities.AddControlToPage(new Guid(ProductsPageId), productsView, "Content", "Products Widget");
            }
        }
Exemple #26
0
        private void CreateNewsPage()
        {
            var result = SampleUtilities.CreatePage(new Guid(NewsPageId), "News");

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(NewsPageId), new Guid(SamplesTemplateId));

                var templateKey = SampleUtilities.GetControlTemplateKey(typeof(MasterListView), "Titles, dates and summaries");
                SampleUtilities.RegisterNewsFrontendView("NewsFrontend", templateKey, typeof(MasterListView), "NewsFrontendTitleDatesAndSummariesList");

                var newsControl = new NewsView();
                newsControl.MasterViewName = "NewsFrontendTitleDatesAndSummariesList";

                SampleUtilities.AddControlToPage(new Guid(NewsPageId), newsControl, "Content", "News View");
            }
        }
        private void CreateSampleWorker(object[] args)
        {
            SampleUtilities.RegisterTheme(SamplesThemeName, SamplesThemePath);
            SampleUtilities.RegisterTemplate(new Guid(SamplesTemplateId), SamplesTemplateName, SamplesTemplateName, SamplesTemplatePath, SamplesThemeName);

            var result = SampleUtilities.CreatePage(new Guid(HomePageId), HomePageName, true);

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(HomePageId), new Guid(SamplesTemplateId));

                // add a note with a link to the Template Builder
                ContentBlockBase contentBlock = new ContentBlockBase();
                contentBlock.Html = @"<h2>Note:</h2><p>The module in this sample works with templates, created using the <a href='http://www.sitefinity.com/devnet/templatebuilder.aspx'>Sitefinity Template Builder</a></p>";
                SampleUtilities.AddControlToPage(new Guid(HomePageId), contentBlock, "Content", "Content Block");
            }
        }
Exemple #28
0
        private void CreateEventsPage()
        {
            var result = SampleUtilities.CreatePage(new Guid(EventsPageId), "Events");

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(EventsPageId), new Guid(SamplesTemplateId));

                var templateKey = SampleUtilities.GetControlTemplateKey(typeof(MasterView), "Titles, cities, dates");
                SampleUtilities.RegisterEventsFrontendView("EventsFrontend", templateKey, typeof(MasterView), "EventsFrontendDateList");

                var eventsControl = new EventsView();
                eventsControl.MasterViewName = "EventsFrontendDateList";
                eventsControl.ControlDefinition.GetDefaultDetailView().TemplateKey = SampleUtilities.GetControlTemplateKey(typeof(Telerik.Sitefinity.Modules.Events.Web.UI.Public.DetailsView), "Full event item");

                SampleUtilities.AddControlToPage(new Guid(EventsPageId), eventsControl, "Content", "Events View");
            }
        }
        private void CreateSample(object[] args)
        {
            SampleUtilities.RegisterToolboxWidget("CoverFlowWidget", typeof(CoverFlow), "Samples");
            SampleUtilities.RegisterTheme(SamplesThemeName, SamplesThemePath);
            SampleUtilities.RegisterTemplate(new Guid(SamplesTemplateId), SamplesTemplateName, SamplesTemplateName, SamplesTemplatePath, SamplesThemeName);

            SampleUtilities.UploadImages(HttpRuntime.AppDomainAppPath + "Images", "CoverFlowImages");

            var result = SampleUtilities.CreatePage(new Guid(CoverFlowWidgetPageId), CoverFlowWidgetPageName, true);

            if (result)
            {
                SampleUtilities.SetTemplateToPage(new Guid(CoverFlowWidgetPageId), new Guid(SamplesTemplateId));

                CoverFlow myWidget = new CoverFlow();
                myWidget.AlbumTitle = "CoverFlowImages";

                SampleUtilities.AddControlToPage(new Guid(CoverFlowWidgetPageId), myWidget, "Content", "CoverFlowWidget");
            }
        }
Exemple #30
0
        private void CreateForums()
        {
            var groupId = new Guid(SampleForumGroupId);

            var mgr = ForumsManager.GetManager();

            if (mgr.GetGroups().Where(g => g.Id == groupId).FirstOrDefault() == null)
            {
                // create forum group
                SampleUtilities.CreateForumGroup(groupId, "Sample Forum Group", "Sample Forum Group for the Sitefinity Event Logger Module website.");

                // create sample forum
                var forumId = new Guid(SampleForumId);
                SampleUtilities.CreateForum(forumId, groupId, "Sample Forum", "Sample Discussion Forum");

                var forumContent = FILLER_TEXT;


                SampleUtilities.CreateForumThreadFromPost(forumId, new Guid(SampleThreadId), new Guid(SamplePostId), "Sample Post A", forumContent);
            }
        }