Completes: U4-3067 Send to publish not implemented
This commit is contained in:
@@ -1228,18 +1228,20 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="content">The <see cref="IContent"/> to send to publication</param>
|
||||
/// <param name="userId">Optional Id of the User issueing the send to publication</param>
|
||||
/// <returns>True if sending publication was succesfull otherwise false</returns>
|
||||
internal bool SendToPublication(IContent content, int userId = 0)
|
||||
public bool SendToPublication(IContent content, int userId = 0)
|
||||
{
|
||||
|
||||
if (SendingToPublish.IsRaisedEventCancelled(new SendToPublishEventArgs<IContent>(content), this))
|
||||
return false;
|
||||
|
||||
//TODO: Do some stuff here.. RunActionHandlers
|
||||
//TODO: Do some stuff here.. ... what is it supposed to do ?
|
||||
// pretty sure all that legacy stuff did was raise an event? and we no longer have IActionHandlers so no worries there.
|
||||
|
||||
SentToPublish.RaiseEvent(new SendToPublishEventArgs<IContent>(content, false), this);
|
||||
|
||||
Audit.Add(AuditTypes.SendToPublish, "Send to Publish performed by user", content.WriterId, content.Id);
|
||||
|
||||
//TODO: will this ever be false??
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace Umbraco.Core.Services
|
||||
public interface IContentService : IService
|
||||
{
|
||||
|
||||
bool SendToPublication(IContent content, int userId = 0);
|
||||
|
||||
IEnumerable<IContent> GetByIds(IEnumerable<int> ids);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace Umbraco.Web.Editors
|
||||
}
|
||||
else if (contentItem.Action == ContentSaveAction.SendPublish || contentItem.Action == ContentSaveAction.SendPublishNew)
|
||||
{
|
||||
throw new NotSupportedException("Send to publish is currently not supported");
|
||||
Services.ContentService.SendToPublication(contentItem.PersistedContent, UmbracoUser.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -754,14 +754,16 @@ namespace umbraco.cms.businesslogic.web
|
||||
/// <param name="u">The User</param>
|
||||
public bool SendToPublication(User u)
|
||||
{
|
||||
SendToPublishEventArgs e = new SendToPublishEventArgs();
|
||||
var e = new SendToPublishEventArgs();
|
||||
FireBeforeSendToPublish(e);
|
||||
if (!e.Cancel)
|
||||
if (e.Cancel == false)
|
||||
{
|
||||
Log.Add(LogTypes.SendToPublish, u, this.Id, "");
|
||||
|
||||
FireAfterSendToPublish(e);
|
||||
return true;
|
||||
var sent = ApplicationContext.Current.Services.ContentService.SendToPublication(Content, u.Id);
|
||||
if (sent)
|
||||
{
|
||||
FireAfterSendToPublish(e);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user