EP Reference

EP Reference

EP Reference

This topic contains reference information and configuration files for examples in Enfold Proxy (EP). See also Caching Headers and Enfold Proxy Reference Guide.

Customizing Error Messages

Typical website error messages (such as "Page not found") are handled by your Plone site and Enfold Proxy (EP) just passes them along to the user.

The only error messages that EP itself generates occur when it has problems contacting your Plone site. You may want to customize these error messages to direct users to your technical support, or to match your web site's branding.

The error message files are located in the 'errors' directory in the application's directory. They are named according to the matching HTTP status code.

Filename HTTP Status Occurs when
403.html 403 Forbidden A remote administration command is received from an unauthorized machine.
403.license.html 403 Forbidden Your Enfold Systems license was not found, or is invalid.
500.html 500 Internal Server Error Any error is encountered, other than those specified below
502.html 502 Bad Gateway The proxied website was contacted, but the communication did not complete as expected.
504.html 504 Gateway Timeout The proxied website could not be contacted at all, or it did not respond in time.

These files are mostly plain HTML which you can customize as you see fit. However, you can also include special strings will be replaced with more details about the error.

String Will be replaced with
%(errnum)s The internal error number.
%(msg)s The internal error message.
%(func)s When available, the part of the program that generated the error.

XSLT Examples

Sample XML File/Script

This is a small python script that outputs an XML file within Plone. It is used in the xslt caching example Create a python script in the python and paste the following into the body:

request = container.REQUEST
response = request.RESPONSE
response.setHeader('XSLTStyleSheet',
       container.absolute_url() + '/cdcatalog.xsl')
response.setHeader('Content-Type', 'text/xml')

print """<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>

<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>

<price>9.90</price>
<year>1988</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>

<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>

</catalog>
"""

return printed

Sample XSLT File (for XSLT Caching Example

Here is a sample XSLT file for the XSLT caching example:

<?xml version="1.0" encoding="ISO-8859-1"?>
 <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="html" version="1.0"
    encoding="UTF-8" indent="yes"/>
  <xsl:template match="/">
    <html>
    <body>
    <h2>My CD Collection</h2>
      <table border="1">
        <tr bgcolor="#9acd32">
          <th align="left">Title</th>
          <th align="left">Artist</th>
        </tr>
        <xsl:for-each select="catalog/cd">
        <tr>
          <td><xsl:value-of select="title"/></td>
          <td><xsl:value-of select="artist"/></td>
        </tr>
        </xsl:for-each>
      </table>
    </body>
    </html>
  </xsl:template>
  </xsl:stylesheet>

Sample eep.ini file

Here is the eep.ini which was used for most of the examples. Note that you can check the syntax of your own eep.ini file by running EP's check utility.

[cache log]
eventlog_level = ERROR
level = INFO

[proxy log]
level = ERROR
eventlog_level = ERROR
backup_count = 5

[options]


[xslt]
cache_default_age = 6000
cache_enabled = True
object_cache_enabled = True
object_cache_max_len = 120

[host originalfunsite]
site = 998577302
excludes = java_application
auto_excludes = fsdirs
xslt_enabled = True
[host funsite1]
vh_root = /Plone2
host_headers =
site = 1180700441
vh_hosts = localhost:8080 localhost:8100

[host adminfunsite]
vh_root = /
site = 652515656
host_headers =
rewrite_mode = vhm

[host testidiot]
vh_hosts = www.python.org:80
rewrite_mode = simple
site = 1133314930
vh_root = /
lh_root = /python