I am using Umbraco 7 and I need to have an additional secondary database, outside of Umbraco, that only contains published data (for some of the documentTypes).
Therefore, I do need to update the secondary db using events. Would you know which events I should use in order to make sure that the secondary db is up to date with published content?
I am actually creating documentTypes to hold the data model, so it would be non-page related data that I would need to save into the secondary database.
For example, I will have a documentType called Person to hold person's data, and I would need to save into the secondary db data like FirstName, LastName, Age etc. Generally it would be data from the generic properties, rather than built in documentType/page properties.
In this occasion, what are are the events that I should be using?
Out of the ones I mentioned in my first post, would I need to use all of them?
And would I also need
Umbraco.Core.Services.ContentService.Trashed
I assume Umbraco.Core.Services.ContentService.Moved won't be necessary
You will need to use the Umbraco.Core.Services.ContentService.Trashed event because the Umbraco.Core.Services.ContentService.Unpublished event is not called when a user sends a page to the recycle bin even though after a user sends the page to the recycle bin the page is unpublished.
You wont need to use the delete because the time the page actually gets unpublished is when its sent to the trash. So the Trashed event will be the one. As for the other Events you may want to put a few breakpoints in them to see when they are called as to which ones you want to use.
Publish related events inUmbraco 7
Hi there,
I am using Umbraco 7 and I need to have an additional secondary database, outside of Umbraco, that only contains published data (for some of the documentTypes).
Therefore, I do need to update the secondary db using events. Would you know which events I should use in order to make sure that the secondary db is up to date with published content?
Obviously I will need to use:
But would I need to use these events too?
Or any other events?
Many thanks
Hi,
Depending on what information you are saving in your secondary database you may also want to use this event
Which is the event called when you delete a page and it is sent to the recycle bin.
If you are saving information about where the page is saved in the tree also consider
Phil
Hi there,
I am actually creating documentTypes to hold the data model, so it would be non-page related data that I would need to save into the secondary database.
For example, I will have a documentType called Person to hold person's data, and I would need to save into the secondary db data like FirstName, LastName, Age etc. Generally it would be data from the generic properties, rather than built in documentType/page properties.
In this occasion, what are are the events that I should be using?
Out of the ones I mentioned in my first post, would I need to use all of them?
And would I also need
I assume Umbraco.Core.Services.ContentService.Moved won't be necessary
Many thanks!
Hi,
You will need to use the
Umbraco.Core.Services.ContentService.Trashed
event because theUmbraco.Core.Services.ContentService.Unpublished
event is not called when a user sends a page to the recycle bin even though after a user sends the page to the recycle bin the page is unpublished.Phil
Great, thank you.
Would I also need:
Or just Publish, Unpublish and Trash?
Thanks!
Hi,
You wont need to use the delete because the time the page actually gets unpublished is when its sent to the trash. So the Trashed event will be the one. As for the other Events you may want to put a few breakpoints in them to see when they are called as to which ones you want to use.
Phil
Great, thank you!
Is there an events life-cycle document, preferably with pretty pictures?
Found it here:
https://our.umbraco.org/Documentation/Getting-Started/Code/Events/ContentService-Events
no pretty picture though
is working on a reply...