diff --git a/src/Umbraco.Core/Configuration/GlobalSettings.cs b/src/Umbraco.Core/Configuration/GlobalSettings.cs
index 7e6e2d53b5..c10b14ffcb 100644
--- a/src/Umbraco.Core/Configuration/GlobalSettings.cs
+++ b/src/Umbraco.Core/Configuration/GlobalSettings.cs
@@ -532,6 +532,16 @@ namespace Umbraco.Core.Configuration
return context.Request.Path.ToLower().IndexOf(SystemDirectories.Umbraco.ToLower() + "/liveediting.aspx") > -1;
}
+ public static bool RequestIsInUmbracoApplication(HttpContextBase context)
+ {
+ return context.Request.Path.ToLower().IndexOf(IOHelper.ResolveUrl(SystemDirectories.Umbraco).ToLower()) > -1;
+ }
+
+ public static bool RequestIsLiveEditRedirector(HttpContextBase context)
+ {
+ return context.Request.Path.ToLower().IndexOf(SystemDirectories.Umbraco.ToLower() + "/liveediting.aspx") > -1;
+ }
+
///
/// Gets a value indicating whether umbraco should force a secure (https) connection to the backoffice.
///
diff --git a/src/Umbraco.Core/Models/Content.cs b/src/Umbraco.Core/Models/Content.cs
index 631f88075e..2e99396707 100644
--- a/src/Umbraco.Core/Models/Content.cs
+++ b/src/Umbraco.Core/Models/Content.cs
@@ -1,4 +1,5 @@
using System;
+using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
diff --git a/src/Umbraco.Core/Models/ContentBase.cs b/src/Umbraco.Core/Models/ContentBase.cs
index 6def10748f..3ddf71308e 100644
--- a/src/Umbraco.Core/Models/ContentBase.cs
+++ b/src/Umbraco.Core/Models/ContentBase.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
+using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
@@ -13,6 +14,7 @@ namespace Umbraco.Core.Models
///
/// Represents an abstract class for base Content properties and methods
///
+ [DebuggerDisplay("Id: {Id}, Name: {Name}, ContentType: {ContentTypeBase.Alias}")]
public abstract class ContentBase : Entity, IContentBase
{
protected IContentTypeComposition ContentTypeBase;
diff --git a/src/Umbraco.Core/Models/EntityBase/Entity.cs b/src/Umbraco.Core/Models/EntityBase/Entity.cs
index 6c081ea0b4..95be4851e7 100644
--- a/src/Umbraco.Core/Models/EntityBase/Entity.cs
+++ b/src/Umbraco.Core/Models/EntityBase/Entity.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
@@ -12,6 +13,7 @@ namespace Umbraco.Core.Models.EntityBase
///
[Serializable]
[DataContract(IsReference = true)]
+ [DebuggerDisplay("Id: {Id}")]
public abstract class Entity : IEntity, ICanBeDirty
{
private bool _hasIdentity;
diff --git a/src/Umbraco.Core/Models/IContent.cs b/src/Umbraco.Core/Models/IContent.cs
index 230b6693e5..7926c595b0 100644
--- a/src/Umbraco.Core/Models/IContent.cs
+++ b/src/Umbraco.Core/Models/IContent.cs
@@ -1,10 +1,11 @@
using System;
+using System.Diagnostics;
namespace Umbraco.Core.Models
{
///
/// Defines a Content object
- ///
+ ///
public interface IContent : IContentBase
{
///
diff --git a/src/Umbraco.Core/Publishing/BasePublishingStrategy.cs b/src/Umbraco.Core/Publishing/BasePublishingStrategy.cs
index d126140c04..9ce2032b57 100644
--- a/src/Umbraco.Core/Publishing/BasePublishingStrategy.cs
+++ b/src/Umbraco.Core/Publishing/BasePublishingStrategy.cs
@@ -8,6 +8,24 @@ namespace Umbraco.Core.Publishing
///
public abstract class BasePublishingStrategy : IPublishingStrategy
{
+
+ protected internal abstract Attempt PublishInternal(IContent content, int userId);
+
+ ///
+ /// Publishes a list of content items
+ ///
+ ///
+ ///
+ ///
+ /// By default this is set to true which means that it will publish any content item in the list that is completely unpublished and
+ /// not visible on the front-end. If set to false, this will only publish content that is live on the front-end but has new versions
+ /// that have yet to be published.
+ ///
+ ///
+ protected internal abstract IEnumerable> PublishWithChildrenInternal(IEnumerable content, int userId, bool includeUnpublishedDocuments = true);
+
+ protected internal abstract IEnumerable> UnPublishInternal(IEnumerable content, int userId);
+
public abstract bool Publish(IContent content, int userId);
public abstract bool PublishWithChildren(IEnumerable content, int userId);
public abstract bool UnPublish(IContent content, int userId);
diff --git a/src/Umbraco.Core/Publishing/PublishStatus.cs b/src/Umbraco.Core/Publishing/PublishStatus.cs
new file mode 100644
index 0000000000..e406c3fff5
--- /dev/null
+++ b/src/Umbraco.Core/Publishing/PublishStatus.cs
@@ -0,0 +1,29 @@
+using Umbraco.Core.Models;
+
+namespace Umbraco.Core.Publishing
+{
+ ///
+ /// The result of publishing a content item
+ ///
+ public class PublishStatus
+ {
+ public IContent ContentItem { get; private set; }
+ public PublishStatusType StatusType { get; private set; }
+
+ public PublishStatus(IContent content, PublishStatusType statusType)
+ {
+ ContentItem = content;
+ StatusType = statusType;
+ }
+
+ ///
+ /// Creates a successful publish status
+ ///
+ public PublishStatus(IContent content)
+ : this(content, PublishStatusType.Success)
+ {
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Publishing/PublishStatusType.cs b/src/Umbraco.Core/Publishing/PublishStatusType.cs
new file mode 100644
index 0000000000..59d063f41d
--- /dev/null
+++ b/src/Umbraco.Core/Publishing/PublishStatusType.cs
@@ -0,0 +1,40 @@
+namespace Umbraco.Core.Publishing
+{
+ ///
+ /// A status type of the result of publishing a content item
+ ///
+ public enum PublishStatusType
+ {
+ ///
+ /// The publishing was successful.
+ ///
+ Success,
+
+ ///
+ /// The content item was scheduled to be un-published and it has expired so we cannot force it to be
+ /// published again as part of a bulk publish operation.
+ ///
+ FailedHasExpired,
+
+ ///
+ /// The content item is scheduled to be released in the future and therefore we cannot force it to
+ /// be published during a bulk publish operation.
+ ///
+ FailedAwaitingRelease,
+
+ ///
+ /// The content item is in the trash, it cannot be published
+ ///
+ FailedIsTrashed,
+
+ ///
+ /// The publish action has been cancelled by an event handler
+ ///
+ FailedCancelledByEvent,
+
+ ///
+ /// The content item contains invalid data (has not passed validation requirements)
+ ///
+ FailedContentInvalid
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Publishing/PublishingStrategy.cs b/src/Umbraco.Core/Publishing/PublishingStrategy.cs
index 17a80be37b..8dfd36b8f6 100644
--- a/src/Umbraco.Core/Publishing/PublishingStrategy.cs
+++ b/src/Umbraco.Core/Publishing/PublishingStrategy.cs
@@ -4,6 +4,7 @@ using System.Linq;
using Umbraco.Core.Events;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
+using Umbraco.Core;
namespace Umbraco.Core.Publishing
{
@@ -12,8 +13,46 @@ namespace Umbraco.Core.Publishing
///
public class PublishingStrategy : BasePublishingStrategy
{
- public PublishingStrategy()
+
+ protected internal override Attempt PublishInternal(IContent content, int userId)
{
+ if (Publishing.IsRaisedEventCancelled(new PublishEventArgs(content), this))
+ return new Attempt(false, new PublishStatus(content, PublishStatusType.FailedCancelledByEvent));
+
+ //Check if the Content is Expired to verify that it can in fact be published
+ if (content.Status == ContentStatus.Expired)
+ {
+ LogHelper.Info(
+ string.Format("Content '{0}' with Id '{1}' has expired and could not be published.",
+ content.Name, content.Id));
+ return new Attempt(false, new PublishStatus(content, PublishStatusType.FailedHasExpired));
+ }
+
+ //Check if the Content is Awaiting Release to verify that it can in fact be published
+ if (content.Status == ContentStatus.AwaitingRelease)
+ {
+ LogHelper.Info(
+ string.Format("Content '{0}' with Id '{1}' is awaiting release and could not be published.",
+ content.Name, content.Id));
+ return new Attempt(false, new PublishStatus(content, PublishStatusType.FailedAwaitingRelease));
+ }
+
+ //Check if the Content is Trashed to verify that it can in fact be published
+ if (content.Status == ContentStatus.Trashed)
+ {
+ LogHelper.Info(
+ string.Format("Content '{0}' with Id '{1}' is trashed and could not be published.",
+ content.Name, content.Id));
+ return new Attempt(false, new PublishStatus(content, PublishStatusType.FailedIsTrashed));
+ }
+
+ content.ChangePublishedState(PublishedState.Published);
+
+ LogHelper.Info(
+ string.Format("Content '{0}' with Id '{1}' has been published.",
+ content.Name, content.Id));
+
+ return new Attempt(true, new PublishStatus(content));
}
///
@@ -24,43 +63,79 @@ namespace Umbraco.Core.Publishing
/// True if the publish operation was successfull and not cancelled, otherwise false
public override bool Publish(IContent content, int userId)
{
- if (Publishing.IsRaisedEventCancelled(new PublishEventArgs(content), this))
- return false;
+ return PublishInternal(content, userId).Success;
+ }
- //Check if the Content is Expired to verify that it can in fact be published
- if (content.Status == ContentStatus.Expired)
+ ///
+ /// Publishes a list of content items
+ ///
+ ///
+ ///
+ ///
+ /// By default this is set to true which means that it will publish any content item in the list that is completely unpublished and
+ /// not visible on the front-end. If set to false, this will only publish content that is live on the front-end but has new versions
+ /// that have yet to be published.
+ ///
+ ///
+ protected internal override IEnumerable> PublishWithChildrenInternal(IEnumerable content, int userId, bool includeUnpublishedDocuments = true)
+ {
+ var statuses = new List>();
+
+ /* Only update content thats not already been published - we want to loop through
+ * all unpublished content to write skipped content (expired and awaiting release) to log.
+ */
+ foreach (var item in content.Where(x => x.Published == false))
{
+ //Check if this item has never been published
+ if (!includeUnpublishedDocuments && !item.HasPublishedVersion())
+ {
+ //this item does not have a published version and the flag is set to not include them
+ continue;
+ }
+
+ //Fire Publishing event
+ if (Publishing.IsRaisedEventCancelled(new PublishEventArgs(item), this))
+
+ //Check if the Content is Expired to verify that it can in fact be published
+ if (item.Status == ContentStatus.Expired)
+ {
+ LogHelper.Info(
+ string.Format("Content '{0}' with Id '{1}' has expired and could not be published.",
+ item.Name, item.Id));
+ statuses.Add(new Attempt(false, new PublishStatus(item, PublishStatusType.FailedHasExpired)));
+ continue;
+ }
+
+ //Check if the Content is Awaiting Release to verify that it can in fact be published
+ if (item.Status == ContentStatus.AwaitingRelease)
+ {
+ LogHelper.Info(
+ string.Format("Content '{0}' with Id '{1}' is awaiting release and could not be published.",
+ item.Name, item.Id));
+ statuses.Add(new Attempt(false, new PublishStatus(item, PublishStatusType.FailedAwaitingRelease)));
+ continue;
+ }
+
+ //Check if the Content is Trashed to verify that it can in fact be published
+ if (item.Status == ContentStatus.Trashed)
+ {
+ LogHelper.Info(
+ string.Format("Content '{0}' with Id '{1}' is trashed and could not be published.",
+ item.Name, item.Id));
+ statuses.Add(new Attempt(false, new PublishStatus(item, PublishStatusType.FailedIsTrashed)));
+ continue;
+ }
+
+ item.ChangePublishedState(PublishedState.Published);
+
LogHelper.Info(
- string.Format("Content '{0}' with Id '{1}' has expired and could not be published.",
- content.Name, content.Id));
- return false;
+ string.Format("Content '{0}' with Id '{1}' has been published.",
+ item.Name, item.Id));
+
+ statuses.Add(new Attempt(true, new PublishStatus(item)));
}
- //Check if the Content is Awaiting Release to verify that it can in fact be published
- if (content.Status == ContentStatus.AwaitingRelease)
- {
- LogHelper.Info(
- string.Format("Content '{0}' with Id '{1}' is awaiting release and could not be published.",
- content.Name, content.Id));
- return false;
- }
-
- //Check if the Content is Trashed to verify that it can in fact be published
- if (content.Status == ContentStatus.Trashed)
- {
- LogHelper.Info(
- string.Format("Content '{0}' with Id '{1}' is trashed and could not be published.",
- content.Name, content.Id));
- return false;
- }
-
- content.ChangePublishedState(PublishedState.Published);
-
- LogHelper.Info(
- string.Format("Content '{0}' with Id '{1}' has been published.",
- content.Name, content.Id));
-
- return true;
+ return statuses;
}
///
@@ -71,48 +146,14 @@ namespace Umbraco.Core.Publishing
/// True if the publish operation was successfull and not cancelled, otherwise false
public override bool PublishWithChildren(IEnumerable content, int userId)
{
- /* Only update content thats not already been published - we want to loop through
- * all unpublished content to write skipped content (expired and awaiting release) to log.
- */
- foreach (var item in content.Where(x => x.Published == false))
- {
- //Fire Publishing event
- if (Publishing.IsRaisedEventCancelled(new PublishEventArgs(item), this))
-
- //Check if the Content is Expired to verify that it can in fact be published
- if (item.Status == ContentStatus.Expired)
- {
- LogHelper.Info(
- string.Format("Content '{0}' with Id '{1}' has expired and could not be published.",
- item.Name, item.Id));
- continue;
- }
-
- //Check if the Content is Awaiting Release to verify that it can in fact be published
- if (item.Status == ContentStatus.AwaitingRelease)
- {
- LogHelper.Info(
- string.Format("Content '{0}' with Id '{1}' is awaiting release and could not be published.",
- item.Name, item.Id));
- continue;
- }
-
- //Check if the Content is Trashed to verify that it can in fact be published
- if (item.Status == ContentStatus.Trashed)
- {
- LogHelper.Info(
- string.Format("Content '{0}' with Id '{1}' is trashed and could not be published.",
- item.Name, item.Id));
- continue;
- }
-
- item.ChangePublishedState(PublishedState.Published);
-
- LogHelper.Info(
- string.Format("Content '{0}' with Id '{1}' has been published.",
- item.Name, item.Id));
- }
-
+ var result = PublishWithChildrenInternal(content, userId);
+
+ //NOTE: This previously always returned true so I've left it that way. It returned true because (from Morten)...
+ // ... if one item couldn't be published it wouldn't be correct to return false.
+ // in retrospect it should have returned a list of with Ids and Publish Status
+ // come to think of it ... the cache would still be updated for a failed item or at least tried updated.
+ // It would call the Published event for the entire list, but if the Published property isn't set to True it
+ // wouldn't actually update the cache for that item. But not really ideal nevertheless...
return true;
}
@@ -147,20 +188,19 @@ namespace Umbraco.Core.Publishing
return true;
}
- ///
- /// Unpublishes a list of Content
- ///
- /// An enumerable list of
- /// Id of the User issueing the unpublish operation
- /// True if the unpublish operation was successfull and not cancelled, otherwise false
- public override bool UnPublish(IEnumerable content, int userId)
+ protected internal override IEnumerable> UnPublishInternal(IEnumerable content, int userId)
{
+ var result = new List>();
+
//Only update content thats already been published
foreach (var item in content.Where(x => x.Published == true))
{
//Fire UnPublishing event
if (UnPublishing.IsRaisedEventCancelled(new PublishEventArgs(item), this))
- return false;
+ {
+ result.Add(new Attempt(false, new PublishStatus(item, PublishStatusType.FailedCancelledByEvent)));
+ continue;
+ }
//If Content has a release date set to before now, it should be removed so it doesn't interrupt an unpublish
//Otherwise it would remain released == published
@@ -178,8 +218,29 @@ namespace Umbraco.Core.Publishing
LogHelper.Info(
string.Format("Content '{0}' with Id '{1}' has been unpublished.",
item.Name, item.Id));
+
+ result.Add(new Attempt(true, new PublishStatus(item)));
}
+ return result;
+ }
+
+ ///
+ /// Unpublishes a list of Content
+ ///
+ /// An enumerable list of
+ /// Id of the User issueing the unpublish operation
+ /// True if the unpublish operation was successfull and not cancelled, otherwise false
+ public override bool UnPublish(IEnumerable content, int userId)
+ {
+ var result = UnPublishInternal(content, userId);
+
+ //NOTE: This previously always returned true so I've left it that way. It returned true because (from Morten)...
+ // ... if one item couldn't be published it wouldn't be correct to return false.
+ // in retrospect it should have returned a list of with Ids and Publish Status
+ // come to think of it ... the cache would still be updated for a failed item or at least tried updated.
+ // It would call the Published event for the entire list, but if the Published property isn't set to True it
+ // wouldn't actually update the cache for that item. But not really ideal nevertheless...
return true;
}
diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs
index ec1d53867e..fbad5073e4 100644
--- a/src/Umbraco.Core/Services/ContentService.cs
+++ b/src/Umbraco.Core/Services/ContentService.cs
@@ -1017,16 +1017,17 @@ namespace Umbraco.Core.Services
return SaveAndPublishDo(content, omitCacheRefresh, userId);
}
- ///
- /// Internal method that Publishes a object and all its children for legacy purposes.
- ///
- /// The to publish along with its children
- /// Optional boolean to avoid having the cache refreshed when calling this Publish method. By default this method will not update the cache.
- /// Optional Id of the User issueing the publishing
- /// True if publishing succeeded, otherwise False
- internal bool PublishWithChildren(IContent content, bool omitCacheRefresh = true, int userId = 0)
+ ///
+ /// Internal method that Publishes a object and all its children for legacy purposes.
+ ///
+ /// The to publish along with its children
+ /// Optional boolean to avoid having the cache refreshed when calling this Publish method. By default this method will not update the cache.
+ /// Optional Id of the User issueing the publishing
+ /// If set to true, this will also publish descendants that are completely unpublished, normally this will only publish children that have previously been published
+ /// True if publishing succeeded, otherwise False
+ internal bool PublishWithChildren(IContent content, bool omitCacheRefresh = true, int userId = 0, bool includeUnpublished = false)
{
- return PublishWithChildrenDo(content, omitCacheRefresh, userId);
+ return PublishWithChildrenDo(content, omitCacheRefresh, userId, includeUnpublished);
}
///
@@ -1142,8 +1143,9 @@ namespace Umbraco.Core.Services
/// The to publish along with its children
/// Optional boolean to avoid having the cache refreshed when calling this Publish method. By default this method will update the cache.
/// Optional Id of the User issueing the publishing
+ /// If set to true, this will also publish descendants that are completely unpublished, normally this will only publish children that have previously been published
/// True if publishing succeeded, otherwise False
- private bool PublishWithChildrenDo(IContent content, bool omitCacheRefresh = false, int userId = 0)
+ private bool PublishWithChildrenDo(IContent content, bool omitCacheRefresh = false, int userId = 0, bool includeUnpublished = false)
{
//Check if parent is published (although not if its a root node) - if parent isn't published this Content cannot be published
if (content.ParentId != -1 && content.ParentId != -20 && IsPublishable(content) == false)
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index b21f82b8b5..4db747c5c1 100644
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -636,6 +636,8 @@
+
+
diff --git a/src/Umbraco.Core/UrlHelperExtensions.cs b/src/Umbraco.Core/UrlHelperExtensions.cs
index 9755dc24cc..0a0f4aaecc 100644
--- a/src/Umbraco.Core/UrlHelperExtensions.cs
+++ b/src/Umbraco.Core/UrlHelperExtensions.cs
@@ -23,5 +23,16 @@ namespace Umbraco.Core
return result.TrimEnd("SavePartialView");
}
+ ///
+ /// Returns the base path (not including the 'action') of the MVC controller "BulkPublishController"
+ ///
+ ///
+ ///
+ public static string GetBulkPublishServicePath(this UrlHelper url)
+ {
+ var result = url.Action("PublishDocument", "BulkPublish", new { area = GlobalSettings.UmbracoMvcArea });
+ return result.TrimEnd("PublishDocument");
+ }
+
}
}
diff --git a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs
index 0c601a227b..83a11814e1 100644
--- a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs
+++ b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs
@@ -7,10 +7,12 @@ using Umbraco.Core.IO;
using Umbraco.Core.Models;
using Umbraco.Core.ObjectResolution;
using Umbraco.Core.Persistence;
+using Umbraco.Core.Publishing;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.Entities;
using umbraco.editorControls.tinyMCE3;
using umbraco.interfaces;
+using System.Linq;
namespace Umbraco.Tests.Publishing
{
@@ -58,6 +60,56 @@ namespace Umbraco.Tests.Publishing
UmbracoSettings.ResetSetters();
}
+ private IContent _homePage;
+
+ [Test]
+ public void Publishes_Many_Ignores_Unpublished_Items()
+ {
+ var strategy = new PublishingStrategy();
+
+ //publish root and nodes at it's children level
+ var result1 = strategy.Publish(_homePage, 0);
+ Assert.IsTrue(result1);
+ Assert.IsTrue(_homePage.Published);
+ foreach (var c in ServiceContext.ContentService.GetChildren(_homePage.Id))
+ {
+ var r = strategy.Publish(c, 0);
+ Assert.IsTrue(r);
+ Assert.IsTrue(c.Published);
+ }
+
+ //ok, all are published except the deepest descendant, we will pass in a flag to not include it to
+ //be published
+ var result = strategy.PublishWithChildrenInternal(
+ ServiceContext.ContentService.GetDescendants(_homePage).Concat(new[] {_homePage}), 0, false);
+ Assert.AreEqual(0, result.Count());
+ }
+
+ [Test]
+ public void Publishes_Many_Does_Not_Ignore_Unpublished_Items()
+ {
+ var strategy = new PublishingStrategy();
+
+ //publish root and nodes at it's children level
+ var result1 = strategy.Publish(_homePage, 0);
+ Assert.IsTrue(result1);
+ Assert.IsTrue(_homePage.Published);
+ foreach (var c in ServiceContext.ContentService.GetChildren(_homePage.Id))
+ {
+ var r = strategy.Publish(c, 0);
+ Assert.IsTrue(r);
+ Assert.IsTrue(c.Published);
+ }
+
+ //ok, all are published except the deepest descendant, we will pass in a flag to include it to
+ //be published
+ var result = strategy.PublishWithChildrenInternal(
+ ServiceContext.ContentService.GetDescendants(_homePage).Concat(new[] { _homePage }), 0, true);
+ Assert.AreEqual(1, result.Count());
+ Assert.IsTrue(result.First().Success);
+ Assert.IsTrue(result.First().Result.ContentItem.Published);
+ }
+
[Test]
public void Can_Publish_And_Update_Xml_Cache()
{
@@ -73,16 +125,21 @@ namespace Umbraco.Tests.Publishing
ServiceContext.ContentTypeService.Save(contentType);
//Create and Save Content "Homepage" based on "umbTextpage" -> 1046
- Content textpage = MockedContent.CreateSimpleContent(contentType);
- ServiceContext.ContentService.Save(textpage, 0);
+ _homePage = MockedContent.CreateSimpleContent(contentType);
+ ServiceContext.ContentService.Save(_homePage, 0);
//Create and Save Content "Text Page 1" based on "umbTextpage" -> 1047
- Content subpage = MockedContent.CreateSimpleContent(contentType, "Text Page 1", textpage.Id);
+ Content subpage = MockedContent.CreateSimpleContent(contentType, "Text Page 1", _homePage.Id);
ServiceContext.ContentService.Save(subpage, 0);
- //Create and Save Content "Text Page 1" based on "umbTextpage" -> 1048
- Content subpage2 = MockedContent.CreateSimpleContent(contentType, "Text Page 2", textpage.Id);
+ //Create and Save Content "Text Page 2" based on "umbTextpage" -> 1048
+ Content subpage2 = MockedContent.CreateSimpleContent(contentType, "Text Page 2", _homePage.Id);
ServiceContext.ContentService.Save(subpage2, 0);
+
+ //Create and Save Content "Text Page 3" based on "umbTextpage" -> 1048
+ Content subpage3 = MockedContent.CreateSimpleContent(contentType, "Text Page 3", subpage2.Id);
+ ServiceContext.ContentService.Save(subpage3, 0);
+
}
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index 13de47d66e..568fd21aa1 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -375,6 +375,13 @@
EditMacro.aspx
+
+ publish.aspx
+ ASPXCodeBehind
+
+
+ publish.aspx
+ ASPXCodeBehind
@@ -712,6 +719,8 @@
+
+
diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.cs b/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.cs
new file mode 100644
index 0000000000..d9bdf2cd44
--- /dev/null
+++ b/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using Umbraco.Web.UI.Pages;
+
+namespace Umbraco.Web.UI.Umbraco.Dialogs
+{
+ public partial class Publish : UmbracoEnsuredPage
+ {
+ protected int TotalNodesToPublish { get; private set; }
+ protected string PageName { get; private set; }
+ protected int DocumentId { get; private set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.designer.cs
new file mode 100644
index 0000000000..ee386da7b8
--- /dev/null
+++ b/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.designer.cs
@@ -0,0 +1,51 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Umbraco.Web.UI.Umbraco.Dialogs {
+
+
+ public partial class Publish {
+
+ ///
+ /// JsInclude1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
+
+ ///
+ /// JsInclude2 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::ClientDependency.Core.Controls.JsInclude JsInclude2;
+
+ ///
+ /// CssInclude1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::ClientDependency.Core.Controls.CssInclude CssInclude1;
+
+ ///
+ /// ProgBar1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::umbraco.uicontrols.ProgressBar ProgBar1;
+ }
+}
diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/publish.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/publish.aspx
index b402e89381..2c065d0d75 100644
--- a/src/Umbraco.Web.UI/umbraco/dialogs/publish.aspx
+++ b/src/Umbraco.Web.UI/umbraco/dialogs/publish.aspx
@@ -1,119 +1,86 @@
-<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" Codebehind="publish.aspx.cs" AutoEventWireup="True" Inherits="umbraco.dialogs.publish" %>
+<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" CodeBehind="Publish.aspx.cs" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.Dialogs.Publish" %>
+
+<%@ Import Namespace="Umbraco.Core" %>
+<%@ Import Namespace="Umbraco.Web" %>
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
-
+
-
-
-
-