View System Documentation - Servlet Filters
Enabling, Disabling, web.xml, and Init Parameters
The web.xml file controls which filter is applied to which incoming request and in what order. The base org.ibisph.filter _URIPatternFilter abstract class is extended by most of the filters. This class provides the ability to specify additional filter URL pattern mappings so that the filters are not limited to the basic Java servlet/ filter pattern mappings. These additional patterns are defined in the web.xml file as <filter>/<init-param>s. These "init-param"s also contain other properties that are needed to control the filter's behavior. See the web.xml file and the description element for more detailed information about what parameters are available and what their valid values are. To enable/disable a filter, simply delete or comment out the web.xml file's "filter" element(s) (and the child elements) as well as the associated "filter-mapping" element(s). The <filter>/<filter-name> and <filter-mapping>/<filter-name> are used as the filter ID/key.System's Filter Table
Filter Class (org.ibisph.filter.) | Chain Order | URL Pattern Match/Mapping(s) | Description |
---|---|---|---|
Set Character Encoding (SetCharacterEncoding.Filter) | 0 | * | Filter that simply sets the character encoding for a downstream/chained request. This allows for form character data to be processed as it was served to the browser (consistently) when accessed via a request.getParameter() type call. This typically isn't a problem for those server enviros that have one or two apps and can set the character encoding to the match the app. It can be an issue if the app server is set for some other character set and this app is different. Since ISO-8859-1 is a subset of UTF-8 it shouldn't be an issue but this filter can be used to set explicitly just in case. |
Announcement (announcement.Filter) | 1 | *.html | Provides ability to redirect a user to a URL/page when initially entering the site. Cookie controls if shown. |
SVG Graphic Type Request Parameter (graphic.GraphicTypeFilter) | 2 |
/indicator/view/* /indicator/complete_profile/* /phom/view/* /phom/expanded_view/* /query/result.html | Adds/sets the GraphicType request parameter for those HTML page requests that need to display a chart or map. |
Artifact (artifact.Filter) | 3 |
/home/* /indicator/* /query/home/* /query/module_selection/* /map/* | Controls creation and distribution of cached/artifacted disk files. Extra init-param property adds this compressed file ext list: ".html", ".svg", ".xml" |
GZIP Compression (gzip.Filter) | 4 |
*.html *.svg *.xml | If browser supports GZIP the system compresses the response to save network bandwidth (and disk space if artifacting). |
SVG to JEPG (graphic.SVGToJPEGFilter) | 5 | *.jpeg and URI contains "/graphic/" | Allows for the SVG to be captured and converted to JPEG. |
Admin Publish Request (security.FromAdminSystem AuthenticationProcessingFilter) | 6 | /publish/* | Enforces that the request is coming from the IBIS-PH Admin System server. |
Filter/Request Cross Reference Table
Request Type | Mime Type | Artifact | Compress | SVG to JPEG |
---|---|---|---|---|
Home | ||||
"HTML_CONTENT" | html | x | x | - |
Indicator Profile (and PHOM) | ||||
"HTML_CONTENT" | html | x | x | - |
Index | html | x | x | - |
View Related | html | x | x | - |
Chart Request | svg | x | x | - |
Chart Request | jpeg | x | - | x |
Query | ||||
"HTML_CONTENT" | html | x | x | - |
Module Selection | html | x | x | - |
Builder | html | - | x | - |
Result | html | - | x | - |
Graphic Request | svg | - | x | - |
Graphic Request | jpeg | - | - | x |
Configuration | xml | - | x | - |
Announcement Page Redirection - org.ibisph.filter.announcement
Provides ability to catch an initial request and redirect the user to an announcement type page. This functionality is not recommended because it breaks the site's ability to be crawled/indexed by search engines. This filter utilizes a cookie to keep track of if the page has been shown or not. Filter init parameters provide the associated redirection URL, cookie name and cookie value properties.Graphic Type - org.ibisph.filter.graphic.GraphicTypeFilter
This filter sets the graphic type request parameter (named "GraphicType") for HTML pages that contain a map or chart graphic image. This parameter is needed so that the XSLT will know to build SVG code using the HTML "object" and "embed" elements instead of the HTML "img" element (used for JPEG, BMP, GIF, PNG etc.).The IBIS-PH View System delivers two types of chart/map graphics. Standard bitmap images that all browsers can display without any special plugins needed or a higher quality, interactive vector based SVG images which requires a plugin. The graphic type is specified in two ways: 1) user specified preference which uses Javascript to store a cookie on the user's local machine named "GraphicType" with a value of "SVG" or "JPEG". 2) on the URL which overrides the user preference graphic type - e.g. explicitly set by the user when making the request. If nothing is specified the system defaults to JPEG since support for this type of graphic is built into all browsers. The filter only wraps the request if the "GraphicType" cookie or a request parameter named "GraphicType" is set to "SVG". As stated above, the request parameter is passed to the XSLT/XML transformation so that the XSLT can build the appropriate HTML elements for the desired chart/map image/graphic type. The wrapped request path adjustment is needed for the optional downstream artifacting filter. Without this semi kludge, the artifacting filter would save both a JPEG type pages and an SVG type pages using the same URI path resource name. This causes all subsequent requests for that artifacted resource to return the page as it was first built. So if the first request for that page had was built to use a bitmap "img" element then even if the user had their graphic type preference set to SVG, they would get the JPEG page and vice versa.
Listed below are the pages that display charts and/or maps:
- Indicator Profile View pages
- Complete Indicator Profile pages
- PHOM Indicator Profile View pages
- PHOM Complete Indicator Profile pages
- Query Result pages