Fixes #U4-414, #U4-1669 - publish dialog now uses new apis and ensures documents are validated during publishing. This also

enhances many other things in the publishing API including giving a status result for each item, ensuring that child items
do not try to get published when the parent item fails (based on a subset of rules)
This commit is contained in:
Shannon Deminick
2013-02-11 03:55:58 +06:00
parent ded940a757
commit c23be1fd96
16 changed files with 594 additions and 91 deletions

View File

@@ -1,49 +1,21 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
using Umbraco.Web.Cache;
using Umbraco.Web.Macros;
using Umbraco.Web.Mvc;
using umbraco;
using umbraco.BasePages;
using umbraco.cms.businesslogic.macro;
using umbraco.cms.businesslogic.template;
using umbraco.presentation.cache;
using Umbraco.Core;
using Template = umbraco.cms.businesslogic.template.Template;
namespace Umbraco.Web.WebServices
{
/// <summary>
/// A REST controller used for the publish dialog in order to publish bulk items at once
/// </summary>
public class BulkPublishController : UmbracoAuthorizedController
{
/// <summary>
/// Publishes an document
/// </summary>
/// <param name="documentId"></param>
/// <returns>A Json array containing objects with the child id's of the document and it's current published status</returns>
[HttpPost]
public JsonResult PublishDocument(int documentId, bool publishChildren)
{
var doc = Services.ContentService.GetById(documentId);
var result = ((ContentService)Services.ContentService).PublishWithChildren(doc, true, UmbracoUser.Id);
if (Services.ContentService.PublishWithChildren(doc, UmbracoUser.Id))
{
}
return null;
}
}
/// <summary>
/// A REST controller used to save files such as templates, partial views, macro files, etc...
/// </summary>