Esempio n. 1
0
        public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) {
            var model = new FieldIndexing();
            updateModel.TryUpdateModel(model, "FieldIndexing", null, null);
            builder.WithSetting("FieldIndexing.Included", model.Included ? true.ToString() : null);

            CreateIndexingTasks();

            yield return DefinitionTemplate(model);
        }
Esempio n. 2
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            var model = new FieldIndexing();

            updateModel.TryUpdateModel(model, "FieldIndexing", null, null);
            builder.WithSetting("FieldIndexing.Included", model.Included ? true.ToString() : null);

            CreateIndexingTasks();

            yield return(DefinitionTemplate(model));
        }
Esempio n. 3
0
        public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) {
            var previous = builder.Current.Settings.GetModel<FieldIndexing>(); 
            
            var model = new FieldIndexing();
            updateModel.TryUpdateModel(model, "FieldIndexing", null, null);
            builder.WithSetting("FieldIndexing.Included", model.Included ? true.ToString() : null);

            // create indexing tasks only if settings have changed
            if (model.Included != previous.Included) {

                // if a field setting has changed, all existing content items need to be re-indexed
                CreateIndexingTasks();
            }

            yield return DefinitionTemplate(model);
        }
Esempio n. 4
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            var previous = builder.Current.Settings.GetModel <FieldIndexing>();

            var model = new FieldIndexing();

            updateModel.TryUpdateModel(model, "FieldIndexing", null, null);
            builder.WithSetting("FieldIndexing.Included", model.Included ? true.ToString() : null);

            // create indexing tasks only if settings have changed
            if (model.Included != previous.Included)
            {
                // if a field setting has changed, all existing content items need to be re-indexed
                CreateIndexingTasks();
            }

            yield return(DefinitionTemplate(model));
        }