Exemplo n.º 1
0
        public override IEnumerable<TemplateViewModel> TypeEditorUpdate(ContentTypeDefinitionBuilder builder, IUpdateModel updateModel) {
            var model = new TypeIndexing();
            updateModel.TryUpdateModel(model, "TypeIndexing", null, null);
            builder.WithSetting("TypeIndexing.Indexes", model.Indexes);

            CreateIndexingTasks();
            
            yield return DefinitionTemplate(model);
        }
Exemplo n.º 2
0
        public override IEnumerable <TemplateViewModel> TypeEditorUpdate(ContentTypeDefinitionBuilder builder, IUpdateModel updateModel)
        {
            var model = new TypeIndexing();

            updateModel.TryUpdateModel(model, "TypeIndexing", null, null);
            builder.WithSetting("TypeIndexing.Indexes", model.Indexes);

            CreateIndexingTasks();

            yield return(DefinitionTemplate(model));
        }
Exemplo n.º 3
0
        public override IEnumerable<TemplateViewModel> TypeEditorUpdate(ContentTypeDefinitionBuilder builder, IUpdateModel updateModel) {
            var previous = builder.Current.Settings.GetModel<TypeIndexing>();

            var model = new TypeIndexing();
            updateModel.TryUpdateModel(model, "TypeIndexing", null, null);
            builder.WithSetting("TypeIndexing.Indexes", model.Indexes);

            // create indexing tasks only if settings have changed
            if (Clean(model.Indexes) != Clean(previous.Indexes)) {
                
                // if a an index is added, all existing content items need to be re-indexed
                CreateIndexingTasks();
            }
            
            yield return DefinitionTemplate(model);
        }
Exemplo n.º 4
0
        public override IEnumerable <TemplateViewModel> TypeEditorUpdate(ContentTypeDefinitionBuilder builder, IUpdateModel updateModel)
        {
            var previous = builder.Current.Settings.GetModel <TypeIndexing>();

            var model = new TypeIndexing();

            updateModel.TryUpdateModel(model, "TypeIndexing", null, null);
            builder.WithSetting("TypeIndexing.Indexes", model.Indexes);

            // create indexing tasks only if settings have changed
            if (Clean(model.Indexes) != Clean(previous.Indexes))
            {
                // if a an index is added, all existing content items need to be re-indexed
                CreateIndexingTasks();
            }

            yield return(DefinitionTemplate(model));
        }