Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Controlling or Logging Copying and Moving View modes: 
User avatar
Member
Member
scott_hancock-urmc.rochester - 9/26/2011 1:31:27 PM
   
Controlling or Logging Copying and Moving
Is there anyway to restrict the copying and moving of documents? Also, is there any way to log moves and copies?

Thanks,
Scott

User avatar
Member
Member
kentico_michal - 9/27/2011 5:53:52 AM
   
RE:Controlling or Logging Copying and Moving
Hello,

Regrettably, it is not possible to restrict copying or moving documents. In terms of logging these events, you can take advantage of CustomTreeNodeHandler class. It provides events which allow you to execute custom code when some Kentico CMS action occurs. This way you can log moving and copying documents using custom code. You can use either OnBeforeMove/ OnBeforeCopy or OnAfterMove / OnAfterCopy handler.

More information about CustomTreeNodeHandler class and how you can attach it to your project, can be found here: Event handling overview, Treenode handler

To log some event to the Event log, you can use the LogEvent method from the CMS.EventLog.EventLogProvider class:

public void LogEvent(
string eventType,
DateTime eventTime,
string source,
string eventCode
)


For more information about this method I would like to point you the API reference:
Kentico CMS API

Best regards,
Michal Legen