3.7 Customizing Error Messages and Error Pages on Access Gateway

Access Gateway uses the custom error page template to rebrand and localize the language of error pages that are published to the browser.

By default, Access Gateway contains the following files to help customize and localize the error messages:

  • The error page configuration file, ErrorPagesConfig.xml

  • The error messages file, ErrorMessages.xml.en

NOTE:If you are modifying any of the above files, ensure that you retain the original filenames.

Access Gateway maintains /opt/novell/nam/mag/webapps/agm/WEB-INF/config/current/ directory to save files that are used for error page configuration.

You can customize and localize the error template and the error messages:

3.7.1 Customizing and Localizing Error Messages

When Access Gateway serves an error message to the browser by using the Accept-Language header value received from the browser, it selects a suitable error template and an error message file. To localize the error messages, you must to do the following:

Localize or customize the error messages in the ErrorPagesConfig.xml file and save it with the language extension. For more information, see Localizing and Customizing the Error Messages.

Localizing and Customizing the Error Messages

The error messages contained in the ErrorMessages.xml.en file can be localized in various languages and stored as ErrorMessages.xml.<lang>, where <lang> is the fileXn attribute value. You can also customize the English error messages present in the ErrorMessages.xml.en file.

NOTE:You cannot customize an error message that is not present in the ErrorMessages.xml.en file.

To localize the error messages:

  1. Log in as root.

  2. Open the ErrorMessages.xml.<lang> file.

  3. Copy the error messages that you have localized or customized to within the <TranslatedMessage></TranslatedMessage> tags. For example:

    </Message>
      <Message id="<ID No>" name="<ERROR_MESSAGE_NAME>" enable="yes">
        <EnglishMessage>English Message goes here</EnglishMessage>
    <TranslatedMessage>
    Localized message goes here
    </TranslatedMessage>
    </Message>
    

    Do not delete the contents within the <TranslatedMessage></TranslatedMessage> tags from an English file because, the ErrorPagesConfig.xml file selects the error message within these tags for display.

  4. Save the file.

  5. If the Access Gateway belongs to a cluster, copy the modified file to each member of the cluster, then restart that member.

  6. Edit the configuration and make dummy changes and push the configuration.

3.7.2 Customizing the Error Pages

Access Gateway uses the Apache method for localizing error messages. You can modify these messages or customize the page they are displayed on.

  1. To change a message:

    1. Change to the Apache message configuration directory:

      Linux: /etc/opt/novell/apache2/conf/extra

      Windows: \Program Files\Novell\apache\conf\extra

    2. Open the http-multilang-errordoc.conf file.

      The first few lines of this file contains comments on how Apache recommends modifying the error messages. You can select to use their method or continue with the following steps.

    3. Locate the ErrorDocument section and determine the error code message you want to modify. Make note of the *.var filename.

    4. Change to the Apache error directory:

      Linux: /opt/novell/apache2/share/apache2/error

      Windows: \Program Files\Novell\apache\error

    5. Open the *.var file that you want to modify.

      The message is listed alphabetically by language code.

    6. Save the changes.

  2. To change the header of the error page:

    1. Change to the Apache error include directory:

      Linux: /opt/novell/apache2/share/apache2/error/include

      Windows: \Program Files\Novell\apache\error\include

    2. Open thetop.html page.

    3. To change the title of the page, locate the following line:

      <title>Access Manager 3.2<\title>
      
    4. Replace the Access Manager 3.2 string with the content you require.

    5. To replace the image in the header, locate the following line:

      <img src="NAGErrors/images/Odyssey_LoginHead.gif" alt="" height="80" width="550" border="0">
      
    6. Replace Odyssey_LoginHead.gif with the filename of the image you want to display.

    7. Adjust the height and width values to match your image.

    8. Save the file.

    9. Copy your image to the images directory:

      Linux: /opt/novell/apache2/share/apache2/error/images

      Windows: \Program Files\Novell\apache\error\images

  3. To change the footer of the error page:

    1. Change to the Apache error include directory:

      Linux: /opt/novell/apache2/share/apache2/error/include

      Windows: \Program Files\Novell\apache\error\include

    2. Open the bottom.html page.

    3. To change the image, find the following line:

      <td style="background-color: #E6D88C; padding-left: 10px"><img style="padding-right: 200px" src="/NAGErrors/images/LAP_interoperable_logo_100.gif" align="absmiddle" border="0">
      
    4. Change LAP_interoperable_logo_100.gif to the filename of the image you want to display.

    5. Save the file.

    6. Copy your image to the images directory:

      Linux: /opt/novell/apache2/share/apache2/error/images

      Windows: \Program Files\Novell\apache\error\images

  4. Copy all modified files and image files to all Access Gateways in the cluster.

The err.jsp file will also log the ESP error messages. For more information on customizing the err.jsp page, see Customizing Identity Server Messages. The procedure for customizing is the same but the paths referred to will change for the Access Gateway. Following are the path changes:

  • In Customizing Messages, the paths for Access Gateway are as follows:

    • Step 3, path on Linux will be /opt/novell/nam/mag/webapps/nesp/WEB-INF/lib and on Windows /Program Files/Novell/Tomcat/webapps/nesp/WEB-INF/lib/.
    • Step 10, path on Linux will be /opt/novell/nam/mag/webapps/nesp/WEB-INF/classes and on Windows /Program Files/Novell/Tomcat/webapps/nesp/WEB-INF/classes.
    • Step 12, restart Access Gateway /etc/init.d/novell-mag restart.
  • In Customizing the Branding of the Error Page, the path for err.jsp in the ESP on Linux will be /opt/novell/nam/mag/webapps/nesp/jsp and on Windows /Program Files/Novell/Tomcat/webapps/nesp/jsp/.