Plugin Hooks

Supported Plugin Hooks

Supported hooks in Pawtucket2 include:

Hook Name

Description

Parameters

Where Used

hookDetailDownloadMediaObjectIDs

Triggered during a user-requested download from a detail. Passes a list of requested objects for which media will be downloaded. The plugin may modify this list to control what is actually sent to the user

Param 1: An array containing a list of object_ids for which the user is requesting a download. The plugin may modify and return this list to expand or reduce the media that will be included in the download

DetailController

hookDetailDownloadMediaFilePaths

Triggered during a user-requested download from a detail. Passes a list of paths to media that will be downloaded. The plugin may modify this list to control what is actually sent to the user

Param 1: An array containing a list of file paths for which the user is requesting a download. The plugin may modify and return this list to expand or reduce the media that will be included in the download, or to add additional files, such as a README file

DetailController

hookReplaceSearch

Triggered prior to “full” search on a specific item type (not a multi-record “multi-search) with information about the search. The plugin can rewrite the user-entered search expression as well as configuration information. If a search result instance is returned for the result value, that instance will be used in place of the serch to be executed. This allows the plugin to adjust search parameters, or, when needed, override normal search behavior with a synthesized result

Param 1: An array containing these keys and values: -search: the name of the search, corresponding to an entry in the browse.conf browsetypes block. Since searches are refineable browses seeded with a search, they use browse.conf definitions -browseInfo: configuration for the browseTypes entry referred to by search -searchExpression: the user-entered search expression -result: a null value. The plugin can set this value to a valid search result if it wished to replace the standard search results with a result generated within the plugin

SearchController