Adding navigation rules

See Also  

Navigation rules define the navigation actions to take depending on the success or failure of the user's attempt to log on to Crystal Enterprise. A navigation rule redirects users to a different page depending on whether the returned string indicates a successful or failed logon attempt. The navigation rule is configured in the Properties view and automatically stored in the faces-config.xml file.

To set the navigation rules for the logon component
  1. Open logon.jsp and select the Logon component in the visual designer.
  2. In the Properties view, click the Add Rule button.
  3. In the Add Navigation Rule window, set the page to contents.jsp. Under the heading "When the action returns the outcome:", select the option "the outcome named", type logon_success, and then click OK.
  4. In the Properties view, click the Add Rule button again.
  5. In the Add Navigation Rule window, set the page to logon.jsp. Under the heading "When the action returns the outcome:", select the option "the outcome named", type logon_failure, and then click OK.

You must now create an action method that performs the checking of the user's logon status, and returns the strings "logon_success" or "logon_failure".

To add an action method to the logon component
  1. Open logon.jsp and select the Logon component in the visual designer.
  2. In the Quick Edit view, click the Command option.
  3. Type the following method to the Quick Edit window:
  4.     identity = getIdentity();

        if (identity == null)

            return "logon_failure";

        if(!identity.isLoggedOn())

            return "logon_failure";

        return "logon_success";

This method checks for the existence and logon status of the Identity bean, which contains the session information for the user. If the Identity bean is not null and is logged on to Crystal Enterprise, then the "logon_success" string is returned, otherwise the user is not logged on and the "logon_failure" string is returned.



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