Esempio n. 1
0
        protected override DriverResult Display(CaseArchivesPart part, string displayType, dynamic shapeHelper)
        {
            return(ContentShape("Parts_Cases_CaseArchives",
                                () => {
                var cAse = _cAseService.Get(part.CaseNumber, VersionOptions.Published).As <CasePart>();

                if (cAse == null)
                {
                    return null;
                }

                return shapeHelper.Parts_Cases_CaseArchives(Case: cAse, Archives: _cAsePostService.GetArchives(cAse));
            }));
        }
Esempio n. 2
0
        public ActionResult ListByArchive(string path)
        {
            var cAsePath = _archiveConstraint.FindPath(path);
            var archive  = _archiveConstraint.FindArchiveData(path);

            if (cAsePath == null)
            {
                return(HttpNotFound());
            }

            if (archive == null)
            {
                return(HttpNotFound());
            }

            CasePart cAsePart = _cAseService.Get(cAsePath);

            if (cAsePart == null)
            {
                return(HttpNotFound());
            }


            if (archive.ToDateTime() == DateTime.MinValue)
            {
                // render the archive data
                return(new ShapeResult(this, Shape.Parts_Cases_CaseArchives(Case: cAsePart, Archives: _cAsePostService.GetArchives(cAsePart))));
            }

            var list = Shape.List();

            list.AddRange(_cAsePostService.Get(cAsePart, archive).Select(b => _services.ContentManager.BuildDisplay(b, "Summary")));

            _feedManager.Register(cAsePart, _services.ContentManager.GetItemMetadata(cAsePart).DisplayText);

            var viewModel = Shape.ViewModel()
                            .ContentItems(list)
                            .Case(cAsePart)
                            .ArchiveData(archive);

            return(View(viewModel));
        }