Changes between Version 4 and Version 5 of TracDev/PluginDevelopment/ExtensionPoints/trac.attachment.IAttachmentChangeListener
- Timestamp:
- Jul 30, 2017, 9:24:34 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/PluginDevelopment/ExtensionPoints/trac.attachment.IAttachmentChangeListener
v4 v5 8 8 == Purpose == 9 9 10 Trac allows users to attach arbitrary files to e.g. tickets or wiki pages. Plugins can hook into the attachment module to trigger their own actions when attachments are added, deleted or reparented (i.e. moved to another parent resource or with a renamed parent resource).10 Trac allows users to attach arbitrary files to e.g. tickets or wiki pages. Plugins can hook into the attachment module to trigger their own actions when attachments are added, deleted or moved (i.e. moved to another parent resource and / or renamed). 11 11 12 12 The main purpose for this interface is to allow plugins to stay informed about the existing attachments and trigger appropriate actions elsewhere (e.g. sending notifications, starting indexing services, updating supplementary data structures etc.) … … 18 18 Implementing the interface follows the standard guidelines found in [wiki:TracDev/ComponentArchitecture] and of course [wiki:TracDev/PluginDevelopment]. 19 19 20 When a user adds a new attachment the `attachment_added` method is called. Similarly `attachment_deleted` is called when a user deletes an attachment or its parent resource, and `attachment_ reparented` is called when a user moves an attachment to a new parent resource or renamesthe parent resource.20 When a user adds a new attachment the `attachment_added` method is called. Similarly `attachment_deleted` is called when a user deletes an attachment or its parent resource, and `attachment_moved` is called when a user moves an attachment to a new parent resource or renames the attachment or the parent resource. 21 21 22 22 == Examples == … … 46 46 pass 47 47 48 def attachment_ reparented(self, attachment, old_parent_realm, old_parent_id):48 def attachment_moved(attachment, old_parent_realm, old_parent_id, old_filename): 49 49 pass 50 50 }}} … … 74 74 * 0.10 introduced the interface (changeset:3399) 75 75 * 0.12 added method `attachment_reparented` (#1106, changeset:9362) 76 * 1.3.2 added method `attachment_moved` (#12870, changeset:16160) 77 * 1.5.1 will remove method `attachment_reparented` (deprecated since #12870)