2

Is there any way to track the users who have modified a specific Publication (metadata or properties). Because Tridion does not keep the versioning history for a publication.

My Investigation:

  • When I checked the Tridion_cm database (dbo.PUBLICATIONS table), found the last modification date but I haven't found who has modified
  • I have checked couples of other tables also but haven't found sufficient info

My Code -

[TcmExtension("TridionEventSystem")]
    public class PublicationSaveEvent: TcmExtension
    {
        public PublicationSaveEvent()
        {
            Subscribe();
        }
        public void Subscribe()
        {
            // Subscribe Your Event
            EventSystem.Subscribe<Publication, SaveEventArgs>(OnPublicationSavePre, EventPhases.Initiated);
        }
        private static void OnPublicationSavePre(Publication pub, SaveEventArgs args, EventPhases phase)
        {
            pub.
        }
    }
2

As you've already pointed out, Tridion's versioning does not apply to Publications. However, you could make use of the Event System and write a simple piece of code which captures and persists the relevant information. Use a combination of Publication (or Repository) and SaveEventArgs. Also, don't forget to deploy your ES code to all your CMs (in a scaled out setup).

UPDATE

Try the following snippet for getting the user who initiated the Save action.

pub.Session.User

Do note that Session.User property is Deprecated starting Web 8.5

7
  • Hi @atila, I have implement the Event System code to get the publication modification versioning but did not get any information when i use 'Publication' and 'SaveEventArgs'. Please refer the below code and suggest me how I can proceed futher. Feb 15 '19 at 10:13
  • [TcmExtension("TridionEventSystem")] public class PublicationSaveEvent: TcmExtension { public PublicationSaveEvent() { Subscribe(); } public void Subscribe() { // Subscribe Your Event EventSystem.Subscribe<Publication, SaveEventArgs>(OnPublicationSavePre, EventPhases.Initiated); } private static void OnPublicationSavePre(Publication pub, SaveEventArgs args, EventPhases phase) { pub. } } Feb 15 '19 at 10:16
  • Can you please update your answer with this snippet, it's hard to read from the comment. Just use the 'edit' function.
    – Atila Sos
    Feb 15 '19 at 10:32
  • Hi Atila, I have provided the code snippet on above. Please refer and provide your comments Feb 15 '19 at 10:43
  • Hi @Atila, I have given my code on above section. Could you please provide any comments? Feb 18 '19 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.