Example #1
0
        public ActionResult EnterPreview(int id)
        {
            var user = _umbracoContextAccessor.UmbracoContext.Security.CurrentUser;

            var previewToken = _publishedSnapshotService.EnterPreview(user, id);

            Response.Cookies.Set(new HttpCookie(Constants.Web.PreviewCookieName, previewToken));

            return(null);
        }
        public IHttpActionResult Get(Guid id)
        {
            var val = _publishedSnapshotService.EnterPreview(_userService.GetUserById(-1), _contentService.GetById(id).Id);

            IPublishedContent content = Umbraco.Content(id);

            ContentModel contentModel = _contentResolver.Value.ResolveContent(content);

            return(Ok(contentModel));
        }
Example #3
0
        public ActionResult Frame(int id, string culture)
        {
            var user = _umbracoContextAccessor.UmbracoContext.Security.CurrentUser;

            var previewToken = _publishedSnapshotService.EnterPreview(user, id);

            Response.Cookies.Set(new HttpCookie(Constants.Web.PreviewCookieName, previewToken));

            // use a numeric URL because content may not be in cache and so .Url would fail
            var query = culture.IsNullOrWhiteSpace() ? string.Empty : $"?culture={culture}";

            Response.Redirect($"../../{id}.aspx{query}", true);

            return(null);
        }
 public string EnterPreview(IUser user, int contentId)
 {
     return(inner.EnterPreview(user, contentId));
 }