I'm trying to set up some events for a specific mediatype.
In the end it's suppose to Create a label with a version number, stop the user for changing the document and stop a delete event
But first up
I trying to create the version number
I have created a MediaService.Created event where i'm setting the version number, and that works a attended.
But when a save the media item it deletes the version number
Then i tryid to setup mediaservice.saving and saved event.
Where it checks if the label is empty and otherwise put the version number in
This works but, not in the first save. So it works if i save a second time, and i want to save it the first time.
I know this is an old thread now, but I ran into an issue that I'm trying to figure out, which I think is related.
I am hooked into the Publish event, which triggers a function for saving a PDF file into the Media Library, in which I have it checking for the file existing, and then I save the same object as new. But I seem to have to Publish twice, essentially running the MediaService_Saving event twice, to get the page to show the latest version of the saved file. It works, but only if I do this (publish twice).
I'm assuming I'm missing updating a version number maybe? Not sure.
MediaService save event
Hi
I'm trying to set up some events for a specific mediatype.
In the end it's suppose to Create a label with a version number, stop the user for changing the document and stop a delete event
But first up
I trying to create the version number I have created a MediaService.Created event where i'm setting the version number, and that works a attended. But when a save the media item it deletes the version number Then i tryid to setup mediaservice.saving and saved event. Where it checks if the label is empty and otherwise put the version number in This works but, not in the first save. So it works if i save a second time, and i want to save it the first time.
Heres the code`public DocumentlibraryEvents() { MediaService.Saving += MediaServiceSaving; MediaService.Deleting += MediaServiceDeleting; MediaService.Created += MediaServiceCreated; MediaService.Saved += MediaServiceSaved; }
Also i want to know how to cancel i Delete event.
I'm using Umbraco 7.1.4
Heres a small video to illustrate what happens http://screencast.com/t/ZaAuvnY4o4pi
I figured out to cancel the delete event
But is there a way to stop the delete animation
See video http://screencast.com/t/uC0hNrRMzi
I managed to find a solution with the version number I used MediaServiceSaving instead of MediaServiceSaved, And then i could i use IsNewEntity
Is it possible to compare the new and the old values in the saving/saved event. I want to stop the user from removing og replace a file in fileupload?
Can still not figure out how to stop the delete animation when i canceling the delete event
I know this is an old thread now, but I ran into an issue that I'm trying to figure out, which I think is related.
I am hooked into the Publish event, which triggers a function for saving a PDF file into the Media Library, in which I have it checking for the file existing, and then I save the same object as new. But I seem to have to Publish twice, essentially running the MediaService_Saving event twice, to get the page to show the latest version of the saved file. It works, but only if I do this (publish twice).
I'm assuming I'm missing updating a version number maybe? Not sure.
is working on a reply...