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:


function beforeReadAttachment(node, attachmentId);

public void beforeReadAttachment(Node node, String attachmentId);


function afterReadAttachment(node, attachmentId);

public void afterReadAttachment(Node node, String attachmentId);


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

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


function afterCreateUpdateAttachment(Node node, Attachment attachment);

public void afterCreateUpdateAttachment(Node node, Attachment attachment);


function beforeDeleteAttachment(node, attachment);

public void beforeDeleteAttachment(Node node, Attachment attachment);


function afterDeleteAttachment(node, attachment);

public void afterDeleteAttachment(Node node, Attachment attachment);