Dispatch Mechanism

Document created by resplin Employee on Jun 6, 2015
Version 1Show Document
  • View in full screen mode

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



JSFNavigationConfiguration
Back to Developer Guide




Introduction


The 1.2 release introduced a dispatching mechanism. The dispatching feature allows actions to be overridden based on the type of the node being acted upon.


Overview


When an action is executed in JSF a navigation handler is used to determine which page to go to next. The id of the current view and the outcome is sent to the navigation handler.

Alfresco uses a custom navigation handler to handle the JSF navigation process. The client also adds the node being acted upon to a dispatch context, this occurs whenever the user clicks on a space or document.

The navigation handler inspects the dispatch context and the parameters passed to it. If a node exists in the dispatch context a config lookup is performed using the node. The navigation element is retrieved and if found a best match override is returned. If an override is found, the navigation handler will navigate directly to the configured view-id or pass the configured outcome to the default navigation  handler.


Configuration


The configuration options are shown below.



<navigation>
   <override [from-view-id | from-outcome] [to-view-id | to-outcome] />
</navigation>

from-view-id - The view id (path) of the page the action was executed on

from-outcome - The outcome being processed i.e. showSpaceDetails

to-view-id   - The view id (path) of the page to navigate to

to-outcome   - The new outcome to send to the original navigation handler prompting a search of the standard JSF navigation rules.


Examples


A typical use case for the dispatch mechanism is when you want to use a slightly different page for an action based on the type. For example, the view space details page is slightly different for the fm:forums, fm:forum or fm:topic spaces (there are less options). This is configured as follows:



<config evaluator='node-type' condition='fm:forums'>
   <navigation>
      <override from-outcome='showSpaceDetails' to-view-id='/jsp/forums/forums-details.jsp' />
   </navigation>
</config>

Attachments

    Outcomes