public TermPartHandler( IRepository <TermPartRecord> repository, ITaxonomyService taxonomyService, ITermPathConstraint termPathConstraint) { Filters.Add(StorageFilter.For(repository)); OnRemoved <IContent>( (context, tags) => taxonomyService.DeleteAssociatedTerms(context.ContentItem) ); OnInitializing <TermPart>( (context, part) => part.Selectable = true ); OnPublished <TermPart>( (context, part) => { termPathConstraint.AddPath(part.Slug); foreach (var child in taxonomyService.GetChildren(part)) { termPathConstraint.AddPath(child.Slug); } }); OnUnpublishing <TermPart>( (context, part) => termPathConstraint.RemovePath(part.Slug) ); }
public TermPartHandler( IRepository<TermPartRecord> repository, ITaxonomyService taxonomyService, ITermPathConstraint termPathConstraint ) { Filters.Add(StorageFilter.For(repository)); OnRemoved<IContent>( (context, tags) => taxonomyService.DeleteAssociatedTerms(context.ContentItem) ); OnInitializing<TermPart>( (context, part) => part.Selectable = true ); OnPublished<TermPart>( (context, part) => { termPathConstraint.AddPath(part.Slug); foreach (var child in taxonomyService.GetChildren(part)) { termPathConstraint.AddPath(child.Slug); } }); OnUnpublishing<TermPart>( (context, part) => termPathConstraint.RemovePath(part.Slug) ); }