/// <summary> /// The default action to render the front-end view /// </summary> /// <param name="model"/> /// <returns/> public new async Task <ActionResult> Index(RenderModel model) { if (model == null) { throw new ArgumentNullException("model"); } var mediaUrlTransformer = new RemoveMediaDomainUrlTransformer(); var viewModel = new TaskViewModelFromUmbraco(model.Content, new RelatedLinksService(mediaUrlTransformer, new ElibraryUrlTransformer(), new RemoveAzureDomainUrlTransformer()), new ElibraryProxyLinkConverter(new SpydusUrlBuilder()), mediaUrlTransformer ).BuildModel(); // Add common properties to the model var modelBuilder = new BaseViewModelBuilder(new EastSussexGovUKTemplateRequest(Request, webChatSettingsService: new UmbracoWebChatSettingsService(model.Content, new UrlListReader()))); var expiryDate = new ExpiryDateFromExamine(model.Content.Id, ExamineManager.Instance.SearchProviderCollection["ExternalSearcher"], new ExpiryDateMemoryCache(TimeSpan.FromHours(1))); await modelBuilder.PopulateBaseViewModel(viewModel, model.Content, new ContentExperimentSettingsService(), expiryDate.ExpiryDate, UmbracoContext.Current.InPreviewMode, new SkinFromUmbraco()); modelBuilder.PopulateBaseViewModelWithInheritedContent(viewModel, new UmbracoLatestService(model.Content), new UmbracoSocialMediaService(model.Content), new UmbracoEastSussex1SpaceService(model.Content), new UmbracoEscisService(model.Content), new RatingSettingsFromUmbraco(model.Content)); new HttpCachingService().SetHttpCacheHeadersFromUmbracoContent(model.Content, UmbracoContext.Current.InPreviewMode, Response.Cache, new IExpiryDateSource[] { expiryDate, new ExpiryDateFromPropertyValue(model.Content, "latestUnpublishDate_Latest") }); return(CurrentTemplate(viewModel)); }
/// <summary> /// The default action to render the front-end view /// </summary> /// <param name="model"/> /// <returns/> public override ActionResult Index(RenderModel model) { if (model == null) { throw new ArgumentNullException("model"); } var mediaUrlTransformer = new RemoveMediaDomainUrlTransformer(); var viewModel = new TaskViewModelFromUmbraco(model.Content, new UmbracoOnAzureRelatedLinksService(mediaUrlTransformer), new ElibraryProxyLinkConverter(new SpydusUrlBuilder()), mediaUrlTransformer ).BuildModel(); // Add common properties to the model var modelBuilder = new BaseViewModelBuilder(); modelBuilder.PopulateBaseViewModel(viewModel, model.Content, new ContentExperimentSettingsService(), UmbracoContext.Current.InPreviewMode); modelBuilder.PopulateBaseViewModelWithInheritedContent(viewModel, new UmbracoLatestService(model.Content), new UmbracoSocialMediaService(model.Content), new UmbracoEastSussex1SpaceService(model.Content), new UmbracoWebChatSettingsService(model.Content, new UrlListReader()), new UmbracoEscisService(model.Content)); new HttpCachingService().SetHttpCacheHeadersFromUmbracoContent(model.Content, UmbracoContext.Current.InPreviewMode, Response.Cache, new List <string>() { "latestUnpublishDate_Latest" }); return(CurrentTemplate(viewModel)); }