.. _dojox/data/GoogleSearchStore:
dojox.data.GoogleSearchStore
============================
:Status: Contributed, Draft
:Version: 1.4
:Author: Shane O'Sullivan
:Available: since V1.2
.. contents::
:depth: 3
The GoogleSearchStore is actually a collection of stores designed to work with Google's Ajax search services. GoogleSearchStore is the base class that all subclasses of GoogleSearchStore extend from. It provides all the basics of working with Google's search API in a dojo.data compliant implementation. The following stores are avaialble for use after dojo.require() is used to load dojox.data.GoogleSearchStore:
* **dojox.data.GoogleSearchStore** - The basic search store that all more fine-grained searches inherit from. This store defaults to querying Google's Web-search Ajax calls.
* **dojox.data.GoogleWebSearchStore** - A store configured to search specifically against Google's Web search Ajax calls.
* **dojox.data.GoogleBlogSearchStore** - A store configured to search specifically against Google's Blog (Web log) search Ajax calls.
* **dojox.data.GoogleLocalSearchStore** - A store configured to search specifically against Google's Location related search Ajax calls.
* **dojox.data.GoogleVideoSearchStore** - A store configured to search specifically against Google's Video search Ajax calls.
* **dojox.data.GoogleBookSearchStore** - A store configured to search specifically against Google's Book search Ajax calls.
* **dojox.data.GoogleImageSearchStore** - A store configured to search specifically against Google's Image search Ajax calls.
**Note:** These stores make use of Google's `AJAX search services. `_. In order to use them in your web-sites, please make sure to read `Google's terms and conditions `_ and agree to them before using these stores.
===========
API Support
===========
* :ref:`dojo.data.api.Read `
==================
Constructor Params
==================
The following parameters are supported by all Google store implementations.
+---------------+------------------------------------------------------------------------------------------+----------------------+
| **name** | **description** | **type** |
+---------------+------------------------------------------------------------------------------------------+----------------------+
|label |The attribute of the search returns to use as the item's label. Defaults to |string |
| |titleNoFormatting. | |
+---------------+------------------------------------------------------------------------------------------+----------------------+
|key |Your Google API key (optional) | string |
+---------------+------------------------------------------------------------------------------------------+----------------------+
|lang |The language locale to use. Defaults to the browser locale. | string |
+---------------+------------------------------------------------------------------------------------------+----------------------+
|urlPreventCache|Flag denoting whether or not browser caching should be avoided. Defaults to true. | boolean |
| |**New to Dojo 1.4** | |
+---------------+------------------------------------------------------------------------------------------+----------------------+
===============
Item Attributes
===============
Depending on which of the search stores you instantiate, the supported list of item attributes changes. This is because each search service exposes different information, since each type of search by its nature deems specific information the key information to return. Below you will find a list of expected attribute names for each search service and what they are:
dojox.data.GoogleSearchStore
----------------------------
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
|**Attribute** |**Description** |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
|url |The URL for the item returned by the search |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
|unescapedUrl |The URL for the item, without URL escaping. This is often more readable. |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
|visibleUrl |The URL with no protocol specified. |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
|cacheUrl |The URL to the copy of the document cached by Google |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
|title |The page title in HTML mat. |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
|titleNoFormatting |The page title in plain text |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
|content |A snippet of information about the e. |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
|estimatedResultCount|The estimated number of results from the query *(New in 1.4!)* |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
dojox.data.GoogleWebSearchStore
-------------------------------
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|**Attribute** |**Description** |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|title |The page title in HTML format. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|titleNoFormatting|The page title in plain text |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|content |A snippet of information about the page. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|blogUrl |The URL for the blog |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|postUrl |The URL for the single blog post |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|visibleUrl |The URL with no protocol specified. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|cacheUrl |The URL to the copy of the document cached by Google |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|author |The author of the blog post |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|publishedDate |The published date, in RFC-822 format |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
dojox.data.GoogleBlogSearchStore
--------------------------------
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|**Attribute** |**Description** |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|url |The URL for the item returned by the search |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|unescapedUrl |The URL for the item, without URL escaping. This is often more readable. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|visibleUrl |The URL with no protocol specified. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|cacheUrl |The URL to the copy of the document cached by Google |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|title |The page title in HTML format. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|titleNoFormatting|The page title in plain text |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|content |A snippet of information about the page. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
dojox.data.GoogleLocalSearchStore
---------------------------------
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|**Attribute** |**Description** |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|title |The page title in HTML format. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|titleNoFormatting|The page title in plain text |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|content |A snippet of information about the page. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|url |The URL for the item returned by the search |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|lat |The latitude of the item in question. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|lng |The longitude of the item in question. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|streetAddress |The street address of the item |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|city |The city of the item |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|region |The region of the item |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|country |The country of the item |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|phoneNumbers |The phone numbers associated with this address. Can be one or more. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|ddUrl |A URL that can be used to provide driving directions from the center of the search results to this search results |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|ddUrlToHere |A URL that can be used to provide driving directions from this search result to a user specified location. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|staticMapUrl |Link to the map for the item. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|viewport |Recommended viewport for the query results (same for all results in a query). This is a JavaScript Object. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
dojox.data.GoogleVideoSearchStore
---------------------------------
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|**Attribute** |**Description** |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|title |The page title in HTML format. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|titleNoFormatting|The page title in plain text |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|content |A snippet of information about the page. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|url |The URL for the item returned by the search |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|published |The published date, in RFC-822 format. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|publisher |The name of the publisher. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|duration |The approximate duration, in seconds, of the video. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|tbWidth |The width in pixels of the video. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|tbHeight |The height in pixels of the video |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|tbUrl |The URL to a thumbnail representation of the video. |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|playUrl |If present, supplies the url of the flash version of the video that can be played inline on your page. To play this video |
| |simply create and