Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matthieu Nelmes 102 posts 385 karma points
    Dec 21, 2015 @ 12:53
    Matthieu Nelmes
    0

    Custom Notification Status

    On a particle Doctype Publishing, we've got a lot of stuff happening in the background. Such as, creating folders, members and content. This can take ~30 seconds. So we would just like to give the user a friendly bit of feedback "Please wait"

    Only references I can find regarding the use of the NotificiationsService relate to the client-side AngularJS but as we're not using any custom property editors here, we'd just like to hook into the Publish event to give the user a friendly bit of feedback.

    Is this possible?

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Dec 21, 2015 @ 22:03
    Marc Goodson
    0

    Hi Matthieu

    You can try now add a custom message when cancelling the Publish event inside your event code via:

    e.Messages.Add(new EventMessage("Mwahahahaha!","I have cancelled your publishing!", EventMessageType.Error));
    

    and this will bubble up to the NotificationsService;

    Worth a try is:

    e.Messages.Add(new EventMessage("Hang On","We're saving lots of stuff", EventMessageType.Warning));
    

    but I have a feeling it will only fire after the stuff has happened....

    (see this issue for the discussion that led to the above: http://issues.umbraco.org/issue/U4-5927)

    Sometimes if there is a big delay in lots of things happening automatically after publish, it's worth, just using the event to store the id of the published node into a queue; and then have all the automatic stuff happen on a different thread working off of the queue; but it depends on what you are doing etc...

Please Sign in or register to post replies

Write your reply to:

Draft