Edgewall Software

Changes between Version 4 and Version 5 of TracDev/PluginDevelopment/ExtensionPoints/trac.attachment.IAttachmentChangeListener


Ignore:
Timestamp:
Jul 30, 2017, 9:24:34 AM (7 years ago)
Author:
anonymous
Comment:

Added method attachment_moved (#12870)

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/PluginDevelopment/ExtensionPoints/trac.attachment.IAttachmentChangeListener

    v4 v5  
    88== Purpose ==
    99
    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).
     10Trac 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).
    1111
    1212The 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.)
     
    1818Implementing the interface follows the standard guidelines found in [wiki:TracDev/ComponentArchitecture] and of course [wiki:TracDev/PluginDevelopment].
    1919
    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 renames the parent resource.
     20When 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.
    2121
    2222== Examples ==
     
    4646        pass
    4747
    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):
    4949        pass
    5050}}}
     
    7474 * 0.10 introduced the interface (changeset:3399)
    7575 * 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)