VcsAfterDeleteObject
Return to Introduction  Previous page  Next page
If this method is exported from the DLL, it will be called after an object is deleted from the repository. This method is called only when the object is permanently deleted and not when it is added to the recycle bin.

VcsAfterDeleteObject

procedure VcsAfterDeleteObject( pObjectName, pObjectParent, pUserName: PChar; UserID, ObjectID, ObjectParentID: Cardinal; ObjectType: Integer ); stdcall; export;  

This is a notification event only and none of the values passed in can be modified. See below for a list of Object Types and their ID's

Parameters

Name
Description
pObjectName
The name of the object that has been deleted
pObjectParent
If the object that has been deleted is a Folder, File, or Revision, this references the name of the parent object.
pUserName
The name of the user that carried out the action
UserID
The ID of the user that carried out the action
ObjectID
The ID of the object that was deleted
ObjectParentID
If the object that has been deleted is a Folder, File, or Revision, this references the ID of the parent object.
ObjectType
The type of object that was deleted. See below



Example (Delphi)

The following method is called after a Project is successfully created and simply logs the action to a local text file:

const  
  // Object types  
  ot_Project        = 1;  
  ot_Folder         = 2;  
  ot_File           = 3;  
  ot_Revision       = 4;  
  ot_VersionLabel   = 5;  
  ot_PromotionLevel = 6;  
 
procedure VcsAfterDeleteObject( pObjectName, pObjectParent, pUserName: PChar; UserID, ObjectID, ObjectParentID: Cardinal; ObjectType: Integer );  
begin  
  // This method is called after an object has been permanently deleted from the repository  
  // See the constants defined above.  
  case ObjectType of  
    ot_Project: LogIt( Format( '%s - ''%s'' Deleted Project ''%s''', [ DateTimeToStr( Now ), String( pUserName ), String( pObjectName ) ] ) );  
    ot_Folder: LogIt( Format( '%s - ''%s'' Deleted Folder ''%s'' from Project ''%s''', [ DateTimeToStr( Now ), String( pUserName ), String( pObjectName ), String( pObjectParent ) ] ) );  
    ot_File: LogIt( Format( '%s - ''%s'' Deleted File ''%s'' from Folder ''%s''', [ DateTimeToStr( Now ), String( pUserName ), String( pObjectName ), String( pObjectParent ) ] ) );  
    ot_Revision: LogIt( Format( '%s - ''%s'' Deleted Revision ''%s'' from File ''%s''', [ DateTimeToStr( Now ), String( pUserName ), String( pObjectName ), String( pObjectParent ) ] ) );  
    ot_VersionLabel: LogIt( Format( '%s - ''%s'' Deleted Version Label ''%s''', [ DateTimeToStr( Now ), String( pUserName ), String( pObjectName ) ] ) );  
    ot_PromotionLevel: LogIt( Format( '%s - ''%s'' Deleted Promotion Level ''%s''', [ DateTimeToStr( Now ), String( pUserName ), String( pObjectName ) ] ) );  
  end;  
end;  
 

 


© 1995-2018 MCN Software