A conceptual abstraction of searchable information in Google OneBox for Enterprise is called a "module." A module is defined by the following primary components:
- Module Name, Type, and DescriptionReference information for the module. The module type must be defined as either "internal" or "external." Internal modules gather information directly from the Google Search Appliance. External modules gather information from external sources, specified by a provider URL.
- TriggerKeywords or search expression that will invoke data collecting by the module. For example, the following code defines a trigger instigated by the keywords: directory, dir, contact, and/or phone:
- Provider URLURL of entity responsible for resolving a data query. For example, the following defines a provider named SampleNoAuthOneBoxProvider, available at localhost, port 8080:
SecurityAn optional specification of authentication parameters and rules. For example, the following defines basic user-name and password authentication rules:
Results TemplateAn optional XSLT template definition to be used to transform query results
Google and its partners offer many pre-built OneBox modules that offer easy access to many common enterprise data sources, but Google provides an API that lets you build your own OneBox modules. For example, the following code defines a simple external module definition named my_onebox_example
that's accessible at http://localhost/onebox/foobarsearch
, requires no authentication, is triggered by the keyword foobar
, and provides no XSLT results template:
This is a simple external OneBox module
The schema document onebox.xsd
defines complete details for module definitions.
The Google OneBox for Enterprise SDK
contains sample code, documentation, and the libraries you need to build OneBox modules for the Google Search Appliance. The SDK also contains a Python-based Google Search Appliance simulator for Enterprise OneBox.
For Java developers, Google offers the OneBox Servlet Starter Kit to enable integration with Google OneBox for Enterprise and Google Search Appliance using standard Java and Java EE technologies.
Installing Google OneBox for Enterprise
The OneBox Servlet Starter Kit
provides components and libraries that enable integration with Google OneBox for Enterprise using a Java servlet-based API. The kit offers a Web application archive (WAR) that can be deployed immediately to any Java EE application server and serve sample OneBox-compliant data to Google Search Appliance or appliance simulator. The kit includes source code, Javadoc, and scripts to simplify the learning curve for developing custom OneBox modules and information providers.
After downloading and installing the OneBox Servlet Starter Kit, you can follow these five steps to see results immediately in Google Search Appliance or in the appliance simulator:
- Deploy onebox.war to your Java EE application server
- Modify the element of the onebox.xml module definition file to point to the onebox.war context within your application server
- Install the onebox.xml module definition file into Google Search Appliance or appliance simulator
- Start your Java EE application server
- Run some sample queries that will instigate triggers defined in the OneBox module definition to see sample results
I'll discuss these steps discussed in detail in the following sections. First, however, the Google Search Appliance simulator supplied as part of the Google OneBox for Enterprise SDK warrants a discussion.