How do I define the navigation flow of my application?

Navigation rules are defined in your faces-config.xml configuration file. To illustrate how to define navigation rules for your application, consider the following example:

Example

You have a web application that consists of three pages: logon.jsp, that allows users to log on to BusinessObjects Enterprise; contents.jsp, that lists a set of reports; and view.jsp, that allows users to view a single report. The navigation flow of the web application is illustrated by the following diagram:

 

For this sample application, you define a navigation rule for two cases:

Navigation rule for logging on

To implement this functionality:

An action method can be added to a backing bean of the logon.jsp page (see How do I use backing beans?). In addition, a reference to that method can then be added to the action attribute of the Logon component tag, which supplies the logon form, in the JSP page. For now, assume that the method returns the string "logon_success" when the logon attempt succeeds and "logon_failure" when the logon attempt fails. The navigation rule must be defined now.

To define the navigation rule for logging on to BusinessObjects Enterprise
  1. Open faces-config.xml for editing.
  2. In the file, add the following lines of code between the <faces-config> and </faces-config> tags:
  3. <navigation-rule>

        <from-view-id>/logon.jsp</from-view-id>

        <navigation-case>

            <from-outcome>logon_success</from-outcome>

            <to-view-id>/contents.jsp</to-view-id>

            <from-outcome>logon_failure</from-outcome>

            <to-view-id>/logon.jsp</to-view-id>

        </navigation-case>

    </navigation-rule>

  4. Save and close the file.

This navigation rule states the following:

The <from-view-id> tag indicates that this navigation rule is only valid for logon.jsp.

Navigation rule for viewing a report

To implement this functionality:

An action method can be added to a backing bean of the contents.jsp page (see How do I use backing beans?). In addition, a reference to that method can be added to the action attribute of the ItemsGrid component tag, which lists the reports, in the JSP page. For now, assume that the method returns the string "view_report".

To define the navigation rule for viewing a report
  1. Open faces-config.xml for editing.
  2. In the file, add the following lines of code between the <faces-config> and </faces-config> tags:
  3. <navigation-rule>

        <from-view-id>/contents.jsp</from-view-id>

        <navigation-case>

            <from-outcome>view_report</from-outcome>

            <to-view-id>/view.jsp</to-view-id>

        </navigation-case>

    </navigation-rule>

  4. Save and close the file.

This navigation rule states the following:

The <from-view-id> tag indicates that this navigation rule is only valid for contents.jsp.



Business Objects
http://www.businessobjects.com/
Support services
http://www.businessobjects.com/services/support/