Example #1
0
        public ActionResult AddPageHtmlContent(string pageIdentifier, string regionIdentifier, string parentPageContentIdentifier)
        {
            var addRequest = new InsertHtmlContentRequest
            {
                PageId              = pageIdentifier,
                RegionId            = regionIdentifier,
                ParentPageContentId = parentPageContentIdentifier
            };
            var model = GetCommand <GetInsertHtmlContentCommand>().ExecuteCommand(addRequest);

            if (model != null)
            {
                var request = new GetWidgetCategoryRequest();
                model.WidgetCategories = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request).WidgetCategories;
            }

            var view = RenderView("AddPageHtmlContent", model ?? new PageContentViewModel());

            var result = ComboWireJson(model != null, view, model, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
// TODO: very large JSON ~2.1MB on test environment!!!
//            var scriptSerializer = new JavaScriptSerializer();
//            if (result.MaxJsonLength.HasValue)
//            {
//                scriptSerializer.MaxJsonLength = result.MaxJsonLength.Value;
//            }
//            var jsonString = scriptSerializer.Serialize(result.Data);

            return(result);
        }
Example #2
0
        public ActionResult SelectWidget(GetWidgetCategoryRequest request)
        {
            var model = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request);
            var view  = model != null?RenderView("SelectWidget", model.WidgetCategories) : string.Empty;

            return(ComboWireJson(model != null, view, model, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public ActionResult Widgets(string query)
        {
            var request = new GetWidgetCategoryRequest { Filter = query };
            var model = GetCommand<GetWidgetCategoryCommand>().ExecuteCommand(request);

            return PartialView(model.WidgetCategories);
        }
Example #4
0
        public ActionResult AddPageHtmlContent(string pageId, string regionId)
        {
            var viewModel = new PageContentViewModel
            {
                PageId = Guid.Parse(pageId),
                RegionId = Guid.Parse(regionId),
                LiveFrom = DateTime.Today
            };

            var request = new GetWidgetCategoryRequest();
            viewModel.WidgetCategories = GetCommand<GetWidgetCategoryCommand>().ExecuteCommand(request).WidgetCategories;            

            return View(viewModel);
        }
Example #5
0
        public ActionResult AddPageHtmlContent(string pageId, string regionId)
        {
            var model = GetCommand <GetInsertHtmlContentCommand>().ExecuteCommand(new InsertHtmlContentRequest()
            {
                PageId = pageId, RegionId = regionId
            });

            var request = new GetWidgetCategoryRequest();

            model.WidgetCategories = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request).WidgetCategories;

            var view = RenderView("AddPageHtmlContent", model);

            return(ComboWireJson(model != null, view, model, JsonRequestBehavior.AllowGet));
        }
Example #6
0
        public ActionResult SelectWidget(GetWidgetCategoryRequest request)
        {
            var model = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request);
            var view  = model != null?RenderView("SelectWidget", model.WidgetCategories) : string.Empty;

            var result = ComboWireJson(model != null, view, model, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
// TODO: very large JSON ~2.1MB on test environment!!!
//            var scriptSerializer = new JavaScriptSerializer();
//            if (result.MaxJsonLength.HasValue)
//            {
//                scriptSerializer.MaxJsonLength = result.MaxJsonLength.Value;
//            }
//            var jsonString = scriptSerializer.Serialize(result.Data);

            return(result);
        }
Example #7
0
        public ActionResult AddPageHtmlContent(string pageIdentifier, string regionIdentifier, string parentPageContentIdentifier)
        {
            var addRequest = new InsertHtmlContentRequest
            {
                PageId              = pageIdentifier,
                RegionId            = regionIdentifier,
                ParentPageContentId = parentPageContentIdentifier
            };
            var model = GetCommand <GetInsertHtmlContentCommand>().ExecuteCommand(addRequest);

            if (model != null)
            {
                var request = new GetWidgetCategoryRequest();
                model.WidgetCategories = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request).WidgetCategories;
            }

            var view = RenderView("AddPageHtmlContent", model ?? new PageContentViewModel());

            return(ComboWireJson(model != null, view, model, JsonRequestBehavior.AllowGet));
        }