I need to add an event to happen as an item is getting published, usually I would use the ContentService and queue it up but when publising multiple documents within a ListView, it seems to skip this service?
*EDIT: I assume it skips it as it doesnt display the message event I have created, where if a single node is published the message is displayed.
Is there a different service the list view uses when doing batch publishing?
Just doesnt seem to behave the same way as single published nodes, here is a stripped back version where I would atleast hope for a message to pop up per item. In another test I tried adding an 'x' to the name of the document. Sadly, no effect on batch list view publishes.
public class IndexDocumentsNews : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
ContentService.Published += ContentService_Published;
}
void ContentService_Published(IPublishingStrategy sender, PublishEventArgs<IContent> e)
{
foreach (var publishedEntity in e.PublishedEntities)
{
e.Messages.Add(new EventMessage("Indexed", publishedEntity.Name + " Has Been Indexed",
EventMessageType.Success));
}
}
}
ListView Publish Events? Content Service?
Hey,
I need to add an event to happen as an item is getting published, usually I would use the ContentService and queue it up but when publising multiple documents within a ListView, it seems to skip this service?
*EDIT: I assume it skips it as it doesnt display the message event I have created, where if a single node is published the message is displayed.
Is there a different service the list view uses when doing batch publishing?
I would find it very inconvenient if the list view used other services.
I presume you are hooking into the ContentService.Published or .Publishing evemt?
Could you show the code of how you are interacting with these events?
Just doesnt seem to behave the same way as single published nodes, here is a stripped back version where I would atleast hope for a message to pop up per item. In another test I tried adding an 'x' to the name of the document. Sadly, no effect on batch list view publishes.
The code seems right, maybe the list view doesn't render the messages.
Have you tried sending a message to the log to verify the event is fired or not?
Either way this warrants a bug report i think.
is working on a reply...