README
Google Search Appliance XHTML Stylesheet
The Google Search Appliance XHTML Stylesheet defines a user interface for your Google Search Appliance that conforms to modern web standards including XHTML 1.0 Strict, XHTML Mobile Profile (XHTML-MP) and CSS 2.1. It generates well-formed, valid markup and is accessible in a variety of browsers and presentation modes. (Learn more about web standards.)
Table of Contents
Features
- 12% size reduction from original XSLT
- 28-68% reduction from original markup (using optional style library)
- Generated XHTML is well formed, valid, and separate from presentation
- Screen, print, and handheld media support for the most common presentation modes
- Pages are readable and accessible even with style disabled
- Numeric accesskey navigation of search results (optional)
- Screen and handheld presentation consistent with existing Google design
- Print style only displays content necessary for printing
- Embedded search results style is minimized depending on presentation
- Handheld-exclusive mode minimizes markup and style even further (optional)
- Linked style library for improved bandwidth usage (optional)
In handheld-exclusive mode, pages are further condensed and optimized for viewing on handheld devices. The WAP 2.0 compliant interface preserves Google Search Appliance features relevant to enterprise search while obeying many of the paradigms set forth by Google Mobile Search.
System Requirements
- Google Search Appliance running software version 4.6.2.S.22 or later
- A browser (user agent) capable of parsing and viewing XHTML documents
- A WAP 2.0 compliant device is required for browsing XHTML Mobile Profile documents
The Google Search Appliance XHTML Stylesheet has been road-tested and tire-kicked in the following user agents:
What's Included
How To Install
The Google Search Appliance provides support for multiple front end user interfaces to the same search engine. We leverage that feature to add XHTML and XHTML-MP support:
- Add a new Front End using your Google Search Appliance's Admin Console. See the documentation on the Google Enterprise support site for details on how to do this. Alternatively use the context sensitive help link in the Serve -> Front Ends section of your Admin Console.
- Modify the new Front End by importing the supplied stylesheet transformation,
gsa-xhtml.en.xslt. See the documentation for details on how to do this. Alternatively select Edit for the new Front End and, on the Format tab, use the context sensitive help link for the XSLT Stylesheet Editor.
- Adjust XSLT variables to taste. Also configure linked style or configure handheld exclusive modes.
- Use the Admin Console's Test Center to sanity check that the stylesheet and Front End have been set up correctly. If you view frame source for the search page proper, you should see
XHTML in the DOCTYPE line (instead of HTML).
- Publish the search link to your new Front End for all of your users:
- Open a browser and navigate to your Google Search Appliance.
- Copy the (rewritten) link from your browser address bar and paste into a text editor.
- Replace the values of the "client" and "proxystylesheet" parameters with the name of your new Front End.
We recommend having a default page on a separate web server redirect to this link so that your users only need to remember (or bookmark) the simpler address (e.g., http://www.acme.com/search).
Linked vs. Embedded Style
By default, the Search Appliance embeds CSS appropriate for each request. To further improve performance, you may optionally link to the CSS instead. This allows style to be cached and save even more bandwidth. To configure:
- Copy the
style directory (included) to your web server of choice.
- Set the variable
style_include_prefix to a URL pointing to your new directory. Include the trailing slash.
- Change the variable
style_include from 0 to 1 to enable linking.
Handheld-Exclusive Mode
In this mode, the XHTML and CSS sizes are reduced even further, to the point of supporting only handheld media. Enable by editing the XSLT as follows:
- Set the variable
media to handheld.
- Comment out the
xsl:output element referencing the XHTML 1.0 Strict Document Type Definition.
- Uncomment the
xsl:output element referencing the XHTML Mobile 1.0 Document Type Definition.
(Steps two and three are required until XSLT 2.0 support is provided.)
A Note About OneBox and XHTML
Typical Google OneBox for Enterprise modules come packaged with their own XSLT to define the display of the OneBox section of the search results page. In most cases the resultant markup may not be well-formed and valid XHTML, nor styled for multiple presentation modes. To help remedy this try the following for each of your OneBox modules:
- Create a duplicate OneBox module with a different name but otherwise similar settings. This will be your XHTML/standards-friendly version of the original OneBox module.
- Replace the XSLT in the new module with that in the given
onebox-xhtml.en.xslt stylesheet transformation.
- Assign this new OneBox module to your mobile Front End.
- Customize the XSLT to recapture the look and feel intended by the OneBox author while remaining consistent with screen, print and handheld display design principals.
Caveats and Known Issues
- Google Desktop integration is not provided.
- To help ensure markup validity, OneBox module result sets should be enclosed by
<tr><td>.
- Cached and text version page validity is not guaranteed.
- Only the http scheme has been tested (not db or anything else).
- Developers using collections will want to copy the collection list from a newly-edited default stylesheet and integrate into the mobile stylesheet. Use the format illustrated in the
collection_menu template (and remove the example "default_collection" and "googleenterprise" entries once finished). To maintain well-formed, valid markup, do not alter the template's structure. (Leave the trailing comma at the end of each list in the collection_menu template.)
Handheld Media-specific Notes
- Onebox results display is not vertically restricted for handheld media. Please be kind.
- Duplicate directory filtering is not reflected by indenting (handheld media). This is intentional.
- KeyMatch link display does not use
http://. This is intentional as some mobile devices may otherwise treat them as additional links.
- Advanced Search is not enabled.
- Result dates are not displayed by default. (Some mobile devices may otherwise treat them as phone numbers!)
- Feel free to customize the XSLT but it is recommended that handheld-exclusive settings for stylesheet variables remain unchanged.
Credits and Thanks
The Google Search Appliance XHTML Stylesheet was developed for Google Enterprise by Joe D'Andrea using the following tools:
Thanks are due to the following people for their generosity, advisement, and support:
Last, but not least, thanks to:
- Anyone who ever wrote a book or article about standards-based web development or accessibility.
- You for downloading and trying this out!