14.2. Integrating Modules (Publish/Subscribe)

One way for a module to participate in Perforce Chronicle operations is by implementing an integration class. When a module is enabled, disabled, loaded for use, or initialized, it can prepare or clean up the resources that it requires. In addition, modules can publish and subscribe to topics that enable it to create and respond to Chronicle events. These mechanisms provide you with great flexibility in enhancing Chronicle.

The Module.php file defines a module's integration with Chronicle. Example: for a module named "Foo," the basic structure of the integration is as follows:

<?php
/**
 * Description of the module.
 *
 * @copyright   Copyright information.
 * @license     License information.
 * @version     Version identifier(s)
 */
class Foo_Module extends P4Cms_Module_Integration
{
    /**
     * Perform early integration work (before load).
     */
    public static function init()
    {
        // subscribe to topics here
    }

    /**
     * Perform integration work at load time.
     */
    public static function load()
    {
    }

    /**
     * Perform work when this module is enabled.
     */
    public static function enable()
    {
    }

    /**
     * Perform work when this module is disabled.
     */
    public static function disable()
    {
    }
}

14.2.1. Publish/Subscribe

Publish/Subscribe (pub/sub) is a messaging pattern that enables modules to participate in operations without modifying Chronicle. The pattern consists of two roles:

  • A publisher that signals when participation by other modules is available.
  • A subscriber that registers to participate in specific operations.

To signal that participation is available, publishers use a topic, which is a unique name used to identify the event. By convention, topic identifiers are composed of a period-separated list of namespaces. For example, the topic p4cms.content.form.validate indicates that the topic is a core p4cms topic, published by the content module when a form.validate operation is underway.

14.2.1.1. Pub/Sub Topics

Chronicle pub/sub topics and arguments are as follows (click on each row to show more details about the topic arguments, click to toggle all details):

Table 14.2. Pub/Sub Topics

Topic Description
p4cms.acl.<resource>.privileges$resource )
Type Argument Description
P4Cms_Acl_Resource $resource The resource to modify.
Modify the passed resource, intended to allow subscribers to add/remove/modify the resource's privileges. The <resource> portion of the topic is the resource's ID.
p4cms.acl.users.privileges$resource )
Type Argument Description
P4Cms_Acl_Resource $resource The resource that must be checked for appropriate privileges.
Gathers the resource privileges for authorization checks, or for presentation by the User module.
p4cms.category.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the Manage Categories grid.
p4cms.category.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Categories grid.
p4cms.category.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Categories grid.
p4cms.category.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Categories filters form.
p4cms.category.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Categories filters form after it has been populated with the passed data.
p4cms.category.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Categories filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.category.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Categories filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.category.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Categories filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.category.grid.populate$items$form )
Type Argument Description
P4Cms_Model_Iterator $items An iterator of Category_Model_Category objects.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which categories will be shown on the Manage Categories grid.
p4cms.category.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Categories grid.
p4cms.comment.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the Moderate Comments grid.
p4cms.comment.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Moderate Comments grid.
p4cms.comment.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after appling any modifications (add properties, change values, etc.) to influence the row values sent to the Moderate Comments grid.
p4cms.comment.grid.populate$query$form )
Type Argument Description
P4Cms_Record_Query $query The query used to filter comments.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed query (possibly based on values in the passed form) to influence which comments will be shown on the Moderate Comments grid.
p4cms.comment.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Moderate Comments grid.
p4cms.content.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the Manage Content grid.
p4cms.content.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Content grid.
p4cms.content.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Content grid.
p4cms.content.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Content filters form.
p4cms.content.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Content filters form after it has been populated with the passed data.
p4cms.content.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Content filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.content.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Content filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.content.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Content filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.content.grid.populate$query$form )
Type Argument Description
P4Cms_Record_Query $query The query to filter content entries.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed query (possibly based on values in the passed form) to filter which content entries will be shown on the Manage Content grid.
p4cms.content.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Content grid.
p4cms.content.record.delete$entry )
Type Argument Description
P4Cms_Content $entry The content entry that is about to be deleted.
Perform operations on a content entry just prior to deletion.
p4cms.content.record.postSave$entry )
Type Argument Description
P4Cms_Content $entry The content entry that has just been saved.
Perform operations on a content entry just after it's saved (but before the batch it is in gets committed).
p4cms.content.record.preSave$entry )
Type Argument Description
P4Cms_Content $entry The content entry that is about to be saved.
Perform operations on a content entry just prior to its being saved.
p4cms.content.record.query$query$adapter )
Type Argument Description
P4Cms_Record_Query $query The query that is about to be used to retrieve records from storage.
P4Cms_Record_Adapter $adapter The current storage connection adapter.
Adjust the passed query to influence the results of P4Cms_Content's fetch/fetchAll/count results (e.g. to exclude unpublished content).
p4cms.content.render$html$content$options )
Type Argument Description
string $html The HTML markup for a content entry.
P4Cms_Content $content The content entry being rendered.
array $options An array of options for the view helper to influence rendering.
Return the passed HTML after applying any modifications. Allows customization of the markup for a content entry.
p4cms.content.render.close$html$helper )
Type Argument Description
string $html The closing HTML markup for the content entry.
Content_View_Helper_ContentEntry $helper The view helper rendering the content entry.
Return the passed HTML after applying any modifications. Allows customization of the closing HTML markup for a content entry.
p4cms.content.type.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the Manage Content Types grid.
p4cms.content.type.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Content Types grid.
p4cms.content.type.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Content Types grid.
p4cms.content.type.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Content Types filters form.
p4cms.content.type.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Content Types filters form after it has been populated with the passed data.
p4cms.content.type.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Content Types filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.content.type.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Content Types filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.content.type.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Content Types filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.content.type.grid.populate$query$form )
Type Argument Description
P4Cms_Record_Query $query The query used to filter the content types.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed query (possibly based on values in the passed form) to filter which content types will be shown on the Manage Content Types grid.
p4cms.content.type.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Content Types grid.
p4cms.content.view.scripts$scripts$entry )
Type Argument Description
array $scripts The list of view script filenames.
P4Cms_Content $entry The content entry to render.
Return the passed scripts array, making any modifications (add, remove or change values), to influence the view script that ends up being selected for rendering. The first view script filename in the list that exists in the view's search paths gets used. Note that the filename should not include the suffix (typically ".phtml").
p4cms.cron.daily Perform periodic operations intended to execute once per day. Any returned text will be saved in the cron log. (requires additional settings on a server, or activation of the Easy_Cron module. Please see Section 18.4, “Time-Based Tasks”)
p4cms.cron.hourly Perform periodic operations intended to execute once per hour. Any returned text will be saved in the cron log. (requires additional settings on a server, or activation of the Easy_Cron module. Please see Section 18.4, “Time-Based Tasks”)
p4cms.cron.monthly Perform periodic operations intended to execute once per month. Any returned text will be saved in the cron log. (requires additional settings on a server, or activation of the Easy_Cron module. Please see Section 18.4, “Time-Based Tasks”)
p4cms.cron.weekly Perform periodic operations intended to execute once per week. Any returned text will be saved in the cron log. (requires additional settings on a server, or activation of the Easy_Cron module. Please see Section 18.4, “Time-Based Tasks”)
p4cms.diff.options$options$type$left$right )
Type Argument Description
P4Cms_Navigation $options A menu to hold diff actions.
P4Cms_Record_RegisteredType $type The type of record being diffed.
P4Cms_Record $left The record displayed on the left side of the diff.
P4Cms_Record $right The record displayed on the right side of the diff.
Modify the passed options to influence the diff results.
p4cms.history.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the History grid.
p4cms.history.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the History grid.
p4cms.history.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the History grid.
p4cms.history.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the History filters form.
p4cms.history.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the History filters form after it has been populated with the passed data.
p4cms.history.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the History filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.history.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the History filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.history.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the History filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.history.grid.populate$changes$form )
Type Argument Description
P4Cms_Model_Iterator $changes An iterator of P4_Change objects
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which versions will be shown on the History grid.
p4cms.history.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the History grid.
p4cms.history.toolbar.actions$type$record$actions )
Type Argument Description
P4Cms_Record_RegisteredType $type The type for which actions are being gathered.
P4Cms_Record $record The record being worked on.
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the history toolbar.
p4cms.macro.<name>$args$body$context )
Type Argument Description
array $args The arguments passed to the macro.
string $body The enclosed body text for paired macros; null otherwise.
array $context An array containing context-specific information to assist macro expansion. Macros filtered by a P4Cms_Content entry receive the entry in the 'content' key, and the current form element in the 'element' key.
Return the result of macro expansion. Normally this would be the expanded text that will replace the macro for display. Returning false indicates that the encountered text should not be processed and be returned unchanged. If multiple subscribers are present, only the first result is examined (subsequent subscribers are ignored). When subscribing, the <name> portion of this topic should be replaced with the macro name.
p4cms.menu.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the Manage Menus grid.
p4cms.menu.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Menus grid.
p4cms.menu.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Menus grid.
p4cms.menu.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Menus filters form.
p4cms.menu.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Menus filters form after it has been populated with the passed data.
p4cms.menu.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Menus filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.menu.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Menus filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.menu.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Menus filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.menu.grid.populate$mixed$form )
Type Argument Description
P4Cms_Model_Iterator $mixed An iterator of P4Cms_Menu_Mixed objects.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which menus will be shown on the Manage Menus grid.
p4cms.menu.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Menus grid.
p4cms.navigation.dynamicHandlers Return a P4Cms_Navigation_DynamicHandler (or array of Dynamic Handlers) to be included in the dynamic handler fetchAll results. The last subscriber to return a valid entry for a given ID wins. Dynamic menu handlers can provide dynamically-generated navigation entries.
p4cms.navigation.pageTypeHandlers Return a P4Cms_Navigation_PageTypeHandler (or array of Page Type Handlers) to be included in the page type handler fetchAll results. The last subscriber to return a valid entry for a given ID wins. Page type handlers can provide custom page types for use in navigation hierarchies.
p4cms.record.registeredTypes Return a P4Cms_Record_RegisteredType (or array of Registered Types) to be included in the registered type fetchAll results. The last subscriber to return a given ID wins. If an ID is specified but the type is invalid, this is considered a request to remove any previously registered type with that ID.
p4cms.search.add$document )
Type Argument Description
Zend_Search_Lucene_Document|P4Cms_Content $document The entry being added.
Perform operations when an entry is added to the search index. Note: Updates to existing entries are accomplished via delete/add.
p4cms.search.delete$document )
Type Argument Description
Zend_Search_Lucene_Document|P4Cms_Content $document The entry being deleted.
Perform operations when an entry is deleted from the search-index. Note: Updates to existing entries are accomplished via delete/add.
p4cms.search.index.rebuild Return a Zend_Paginator of P4Cms_Content entries (or null) to be included when the search index is rebuilt.
p4cms.search.prepareDocument$document$original )
Type Argument Description
Zend_Search_Lucene_Document|mixed $document The document to prepare for indexing.
mixed $original The original value passed to 'prepareDocument'
Return the passed document after making any necessary modifications for proper indexing. Subscribers can adjust values or take responsibility for converting the document to Lucene Document format so it can be successfully indexed.
p4cms.search.results$results )
Type Argument Description
Zend_Search_Lucene_Search_QueryHit $results The list of search results.
Return the passed search results after applying any filters.
p4cms.search.update$document )
Type Argument Description
Zend_Search_Lucene_Document|P4Cms_Content $document The entry being updated.
Perform search indexing related operations with the passed document. Called when content is saved, indicating it has been added or edited.
p4cms.site.branch.add.postSubmit$branch$parent$adapter )
Type Argument Description
P4Cms_Site $branch The branch just added.
P4Cms_Site $parent The new branch's parent branch.
P4Cms_Record_Adapter $adapter The current storage connection adapter.
Provides an opportunity for modules to modify a new branch just after its files have been committed to Perforce.
p4cms.site.branch.add.preSubmit$branch$parent$adapter )
Type Argument Description
P4Cms_Site $branch The branch being added.
P4Cms_Site $parent The new branch's parent branch.
P4Cms_Record_Adapter $adapter The current storage connection adapter.
Provides an opportunity for modules to modify a new branch just prior to its files being committed to Perforce.
p4cms.site.branch.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the Manage Sites and Branches grid.
p4cms.site.branch.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Sites and Branches grid.
p4cms.site.branch.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Sites and Branches grid.
p4cms.site.branch.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Sites and Branches filters form.
p4cms.site.branch.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Sites and Branches filters form after it has been populated with the passed data.
p4cms.site.branch.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Sites and Branches filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.site.branch.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Sites and Branches filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.site.branch.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Sites and Branches filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.site.branch.grid.populate$branches$form )
Type Argument Description
P4Cms_Model_Iterator $branches An iterator of P4Cms_Site objects.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which branches will be shown on the Manage Sites and Branches grid.
p4cms.site.branch.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Sites and Branches grid.
p4cms.site.branch.pull.conflicts$conflicts$target$source$headChange$preview$adapter )
Type Argument Description
P4_Result $conflicts A list of the conflicts encountered during a pull operation.
P4Cms_Site $target The target branch for the pull.
P4Cms_Site $source The source branch for the pull.
int $headChange The head change number this pull was pinned to.
bool $preview Set to true if the pull operation is just a preview, false if the pull operation is to be completed.
P4Cms_Record_Adapter $adapter The current storage connection adapter.
Intended to provide modules an opportunity to programmatically resolve conflicts where possible. A resolve '-as' is run prior to this event so only files that were not safely auto resolved will be included. Any files which remain unresolved will be shown with a conflict warning to the end user.
p4cms.site.branch.pull.groupPaths$paths$source$target$result )
Type Argument Description
Site_Model_PullPathGroup $paths The path structure to be organized.
P4Cms_Site $source The source branch.
P4Cms_Site $target The target branch.
P4_Result $result the output from a merge or copy command.
The passed paths object starts with all paths being pulled directly associated with it. Modules should add sub-groups and move logically grouped paths into them. They can also set callbacks on the sub-groups to provide human friendly entry titles and counts. Any paths left at the top level will be automatically moved into an 'Other' group after this event completes.
p4cms.site.branch.pull.postSubmit$paths$target$source$adapter )
Type Argument Description
Site_Model_PullPathGroup $paths The paths affected by this pull, grouped logically.
P4Cms_Site $target The target branch for the pull.
P4Cms_Site $source The source branch for the pull.
P4Cms_Record_Adapter $adapter The current storage connection adapter.
Provides an opportunity for modules to react to pulling changes from the source branch into the target branch just after the files have been committed to Perforce.
p4cms.site.branch.pull.preSubmit$target$source$headChange$adapter )
Type Argument Description
P4Cms_Site $target The target branch for the pull.
P4Cms_Site $source The source branch for the pull.
int $headChange A numerical revision representing the head change on the source branch to pull.
P4Cms_Record_Adapter $adapter The current storage connection adapter.
Provides an opportunity for modules to react to pulling changes from the source branch into the target branch just prior to the paths being grouped. This event will occur for both actual pulls (where a postSubmit event will follow) and for previews (used to inform the user of which files are available for pull) where the data is never actually submitted.
p4cms.site.created$site$admin )
Type Argument Description
P4Cms_Site $site The site that has been created.
P4Cms_User $admin The administrator account used for creation.
Perform operations when a site is created by the Site Module.
p4cms.site.module.disabled$site$module )
Type Argument Description
P4Cms_Site $site The site for which the module is being disabled.
P4Cms_Module $module The module being disabled.
Perform operations when a module is disabled by the Site module.
p4cms.site.module.enabled$site$module )
Type Argument Description
P4Cms_Site $site The site for which the module is being enabled.
P4Cms_Module $module The module being enabled.
Perform operations when a module is enabled by the Site module.
p4cms.site.module.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Modules grid.
p4cms.site.module.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Modules grid.
p4cms.site.module.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Modules filters form.
p4cms.site.module.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Modules filters form after it has been populated with the passed data.
p4cms.site.module.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Modules filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.site.module.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Modules filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.site.module.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Modules filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.site.module.grid.populate$modules$form )
Type Argument Description
P4Cms_Model_Iterator $modules An iterator of P4Cms_Module objects.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which modules will be shown on the Manage Modules grid.
p4cms.site.module.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Modules grid.
p4cms.site.theme.disabled$site$theme )
Type Argument Description
P4Cms_Site $site The site for which the theme is being disabled.
P4Cms_Theme $theme The theme being disabled.
Perform operations when a theme is disabled by the Site module.
p4cms.site.theme.enabled$site$theme )
Type Argument Description
P4Cms_Site $site The site for which the theme is being enabled.
P4Cms_Theme $theme The theme being enabled.
Perform operations when a theme is enabled by the Site module.
p4cms.site.theme.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Themes grid.
p4cms.site.theme.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Themes grid.
p4cms.site.theme.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Themes filters form.
p4cms.site.theme.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Themes filters form after it has been populated with the passed data.
p4cms.site.theme.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Themes filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.site.theme.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Themes filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.site.theme.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Themes filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.site.theme.grid.populate$themes$form )
Type Argument Description
P4Cms_Model_Iterator $themes An iterator of P4Cms_Theme objects.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which themes will be shown on the Manage Themes grid.
p4cms.site.theme.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Themes grid.
p4cms.system.info$info )
Type Argument Description
P4Cms_Model_Iterator $info The list of System_Model_Info objects.
Allows subscribers to add additional System_Model_Info models to the passed iterator, or modify any existing entries, to influence the data available on the System Info management page.
p4cms.user.acl.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Permissions grid.
p4cms.user.acl.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Permissions grid.
p4cms.user.acl.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Permissions filters form.
p4cms.user.acl.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Permissions filters form after it has been populated with the passed data.
p4cms.user.acl.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Permissions filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.user.acl.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Permissions filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.user.acl.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Permissions filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.user.acl.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (i.e. change options) for the Manage Permissions grid.
p4cms.user.acl.permissions$permissions$form )
Type Argument Description
P4Cms_Model_Iterator $permissions An iterator of P4Cms_Model objects (representing each permission).
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which permissions will be shown on the Manage Permissions grid.
p4cms.user.acl.roles$roles$form )
Type Argument Description
P4Cms_Model_Iterator $roles An iterator of P4Cms_Acl_Role objects.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which roles will be shown on the Manage Permissions grid.
p4cms.user.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the Manage Users grid.
p4cms.user.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Users grid.
p4cms.user.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Users grid.
p4cms.user.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Users filters form.
p4cms.user.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Users filters form after it has been populated with the passed data.
p4cms.user.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Users filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.user.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Users filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.user.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Users filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.user.grid.populate$users$form )
Type Argument Description
P4Cms_Model_Iterator $users An Iterator of User_Model_User objects.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which users will be shown on the Manage Users grid.
p4cms.user.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Users grid.
p4cms.user.role.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the Manage Users grid.
p4cms.user.role.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Roles grid.
p4cms.user.role.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Roles grid.
p4cms.user.role.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Roles filters form.
p4cms.user.role.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Roles filters form after it has been populated with the passed data.
p4cms.user.role.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Roles filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.user.role.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Roles filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.user.role.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Roles filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.user.role.grid.populate$roles$form )
Type Argument Description
P4Cms_Model_Iterator $roles An iterator of Role_Model_Role objects.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which roles will be shown on the Manage Roles grid.
p4cms.user.role.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Roles grid.
p4cms.workflow.grid.actions$actions )
Type Argument Description
P4Cms_Navigation $actions A menu to hold grid actions.
Modify the passed menu (add/modify/delete items) to influence the actions shown on entries in the Manage Workflows grid.
p4cms.workflow.grid.data$data$helper )
Type Argument Description
Zend_Dojo_Data $data The data to be filtered.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Adjust the passed data (add properties, modify values, etc.) to influence the row values sent to the Manage Workflows grid.
p4cms.workflow.grid.data.item$item$model$helper )
Type Argument Description
array $item The item to potentially modify.
mixed $model The original object/array that was used to make the item.
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Return the passed item after applying any modifications (add properties, change values, etc.) to influence the row values sent to the Manage Workflows grid.
p4cms.workflow.grid.form$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Make arbitrary modifications to the Manage Workflows filters form.
p4cms.workflow.grid.form.populate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values The values passed to the populate method.
Allows subscribers to adjust the Manage Workflows filters form after it has been populated with the passed data.
p4cms.workflow.grid.form.preValidate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Allows subscribers to adjust the Manage Workflows filters form prior to validation of the passed data. For example, modify element values based on related selections to permit proper validation.
p4cms.workflow.grid.form.subForms$form )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
Return a Form (or array of Forms) to have them added to the Manage Workflows filters form. The returned form(s) should have a 'name' set on them to allow them to be uniquely identified.
p4cms.workflow.grid.form.validate$form$values )
Type Argument Description
P4Cms_Form_PubSubForm $form The form that published this event.
array $values An associative array of form values.
Return false to indicate the Manage Workflows filters form is invalid. Return true to indicate your custom checks were satisfied, so form validity should be unchanged.
p4cms.workflow.grid.populate$workflows$form )
Type Argument Description
P4Cms_Model_Iterator $workflows An iterator of Workflow_Model_Workflow objects.
P4Cms_Form_PubSubForm $form A form containing filter options.
Adjust the passed iterator (possibly based on values in the passed form) to filter which workflows will be shown on the Manage Workflows grid.
p4cms.workflow.grid.render$helper )
Type Argument Description
Ui_View_Helper_DataGrid $helper The view helper that broadcast this topic.
Make adjustments to the datagrid helper's options pre-render (e.g. change options to add columns) for the Manage Workflows grid.

Perforce Chronicle - Release: 2012.2/486814