2.7 Customizing Error Pages on the Access Gateway Appliance

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

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

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

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

During the initial installation, the default template files 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:

2.7.1 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:

  1. Log in to the Access Gateway Appliance machine.

  2. Back up the ErrorPageTemplate.htm.en file in the /var/novell/errorpagesconfig/current directory.

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

    A sample error page template looks similar to the following:

    <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>
    
  4. Modify the error page template. You can edit the default template to customize the user interface, to modify 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 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.

  5. If you have changed the file to use 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/tomcat5/webapps/LAGERROR/images.

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

  6. Save the file.

  7. Enter the following commands to restart the machine:

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

  8. If the Access Gateway belongs to a cluster, copy the modified file and images to each member in the cluster, then restart that member.

2.7.2 Customizing and Localizing Error Messages

When the Access Gateway Appliance 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>
    

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

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

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

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 the Access Gateway Appliance machine.

  2. Open the ErrorPagesConfig.xml file located in the /var/novell/errorpagesconfig/current 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

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