Attachment Policies

Attachment policies provide places where you can hook in behaviors that trigger when attachments are read, created, updated or deleted against a node.

The following policies are available:

Policy QName Description
p:beforeReadAttachment Raised before a node's attachment is read
p:afterReadAttachment Raised after a node's attachment is read
p:beforeCreateUpdateAttachment Raised before an node's attachment is added to a node (either created or updated)
p:afterCreateUpdateAttachment Raised after an node's attachment is added to a node (either created or updated)
p:beforeDeleteAttachment Raised before an attachment is deleted from a node
p:afterDeleteAttachment Raised after an attachment is deleted from a node

Method Signatures

The following method signatures apply for the policies mentioned above:

p:beforeReadAttachment

(JavaScript)    
function beforeReadAttachment(node, attachmentId);

(Java)          
public void beforeReadAttachment(Node node, String attachmentId);

p:afterReadAttachment

(JavaScript)    
function afterReadAttachment(node, attachmentId);

(Java)          
public void afterReadAttachment(Node node, String attachmentId);

p:beforeCreateUpdateAttachment

(JavaScript)    
function beforeCreateUpdateAttachment(node, attachmentId, contentType, filename);

(Java)        
public void beforeCreateUpdateAttachment(Node node, String attachmentId, String contentType, String filename);

p:afterCreateUpdateAttachment

(JavaScript)    
function afterCreateUpdateAttachment(Node node, Attachment attachment);

(Java)       
public void afterCreateUpdateAttachment(Node node, Attachment attachment);

p:beforeDeleteAttachment

(JavaScript)    
function beforeDeleteAttachment(node, attachment);

(Java)          
public void beforeDeleteAttachment(Node node, Attachment attachment);

p:afterDeleteAttachment

(JavaScript)    
function afterDeleteAttachment(node, attachment);

(Java)          
public void afterDeleteAttachment(Node node, Attachment attachment);