Ejemplo 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);
        }
Ejemplo 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));
        }
Ejemplo 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);
        }
Ejemplo 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));
        }