예제 #1
0
        public async Task <int> CreateAsync()
        {
            await _recipeMigrator.ExecuteAsync("menu.recipe.json", this);

            // Return 2 to shortcut the second migration on new content definition schemas.
            return(2);
        }
예제 #2
0
        public async Task <int> CreateAsync()
        {
            await _recipeMigrator.ExecuteAsync("menu.recipe.json", this);

            // Shortcut other migration steps on new content definition schemas.
            return(4);
        }
예제 #3
0
        public async Task <int> UpdateFrom5Async()
        {
            // Creates some default content so the console app can use hard coded ids.
            await _recipeMigrator.ExecuteAsync("foo-text-container-content.json", this);

            return(6);
        }
예제 #4
0
        public async Task <int> CreateAsync()
        {
            await _recipeMigrator.ExecuteAsync("userprofilecontenttype.recipe.json", this);

            await _recipeMigrator.ExecuteAsync("createuserProfileWorkflowType.recipe.json", this);

            return(1);
        }
예제 #5
0
        public async Task <int> CreateAsync()
        {
            await _recipeMigrator.ExecuteAsync("types.recipe.json", this);

            await _recipeMigrator.ExecuteAsync("queries.recipe.json", this);

            await _recipeMigrator.ExecuteAsync("content.recipe.json", this);

            _contentDefinitionManager.AlterTypeDefinition("Taxonomy", t => t.Securable());
            return(3);
        }
        public async Task <int> CreateAsync()
        {
            CreateHackathonCustomSetings();
            CreateUserProfiles();
            CreateWidgets();
            CreateChallenge();

            await _recipeMigrator.ExecuteAsync("queries.recipe.json", this);

            await _recipeMigrator.ExecuteAsync("roles.recipe.json", this);

            return(1);
        }
예제 #7
0
        public async Task <int> CreateAsync()
        {
            _contentDefinitionManager.AlterPartDefinition(nameof(LeverPostingPart), part => part
                                                          .WithDescription("Create a Lever posting content.")
                                                          .WithDisplayName(Constants.Lever.DisplayName));

            _contentDefinitionManager.AlterTypeDefinition(Constants.Lever.ContentType, type => type
                                                          .Draftable()
                                                          .Versionable()
                                                          .Listable()
                                                          .Creatable()
                                                          .Securable()
                                                          .WithPart(nameof(TitlePart))
                                                          .WithPart("AutoroutePart", part => part.WithSettings(new AutoroutePartSettings
            {
                AllowCustomPath = true,
                Pattern         = "{{ Model.ContentItem | display_text | slugify }}"
            }))
                                                          .WithPart(nameof(LeverPostingPart))
                                                          .DisplayedAs(Constants.Lever.DisplayName));

            SchemaBuilder.CreateMapIndexTable <LeverPostingPartIndex>(table => table
                                                                      .Column <string>("LeverId")
                                                                      );

            SchemaBuilder.AlterTable(nameof(LeverPostingPartIndex), table => table
                                     .CreateIndex("IDX_LeverPostingPartIndex_LeverId", "LeverId")
                                     );

            await _recipeMigrator.ExecuteAsync("create.recipe.json", this);

            return(1);
        }
예제 #8
0
        public async Task <int> CreateAsync()
        {
            // feature recipe is executed as a seperate step due to the
            // recipeMigrator not flushing the database session between steps.
            // Any new feature would not be enabled prior to the additional steps running.
            await _recipeMigrator.ExecuteAsync("features.recipe.json", this);

            await _recipeMigrator.ExecuteAsync("initial.recipe.json", this);

            await _recipeMigrator.ExecuteAsync("placements.recipe.json", this);

            Col();
            Row();
            Container();
            return(2);
        }
예제 #9
0
        public async Task <int> CreateAsync()
        {
            _contentDefinitionManager.AlterPartDefinition(nameof(FacebookPluginPart), builder => builder
                                                          .Attachable()
                                                          .WithDescription("Provides a facebook plugin part to create facebook social plugin widgets."));

            await _recipeMigrator.ExecuteAsync("Widgets/migration.recipe.json", this);

            return(await Task.FromResult(1));
        }
예제 #10
0
        public async Task <int> CreateAsync()
        {
            _contentDefinitionManager.AlterPartDefinition("GalleryPart", part => part
                                                          .Reusable()
                                                          .Attachable()
                                                          .WithDescription("Create a collection of media items."));

            await _recipeMigrator.ExecuteAsync("create.recipe.json", this);

            return(1);
        }
예제 #11
0
        public async Task <int> CreateAsync()
        {
            SchemaBuilder.CreateMapIndexTable <DashboardPartIndex>(table => table
                                                                   .Column <double>("Position")
                                                                   );

            SchemaBuilder.AlterIndexTable <DashboardPartIndex>(table => table
                                                               .CreateIndex("IDX_DashboardPart_DocumentId",
                                                                            "DocumentId",
                                                                            nameof(DashboardPartIndex.Position))
                                                               );

            _contentDefinitionManager.AlterPartDefinition("DashboardPart", builder => builder
                                                          .Attachable()
                                                          .WithDescription("Provides a way to add widgets to a dashboard.")
                                                          );

            await _recipeMigrator.ExecuteAsync("dashboard-widgets.recipe.json", this);

            // Shortcut other migration steps on new content definition schemas.
            return(3);
        }
예제 #12
0
        public async Task <int> CreateAsync()
        {
            _contentDefinitionManager.AlterPartDefinition("SiteSearch", part => part
                                                          .WithDescription("Adds site search to page.")
                                                          .WithDisplayName("Site Search"));

            await _recipeMigrator.ExecuteAsync("create.recipe.json", this);

            _contentDefinitionManager.AlterPartDefinition("SearchablePart", part => part
                                                          .Attachable()
                                                          .WithDescription("Makes content type included within site search.")
                                                          .WithDisplayName("Searchable"));

            return(1);
        }
        public async Task <int> CreateAsync()
        {
            #region Contextual Edit Part

            _contentDefinitionManager.AlterPartDefinition("ContextualEditPart", part => part
                                                          .WithDescription("When authorised, displays edit control for current page.")
                                                          .WithDisplayName("Contextual Edit"));

            #endregion

            #region Run Recipe

            await _recipeMigrator.ExecuteAsync("create.recipe.json", this);

            #endregion

            return(1);
        }
예제 #14
0
        public async Task <int> CreateAsync()
        {
            CreateJudgingCustomSettings();

            // create new Score part
            _contentDefinitionManager.AlterPartDefinition("Score", p => p
                                                          .Attachable()
                                                          .WithNumericField("Score", "0", new NumericFieldSettings()
            {
                Required = true, Scale = 1, Minimum = (decimal?)0.0, DefaultValue = "0"
            })
                                                          .WithTextField("Comment", "1")
                                                          .WithField("Judge", f => f
                                                                     .OfType(nameof(ContentPickerField))
                                                                     .WithDisplayName("Judge")
                                                                     .WithPosition("2")
                                                                     .WithSettings(new ContentPickerFieldSettings()
            {
                DisplayedContentTypes = new[] { "Volunteer" }, Required = true
            })
                                                                     )
                                                          .WithTeamField("2")
                                                          );

            _contentDefinitionManager.AlterTypeDefinition("ScoreEntry", t => t
                                                          .WithPart("Score", p => p.WithPosition("0"))
                                                          .WithPart("ScoreEntry", p => p.WithPosition("1"))
                                                          );

            // Judging List Widget
            _contentDefinitionManager.AlterPartDefinition("JudgingListWidget", p => p.WithDisplayName("Judging List Widget"));
            _contentDefinitionManager.AlterTypeDefinition("JudgingListWidget", t => t.Stereotype("Widget")
                                                          .WithPart("JudgingListWidget", p => p.WithPosition("0"))
                                                          );

            _contentDefinitionManager.AlterPartDefinition("JudgingResultWidget", p => p.WithDisplayName("Judging Result Widget"));
            _contentDefinitionManager.AlterTypeDefinition("JudgingResultWidget", t => t.Stereotype("Widget")
                                                          .WithPart("JudgingResultWidget", p => p.WithPosition("0"))
                                                          );

            await _recipeMigrator.ExecuteAsync("role-judge.recipe.json", this);

            return(1);
        }
예제 #15
0
        public async Task <int> CreateAsync()
        {
            await _recipeMigrator.ExecuteAsync("exportcontenttodeploymenttarget.recipe.json", this);

            var deploymentPlans = await _deploymentPlanService.GetAllDeploymentPlansAsync();

            var exportContentToDeploymentTargetPlan = deploymentPlans.FirstOrDefault(x => x.DeploymentSteps.Any(x => x.Name == nameof(ExportContentToDeploymentTargetDeploymentStep)));

            if (exportContentToDeploymentTargetPlan != null)
            {
                var siteSettings = await _siteService.LoadSiteSettingsAsync();

                siteSettings.Alter <ExportContentToDeploymentTargetSettings>(nameof(ExportContentToDeploymentTargetSettings), aspect => aspect.ExportContentToDeploymentTargetPlanId = exportContentToDeploymentTargetPlan.Id);

                await _siteService.UpdateSiteSettingsAsync(siteSettings);
            }

            return(1);
        }
예제 #16
0
        public async Task <int> CreateAsync()
        {
            _contentDefinitionManager.AlterPartDefinition("PostcodePart", part => part
                                                          .Attachable()
                                                          .WithDisplayName("Postcode")
                                                          .WithDescription("Adds postcode, longitude, latitude.")
                                                          );

            SchemaBuilder.CreateMapIndexTable(typeof(PostcodeIndex), table => table
                                              .Column <string>("Postcode", c => c.WithDefault(null))
                                              .Column <string>("Longitude", c => c.WithDefault(null))
                                              .Column <string>("Latitude", c => c.WithDefault(null)),
                                              null
                                              );

            _contentDefinitionManager.AlterPartDefinition("PostcodeSearch", part => part
                                                          .WithDescription("Adds postcode search to page.")
                                                          .WithDisplayName("Postcode Search"));

            await _recipeMigrator.ExecuteAsync("create.recipe.json", this);

            return(1);
        }
예제 #17
0
        public async Task <int> UpdateFrom1Async()
        {
            await _recipeMigrator.ExecuteAsync("socialmetasettings.recipe.json", this);

            return(2);
        }
예제 #18
0
        public async Task <int> UpdateFrom1()
        {
            await _recipeMigrator.ExecuteAsync("resume.recipe.json", this);

            return(2);
        }
예제 #19
0
        public async Task <int> CreateAsync()
        {
            await _recipeMigrator.ExecuteAsync("faqssetup.recipe.json", this);

            return(1);
        }
        public async Task <int> CreateAsync()
        {
            await _recipeMigrator.ExecuteAsync("advancedforms.recipe.json", this);

            return(1);
        }
예제 #21
0
        public async Task <int> CreateAsync()
        {
            await _recipeMigrator.ExecuteAsync("theadmintheme-settings.recipe.json", this);

            return(1);
        }
예제 #22
0
        public async Task <int> CreateAsync()
        {
            await recipeMigrator.ExecuteAsync("commentator.recipe.json", this);

            return(1);
        }
예제 #23
0
        public async Task <int> UpdateFrom1Async()
        {
            await _recipeMigrator.ExecuteAsync("api-role.json", this);

            return(2);
        }