private void DisplayFilter(DisplayFilterContext context)
        {
            var filterDisplay = context.ShapeFactory.AuditTrailFilter__ContentType(
                ContentType: context.Filters.Get("contenttype"),
                ContentTypes: _contentDefinitionManager.ListTypeDefinitions().OrderBy(x => x.DisplayName).ToArray());

            context.FilterDisplay.Add(filterDisplay);
        }
        private void DisplayFilter(DisplayFilterContext context)
        {
            var contentItemId = context.Filters.Get("content").ToInt32();

            if (contentItemId != null)
            {
                var contentItem   = _contentManager.Get(contentItemId.Value, VersionOptions.AllVersions);
                var filterDisplay = context.ShapeFactory.AuditTrailFilter__ContentItem(ContentItem: contentItem);

                context.FilterDisplay.Add(filterDisplay);
            }
        }
Beispiel #3
0
        public async Task <IShape> BuildFilterDisplayAsync(Filters filters)
        {
            var filterDisplay = await _shapeFactory.CreateAsync("AuditTrailFilter");

            var filterDisplayContext = new DisplayFilterContext(_shapeFactory, filters, filterDisplay as Shape);

            _auditTrailEventHandlers.Invoke((handler, context) => handler.DisplayFilterAsync(context), filterDisplayContext, Logger);

            // Give each provider a chance to provide a filter display.
            var providersContext = _auditTrailManager.DescribeProviders();

            foreach (var action in providersContext.FilterDisplays)
            {
                await action(filterDisplayContext);
            }

            return(filterDisplay);
        }
        public dynamic BuildFilterDisplay(Filters filters)
        {
            var filterDisplay        = (dynamic)_shapeFactory.Create("AuditTrailFilter");
            var filterDisplayContext = new DisplayFilterContext(_shapeFactory, filters, filterDisplay);

            // Invoke event handlers.
            _auditTrailEventHandlers.DisplayFilter(filterDisplayContext);

            // Give each provider a chance to provide a filter display.
            var providersContext = DescribeProviders();

            foreach (var action in providersContext.FilterDisplays)
            {
                action(filterDisplayContext);
            }

            return(filterDisplay);
        }
        public override void DisplayFilter(DisplayFilterContext context)
        {
            var userName = context.Filters.Get("username");
            var fromDate = context.Filters.Get("from.Date");
            var toDate   = context.Filters.Get("to.Date");
            var category = context.Filters.Get("category");
            var userNameFilterDisplay = context.ShapeFactory.AuditTrailFilter__Common__User(UserName: userName);
            var dateFromFilterDisplay = context.ShapeFactory.AuditTrailFilter__Common__Date__From(Editor: new DateTimeEditor {
                Date = fromDate, ShowDate = true
            });
            var dateToFilterDisplay = context.ShapeFactory.AuditTrailFilter__Common__Date__To(Editor: new DateTimeEditor {
                Date = toDate, ShowDate = true
            });
            var categoryFilterDisplay = context.ShapeFactory.AuditTrailFilter__Common__Category(
                Categories: _auditTrailManager.Value.DescribeCategories().ToArray(),
                Category: category);

            context.FilterDisplay.Add(dateFromFilterDisplay);
            context.FilterDisplay.Add(dateToFilterDisplay);
            context.FilterDisplay.Add(categoryFilterDisplay);
            context.FilterDisplay.Add(userNameFilterDisplay);
        }
Beispiel #6
0
        public override async Task DisplayFilterAsync(DisplayFilterContext context)
        {
            var auditTrailManager = _serviceProvider.GetService <IAuditTrailManager>();

            var userName = context.Filters.Get("username");
            var fromDate = context.Filters.Get("fromDate");
            var toDate   = context.Filters.Get("toDate");
            var category = context.Filters.Get("category");

            var userNameFilterDisplay = await context.ShapeFactory.New.AuditTrailFilter__Common__User(UserName : userName);

            var dateFromFilterDisplay = await context.ShapeFactory.New.AuditTrailFilter__Common__Date__From(Date : fromDate);

            var dateToFilterDisplay = await context.ShapeFactory.New.AuditTrailFilter__Common__Date__To(Date : toDate);

            var categoryFilterDisplay = await context.ShapeFactory.New.AuditTrailFilter__Common__Category(
                Categories : auditTrailManager.DescribeCategories().ToArray(),
                Category : category);

            context.FilterDisplay.Add(dateFromFilterDisplay);
            context.FilterDisplay.Add(dateToFilterDisplay);
            context.FilterDisplay.Add(categoryFilterDisplay);
            context.FilterDisplay.Add(userNameFilterDisplay);
        }
 public virtual void DisplayFilter(DisplayFilterContext context)
 {
 }
Beispiel #8
0
 public virtual Task DisplayFilterAsync(DisplayFilterContext context) => Task.CompletedTask;