Show TOC

Background documentationHooks Locate this document in the navigation structure

 

The Portal Runtime has defined some points during the request cycle where you can add your own processing. Those entry points, which are called hooks, are defined by the connection and are run for every request.

Note Note

Hooks affect every request to the portal, and are designed for special situations. Because hooks can have wide-ranging and dangerous side-effects, it is strongly recommended not to implement new hooks.

End of the note.

The following types of hooks can be defined (for the portal connection only):

  • POM Hooks: Executed whenever a POM node is created.

  • Event Hooks: Executed before any event is fired. It could replace the event, forward it to another object or cancel the publishing.

  • Document Hooks: Executed before and after construction of the HTML document.

  • Response Hooks: Executed before and after the service() method of the component. The hook can substitute the original response and is notified when the component has finished using the response object.

  • Component Hooks: Executed before the service() method of the component. It could add content or replace the content.

The hooks to be executed are defined in the portal registry under /runtime/hooks.