| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 |
<section xmlns:db="http://docbook.org/docbook-ng" xmlns:xi="http://www.w3.org/2001/XInclude" |
|---|
| 3 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:id="builtinfilters"> |
|---|
| 4 |
<title>Builtin Filters</title> |
|---|
| 5 |
<section id="baseurlfilter"> |
|---|
| 6 |
<title>baseurlfilter</title> |
|---|
| 7 |
<para>The baseurlfilter changes the base url of a request. It is useful for running CherryPy |
|---|
| 8 |
behind Apache with mod_rewrite.</para> |
|---|
| 9 |
<para>The baseurlfilter has the following configuration options</para> |
|---|
| 10 |
<itemizedlist> |
|---|
| 11 |
<listitem>baseUrlFilter.baseUrl</listitem> |
|---|
| 12 |
<listitem>baseUrlFilter.useXForwardedHost</listitem> |
|---|
| 13 |
</itemizedlist> |
|---|
| 14 |
</section> |
|---|
| 15 |
<section id="cachefilter"> |
|---|
| 16 |
<title>cachefilter</title> |
|---|
| 17 |
</section> |
|---|
| 18 |
<section id="decodingfilter"> |
|---|
| 19 |
<title>decodingfilter</title> |
|---|
| 20 |
<para>The decoding filter can be configured to automatically decode incoming requests.</para> |
|---|
| 21 |
<para>The decodingfilter has the following configuration options:</para> |
|---|
| 22 |
<itemizedlist> |
|---|
| 23 |
<listitem>decodingFilter.encoding</listitem> |
|---|
| 24 |
</itemizedlist> |
|---|
| 25 |
</section> |
|---|
| 26 |
<section id="encodingfilter"> |
|---|
| 27 |
<title>encodingfilter</title> |
|---|
| 28 |
<para>The encodingfilter can be configured to automatically encode outgoing responses.</para> |
|---|
| 29 |
<para>The encodingfilter has the following configuration options:</para> |
|---|
| 30 |
<itemizedlist> |
|---|
| 31 |
<listitem>encodingFilter.encoding</listitem> |
|---|
| 32 |
<listitem>encodingFilter.mimeTypeList</listitem> |
|---|
| 33 |
</itemizedlist> |
|---|
| 34 |
</section> |
|---|
| 35 |
<section id="gzipfilter"> |
|---|
| 36 |
<title>gzipfilter</title> |
|---|
| 37 |
<para>The gzipfilter will automatically gzip outgoing requests, if it is supported by the |
|---|
| 38 |
client.</para> |
|---|
| 39 |
<para>The gzipfilter does not have any configuration options.</para> |
|---|
| 40 |
</section> |
|---|
| 41 |
<section id="logdebuginfofilter"> |
|---|
| 42 |
<title>logdebuginfofilter</title> |
|---|
| 43 |
<para>The logdebuinfofilter adds debug information to each page. The filter is automatically |
|---|
| 44 |
turned on when "server.environment" is set to "development".</para> |
|---|
| 45 |
<para>The logdebuginfofilter has the following configuration options:</para> |
|---|
| 46 |
<itemizedlist> |
|---|
| 47 |
<itemizedlist>logDebugInfoFilter.mimeTypeList, ['text/html']</itemizedlist> |
|---|
| 48 |
<itemizedlist>logDebugInfoFilter.logAsComment, False</itemizedlist> |
|---|
| 49 |
<itemizedlist>logDebugInfoFilter.logBuildTime, True</itemizedlist> |
|---|
| 50 |
<itemizedlist>logDebugInfoFilter.logPageSize, True</itemizedlist> |
|---|
| 51 |
</itemizedlist> |
|---|
| 52 |
</section> |
|---|
| 53 |
<section id="staticfilter"> |
|---|
| 54 |
<title>staticfilter</title> |
|---|
| 55 |
<para>The static filter allows CherryPy to serve static files.</para> |
|---|
| 56 |
<para>The staticfilter has the following configuration options:</para> |
|---|
| 57 |
<itemizedlist> |
|---|
| 58 |
<listitem>staticFilter.file</listitem> |
|---|
| 59 |
<listitem>staticFilter.dir</listitem> |
|---|
| 60 |
<listitem> |
|---|
| 61 |
<para>staticFilter.root</para> |
|---|
| 62 |
</listitem> |
|---|
| 63 |
</itemizedlist> |
|---|
| 64 |
</section> |
|---|
| 65 |
<section id="nsgmlsfilter"> |
|---|
| 66 |
<title>nsgmlsfilter</title> |
|---|
| 67 |
</section> |
|---|
| 68 |
<section id="tidyfilter"> |
|---|
| 69 |
<title>tidyfilter</title> |
|---|
| 70 |
<para>The tidyfilter cleans up returned html by running the response through Tidy.</para> |
|---|
| 71 |
<para>Note that we use the standalone Tidy tool rather than the python mxTidy module. This is |
|---|
| 72 |
because this module doesn't seem to be stable and it crashes on some HTML pages (which means |
|---|
| 73 |
that the server would also crash.)</para> |
|---|
| 74 |
<para>The tidyfilter has the following configuration options:</para> |
|---|
| 75 |
<itemizedlist> |
|---|
| 76 |
<listitem>tidyFilter.tmpDir</listitem> |
|---|
| 77 |
<listitem>tidyFilter.strictXml, False</listitem> |
|---|
| 78 |
<listitem>tidyFilter.tidyPath</listitem> |
|---|
| 79 |
<listitem>encodingFilter.errorsToIgnore, []</listitem> |
|---|
| 80 |
</itemizedlist> |
|---|
| 81 |
</section> |
|---|
| 82 |
<section id="virtualhostfilter"> |
|---|
| 83 |
<title>virtualhostfilter</title> |
|---|
| 84 |
<para>The virtualhostfilter changes the ObjectPath based on the Host. Use this filter when |
|---|
| 85 |
running multiple sites within one CP server.</para> |
|---|
| 86 |
<para>The virtualhostfilter has the following configuration options:</para> |
|---|
| 87 |
<itemizedlist> |
|---|
| 88 |
<listitem>virtualHostFilter.prefix, '/'</listitem> |
|---|
| 89 |
</itemizedlist> |
|---|
| 90 |
</section> |
|---|
| 91 |
<section id="xmlrpcfilter"> |
|---|
| 92 |
<title>xmlrpcfilter</title> |
|---|
| 93 |
<para>The xmlrpcfilter converts XMLRPC to the CherryPy2 object system and vice-versa.</para> |
|---|
| 94 |
<para>PLEASE NOTE: beforeRequestBody: Unmarshalls the posted data to a methodname and |
|---|
| 95 |
parameters. - These are stored in cherrypy.request.rpcMethod and .rpcParams - The method is |
|---|
| 96 |
also stored in cherrypy.request.path, so CP2 will find the right method to call for you, |
|---|
| 97 |
based on the root's position. beforeFinalize: Marshalls cherrypy.response.body to xmlrpc. - |
|---|
| 98 |
Until resolved: cherrypy.response.body must be a python source string; this string is |
|---|
| 99 |
'eval'ed to return the results. This will be resolved in the future. - Content-Type and |
|---|
| 100 |
Content-Length are set according to the new (marshalled) data</para> |
|---|
| 101 |
<para>The xmlrpcfilter does not have any configuration options.</para> |
|---|
| 102 |
</section> |
|---|
| 103 |
<section id="sessionauthfilter"> |
|---|
| 104 |
<title>sessionauthenticatefilter</title> |
|---|
| 105 |
</section> |
|---|
| 106 |
<section id="sessionfilter"><title>sessionfilter</title> The Session Filter has its own |
|---|
| 107 |
section</section> |
|---|
| 108 |
</section> |
|---|