15.6 Customizing Error Pages

15.6.1 Customizing Error Pages for the Linux Access Gateway

With the Novell Access Manager 3.0 SP3 release, the Linux Access Gateway uses the custom error page template to rebrand and localize the language of error pages that are published to the browser.

WARNING:With the SP3 release, error.jsp files are no longer used to serve error pages. If you have customized the error pages during the previous release by using the error.jsp file, you will lose all of your changes. You must now customize your error pages by using the error pages template. The service-based customizing of error pages is not supported with these SP 3 changes.

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

  • The error page configuration file, ErrorPagesConfig.xml

  • The error page template file, ErrorPageTemplate.htm.en

  • The error messages file, ErrorMessages.xml.en

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

The Linux Access Gateway maintains three directories to save files that are used for error page configuration:

During the initial installation, the default template files packaged in the build are copied to the .factory and the current directories. If you have not customized the files in the current directory, subsequent installations do not overwrite these files.

When the next version of the files is installed, the files in the current directory are copied to the .backup directory with the format <filename>.oldBuildNo. This ensures that the old build files and customized files are always available in the .backup directory.

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

Customizing the Error Pages by Using the Default Template

To customize the default error page template, you must edit the ErrorPageTemplate.htm.en file as follows:

NOTE:Make sure that you save the ErrorPageTemplate.htm.en file as a backup, before modifying it.

  1. Log in to a Linux Access Gateway machine.

  2. Open the ErrorPageTemplate.htm.en file located in the /var/novell/errorpagesconfig/current directory.

    A sample error page template is as follows:

    <html> <head><title>Information Alert</title></head> <body bgcolor="white"><div align="center"><center> <table border="0" cellpadding="2" frame height="199" style="margin-top: 1px; margin-bottom: 1px; padding-top: 1px; padding-bottom: -1px"> <tr> <td height="34" align="center"><font color="black" face="Arial Bold" size="4"> <b><p align="center"></b></font><font face="Intrepid" size="6" color="#000080"> <strong>Information Alert </strong></font> </td> </tr> <tr> <td height="20" align="center"><img height="8" width="445" src="<PROXY_ADDRESS>/images/Odyssey_LoginHead.gif"></td> </tr> <tr> <td height="24" width="444" bgcolor="white" align="center"> <p align="left"> <b><br><font color="black" face="Comic Sans MS">Status</font></b> <font color="#ff0033" face="Comic Sans MS"><b>: </b></font><font color="black" face="Comic Sans MS"><ERROR_STATUS> </font> </p> <p align="left"> <font color="black" face="Comic Sans MS"><b>Description</b></font> <font color="#ff0033" face="Comic Sans MS"><b>: </b></font> <font color="black" face="Comic Sans MS"><ERROR_DESCRIPTION></font> </p> <br> <br> </font></td> </tr> <tr><td width="444" height="10" align="center"><img height="8" width="445" src="<PROXY_ADDRESS>/images/LAP_interoperable_logo_100.gif"></td></tr> </table> </center></div> </body> </html>

  3. Modify the error page template. You can edit the default template to customize the user interface, embedded images and to provide localization. However, <ERROR_STATUS> and ERROR_DESCRIPTION> tags should not be removed because, the following actions take place when the error page is served to the browser:

    • <ERROR_STATUS>: When the When the error page is served to the browser, <ERROR_STATUS> is replaced with the HTTP status code description.

    • <ERROR_DESCRIPTION>: When the error page is served to the browser, <ERROR_DESCRIPTION> is replaced with the detailed error description.

    If you have changed the images with a new image:

    • All the images must be linked to the <PROXY_ADDRESS>/images/ directory.

    • All the images must be copied to Tomcat in the path /var/opt/novell/tomcat4/webapps/LAGERROR/images.

    If you have changed an image but retained the filename, press Ctrl + F5 in the browser to refresh the Linux Access Gateway cache.

  4. Save the file.

  5. Enter the following commands to restart the machine:

    /etc/init.d/novell-vmc stop /etc/init.d/novell-vmc start

Customizing and Localizing Error Messages

When the Linux 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:

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>
    

    NOTE: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. Enter the following commands to restart the Linux Access Gateway:

    /etc/init.d/novell-vmc stop /etc/init.d/novell-vmc start

Modifying the ErrorPagesConfig.XML file

The ErrorPagesConfig.xml file stores the header value and the template mapping information. You must edit the ErrorPagesConfig.xml file to provide localization for error messages in various languages. In the ErrorPagesConfig.xml file, each <Profile> element corresponds to a template file ErrorPageTemplate.htm.<lang> and a messages file ErrorMessages.xml.<lang>, where <lang> is the fileXn attribute value. For example, if the fileXn attribute value is de, the ErrorPagesTemplate.htm.de file is served to the browser.

To map a list of Accept-Language header values to the template, you must add the header value as the <header> element under the corresponding <Profile> element.

To modify the ErrorPagesConfig.xml file:

  1. Log in to a Linux Access Gateway machine.

  2. Open the ErrorPagesConfig.xml file located in the /var/novell directory.

  3. Add the language information within the <profile> tag as follows:

    <ErrorPageConfiguration> <Profile name = “English” enable = “1” fileXn = “en”> <header value = “en-us” /> <header value = “en-uk” /> <header value = “en-any” /> <header value = “any” /> </Profile> <Profile name = “German” enable = “1” fileXn = “de”> <header value = “de-CH” /> <header value = “de-any” /> </Profile> </ErrorPageConfiguration>

    This file serves the error messages from:

    • The English profile, if the header value is en-us or en-uk or en-*

    • The German profile, if the header value is de-CH or de-*

    • The default profile, if the header value is not any of the above, or if it is defined as any.

    When the header value is defined as any, the default profile is served. This profile matches any header value that did not have a matching profile. For example, if the header value entry is en-any, and the Accept-Language header value of the browser is en-xyz (for which there is no proper match), then the profile with the entry en-any would be a match.

    If any is used to search for any language-specific files, then the word any must be preceded by the hyphen (-). For example, you must not specify en-cany as the header value entry to match en-c* header values.

  4. Save the file.

  5. Enter the following commands to restart the machine:

    /etc/init.d/novell-vmc stop /etc/init.d/novell-vmc start

15.6.2 Configuring Error Page Presentation for the NetWare Access Gateway

The Error Page option allows you to specify how the error pages generated by the NetWare Access Gateway are published to the browsers.

  1. In the Administration Console, click Access Manager > Access Gateways > Edit > Error Page.

  2. In the Error Page Language field, select the language in which the error page is published.

  3. To save your changes to browser cache, click OK.

  4. On the Server Configuration page, click Close, then click Update > OK.

WARNING:The messages are available from Novell in English. To use another language, you must translate the messages to that language. For information on how to customize the error messages for a specific language, see Customizing Error Pages in the Novell Access Manager 3.0 SP4 Installation Guide.