beautypg.com

Checking the visual layout, Creating a wrapper, Adding a secure connection to the provider – Google Search Appliance OneBox for Enterprise Developers Guide User Manual

Page 16

background image

Google Search Appliance: Google OneBox for Enterprise Developer’s Guide

16

Checking the Visual Layout

You can verify an XSLT template by:

Using the OneBox Simulator (see “Testing with the OneBox Simulator” on page 19).

Inserting a temporary wrapper element in the XSLT file. The wrapper enables you to see how the
OneBox results appears, but doesn’t provide an interface for testing different parameters as does
the OneBox Simulator.

Note: If you use the wrapper code to verify your layout, you must remove the wrapper code before
deploying your template on a search appliance. The match statement in the wrapper is not permitted in
a search appliance template.

Creating a Wrapper

To create a wrapper:

1.

Install an XSLT processing application such as Saxon and Java as described in “Planning” on page 7.
The compilation step in this procedure uses Saxon.

2.

Add the following statements at the start of your XSLT template after the shown in “Formatting the Results” on page 14:




The code is as follows:

The first three statements identify the XSLT code and the output method.

The xsl:template match statement picks up the tag in the example XML
file shown in “Receiving a Provider’s Response” on page 12.

The and statements provide starting and closing and tags to wrap the code that
the XSLT template generates in the call-template statement.

The xsl:call-template statement calls the XSLT template module.

The statement closes the wrapper code block.

3.

Use the lines similar to the following to compile and view the OneBox module (these are from a
Windows command prompt):

java -jar c:\saxon\saxon8.jar -t directory.xml dirtest.xsl > test.html
call start firefox test.html

Adding a Secure Connection to the Provider

After defining a OneBox module, you can add advanced features to ensure security of data and provide
additional user functionality.