public DocumentPartHandler(IRepository<DocumentPartRecord> repository,
            IDocumentPathConstraint documentPathConstraint) {
            _documentPathConstraint = documentPathConstraint;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape<DocumentPart>((context, document) =>
            {
                context.Shape.Description = document.Description;
            });

            OnPublished<DocumentPart>((context, blog) => _documentPathConstraint.AddPath(blog.As<IAliasAspect>().Path));
            OnUnpublished<DocumentPart>((context, blog) => _documentPathConstraint.RemovePath(blog.As<IAliasAspect>().Path));
        }
示例#2
0
 public DocumentService(IContentManager contentManager, IDocumentPathConstraint documentPathConstraint)
 {
     _contentManager = contentManager;
     _documentPathConstraint = documentPathConstraint;
 }
 public DocumentPathConstraintUpdater(IDocumentPathConstraint documentPathConstraint, 
     IDocumentService documentService)
 {
     _documentPathConstraint = documentPathConstraint;
     _documentService = documentService;
 }