<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='./rfc2629.xslt' ?>
<?rfc toc="yes"?>
<!DOCTYPE rfc PUBLIC "-//IETF//DTD RFC 2629//EN"
"http://xml.resource.org/authoring/rfc2629.dtd">
<rfc ipr="full3978"
     docName="opensocial-gadgets-api-specification-v0_9">
 <front>
  <title abbrev="OpenSocial Gadgets">OpenSocial Gadgets API Specification
  v0.9</title>
  <author surname="OpenSocial and Gadgets Specification Group"
          fullname='OpenSocial and Gadgets Specification Group &lt;opensocial-and-gadgets-spec@googlegroups.com&gt;'>
   <address>
    <email>opensocial-and-gadgets-spec@googlegroups.com</email>
   </address>
  </author>
  <date month="April"
        year="2009" />
  <area>General</area>
  <keyword>OpenSocial</keyword>
  <keyword>social networking</keyword>
  <keyword>REST</keyword>
  <keyword>XML</keyword>
  <keyword>Extensible Markup Language</keyword>
  <keyword>JSON</keyword>
  <keyword>JavaScript Object Notation</keyword>
  <keyword>Atom</keyword>
 </front>
 <middle>
  <section title="Notation and Conventions">
   <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in 
   <xref target="RFC2119">RFC2119</xref>. Domain name examples use 
   <xref target="RFC2606">RFC2606</xref>.</t>
  </section>
  <section title="Overview">
   <t>Gadgets are web-based software components based on HTML, CSS, and
   JavaScript. They allow developers to easily write useful web applications
   that work anywhere on the web without modification. They are defined using a
   declarative XML syntax that is processed by a gadget server into a format
   that allows them to be embedded into various contexts: standalone web pages,
   web applications, even other gadgets. A context into which a gadget is
   embedded is called a gadget container. The container is responsible for
   managing the gadgets' layout and controls, as well as for supporting various
   functionality on behalf of the gadget. A gadget may be a simple widget, a
   reusable component, or a full-blown application, possibly utilizing or
   communicating with other gadgets.</t>
   <t>A gadget and its XML are synonymous. The gadget XML contains all
   information needed to identify and render a web application.</t>
   <t>Metadata. Several pieces of metadata are specified by the gadget
   developer in the gadget XML, such as author information, gadget title, and
   description. This data gives hints to the gadget container on how to
   identify it, in addition to providing data to gadget directories, which are
   databases that help users find gadgets useful for their needs</t>
   <t>Gadget Features. A list of all gadget features that are either required
   for the gadget to operate, or may optionally be utilized if available.
   Gadget features are the primary extensibility mechanism employed by gadgets.
   They often direct a gadget server to make new JavaScript APIs available to
   rendering code, but may also manipulate the gadget's contents, for example
   to add extended syntax. Examples of gadget features include OpenSocial
   (provides gadgets with a rich set of social APIs), dynamic-height (enables
   gadgets to resize themselves to an appropriate height), and tabs (a UI
   library facilitating tabular navigation).</t>
   <t>User Preferences. These are key/value pairs that form the basis of gadget
   configuration and persistence. They are most often manipulable by users of
   the gadget, and are persisted on behalf of a user so that the gadget has
   access to them across multiple rendering requests. The gadget container is
   typically responsible for providing their persistence for this data and an
   interface to edit it.</t>
   <t>Message Bundles. Message bundles allow developers to internationalize
   their gadgets simply by adding name/message mappings corresponding to
   whatever languages the developer chooses to support. These messages may be
   accessed programmatically through the core JavaScript APIs provided to all
   gadgets, or may be statically substituted into code using simple syntax.</t>
   <t>Content. Provides the actual HTML, CSS, and JavaScript to be rendered by
   the gadget. Two delivery mechanisms are supported: 
   <list style="hanging">
    <t hangText="Type HTML">Type HTML gadgets are the most prevalent, and are 
    imbued with the most rich feature set. Code is provided directly in the 
    gadget XML content section for rendering and control flow. This code simply 
    assumes that functionality is available that has been requested from 
    whatever gadget features were declared. In the case of optional-declared 
    features, a simple feature-existence API can and should be consulted to 
    ensure the capability is enabled. The code is processed by a gadget server 
    and rendered in an IFRAME.</t>
    <t hangText="Type URL">Type URL gadgets only specify a base URL. A standard 
    set of parameters are added to this URL by the gadget server, which renders 
    the gadget in an IFRAME. The application to which the URL points must 
    include a referenced JavaScript library using a &lt;script&gt; tag as it 
    renders, to enable gadget APIs to be made available. Type URL gadgets can't 
    take advantage of all features, notably features that manipulate HTML and 
    JavaScript code directly. However, this gadget type has proven highly useful
    for turning existing web sites or applications into gadgets.</t>
   </list>Multiple Content sections may be specified in gadget XML. Each is
   labeled with one or more optional view identifiers, which allow the gadget
   to behave or appear differently depending on the context in which it's
   rendered. This context is provided by the gadget container.</t>
   <t>This document describes the gadget XML syntax and how it is processed by
   a compliant gadget server. In addition, it describes the core JavaScript
   APIs that must be made available to every gadget as it is rendered. While
   compliance can be attained by supporting only these core APIs, doing so
   severely limits a gadget server's usefulness. Gadget servers should support
   as many features as possible. Widely used, highly recommended features are
   listed at the end of this document.</t>
  </section>
  <section title="Compliance: Gadget Server">
   <t>To be gadgets-compliant, a server must be able to satisfy a
   Gadget Rendering Request and JavaScript Request. Containers may
   provide support for Content Rewriting. There are typically a number
   of other interfaces that a server provides, such as metadata
   requests, but these are a private contract between the Gadget
   Server and the Container.</t>
   <section title="Gadget Rendering Request">
    <t>The core gadget API, this translates gadget XML into content that can be
    rendered in a browser, typically in an IFRAME.</t>
    <section title="Inputs">
     <t>
      <list style="symbols">
       <t>Gadget XML, typically specified as a URL pointing to a file on the
       web.</t>
       <t>User prefs.</t>
       <t>Locale of the end user.</t>
       <t>(optional) IgnoreCache processing option.</t>
       <t>(optional) Module ID, an integer identifier for the gadget in a given
       container context. If not provided, this defaults to 0.</t>
      </list>
     </t>
    </section>
    <section title="Outputs">
     <t>
      <list style="symbols">
       <t>HTML, CSS, and JavaScript.</t>
      </list>
     </t>
    </section>
    <section title="Process"
             anchor="process">
     <t>
      <list style="numbers">
       <t>Fetch the gadget XML. 
       <list style="numbers">
        <t>This SHOULD consult a cache to minimize load on the gadget XML
        hosting server. The specific properties of caching are left to the
        implementation.</t>
        <t>The server may honor HTTP caching headers to provide developers with
        a way to balance the load their servers receive against the frequency
        with which they can reliably deploy updated content.</t>
        <t>The server SHOULD honor an IgnoreCache processing option. This
        causes all built-in spec caches to be ignored, fetching the spec
        directly from its canonical resource. This feature is very useful while
        developing a gadget. 
        <list style="numbers">
         <t>HTTP-based request servers SHOULD support this via a URL parameter
         named nocache.</t>
         <t>The server MAY implement denial-of-service protection limiting the
         number fetches for a spec in a given period of time, as a courtesy to
         developers.</t>
        </list></t>
       </list></t>
       <t>Parse the gadget XML. 
       <list style="numbers">
        <t>The XML MUST conform to the 
        <xref target="gadgetsExtendedXSD">extended gadget spec XSD</xref>. This
        XSD represents all valid elements and attributes accepted by the legacy
        iGoogle gadget server (gmodules.com). However, some of these fields
        will be phased out. The 
        <xref target="canonicalGadgetXSD">canonical gadget spec XSD</xref> the
        subset of attributes that must be parsed and interpreted by the server.
        In other words, the parser MUST NOT reject gadget specs conforming to
        the extended spec, yet need not interpret more than the canonical
        spec.</t>
        <t>On a &lt;Content&gt; block, the view names are represented as comma
        delimited strings which allows a particular &lt;Content&gt; block to be
        used on one or more surfaces. Surfaces with common view names have the
        inner XML of their &lt;Content&gt; blocks concatenated. Concatenation
        only occurs with exact matches of a view name on a &lt;Content&gt;
        block. Example: &lt;Content view="Profile, Home,Home.About"/&gt;
        contains Content for three named views: Profile, Home, and Home.About.
        Concatenation does not happen when the @href is set on a
        &lt;Content&gt; block. In this case, the set of view names on
        &lt;Content&gt; blocks with @href set to a non-null, non-empty string
        MUST be unique within the Gadget XML. If this is not true, the markup
        is invalid. A container may process gadget markup ahead of acceptance
        into a container's application gallery, checking for the href
        conditions when importing gadget XML. This validity check need not be
        performed at render time.</t>
       </list></t>
       <t>Identify the Locale object corresponding to the request, and fetch
       messages specified by it. 
       <list style="numbers">
        <t>The &lt;Locale&gt; element is selected from the gadget XML by
        matching to the declared language and/or country. If an element matches
        both, use it. Otherwise select a language-only match over a
        country-only match. If no such match exists and an element is defined
        without language or country attributes defined, use it. The following
        assumptions are made when implementing the gadgets specification: 
        <list style="numbers">
         <t>The container MAY choose to utilize the rendered gadget's page
         fragment for its own purposes. Gadget developers SHOULD NOT modify
         this value.</t>
         <t>The behavior of relative URLs in the gadget spec is undefined.
         Gadget developers SHOULD output fully qualified URLs, or inject a
         &lt;base&gt; element as described in 3.1.3.</t>
         <t>Containers MUST support the &lt;base&gt; element as described in
         the HTML 4.01 specification. Containers SHOULD move &lt;base&gt;
         elements encountered in a gadget's &lt;Content&gt; section into the
         rendered gadget's &lt;head&gt; element, as required by the HTML 4.01
         specification.</t>
        </list></t>
        <t>Load the message bundle specified in the matched &lt;Locale&gt;
        element, if any. 
        <list style="numbers">
         <t>If the message attribute is specified, use it: load the bundle from
         the network using the provided URL.</t>
         <t>Otherwise use the &lt;messagebundle&gt; element that is a child of
         &lt;Locale&gt;, if present.</t>
        </list></t>
       </list></t>
       <t>Substitute "hangman variables" into supported gadget spec fields.
       Hangman variables are of the form __&lt;TYPE&gt;_&lt;ID&gt;__, and are
       replaced with string values. There are four types of hangman variables,
       which are defined as follows. 
       <list style="numbers">
        <t>Process message bundle into __MSG_foo__ hangman variables. 
        <list style="numbers">
         <t>The bundle MUST conform to the 
         <xref target="messageBundleSchema">message bundle XSD</xref>.</t>
         <t>For each message named foo with value bar, hangman expansion
         __MSG_foo__ = bar.</t>
        </list></t>
        <t>For each provided User Pref with key foo and value bar, hangman
        expansion __UP_foo__ = bar.</t>
        <t>Hangman expansion __MODULE_ID__ = &lt;provided module ID&gt;. 
        <list style="numbers">
         <t>HTTP-based request servers SHOULD use the URL parameter named mid
         for this.</t>
        </list></t>
        <t>If a message bundle was found with language_direction = "rtl" ,
        hangman expansions __BIDI_START_EDGE__ = "right", __BIDI_END_EDGE__ =
        "left", __BIDI_DIR__ = "rtl", __BIDI_REVERSE_DIR__ = "ltr". Otherwise
        __BIDI_START_EDGE__ = "left", __BIDI_END_EDGE__ = "right", __BIDI_DIR__
        = "ltr", __BIDI_REVERSE_DIR__ = "rtl".</t>
        <t>Perform substitutions of each hangman expansion on all fields which
        get displayed to users. This currently includes, but is not limited to,
        the following fields: 
        <list style="numbers">
         <t>Module.ModulePrefs attributes, Module.Content@href, Module.Content,
         UserPref@display_name, UserPref@default_value, and
         UserPref.EnumValue@display_value.</t>
        </list></t>
       </list></t>
       <t>Process gadget features, specified as &lt;Require&gt; or
       &lt;Optional&gt; in the gadget XML. 
       <list style="numbers">
        <t>If one or more unsupported features are specified in a
        &lt;Require&gt; block, the server MUST emit a standard error message
        indicating that it cannot satisfy the rendering request. 
        <list style="numbers">
         <t>The message SHOULD list all requested features that could not be
         used because the container does not support them.</t>
         <t>The message MAY provide contact information for the gadget server
         administrator, along with a mechanism to request adding support for
         the feature.</t>
        </list></t>
        <t>The server MUST support the following core JavaScript API, which
        applies to &lt;Optional&gt; features: 
        <figure>
         <artwork xml:space="preserve">
gadgets.util.hasFeature(featureName)
</artwork>
        </figure>As indicated in the JsDoc, this method returns true if the
        server is able to satisfy featureName, false otherwise. Gadget
        developers can use this functionality to enhance their gadgets if
        features are available without disabling their gadget if the features
        are missing.</t>
        <t>The server MUST conform to the requirements specified by each
        requested feature in order to claim support for it. The particulars of
        this vary per feature, but include injecting JavaScript APIs into
        rendered output or the type URL-included libraries and manipulating
        type HTML content to support extended syntax.</t>
       </list></t>
       <t>Output gadget content. 
       <list style="numbers">
        <t>Determine if the /Content/@href attribute is present. If so, the
        content for the active view is proxied and follows the rules in the
        section labeled Proxied Content</t>
        <t>For type HTML gadgets, the order is as follows: 
        <list style="numbers">
         <t>Standard HTML header, opening &lt;html&gt; tag and &lt;body&gt;
         tag. &lt;head&gt; information is optional. Gadgets run in browser
         quirks mode.</t>
         <t>Core gadgets JavaScript libraries, as specified here.</t>
         <t>Feature library initialization code, if needed.</t>
         <t>Processed gadget content, the result of steps #4 and possibly
         #5.</t>
         <t>A single call to gadgets.util.runOnLoadHandlers();</t>
         <t>Standard HTML closing tags.</t>
        </list></t>
        <t>For type URL gadgets, the provided URL MUST have the following
        parameters added to it: 
        <list style="numbers">
         <t>up_&lt;name&gt;=&lt;value&gt; for each provided user
         preference.</t>
         <t>lang=&lt;language&gt; and country=&lt;country&gt;, from the
         provided request Locale.</t>
         <t>libs=&lt;jsLib&gt;, where &lt;jsLib&gt; is a comma-separated list
         of URL path fragments relative to the server's JavaScript request
         handler path. These fragments are added to the JS path by the type URL
         target to load gadget API JavaScript into its execution context. 
         <list style="numbers">
          <t>The server SHOULD consolidate all libs into a single request to
          minimize the number of HTTP requests made by the client browser.</t>
         </list></t>
        </list></t>
       </list></t>
      </list>
     </t>
    </section>
   </section>
   <section title="JavaScript Request">
    <t>In order to satisfy type URL gadgets' JavaScript library loading
    requests, a server MUST provide an HTTP service for retrieving core and
    feature-linked JavaScript.</t>
    <section title="Input">
     <t>
      <list style="symbols">
       <t>Fixed path, computed by a static base URL combined with a path
       fragment as described in 
       <xref target="process">6.b.c</xref>.</t>
      </list>
     </t>
    </section>
    <section title="Output">
     <t>
      <list style="symbols">
       <t>JavaScript code corresponding to the API(s) required by the type URL
       gadget.</t>
      </list>
     </t>
    </section>
   </section>
   <section title="Content Rewriting">
    <t>Containers MAY support content rewriting. The feature supports rewriting
    the content of a generated gadget and allow developers to control how the
    behavior of the rewriter through an optional gadget feature named
    content-rewrite. The content-rewrite feature defines a set of rewriting
    operations that a container can perform on rendered and proxied content and
    defines rules to allow developers to control which content the rewriter can
    operate on.</t>
    <section title="Definition">
     <t>
     <figure>
      <preamble>The rewriter feature has the general form :</preamble>
      <artwork xml:space="preserve">
&lt;Optional feature="content-rewrite"&gt;
    &lt;Param name="expires"&gt;86400&lt;/Param&gt;
    &lt;Param name="include-url"&gt;&lt;/Param&gt;
    &lt;Param name="exclude-url"&gt;excluded&lt;/Param&gt;
    &lt;Param name="exclude-url"&gt;moreexcluded&lt;/Param&gt;
    &lt;Param name="minify-css"&gt;true&lt;/Param&gt;
    &lt;Param name="minify-js"&gt;true&lt;/Param&gt;
    &lt;Param name="minify-html"&gt;true&lt;/Param&gt;
&lt;/Optional&gt;
</artwork>
     </figure>The parameters are defined as follows: 
     <list type="symbols">
      <t>expires - The duration in seconds to force as minimum HTTP cache time
      for content fetched through the proxy via a rewritten URL. Default
      86400.</t>
      <t>include-url - Any URL which contains this parameters value as a
      case-insensitive substring is considered rewriteable. The literal string
      "*" is a special case and implies all URLs. If not specified an entry
      with the value "*" is assumed. This parameter can be repeated.</t>
      <t>exclude-url - Any URL which contains this parameters value as a
      case-insensitive substring is excluded from rewriting. The literal string
      "*" implies all URLs and effectively disables all rewriting. This
      parameter can be repeated.</t>
      <t>minify-css - Controls whether the container will attempt to minify css
      in style tags and referenced css files. Valid values are "true"|"false".
      Default is "true".</t>
      <t>minify-js - Controls whether the container will attempt to minify JS
      in script tags and referenced JS files. Valid values are true|false.
      Valid values are "true"|"false". Default is "true".</t>
      <t>minify-html - Controls whether the container will attempt to minify
      HTML content. Valid values are true|false. Valid values are
      "true"|"false". Default is "true".</t>
     </list>Matches for "exclude-url" take precedence over matches for
     "include-url"</t>
     <t>Note that the special use of "*" to denote all URLs should not be
     interpreted as support for GLOB or RegEx matching on strings.</t>
     <t>Containers are free to perform additional optimizations when rewriting
     links including but not limited to: 
     <list type="symbols">
      <t>Extract @import directives from style tags and convert them into link
      tags in the head tag of the containing HTML content.</t>
      <t>Merge multiple CSS fetches from successive link tags into one link tag
      that causes the proxy to concatenate the content fetched from the
      individual URLs.</t>
      <t>Merge contiguous &lt;script src=xxx&gt; tags into one concatenating
      proxy fetch.</t>
     </list></t>
    </section>
    <section title="Examples">
     <t>
      <figure>
       <preamble>Rewrite only gif images</preamble>
       <artwork xml:space="preserve">
&lt;Optional feature="content-rewrite"&gt;
    &lt;Param name="include-url"&gt;.gif&lt;/Param&gt;
&lt;/Optional&gt;
</artwork>
      </figure>
      <figure>
       <preamble>Rewrite only gif images that do not contain "animated" or
       "cdn"</preamble>
       <artwork xml:space="preserve">
&lt;Optional feature="content-rewrite"&gt;
    &lt;Param name="include-url"&gt;.gif&lt;/Param&gt;
    &lt;Param name="exclude-url"&gt;animated&lt;/Param&gt;
    &lt;Param name="exclude-url"&gt;cdn&lt;/Param&gt;
&lt;/Optional&gt;
</artwork>
      </figure>
      <figure>
       <preamble>Disable all rewriting</preamble>
       <artwork xml:space="preserve">
&lt;Optional feature="content-rewrite"&gt;
    &lt;Param name="exclude-url"&gt;*&lt;/Param&gt;
&lt;/Optional&gt;
</artwork>
      </figure>
     </t>
    </section>
   </section>
  </section>
  <section title="Proxied Content"
           anchor="ProxiedContent">
   <t>When rendering an OpenSocial Gadget, the container MUST determine if the
   content for the active view is to be proxied. This is done by checking for
   the presence of a /Content/@href attribute.</t>
   <t>If the attribute is present, the container MUST issue an HTTP request to
   the URI specified by the href attribute following the rules defined in 
   <xref target="gadgets.io.makeRequest">gadgets.io.makeRequest</xref>.</t>
   <t>Attributes on the Content element map to makeRequest as follows: 
   <list style="symbols">
    <t>authz: gadgets.io.AuthorizationType (values are canonicalized by
    converting to lower case. Default value is 'none')</t>
    <t>oauth_service_name: gadgets.io.RequestParameters.OAUTH_SERVICE_NAME</t>
    <t>oauth_token_name: gadgets.io.RequestParameters.OAUTH_TOKEN_NAME</t>
    <t>oauth_request_token:
    gadgets.io.RequestParameters.OAUTH_REQUEST_TOKEN</t>
    <t>oauth_request_token_secret:
    gadgets.io.RequestParameters.OAUTH_REQUEST_TOKEN_SECRET</t>
    <t>sign_owner: gadgets.io.RequestParameters.SIGN_OWNER (default 'true')</t>
    <t>sign_viewer: gadgets.io.RequestParameters.SIGN_VIEWER (default
    'true')</t>
    <t>refresh_interval: gadgets.io.RequestParameters.REFRESH_INTERVAL</t>
   </list></t>
   <t>Note that these attributes also apply to Preload elements.</t>
   <t>The container MUST also add the following parameters to the URI query
   string: 
   <list style="symbols">
    <t>lang: The language of the user viewing the page as specified in Section
    3 i under Process in this document.</t>
    <t>country: The country of the user viewing the page as specified in
    Section 3 i under Process in this document.</t>
    <t>opensocial_proxied_content: MUST be present and set to 1. Servers can
    use this to distinguish proxied content renders from
    gadgets.io.makeRequest() calls. Remote sites that expect proxied content
    requests SHOULD reject requests that do not have opensocial_proxied_content
    set to 1. If a remote site fails to implement this check, any content in
    the POST body may be spoofed by a malicious user or application.</t>
   </list></t>
   <t>By default, the request is sent to the remote site MUST be sent to the
   remote site as an HTTP GET. When the Content section includes Data
   Pipelining elements, the container MUST send the data to the request URI
   using an HTTP POST. The structure of this data will match the 
   <xref target="JSON-RPC" /> format.</t>
   <section title="Processing Results">
    <t>If the response to the proxied request returns a successful HTTP status
    code, the container MUST interpret the resulting response body according to
    the rules for content declared inline.</t>
    <t>If the response to the proxied request returns an unsuccessful HTTP
    status code, the container SHOULD present a meaningful error message to the
    end user. Containers SHOULD obtain a suitable error message for display by
    displaying the content specified for a view named as view-name.error, where
    view-name matches the name of the view that the proxied request was being
    processed for. If an exact match can not be found, the special value
    default.error should be used. If default.error is not present, the
    container SHOULD display a generic message indicating that a problem
    occurred.</t>
   </section>
   <section title="Caching">
    <t>Containers SHOULD cache the results of the HTTP request following the
    recommendations of section 13 of 
    <xref target="RFC2616">RFC 2616</xref>. If a container does support caching
    of data, it MUST also support overriding HTTP caching by using the value
    specified for refresh_interval.</t>
    <t>Caches SHOULD be keyed using the following: 
    <list style="symbols">
     <t>The URI of the proxied request.</t>
     <t>The opensocial owner id, if sign_owner is set to true and requests are
     authenticated.</t>
     <t>The opensocial viewer id, if sign_viewer is set to true and requests
     are authenticated.</t>
     <t>The language and country passed in to the proxied URI.</t>
    </list></t>
    <t>Containers MAY cache unsuccessful HTTP responses ("negative caching"),
    but SHOULD NOT cache unsuccessful responses for a period longer than 5
    minutes.</t>
    <section title="Processing Content">
     <t>The container MUST normalize content bodies in a way that preserves
     semantic meaning in the resulting HTML output. Specifically, containers
     MUST preserve the structure of the document for the context the gadget
     will be rendered in as follows: 
     <list style="symbols">
      <t>If the document is a complete HTML document, including opening and
      closing html tags, the container MUST retain the semantic meaning of
      document type definition declarations as well as the relative position of
      elements in the document. 
      <list style="symbols">
       <t>A container MAY choose to move elements from the head of a document
       and into the body (or vice versa), but the end result MUST behave the
       same as the original input .</t>
      </list></t>
      <t>Containers MAY modify the document in other ways for optimization and
      security purposes as long as semantics are preserved</t>
     </list></t>
    </section>
    <section title="Processing XML">
     <t>The container MUST resolve all URI attributes and values relative to
     the location of the gadget spec xml document. This DOES NOT include links
     inside of the body of the Content element at this point in time.</t>
    </section>
   </section>
  </section>
  <section title="Core JavaScript API">
   <section title="gadgets"
            anchor="gadgets">
    <!-- ============================== class summary ========================== -->
    <t>Namespace for top-level people functions.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.ctor">
     <t>gadgets</t>
     <t></t>
    </section>
    <section title="Method Details">
     <section title="log"
              anchor="gadgets.log">
      <t>&lt;static&gt; gadgets.log(message)</t>
      <t>Description: Log an informational message.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>message</c>
       <c>Object</c>
       <c>The message to log</c>
      </texttable></t>
     </section>
     <section title="warn"
              anchor="gadgets.warn">
      <t>&lt;static&gt; gadgets.warn(message)</t>
      <t>Description: Log a warning message.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>message</c>
       <c>Object</c>
       <c>The message to log</c>
      </texttable></t>
     </section>
     <section title="error"
              anchor="gadgets.error">
      <t>&lt;static&gt; gadgets.error(message)</t>
      <t>Description: Log an error message.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>message</c>
       <c>Object</c>
       <c>The message to log</c>
      </texttable></t>
     </section>
     <section title="setLogLevel"
              anchor="gadgets.setLogLevel">
      <t>&lt;static&gt; gadgets.setLogLevel(logLevel)</t>
      <t>Description: Sets the log level threshold.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>logLevel</c>
       <c>Number</c>
       <c>New log level threshold.</c>
      </texttable></t>
     </section>
    </section>
    <section title="gadgets.log"
             anchor="gadgets.log">
     <t>Used by 
     <xref target="gadgets.setLogLevel">gadgets.setLogLevel</xref>.</t>
     <section title="INFO"
              anchor="gadgets.log.INFO">
      <t>&lt;static&gt; Member of: gadgets.log</t>
      <t>Description: Log level for informational logging.</t>
     </section>
     <section title="WARN"
              anchor="gadgets.log.WARN">
      <t>&lt;static&gt; Member of: gadgets.log</t>
      <t>Description: Log level for warning logging.</t>
     </section>
     <section title="ERROR"
              anchor="gadgets.log.ERROR">
      <t>&lt;static&gt; Member of: gadgets.log</t>
      <t>Description: Log level for error logging.</t>
     </section>
     <section title="NONE"
              anchor="gadgets.log.NONE">
      <t>&lt;static&gt; Member of: gadgets.log</t>
      <t>Description: Log level for no logging.</t>
     </section>
    </section>
   </section>
   <section title="gadgets.io"
            anchor="gadgets.io">
    <!-- ============================== class summary ========================== -->
    <t>Provides remote content retrieval functions.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.io.ctor">
     <t>gadgets.io</t>
     <t></t>
    </section>
    <section title="Method Details">
     <section title="encodeValues"
              anchor="gadgets.io.encodeValues">
      <t>&lt;static&gt; Type: {String} gadgets.io.encodeValues(fields)</t>
      <t>Description: Converts an input object into a URL-encoded data string.
      (key=value&amp;...)</t>
      <t>Parameters:
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>fields</c>
       <c>Object</c>
       <c>The post fields you wish to encode</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The processed post data; this includes a trailing ampersand
       (&amp;)</c>
      </texttable></t>
     </section>
     <section title="getProxyUrl"
              anchor="gadgets.io.getProxyUrl">
      <t>&lt;static&gt; Type: {String} gadgets.io.getProxyUrl(url,
      opt_params)</t>
      <t>Description: Gets the proxy version of the passed-in URL.</t>
      <t>Parameters:
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>url</c>
       <c>String</c>
       <c>The URL to get the proxy URL for</c>
       <c>opt_params</c>
       <c>Map&lt;String|String&gt;</c>
       <c>Additional optional
       <xref target="gadgets.io.ProxyUrlRequestParameters">parameters</xref> to
       pass to the request</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The proxied version of the URL</c>
      </texttable></t>
     </section>
     <section title="makeRequest"
              anchor="gadgets.io.makeRequest">
      <t>&lt;static&gt; gadgets.io.makeRequest(url, callback, opt_params)</t>
      <t>Description: Fetches content (e.g. HTML, JSON, XML, and ATOM data) from the provided URL and feeds that content into the callback function. 
      <figure>
       <preamble>Example:</preamble>
       <artwork xml:space="preserve">
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;
gadgets.io.makeRequest(url, callback, params);
</artwork>
      </figure></t>
       <section title="Signed authorization">
      <t>If opt_params[gadgets.io.RequestParameters.AUTHORIZATION] is set to
       gadgets.io.AuthorizationType.SIGNED, 
      container mediates communications from the gadget to the
      application server in a way that can not be spoofed. This trusted content fetching
      has two main steps: [1] the gadget contacts the container, and [2] the
      container sends a signed requests to the application server. 
      <list style="numbers">
       <t>When the gadget contacts the container, the container needs to be able
       to validate any parameters it knows about: the viewer id, the owner id
       (if known), and the application id. Validating these parameters is an
       implementation detail that may vary between containers. For example,
       orkut uses an encrypted token passed in the document fragment of the
       gadget URL.</t>
       <t>When the container contacts the app server, the app server needs to be
       able to validate that the parameters really came from the container (and
       were not forged by some other entity). OpenSocial uses <xref target="OAuth-Core">OAuth's parameter
       signing algorithm</xref>. Note that most of the functionality in the OAuth spec,
       including token exchange, is not required; OpenSocial only plans to use
       the parameter signing piece of the spec (including timestamp and nonce).
       OpenSocial permits the HMAC-SHA1 method (except that the key is a shared
       secret between container and app, not a concatenation of tokens as
       specified in section 9.2 of the OAuth spec) and the RSA-SHA1 method.
       HMAC-SHA1 executes faster and is easier to implement, but it requires more
       coordination than RSA-SHA1.</t>
      </list>
      </t>
      <t>The container signs requests by doing the following: </t>
        <list style="numbers">
         <t>Removing any request parameters with names that begin with oauth,
         xoauth, or opensocial (case insensitive).</t>
       <t>Adding the following parameters to the request query string:</t>
       <list style="hanging">
        <t hangText="opensocial_viewer_id">Optional. The ID of the current
        viewer, which matches the getId() value on the viewer person
        object.</t>
        <t hangText="opensocial_owner_id">Required. The ID of the current
        owner, which matches the getId() value on the owner person object.</t>
        <t hangText="opensocial_app_url">Required. The URL of the application
        making the request. Containers may alias multiple application URLs to a
        single canonical application URL in the case where an application
        changes URLs.</t>
        <t hangText="opensocial_instance_id">Optional. An opaque identifier
        used to distinguish between multiple instances of the same application
        in a single container. If a container does not allow multiple instances
        of the same application to coexist, this parameter may be omitted. The
        combination of opensocial_app_url and opensocial_instance_id uniquely
        identify an instance of an application in a container.</t>
        <t hangText="opensocial_app_id">Optional. An opaque identifier for the
        application, unique to a particular container. Containers that wish to
        maintain backwards compatibility with the opensocial-0.7 specification
        may include this parameter.</t>
        <t hangText="xoauth_public_key">Optional. An opaque identifier for the
        public key used to sign the request. This parameter may be omitted by
        containers that do not use public keys to sign requests, or if the
        container arranges other means of key distribution with the target of
        the request.</t>
       </list>
       <t>Signing the resulting request according to section 9 of the 
       <xref target="OAuth-Core">
       OAuth specification</xref>.</t>
      </list>
      <section title="Key management">
       <t>If a container uses public keys to sign requests, the container MAY
       use either self-signed certificates or certificates signed by
       a well-known certificate authority. If a container does not distribute
       its OAuth signing key over HTTPS, it SHOULD use a certificate signed by
       a well-known certificate authority.</t>
       <t>The commonName attribute of the certificate SHOULD match the hostname
       of the container server, and should also match the value of the
       oauth_consumer_key parameter specified in the request.</t>
       <t>The container SHOULD make its public key available for download at a
       well-known location. The location
       https://[container-hostname]/opensocial/certificates/xoauth_public_keyvalue
       is recommended.</t>
       <t>Recipients of signed requests MUST verify that the signature on the
       request is correct, and that the timestamp on the request is within a
       reasonable time window. A time window of 5 minutes before and after the
       current time is recommended.</t>
       <t>Recipients of signed requests may use the oauth_consumer_key and
       xoauth_public_key parameters to automatically detect when a container
       deploys new certificates. If the container deploys certificates at a
       well-known location, the recipient MAY automatically download the new
       certificate. Recipients that automatically download new certificates
       SHOULD cache the resulting certificates.</t>
       <t>If a container's certificate is not downloaded from
       https://[container-hostname], the recipient SHOULD verify that the
       certificate is signed by a well-known certificate authority before
       trusting the certificate.</t>
      </section>
      </section>
      <section title="OAuth authorization">
       <t>If opt_params[gadgets.io.RequestParameters.AUTHORIZATION] is set to
       gadgets.io.AuthorizationType.OAUTH, the container needs to use OAuth to
       gain access to the resource specified in the request. This may require
       that the gadget obtain the user's content by directing the user to the
       service provider to gain access.</t>
      <section title="Additional parameters">
       <t>The following additional parameters may be specified in opt_params: 
       <list style="hanging">
        <t hangText="gadgets.io.RequestParameters.OAUTH_SERVICE_NAME">The
        nickname the gadget uses to refer to the OAuth &lt;Service&gt; element
        from its XML spec. If unspecified, defaults to "".</t>
        <t hangText="gadgets.io.RequestParameters.OAUTH_TOKEN_NAME">The
        nickname the gadget uses to refer to an OAuth token granting access to
        a particular resources. If unspecified, defaults to "". Gadgets can use
        multiple token names if they have access to multiple resources from the
        same service provider. For example, a gadget with access to a contact
        list and a calendar might use a token name of "contacts" to use the
        contact list token, and a contact list of "calendar" to use the
        calendar token.</t>
        <t hangText="gadgets.io.RequestParameters.OAUTH_REQUEST_TOKEN">A
        service provider may be able to automatically provision a gadget with a
        request token that is preapproved for access to a resource. The gadget
        can use that token with the OAUTH_REQUEST_TOKEN parameter. This
        parameter is optional.</t>
        <t hangText="gadgets.io.RequestParameters.OAUTH_REQUEST_TOKEN_SECRET">
        The secret corresponding to a preapproved request token. This parameter
        is optional.</t>
       </list></t>
       <t>If OAuth is used, the container should execute the OAuth protocol on
       behalf of the gadget. If the gadget has not registered a consumer key
       for use with this service provider, the container may choose to use a
       default RSA signing key corresponding to a well-known certificate to
       sign requests. If the container uses a default consumer key, it MUST
       include an additional OAuth parameter xoauth_app_url that identifies the
       gadget making the request.</t>
      </section>
      <section title="The callback parameter">
       <t>The makeRequest() callback parameter is passed a JavaScript object
       with several OAuth-specific fields in addition to the normal values
       returned by makeRequest(): 
       <list style="hanging">
        <t hangText='"oauthApprovalUrl"'>If this value is specified, the user
        needs to visit an external page to approve the gadget's request to
        access data. Use of a pop-up window to direct the user to the external
        page is recommended. Once the user has approved access, the gadget can
        repeat the makeRequest call to retrieve the data.</t>
        <t hangText='"oauthError"'>If this value is specified, it indicates an
        OAuth-related error occurred. The value will be one of a set of string
        constants that can be used for programmatically detecting errors. The
        constants are undefined for opensocial-0.8, but implementers should
        attempt to agree on a set of useful constant values for standardization
        in opensocial-0.9.</t>
        <t hangText='"oauthErrorText"'>If this value is specified, it indicates
        an OAuth-related error occurred. The value is free-form text that can
        be used to provide debugging information for gadget developers.</t>
       </list></t>
      </section>
     </section>
    <section title="Caching">
     <t>Gadgets calls to makeRequest, the calls MAY be cached, reducing the load that application servers have to be able to handle. The gadgets.io.RequestParameters.REFRESH_INTERVAL parameter is used to specify the number of seconds that should elapse before the makeRequest call requests content from your servers again. For example,
     specifying 10 will mean that the container would only query the supplied
     URL once every 10 seconds, no matter how many people are using the
     application. Specifying 0 will query the server each time the function is
     called, effectively bypassing the cached version.</t>
    </section>
      <section title="Parameters">
       <t>
        <texttable>
         <ttcol>Name</ttcol>
         <ttcol>Type</ttcol>
         <ttcol>Description</ttcol>
         <c>url</c>
         <c>String</c>
         <c>The URL where the content is located</c>
         <c>callback</c>
         <c>Function</c>
         <c>The function to call with the data from the URL once it is fetched.
         The callback function will not be called until after the existing
         callstack has completed execution.</c>
         <c>opt_params</c>
         <c>Map.&lt;gadgets.io.RequestParameters|Object&gt;</c>
         <c>Additional 
         <xref target="gadgets.io.RequestParameters">request
         parameters</xref> or 
         <xref target="gadgets.io.ProxyUrlRequestParameters">proxy request
         parameters</xref> </c>
        </texttable>
       </t>
      </section>
     </section>
    </section>
   </section>
   <section title="gadgets.io.AuthorizationType"
            anchor="gadgets.io.AuthorizationType">
    <!-- ============================== class summary ========================== -->
    <t>Used by 
    <xref target="gadgets.io.RequestParameters">RequestParameters</xref>.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.io.AuthorizationType.ctor">
     <t>gadgets.io.AuthorizationType</t>
     <t></t>
    </section>
    <section title="Field Details">
     <section title="NONE"
              anchor="gadgets.io.AuthorizationType.NONE">
      <t>&lt;static&gt; Member of: gadgets.io.AuthorizationType.NONE</t>
      <t>Description: No authorization. This field may be used interchangeably
      with the string 'NONE'.</t>
     </section>
     <section title="OAUTH"
              anchor="gadgets.io.AuthorizationType.OAUTH">
      <t>&lt;static&gt; Member of: gadgets.io.AuthorizationType.OAUTH</t>
      <t>Description: The container will use OAuth for authentication. This
      field may be used interchangeably with the string 'OAUTH'.</t>
     </section>
     <section title="SIGNED"
              anchor="gadgets.io.AuthorizationType.SIGNED">
      <t>&lt;static&gt; Member of: gadgets.io.AuthorizationType.SIGNED</t>
      <t>Description: The request will be signed by the container. This field
      may be used interchangeably with the string 'SIGNED'.</t>
     </section>
    </section>
   </section>
   <section title="gadgets.io.ContentType"
            anchor="gadgets.io.ContentType">
    <!-- ============================== class summary ========================== -->
    <t>Used by 
    <xref target="gadgets.io.RequestParameters">RequestParameters</xref>.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.io.ContentType.ctor">
     <t>gadgets.io.ContentType</t>
     <t></t>
    </section>
    <section title="Field Details">
     <section title="DOM"
              anchor="gadgets.io.ContentType.DOM">
      <t>&lt;static&gt; Member of: gadgets.io.ContentType.DOM</t>
      <t>Description: Returns a DOM object; used for fetching XML. This field
      may be used interchangeably with the string 'DOM'.</t>
     </section>
     <section title="FEED"
              anchor="gadgets.io.ContentType.FEED">
      <t>&lt;static&gt; Member of: gadgets.io.ContentType.FEED</t>
      <t>Description: Returns a JSON representation of an RSS or Atom feed.
      This field may be used interchangeably with the string 'FEED'.</t>
     </section>
     <section title="JSON"
              anchor="gadgets.io.ContentType.JSON">
      <t>&lt;static&gt; Member of: gadgets.io.ContentType.JSON</t>
      <t>Description: Returns a JSON object. This field may be used
      interchangeably with the string 'JSON'.</t>
     </section>
     <section title="TEXT"
              anchor="gadgets.io.ContentType.TEXT">
      <t>&lt;static&gt; Member of: gadgets.io.ContentType.TEXT</t>
      <t>Description: Returns text; used for fetching HTML. This field may be
      used interchangeably with the string 'TEXT'.</t>
     </section>
    </section>
   </section>
   <section title="gadgets.io.MethodType"
            anchor="gadgets.io.MethodType">
    <!-- ============================== class summary ========================== -->
    <t>Defines values for 
    <xref target="gadgets.io.RequestParameters.METHOD">
    RequestParameters.METHOD</xref>.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.io.MethodType.ctor">
     <t>gadgets.io.MethodType</t>
     <t></t>
    </section>
    <section title="Field Details">
     <section title="DELETE"
              anchor="gadgets.io.MethodType.DELETE">
      <t>&lt;static&gt; Member of: gadgets.io.MethodType.DELETE</t>
      <t>Description: Container support for this method type is OPTIONAL. This
      field may be used interchangeably with the string 'DELETE'.</t>
     </section>
     <section title="GET"
              anchor="gadgets.io.MethodType.GET">
      <t>&lt;static&gt; Member of: gadgets.io.MethodType.GET</t>
      <t>Description: The default type. This field may be used interchangeably
      with the string 'GET'.</t>
     </section>
     <section title="HEAD"
              anchor="gadgets.io.MethodType.HEAD">
      <t>&lt;static&gt; Member of: gadgets.io.MethodType.HEAD</t>
      <t>Description: Container support for this method type is OPTIONAL. This
      field may be used interchangeably with the string 'HEAD'.</t>
     </section>
     <section title="POST"
              anchor="gadgets.io.MethodType.POST">
      <t>&lt;static&gt; Member of: gadgets.io.MethodType.POST</t>
      <t>Description: Container support for this method type is OPTIONAL. This
      field may be used interchangeably with the string 'POST'.</t>
     </section>
     <section title="PUT"
              anchor="gadgets.io.MethodType.PUT">
      <t>&lt;static&gt; Member of: gadgets.io.MethodType.PUT</t>
      <t>Description: Container support for this method type is OPTIONAL. This
      field may be used interchangeably with the string 'PUT'.</t>
     </section>
    </section>
   </section>
   <section title="gadgets.io.ProxyUrlRequestParameters"
            anchor="gadgets.io.ProxyUrlRequestParameters">
    <!-- ============================== class summary ========================== -->
    <t>Used by 
    <xref target="gadgets.io.getProxyUrl">
    gadgets.io.getProxyUrl()</xref> method.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.io.ProxyUrlRequestParameters.ctor">
     <t>gadgets.io.ProxyUrlRequestParameters</t>
     <t></t>
    </section>
    <section title="Field Details">
     <section title="REFRESH_INTERVAL"
              anchor="gadgets.io.ProxyUrlRequestParameters.REFRESH_INTERVAL">
      <t>&lt;static&gt; Member of:
      gadgets.io.ProxyUrlRequestParameters.REFRESH_INTERVAL</t>
      <t>Description: Explicitly sets the lifespan of cached content. The
      Refresh Interval is the number of seconds the container should cache the
      given response. By default, the HTTP caching headers will be respected
      for fetched content. If the refresh interval is set, this value will take
      precedence over any HTTP cache headers. If this value is not set and
      there are no HTTP caching headers specified, this value will default to
      3600 (one hour). Note that Signed requests and objects with POST_DATA
      present will generally not be cached. This field may be used
      interchangeably with the string 'REFRESH_INTERVAL'.</t>
     </section>
    </section>
   </section>
   <section title="gadgets.io.RequestParameters"
            anchor="gadgets.io.RequestParameters">
    <!-- ============================== class summary ========================== -->
    <t>Used by the
    <xref target="gadgets.io.makeRequest">
    gadgets.io.makeRequest()</xref> method.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.io.RequestParameters.ctor">
     <t>gadgets.io.RequestParameters</t>
     <t></t>
    </section>
    <section title="Field Details">
     <section title="AUTHORIZATION"
              anchor="gadgets.io.RequestParameters.AUTHORIZATION">
      <t>&lt;static&gt; Member of:
      gadgets.io.RequestParameters.AUTHORIZATION</t>
      <t>Description: The type of authentication to use when fetching the
      content; defaults to AuthorizationType.NONE. Specified as an
      <xref target="gadgets.io.AuthorizationType">AuthorizationType</xref>.
      This field may be used interchangeably with the string
      'AUTHORIZATION'.</t>
     </section>
     <section title="CONTENT_TYPE"
              anchor="gadgets.io.RequestParameters.CONTENT_TYPE">
      <t>&lt;static&gt; Member of:
      gadgets.io.RequestParameters.CONTENT_TYPE</t>
      <t>Description: The type of content that lives at the URL; defaults to
      ContentType.TEXT. Specified as a
      <xref target="gadgets.io.ContentType">ContentType</xref>. This field may
      be used interchangeably with the string 'CONTENT_TYPE'.</t>
     </section>
     <section title="GET_SUMMARIES"
              anchor="gadgets.io.RequestParameters.GET_SUMMARIES">
      <t>&lt;static&gt; Member of:
      gadgets.io.RequestParameters.GET_SUMMARIES</t>
      <t>Description: If the content is a feed, whether to fetch summaries for
      that feed; defaults to false. Specified as a Boolean. This field may be
      used interchangeably with the string 'GET_SUMMARIES'.</t>
     </section>
     <section title="HEADERS"
              anchor="gadgets.io.RequestParameters.HEADERS">
      <t>&lt;static&gt; Member of: gadgets.io.RequestParameters.HEADERS</t>
      <t>Description: The HTTP headers to send to the URL; defaults to null.
      Specified as a Map.&lt;String,String&gt;. This field may be used
      interchangeably with the string 'HEADERS'.</t>
     </section>
     <section title="METHOD"
              anchor="gadgets.io.RequestParameters.METHOD">
      <t>&lt;static&gt; Member of: gadgets.io.RequestParameters.METHOD</t>
      <t>Description: The method to use when fetching content from the URL;
      defaults to 
      <xref target="gadgets.io.MethodType.GET">MethodType.GET</xref>. Valid
      values are specified by
      <xref target="gadgets.io.MethodType">MethodType</xref>. This field may be
      used interchangeably with the string 'METHOD'.</t>
     </section>
     <section title="NUM_ENTRIES"
              anchor="gadgets.io.RequestParameters.NUM_ENTRIES">
      <t>&lt;static&gt; Member of: gadgets.io.RequestParameters.NUM_ENTRIES</t>
      <t>Description: If the content is a feed, the number of entries to fetch;
      defaults to 3. Specified as a Number. This field may be used
      interchangeably with the string 'NUM_ENTRIES'.</t>
     </section>
     <section title="POST_DATA"
              anchor="gadgets.io.RequestParameters.POST_DATA">
      <t>&lt;static&gt; Member of: gadgets.io.RequestParameters.POST_DATA</t>
      <t>Description: The data to send to the URL using the POST method;
      defaults to null. Specified as a String. This field may be used
      interchangeably with the string 'POST_DATA'.</t>
     </section>
     <section title="REFRESH_INTERVAL"
              anchor="gadgets.io.RequestParameters.REFRESH_INTERVAL">
      <t>&lt;static&gt; Member of:
      gadgets.io.RequestParameters.REFRESH_INTERVAL</t>
      <t>Description: Explicitly sets the lifespan of cached content. The
      Refresh Interval is the number of seconds the container should cache the
      given response. By default, the HTTP caching headers will be respected
      for fetched content. If the refresh interval is set, this value will take
      precedence over any HTTP cache headers. If this value is not set and
      there are no HTTP caching headers specified, this value will default to
      3600 (one hour). Note that Signed requests and objects with POST_DATA
      present will generally not be cached. This field may be used
      interchangeably with the string 'REFRESH_INTERVAL'.</t>
     </section>
    </section>
   </section>
   <section title="gadgets.json"
            anchor="gadgets.json">
    <!-- ============================== class summary ========================== -->
    <t>Provides operations for translating objects to and from JSON.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.json.ctor">
     <t>gadgets.json</t>
     <t></t>
    </section>
    <section title="Method Details">
     <section title="parse"
              anchor="gadgets.json.parse">
      <t>&lt;static&gt; Type: {Object} gadgets.json.parse(text)</t>
      <t>Description: Parses a JSON string, producing a JavaScript value.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>text</c>
       <c>String</c>
       <c>The string to transform into an object; usually the result of a
       previous stringify call</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Object</c>
       <c>The object parsed from the passed in text; false if an error
       occurred</c>
      </texttable></t>
     </section>
     <section title="stringify"
              anchor="gadgets.json.stringify">
      <t>&lt;static&gt; Type: {String} gadgets.json.stringify(v)</t>
      <t>Description: Converts a JavaScript value to a JSON string.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>v</c>
       <c>Object</c>
       <c>The object to convert</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The JSON equivalent</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.Prefs"
            anchor="gadgets.Prefs">
    <!-- ============================== class summary ========================== -->
    <t>Provides access to user preferences, module dimensions, and messages.
    Clients can access their preferences by constructing an instance of
    gadgets.Prefs and passing in their module ID. Example: 
    <figure>
     <artwork xml:space="preserve">
var prefs = new gadgets.Prefs();
var name = prefs.getString("name");
var lang = prefs.getLang();
</artwork>
    </figure></t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.Prefs.ctor">
     <t>gadgets.Prefs(opt_moduleId)</t>
     <t>Creates a new Prefs object.</t>
     <t>Parameters:
     <texttable>
      <ttcol>Name</ttcol>
      <ttcol>Type</ttcol>
      <ttcol>Description</ttcol>
      <c>opt_moduleId</c>
      <c>String | Number</c>
      <c>An optional parameter specifying the module ID to create prefs for; if
      not provided, the default module ID is used</c>
     </texttable></t>
    </section>
    <section title="Method Details">
     <section title="getArray"
              anchor="gadgets.Prefs.getArray">
      <t>Type: {Array.&lt;String&gt;} getArray(key)</t>
      <t>Description: Retrieves a preference as an array. UserPref values that
      were not declared as lists are treated as one-element arrays.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>key</c>
       <c>String</c>
       <c>The preference to fetch</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Array.&lt;String&gt;</c>
       <c>The preference; if not set, an empty array</c>
      </texttable></t>
     </section>
     <section title="getBool"
              anchor="gadgets.Prefs.getBool">
      <t>Type: {Boolean} getBool(key)</t>
      <t>Description: Retrieves a preference as a boolean.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>key</c>
       <c>String</c>
       <c>The preference to fetch</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Boolean</c>
       <c>The preference; if not set, false</c>
      </texttable></t>
     </section>
     <section title="getCountry"
              anchor="gadgets.Prefs.getCountry">
      <t>Type: {String} getCountry()</t>
      <t>Description: Gets the current country, returned as ISO 3166-1 alpha-2
      code.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The country for this module instance</c>
      </texttable></t>
     </section>
     <section title="getFloat"
              anchor="gadgets.Prefs.getFloat">
      <t>Type: {Number} getFloat(key)</t>
      <t>Description: Retrieves a preference as a floating-point value.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>key</c>
       <c>String</c>
       <c>The preference to fetch</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Number</c>
       <c>The preference; if not set, 0</c>
      </texttable></t>
     </section>
     <section title="getInt"
              anchor="gadgets.Prefs.getInt">
      <t>Type: {Number} getInt(key)</t>
      <t>Description: Retrieves a preference as an integer.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>key</c>
       <c>String</c>
       <c>The preference to fetch</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Number</c>
       <c>The preference; if not set, 0</c>
      </texttable></t>
     </section>
     <section title="getLang"
              anchor="gadgets.Prefs.getLang">
      <t>Type: {String} getLang()</t>
      <t>Description: Gets the current language the gadget should use when
      rendering, returned as a ISO 639-1 language code.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The language for this module instance</c>
      </texttable></t>
     </section>
     <section title="getModuleId"
              anchor="gadgets.Prefs.getModuleId">
      <t>Type: {String | Number} getModuleId()</t>
      <t>Description: Gets the module ID for the current instance.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String | Number</c>
       <c>The module ID for this module instance</c>
      </texttable></t>
     </section>
     <section title="getMsg"
              anchor="gadgets.Prefs.getMsg">
      <t>Type: {String} getMsg(key)</t>
      <t>Description: Fetches an unformatted message.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>key</c>
       <c>String</c>
       <c>The message to fetch</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The message</c>
      </texttable></t>
     </section>
     <section title="getString"
              anchor="gadgets.Prefs.getString">
      <t>Type: {String} getString(key)</t>
      <t>Description: Retrieves a preference as a string.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>key</c>
       <c>String</c>
       <c>The preference to fetch</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The preference; if not set, an empty string</c>
      </texttable></t>
     </section>
     <section title="set"
              anchor="gadgets.Prefs.set">
      <t>set(key, val)</t>
      <t>Description: Stores a preference. To use this call, the gadget must
      require the feature setprefs. 
      <t>Note: If the gadget needs to store an Array it should use setArray
      instead of this call.</t></t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>key</c>
       <c>String</c>
       <c>The pref to store</c>
       <c>val</c>
       <c>Object</c>
       <c>The values to store</c>
      </texttable></t>
     </section>
     <section title="setArray"
              anchor="gadgets.Prefs.setArray">
      <t>setArray(key, val)</t>
      <t>Description: Stores an array preference. To use this call, the gadget
      must require the feature setprefs.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>key</c>
       <c>String</c>
       <c>The pref to store</c>
       <c>val</c>
       <c>Array</c>
       <c>The values to store</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.util"
            anchor="gadgets.util">
    <!-- ============================== class summary ========================== -->
    <t>Provides general-purpose utility functions.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.util.ctor">
     <t>gadgets.util</t>
     <t></t>
    </section>
    <section title="Method Details">
     <section title="escapeString"
              anchor="gadgets.util.escapeString">
      <t>&lt;static&gt; Type: {String} gadgets.util.escapeString(str)</t>
      <t>Description: Escapes the input using HTML entities to make it safer.
      The following characters are affected: 
      <list style="symbols">
       <t>newline (\n, Unicode code point 10)</t>
       <t>carriage return (\r, Unicode 13)</t>
       <t>double quote (", Unicode 34)</t>
       <t>ampersand (&amp;, Unicode 38)</t>
       <t>single quote (', Unicode 39)</t>
       <t>left angle bracket (&lt;, Unicode 60)</t>
       <t>right angle bracket (&gt;, Unicode 62)</t>
       <t>backslash (\, Unicode 92)</t>
       <t>line separator (Unicode 8232)</t>
       <t>paragraph separator (Unicode 8233)</t>
      </list></t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>str</c>
       <c>String</c>
       <c>The string to escape</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The escaped string</c>
      </texttable></t>
     </section>
     <section title="getFeatureParameters"
              anchor="gadgets.util.getFeatureParameters">
      <t>&lt;static&gt; Type: {Object}
      gadgets.util.getFeatureParameters(feature)</t>
      <t>Description: Returns the value of parameters for this feature. A
      gadget specifies parameters using the &lt;Param&gt; subelement of the
      &lt;Requires&gt; or &lt;Optional&gt; element.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>feature</c>
       <c>String</c>
       <c>The feature to get parameters for</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Object</c>
       <c>The parameters for the given feature, or null</c>
      </texttable></t>
     </section>
     <section title="hasFeature"
              anchor="gadgets.util.hasFeature">
      <t>&lt;static&gt; Type: {Boolean} gadgets.util.hasFeature(feature)</t>
      <t>Description: Returns whether the specified feature is supported.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>feature</c>
       <c>String</c>
       <c>The feature to test for</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Boolean</c>
       <c>True if the feature is supported</c>
      </texttable></t>
     </section>
     <section title="registerOnLoadHandler"
              anchor="gadgets.util.registerOnLoadHandler">
      <t>&lt;static&gt; gadgets.util.registerOnLoadHandler(callback)</t>
      <t>Description: Registers an onload handler; a function that's executed
      when the gadget loads. Multiple handlers can be registered, and all will
      be invoked in the same order that they were registered.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>callback</c>
       <c>Function</c>
       <c>The handler to run. The callback function will not be called until
       after the existing callstack has completed execution.</c>
      </texttable></t>
     </section>
     <section title="sanitizeHtml"
              anchor="gadgets.util.sanitizeHtml">
      <t>&lt;static&gt; Type: {String} gadgets.util.sanitizeHtml(text)</t>
      <t>Description: Sanitizes a text string. The returned value is safe to
      assign to innerHTML. The returned value may include HTML tags. If plain
      text is desired, use gadgets.util.escapeString instead.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>text</c>
       <c>String</c>
       <c>arbitrary text string</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>a sanitized version that may include HTML tags, but will not execute
       script.</c>
      </texttable></t>
     </section>
     <section title="unescapeString"
              anchor="gadgets.util.unescapeString">
      <t>&lt;static&gt; Type: {String} gadgets.util.unescapeString(str)</t>
      <t>Description: Reverses escapeString</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>str</c>
       <c>String</c>
       <c>The string to unescape.</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The unescaped string</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.views"
            anchor="gadgets.views">
    <!-- ============================== class summary ========================== -->
    <t>Provides operations for dealing with views.
    <t>See also: 
    <xref target="gadgets.views.View">gadgets.views.View</xref> </t></t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.views.ctor">
     <t>gadgets.views</t>
     <t></t>
    </section>
    <section title="Method Details">
     <section title="bind"
              anchor="gadgets.views.bind">
      <t>&lt;static&gt; Type: {String} gadgets.views.bind(urlTemplate,
      environment)</t>
      <t>Description: Binds a URL template with variables in the passed
      environment to produce a URL string.
      <t>See also: 
      <xref target="gadgets.views.View.getUrlTemplate">
      View.getUrlTemplate()</xref> </t></t>
      <t>Parameters:
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>urlTemplate</c>
       <c></c>
       <c>A url template for a container view</c>
       <c>environment</c>
       <c></c>
       <c>A set of named variables (for example, [[]OWNER | PATH | PARAMS |
       NAME]) of type string.</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>A URL string</c>
      </texttable></t>
     </section>
     <section title="getCurrentView"
              anchor="gadgets.views.getCurrentView">
      <t>&lt;static&gt; Type: {
      <xref target="gadgets.views.View">gadgets.views.View</xref> }
      gadgets.views.getCurrentView()</t>
      <t>Description: Returns the current view.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>
        <xref target="gadgets.views.View">gadgets.views.View</xref>
       </c>
       <c>The current view</c>
      </texttable></t>
     </section>
     <section title="getParams"
              anchor="gadgets.views.getParams">
      <t>&lt;static&gt; Type: {Map.&lt;String|String&gt;}
      gadgets.views.getParams()</t>
      <t>Description: Returns the parameters passed into this gadget for this
      view. Does not include all URL parameters, only the ones passed into
      gadgets.views.requestNavigateTo.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Map.&lt;String|String&gt;</c>
       <c>The parameter map</c>
      </texttable></t>
     </section>
     <section title="getSupportedViews"
              anchor="gadgets.views.getSupportedViews">
      <t>&lt;static&gt; Type: {Map&lt;gadgets.views.ViewType |
      String|gadgets.views.View&gt;} gadgets.views.getSupportedViews()</t>
      <t>Description: Returns a map of all the supported views. Keys each
      gadgets.view.View by its name. This function only returns the primary
      views and does not return any secondary views. Example: if the markup
      indicates a set of views named Canvas.About, Profile.About, Home.About,
      Canvas.Help the returned views will only be Canvas, Profile, Home.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Map&lt;gadgets.views.ViewType | String|gadgets.views.View&gt;</c>
       <c>All supported views, keyed by their name attribute.</c>
      </texttable></t>
     </section>
     <section title="requestNavigateTo"
              anchor="gadgets.views.requestNavigateTo">
      <t>&lt;static&gt; gadgets.views.requestNavigateTo(|, |, opt_ownerId)</t>
      <t>Description: Attempts to navigate to this gadget in a different view.
      If the container supports parameter passing it will pass the optional
      parameters along to the gadget in the new view. This also allows for
      navigation to named views on the current surface. Views are composed of
      names that are [Surface](.[Secondary])?. The canonical Surface names are
      Canvas, Profile, Home. The Secondary names are user defined. When
      navigating from [Surface].valueX to [Surface].valueY, the container can
      stay on the same Surface but will show the appropriate &lt;Content&gt;
      sections whose View is [Surface].valueY. When navigating from
      SurfaceA.[Secondary] to SurfaceB.[Secondary], the container will switch
      to the SurfaceB surface and show the appropriate &lt;Content&gt; sections
      whose View is SurfaceB.[Secondary].In no cases must the .[Secondary] item
      ever be declared.</t>
      <t>Parameters:
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>|</c>
       <c>gadgets.views.View</c>
       <c>{string} view If set to a string, the name of the view to navigate
       to. If set to a View, the View object to navigate to. Passing a View has
       been deprecated.</c>
       <c>|</c>
       <c>Map.&lt;String|String&gt;</c>
       <c>{string} opt_params If the value is an object, it represents
       parameters to pass to the gadget after it has been navigated to on the
       surface. If the view navigated to contains an href and opt_params is a
       string, the value in opt_params is treated as a relative path that must
       be resolved relative to the href of the referenced view according to RFC
       3986. If opt_params is a string all query parameters including query
       parameters encoded in a fragment are available in the receiving view
       using gadgets.views.getParams()</c>
       <c>opt_ownerId</c>
       <c>String</c>
       <c>The ID of the owner of the page to navigate to; defaults to the
       current owner</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.views.View"
            anchor="gadgets.views.View">
    <!-- ============================== class summary ========================== -->
    <t>Base interface for all view objects.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Method Details">
     <section title="bind"
              anchor="gadgets.views.View.bind">
      <t>Type: {String} bind(environment)</t>
      <t>Description: Binds the view's URL template with variables in the
      passed environment to produce a URL string.
      <t>See also: 
      <xref target="gadgets.views.View.getUrlTemplate">
      getUrlTemplate()</xref> </t></t>
      <t>Parameters:
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>environment</c>
       <c></c>
       <c>A set of named variables (for example, [[]OWNER | PATH | PARAMS |
       NAME]) of type string.</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>A URL string</c>
      </texttable></t>
     </section>
     <section title="getName"
              anchor="gadgets.views.View.getName">
      <t>Type: {
      <xref target="gadgets.views.ViewType">gadgets.views.ViewType</xref> |
      String} getName()</t>
      <t>Description: Returns the name of this view.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>
       <xref target="gadgets.views.ViewType">gadgets.views.ViewType</xref> |
       String</c>
       <c>The view name, usually specified as a gadgets.views.ViewType</c>
      </texttable></t>
     </section>
     <section title="getUrlTemplate"
              anchor="gadgets.views.View.getUrlTemplate">
      <t>Type: {String} getUrlTemplate()</t>
      <t>Description: Returns a string URI template conforming to the 
      <eref target="http://bitworking.org/projects/URI-Templates/spec/draft-gregorio-uritemplate-03">
      IETF spec draft</eref> with variables for substitution.
      <t>Four variables are supported:</t>
      <list style="hanging">
      <t hangText="name">The name or ID of the application</t>
      <t hangText="owner">The ID of the owner of the page</t>
      <t hangText="path">An array of path steps</t>` 
      <t hangText="params">Associative array or
      array[[]param1,value1,param2,value2,...]</t></list>Example 
      <figure>
       <preamble>Here are two valid URL template strings:</preamble>
       <artwork xml:space="preserve">
http://container.com/{-list|/|name,owner,path}?{-join|&amp;|params}
http://container.com/apps/{name}/{owner}{-prefix|/|path}{-opt|?os_|params}{-join|&amp;os_|params}
</artwork>
      </figure>
      <t>Here are some parameters:</t>
      <figure>
       <artwork xml:space="preserve">
{
    name : 'Wilma',
    owner : 'Betty',
    path : ['dino','car'],
    params : { a : 'Barney', b : 'Fred'}          
}
</artwork>
      </figure>
      <t>With those parameters, the two example URL template strings resolve to
      the following URLs:</t>
      <figure>
       <artwork xml:space="preserve">
http://container.com/Wilma/Betty/dino/car?a=Barney&amp;b=Fred
http://container.com/apps/Wilma/Betty/dino/car?os_a=Barney&amp;os_b=Fred
</artwork>
      </figure>
      <t>See also: 
      <xref target="gadgets.views.View.bind">bind()</xref> </t></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>A template that can be used to construct URLs that navigate to this
       view</c>
      </texttable></t>
     </section>
     <section title="isOnlyVisibleGadget"
              anchor="gadgets.views.View.isOnlyVisibleGadget">
      <t>Type: {boolean} isOnlyVisibleGadget()</t>
      <t>Description: Returns true if the gadget is the only visible gadget in
      this view. On a canvas page or in maximize mode this is most likely true;
      on a profile page or in dashboard mode, it is most likely false.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>boolean</c>
       <c>True if the gadget is the only visible gadget; otherwise, false</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.views.ViewType"
            anchor="gadgets.views.ViewType">
    <!-- ============================== class summary ========================== -->
    <t>Used by 
    <xref target="gadgets.views.View">View</xref> s.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.views.ViewType.ctor">
     <t>gadgets.views.ViewType</t>
     <t></t>
    </section>
    <section title="Field Details">
     <section title="CANVAS"
              anchor="gadgets.views.ViewType.CANVAS">
      <t>&lt;static&gt; Member of: gadgets.views.ViewType.CANVAS</t>
      <t>Description: A view where the gadget is displayed in a very large
      mode. It is typically the main content on the page. The viewer is not
      always the same as the owner. This field may be used interchangeably with
      the string 'CANVAS'.</t>
     </section>
     <section title="HOME"
              anchor="gadgets.views.ViewType.HOME">
      <t>&lt;static&gt; Member of: gadgets.views.ViewType.HOME</t>
      <t>Description: A view where the gadget is displayed in a small area
      usually on a page with other gadgets. Typically the viewer is the same as
      the owner. This field may be used interchangeably with the string
      'HOME'.</t>
     </section>
     <section title="PREVIEW"
              anchor="gadgets.views.ViewType.PREVIEW">
      <t>&lt;static&gt; Member of: gadgets.views.ViewType.PREVIEW</t>
      <t>Description: A demo view of the gadget. In this view the owner and
      viewer are not known. This field may be used interchangeably with the
      string 'PREVIEW'.</t>
     </section>
     <section title="PROFILE"
              anchor="gadgets.views.ViewType.PROFILE">
      <t>&lt;static&gt; Member of: gadgets.views.ViewType.PROFILE</t>
      <t>Description: A view where the gadget is displayed in a small area
      usually on a page with other gadgets. The viewer is not always the same
      as the owner. This field may be used interchangeably with the string
      'PROFILE'.</t>
     </section>
    </section>
   </section>
  </section>
  <section title="Highly Recommended Features">
   <section title="gadgets.flash"
            anchor="gadgets.flash">
    <!-- ============================== class summary ========================== -->
    <t>Embeds Flash content in gadgets.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.flash.ctor">
     <t>gadgets.flash</t>
     <t></t>
    </section>
    <section title="Method Details">
     <section title="embedCachedFlash"
              anchor="gadgets.flash.embedCachedFlash">
      <t>&lt;static&gt; Type: {Boolean} gadgets.flash.embedCachedFlash()</t>
      <t>Description: Injects a cached Flash file into the DOM tree. Accepts
      the same parameters as gadgets.flash.embedFlash does.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Boolean</c>
       <c>Whether the function call completes successfully</c>
      </texttable></t>
     </section>
     <section title="embedFlash"
              anchor="gadgets.flash.embedFlash">
      <t>&lt;static&gt; Type: {Boolean} gadgets.flash.embedFlash(swfUrl,
      swfContainer, swfVersion, opt_params)</t>
      <t>Description: Injects a Flash file into the DOM tree.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>swfUrl</c>
       <c>String</c>
       <c>SWF URL</c>
       <c>swfContainer</c>
       <c>String | Object</c>
       <c>The ID or object reference of an existing HTML container element</c>
       <c>swfVersion</c>
       <c>Number</c>
       <c>Minimum Flash Player version required</c>
       <c>opt_params</c>
       <c>Object</c>
       <c>An optional object that may contain any valid HTML parameter; all
       attributes will be passed through to the Flash movie on creation</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Boolean</c>
       <c>Whether the function call completes successfully</c>
      </texttable></t>
     </section>
     <section title="getMajorVersion"
              anchor="gadgets.flash.getMajorVersion">
      <t>&lt;static&gt; Type: {Number} gadgets.flash.getMajorVersion()</t>
      <t>Description: Detects Flash Player and its major version.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Number</c>
       <c>The major version of Flash Player or 0 if Flash is not supported</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.MiniMessage"
            anchor="gadgets.MiniMessage">
    <!-- ============================== class summary ========================== -->
    <t>MiniMessage class, used to create messages that will appear to the user
    within the gadget. Typical use cases:
    <list style="symbols">
     <t>Status messages: loading, saving, etc.</t>
     <t>Promotional messages: new features, new gadget, etc.</t>
     <t>Debug/error messages: bad input, failed connection to server, etc.</t>
    </list></t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.MiniMessage.ctor">
     <t>gadgets.MiniMessage(opt_moduleId, opt_container)</t>
     <t>Creates a MiniMessage.</t>
     <t>Parameters:
     <texttable>
      <ttcol>Name</ttcol>
      <ttcol>Type</ttcol>
      <ttcol>Description</ttcol>
      <c>opt_moduleId</c>
      <c>String</c>
      <c>Optional module ID</c>
      <c>opt_container</c>
      <c>HTMLElement</c>
      <c>Optional HTML container element where mini-messages will appear</c>
     </texttable></t>
    </section>
    <section title="Method Details">
     <section title="createDismissibleMessage"
              anchor="gadgets.MiniMessage.createDismissibleMessage">
      <t>Type: {HTMLElement} createDismissibleMessage(message,
      opt_callback)</t>
      <t>Description: Creates a dismissible message with an [x] icon that
      allows users to dismiss the message. When the message is dismissed, it is
      removed from the DOM and the optional callback function, if defined, is
      called.</t>
      <t>Parameters:
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>message</c>
       <c>String | Object</c>
       <c>The message as an HTML string or DOM element</c>
       <c>opt_callback</c>
       <c>Function</c>
       <c>Optional callback function to be called when the message is
       dismissed. The callback function will not be called until after the
       existing callstack has completed execution.</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>HTMLElement</c>
       <c>HTML element of the created message</c>
      </texttable></t>
     </section>
     <section title="createStaticMessage"
              anchor="gadgets.MiniMessage.createStaticMessage">
      <t>Type: {HTMLElement} createStaticMessage(message)</t>
      <t>Description: Creates a static message that can only be dismissed
      programmatically (by calling dismissMessage()).</t>
      <t>Parameters:
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>message</c>
       <c>String | Object</c>
       <c>The message as an HTML string or DOM element</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>HTMLElement</c>
       <c>HTML element of the created message</c>
      </texttable></t>
     </section>
     <section title="createTimerMessage"
              anchor="gadgets.MiniMessage.createTimerMessage">
      <t>Type: {HTMLElement} createTimerMessage(message, seconds,
      opt_callback)</t>
      <t>Description: Creates a message that displays for the specified number
      of seconds. When the timer expires, the message is dismissed and the
      optional callback function is executed.</t>
      <t>Parameters:
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>message</c>
       <c>String | Object</c>
       <c>The message as an HTML string or DOM element</c>
       <c>seconds</c>
       <c>number</c>
       <c>Number of seconds to wait before dismissing the message</c>
       <c>opt_callback</c>
       <c>Function</c>
       <c>Optional callback function to be called when the message is
       dismissed. To continue the dismissal of the message, this function should return true. The callback function will not be called until after the
       existing callstack has completed execution.</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>HTMLElement</c>
       <c>HTML element of the created message</c>
      </texttable></t>
     </section>
     <section title="dismissMessage"
              anchor="gadgets.MiniMessage.dismissMessage">
      <t>dismissMessage(message)</t>
      <t>Description: Dismisses the specified message.</t>
      <t>Parameters:
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>message</c>
       <c>HTMLElement</c>
       <c>HTML element of the message to remove</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.oauth.Popup"
            anchor="gadgets.oauth.Popup">
    <!-- ============================== class summary ========================== -->
    <t>OAuth popup window manager.</t>
    <t>Expected usage: 
    <list style="numbers">
     <t>Gadget attempts to fetch OAuth data for the user and discovers that
     approval is needed. The gadget creates two new UI elements: 
     <list style="symbols">
      <t>a "personalize this gadget" button or link</t>
      <t>a "personalization done" button or link, which is initially
      hidden.</t>
     </list>The "personalization done" button may be unnecessary. The popup
     window manager will attempt to detect when the window closes. However, the
     "personalization done" button should still be displayed to handle cases
     where the popup manager is unable to detect that a window has closed. This
     allows the user to signal approval manually.</t>
     <t>Gadget creates a popup object and associates event handlers with the UI
     elements: 
     <figure>
      <artwork xml:space="preserve">
// Called when the user opens the popup window.
var onOpen = function() {
  $("personalizeDone").style.display = "block"
}
// Called when the user closes the popup window.
var onClose = function() {
  $("personalizeDone").style.display = "none"
  fetchData();
}
var popup = new gadgets.oauth.Popup(
    response.oauthApprovalUrl,
    "height=300,width=200",
    onOpen,
    onClose
);
personalizeButton.onclick = popup.createOpenerOnClick();
personalizeDoneButton.onclick = popup.createApprovedOnClick();
</artwork>
     </figure></t>
     <t>When the user clicks the personalization button/link, a window is
     opened to the approval URL. The onOpen function is called to notify the
     gadget that the window was opened.</t>
     <t>When the window is closed, the popup manager calls the onClose function
     and the gadget attempts to fetch the user's data.</t>
    </list></t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.oauth.Poup.ctor">
     <t>gadgets.oauth.Popup(destination, windowOptions, openCallback,
     closeCallback)</t>
     <t>Description: used to create a new OAuth popup window manager.</t>
     <t>Parameters:
     <texttable>
      <ttcol>Name</ttcol>
      <ttcol>Type</ttcol>
      <ttcol>Description</ttcol>
      <c>destination</c>
      <c>String</c>
      <c>Target URL for the popup window.</c>
      <c>windowOptions</c>
      <c>String</c>
      <c>Options for window.open, used to specify look and feel of the
      window.</c>
      <c>openCallback</c>
      <c>Function</c>
      <c>Function to call when the window is opened.</c>
      <c>closeCallback</c>
      <c>Function</c>
      <c>Function to call when the window is closed.</c>
     </texttable></t>
    </section>
    <section title="Method Details">
     <section title="createOpenerOnClick"
              anchor="gadgets.oauth.Popup.createOpenerOnClick">
      <t>Type: {Function} createOpenerOnClick()</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Function</c>
       <c>an onclick handler for the "open the approval window" link.</c>
      </texttable></t>
     </section>
     <section title="createApprovedOnClick"
              anchor="gadgets.oauth.Popup.createApprovedOnClick">
      <t>Type: {Function} createApprovedOnClick()</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Function</c>
       <c>an onclick handler for the "I've approved" link. This may not ever be
       called. If we successfully detect that the window was closed, this link
       is unnecessary.</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.rpc"
            anchor="gadgets.rpc">
    <!-- ============================== class summary ========================== -->
    <t>Provides operations for making remote procedure calls for
    gadget-to-container, container-to-gadget, and gadget-to-gadget
    communication.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.rpc.ctor">
     <t>gadgets.rpc</t>
     <t></t>
    </section>
    <section title="Method Details">
     <section title="call"
              anchor="gadgets.rpc.call">
      <t>&lt;static&gt; gadgets.rpc.call(targetId, serviceName, callback,
      var_args)</t>
      <t>Description: Calls an RPC service.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>targetId</c>
       <c>String</c>
       <c>ID of the RPC service provider; empty if calling the parent
       container</c>
       <c>serviceName</c>
       <c>String</c>
       <c>Service name to call</c>
       <c>callback</c>
       <c>Function|null</c>
       <c>Callback function (if any) to process the return value of the RPC
       request. The callback function will not be called until after the
       existing callstack has completed execution.</c>
       <c>var_args</c>
       <c>*</c>
       <c>Parameters for the RPC request</c>
      </texttable></t>
     </section>
     <section title="register"
              anchor="gadgets.rpc.register">
      <t>&lt;static&gt; gadgets.rpc.register(serviceName, handler)</t>
      <t>Description: Registers an RPC service.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>serviceName</c>
       <c>String</c>
       <c>Service name to register</c>
       <c>handler</c>
       <c>Function</c>
       <c>Service handler</c>
      </texttable></t>
     </section>
     <section title="registerDefault"
              anchor="gadgets.rpc.registerDefault">
      <t>&lt;static&gt; gadgets.rpc.registerDefault(handler)</t>
      <t>Description: Registers a default service handler to process all
      unknown remote procedure calls, which fail silently by default.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>handler</c>
       <c>Function</c>
       <c>Service handler</c>
      </texttable></t>
     </section>
     <section title="unregister"
              anchor="gadgets.rpc.unregister">
      <t>&lt;static&gt; gadgets.rpc.unregister(serviceName)</t>
      <t>Description: Unregisters an RPC service.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>serviceName</c>
       <c>String</c>
       <c>Service name to unregister</c>
      </texttable></t>
     </section>
     <section title="unregisterDefault"
              anchor="gadgets.rpc.unregisterDefault">
      <t>&lt;static&gt; gadgets.rpc.unregisterDefault()</t>
      <t>Description: Unregisters the default service handler. Future unknown
      remote procedure calls will fail silently.</t>
     </section>
    </section>
   </section>
   <section title="gadgets.skins"
            anchor="gadgets.skins">
    <!-- ============================== class summary ========================== -->
    <t>Provides operations for getting display information about the currently
    shown skin.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.skins.ctor">
     <t>gadgets.skins</t>
     <t></t>
    </section>
    <section title="Method Details">
     <section title="getProperty"
              anchor="gadgets.skins.getProperty">
      <t>&lt;static&gt; Type: {String}
      gadgets.skins.getProperty(propertyKey)</t>
      <t>Description: Fetches the display property mapped to the given key.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>propertyKey</c>
       <c>String</c>
       <c>The key to get data for; keys are defined in 
       <xref target="gadgets.skins.Property">gadgets.skins.Property</xref> </c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The data</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.skins.Property"
            anchor="gadgets.skins.Property">
    <!-- ============================== class summary ========================== -->
    <t>All of the display values that can be fetched and used in the gadgets
    UI. These are the supported keys for the 
    <xref target="gadgets.skins.getProperty">
    gadgets.skins.getProperty()</xref> method.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.skins.Property.ctor">
     <t>gadgets.skins.Property</t>
     <t></t>
    </section>
    <section title="Field Details">
     <section title="ANCHOR_COLOR"
              anchor="gadgets.skins.Property.ANCHOR_COLOR">
      <t>&lt;static&gt; Member of: gadgets.skins.Property.ANCHOR_COLOR</t>
      <t>Description: The color that anchor tags should use. This field may be
      used interchangeably with the string 'ANCHOR_COLOR'.</t>
     </section>
     <section title="BG_COLOR"
              anchor="gadgets.skins.Property.BG_COLOR">
      <t>&lt;static&gt; Member of: gadgets.skins.Property.BG_COLOR</t>
      <t>Description: The color of the background of the gadget. This field may
      be used interchangeably with the string 'BG_COLOR'.</t>
     </section>
     <section title="BG_IMAGE"
              anchor="gadgets.skins.Property.BG_IMAGE">
      <t>&lt;static&gt; Member of: gadgets.skins.Property.BG_IMAGE</t>
      <t>Description: An image to use in the background of the gadget. This
      field may be used interchangeably with the string 'BG_IMAGE'.</t>
     </section>
     <section title="FONT_COLOR"
              anchor="gadgets.skins.Property.FONT_COLOR">
      <t>&lt;static&gt; Member of: gadgets.skins.Property.FONT_COLOR</t>
      <t>Description: The color in which the main font should be rendered. This
      field may be used interchangeably with the string 'FONT_COLOR'.</t>
     </section>
    </section>
   </section>
   <section title="gadgets.Tab"
            anchor="gadgets.Tab">
    <!-- ============================== class summary ========================== -->
    <t>Tab class for gadgets. You create tabs using the TabSet addTab() method.
    To get Tab objects, use the TabSet getSelectedTab() or getTabs() methods. 
    <t>See also: 
    <xref target="gadgets.TabSet">TabSet</xref> </t></t>
    <!-- ============================== constructor details ==================== -->
    <section title="Method Details">
     <section title="getCallback"
              anchor="gadgets.Tab.getCallback">
      <t>Type: {Function} getCallback()</t>
      <t>Description: Returns the callback function that is executed when the
      tab is selected.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Function</c>
       <c>The callback function of the tab</c>
      </texttable></t>
     </section>
     <section title="getContentContainer"
              anchor="gadgets.Tab.getContentContainer">
      <t>Type: {HTMLElement} getContentContainer()</t>
      <t>Description: Returns the HTML element where the tab content is
      rendered.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>HTMLElement</c>
       <c>The HTML element of the content container</c>
      </texttable></t>
     </section>
     <section title="getIndex"
              anchor="gadgets.Tab.getIndex">
      <t>Type: {Number} getIndex()</t>
      <t>Description: Returns the tab's index.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Number</c>
       <c>The tab's index</c>
      </texttable></t>
     </section>
     <section title="getName"
              anchor="gadgets.Tab.getName">
      <t>Type: {String} getName()</t>
      <t>Description: Returns the label of the tab as a string (may contain
      HTML).</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>The label of the tab</c>
      </texttable></t>
     </section>
     <section title="getNameContainer"
              anchor="gadgets.Tab.getNameContainer">
      <t>Type: {HTMLElement} getNameContainer()</t>
      <t>Description: Returns the HTML element that contains the tab's
      label.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>HTMLElement</c>
       <c>The HTML element of the tab's label</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.TabSet"
            anchor="gadgets.TabSet">
    <!-- ============================== class summary ========================== -->
    <t>A class gadgets can use to make tabs.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.TabSet.ctor">
     <t>gadgets.TabSet(opt_moduleId, opt_defaultTab, opt_container)</t>
     <t>Creates a new TabSet object</t>
     <t>Parameters:
     <texttable>
      <ttcol>Name</ttcol>
      <ttcol>Type</ttcol>
      <ttcol>Description</ttcol>
      <c>opt_moduleId</c>
      <c>String</c>
      <c>Optional suffix for the ID of tab container</c>
      <c>opt_defaultTab</c>
      <c>String</c>
      <c>Optional tab name that specifies the name of of the tab that is
      selected after initialization; if this parameter is omitted, the first
      tab is selected by default</c>
      <c>opt_container</c>
      <c>HTMLElement</c>
      <c>The HTML element to contain the tabs; if omitted, a new div element is
      created and inserted at the very top</c>
     </texttable></t>
    </section>
    <section title="Method Details">
     <section title="addTab"
              anchor="gadgets.TabSet.addTab">
      <t>Type: {String} addTab(tabName, opt_params)</t>
      <t>Description: Adds a new tab based on the name-value pairs specified in
      opt_params. The following properties are supported in opt_params: 
      <list style="hanging">
       <t hangText="contentContainer">An existing HTML element to be used as
       the tab content container. If omitted, the tabs library creates one.</t>
       <t hangText="callback">A callback function to be executed when the tab
       is selected. The callback function will not be called until after the
       existing callstack has completed execution.</t>
       <t hangText="tooltip">A tooltip description that pops up when user moves
       the mouse cursor over the tab.</t>
       <t hangText="index">The index at which to insert the tab. If omitted,
       the new tab is appended to the end.</t>
      </list></t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>tabName</c>
       <c>String</c>
       <c>Label of the tab to create</c>
       <c>opt_params</c>
       <c>Object</c>
       <c>Optional parameter object</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>String</c>
       <c>DOM id of the tab container</c>
      </texttable></t>
     </section>
     <section title="alignTabs"
              anchor="gadgets.TabSet.alignTabs">
      <t>alignTabs(align, opt_offset)</t>
      <t>Description: Sets the alignment of tabs. Tabs are center-aligned by
      default.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>align</c>
       <c>String</c>
       <c>'left', 'center', or 'right'</c>
       <c>opt_offset</c>
       <c>Number</c>
       <c>Optional parameter to set the number of pixels to offset tabs from
       the left or right edge; the default value is 3px</c>
      </texttable></t>
     </section>
     <section title="displayTabs"
              anchor="gadgets.TabSet.displayTabs">
      <t>displayTabs(display)</t>
      <t>Description: Shows or hides tabs and all associated content.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>display</c>
       <c>Boolean</c>
       <c>True to show tabs; false to hide tabs</c>
      </texttable></t>
     </section>
     <section title="getHeaderContainer"
              anchor="gadgets.TabSet.getHeaderContainer">
      <t>Type: {HTMLElement} getHeaderContainer()</t>
      <t>Description: Returns the tab headers container element.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>HTMLElement</c>
       <c>The tab headers container element</c>
      </texttable></t>
     </section>
     <section title="getSelectedTab"
              anchor="gadgets.TabSet.getSelectedTab">
      <t>Type: {
      <xref target="gadgets.Tab">gadgets.Tab</xref> } getSelectedTab()</t>
      <t>Description: Returns the currently selected tab object.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>
        <xref target="gadgets.Tab">gadgets.Tab</xref>
       </c>
       <c>The currently selected tab object</c>
      </texttable></t>
     </section>
     <section title="getTabs"
              anchor="gadgets.TabSet.getTabs">
      <t>Type: {Array.&lt;gadgets.Tab&gt;} getTabs()</t>
      <t>Description: Returns an array of all existing tab objects.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Array.&lt;gadgets.Tab&gt;</c>
       <c>Array of all existing tab objects</c>
      </texttable></t>
     </section>
     <section title="removeTab"
              anchor="gadgets.TabSet.removeTab">
      <t>removeTab(tabIndex)</t>
      <t>Description: Removes a tab at tabIndex and all of its associated
      content.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>tabIndex</c>
       <c>Number</c>
       <c>Index of the tab to remove</c>
      </texttable></t>
     </section>
     <section title="setSelectedTab"
              anchor="gadgets.TabSet.setSelectedTab">
      <t>setSelectedTab(tabIndex)</t>
      <t>Description: Selects the tab at tabIndex and fires the tab's callback
      function if it exists. If the tab is already selected, the callback is
      not fired.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>tabIndex</c>
       <c>Number</c>
       <c>Index of the tab to select</c>
      </texttable></t>
     </section>
     <section title="swapTabs"
              anchor="gadgets.TabSet.swapTabs">
      <t>swapTabs(tabIndex1, tabIndex2)</t>
      <t>Description: Swaps the positions of tabs at tabIndex1 and tabIndex2.
      The selected tab does not change, and no callback functions are
      called.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>tabIndex1</c>
       <c>Number</c>
       <c>Index of the first tab to swap</c>
       <c>tabIndex2</c>
       <c>Number</c>
       <c>Index of the secnod tab to swap</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="gadgets.window"
            anchor="gadgets.window">
    <!-- ============================== class summary ========================== -->
    <t>Provides operations for getting information about and modifying the
    window the gadget is placed in.</t>
    <!-- ============================== constructor details ==================== -->
    <section title="Constructor"
             anchor="gadgets.window.ctor">
     <t>gadgets.window</t>
     <t></t>
    </section>
    <section title="Method Details">
     <section title="adjustHeight"
              anchor="gadgets.window.adjustHeight">
      <t>&lt;static&gt; gadgets.window.adjustHeight(opt_height)</t>
      <t>Description: Adjusts the gadget height.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>opt_height</c>
       <c>Number</c>
       <c>An optional preferred height in pixels; If not specified, will
       attempt to fit the gadget to its content</c>
      </texttable></t>
     </section>
     <section title="getViewportDimensions"
              anchor="gadgets.window.getViewportDimensions">
      <t>&lt;static&gt; Type: {Object}
      gadgets.window.getViewportDimensions()</t>
      <t>Description: Detects the inner dimensions of a frame. See 
      <eref target="http://www.quirksmode.org/dom/w3c_cssom">
      http://www.quirksmode.org/dom/w3c_cssom</eref> for more information.</t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>Object</c>
       <c>An object with width and height properties</c>
      </texttable></t>
     </section>
     <section title="setTitle"
              anchor="gadgets.window.setTitle">
      <t>&lt;static&gt; gadgets.window.setTitle(title)</t>
      <t>Description: Sets the gadget title.</t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>title</c>
       <c>String</c>
       <c>The preferred title</c>
      </texttable></t>
     </section>
    </section>
   </section>
   <section title="JavaScript Internationalization (i18n)">
    <t>A container MUST emit the OpenSocial JavaScript internationalization
    libraries and data files required by the libraries if an application
    requires the feature &lt;Require feature="opensocial-i18n"/&gt;. The
    container SHOULD emit the OpenSocial JavaScript internationalization
    libraries and data files required by the libraries if an application
    optionallly requests the feature &lt;Optional
    feature="opensocial-i18n"/&gt;.</t>
    <section title="gadgets.i18n"
             anchor="gadgets.i18n">
     <!-- ============================== class summary ========================== -->
     <t>Class for internationalization features.</t>
    </section>
    <section title="Formatting/Parsing using Predefined Patterns is Done within Default Locale">
     <t>Gadgets locale is set at render time. The i18n package above will use
     getCountry and getLanguage to load the corresponding formatter/parser for
     that locale if any of the functions in the package are invoked. For
     example, let's say gadgets has lanuguage as french and country as france,
     the i18n package will use formatter/parser following french conventions by
     default. That means gadget developers could format/parse French
     date/time/number/currency using the predefined CURRENCY_PATTERN. 
     <figure>
      <preamble>Example</preamble>
      <artwork xml:space="preserve">
           
gadgets.i18n.parseNumber(gadgets.i18n.CURRENCY_PATTERN, "20 000 \u20AC"); // will return 20000
</artwork>
     </figure>They could also parse foreign currency by passing in a
     opt_currencyCode. Note when French writes an amount of foreign currency,
     they will still use the French way of writing numbers the positioning
     currency code - just the currency code is different. 
     <figure>
      <preamble>Example</preamble>
      <artwork xml:space="preserve">
           
gadgets.i18n.parseNumber(gadgets.i18n.CURRENCY_PATTERN, "20 000 $", 0, "USD"); // will return 20000
</artwork>
     </figure>It gets a little bit complicated if a foreign currency written in
     the foreign way is to be parsed. In that case, predefined patterns won't
     work, and string patterns need to be used. The example below returns 0
     (indicating error in parsing), as the number presented is not in French
     format. 
     <figure>
      <preamble>Example</preamble>
      <artwork xml:space="preserve">
           
gadgets.i18n.parseNumber(gadgets.i18n.CURRENCY_PATTERN, "$20,000"); // will return 0, indicating error
</artwork>
     </figure>To make this work, a string pattern needs to be passed in, like
     what is done below: 
     <figure>
      <preamble>Example</preamble>
      <artwork xml:space="preserve">
           
gadgets.i18n.parseNumber("#,###", "$20,000", 0, "USD"); // will return 20000
</artwork>
     </figure></t>
    </section>
    <section title="Pattern Specification">
     <section title="Date/Time Pattern Specification">
      <t>Both Formatting and Parsing following the same pattern specification.
      The date/time pattern specifications are found in 
      <eref target="http://www.unicode.org/reports/tr35/#Date_Format_Patterns">
      Unicode Locale Data Markup Language, Date Format Patterns</eref> The
      following specifiers are not required in this release: 
      <list style="symbols">
       <t>w: Week of year</t>
       <t>W: Week of Month.</t>
       <t>D: Day of year.</t>
       <t>F: Day of Week in Month.</t>
       <t>g: Modified Julian day</t>
      </list></t>
     </section>
     <section title="Number Pattern Specification">
      <t>Many characters in a pattern are taken literally; they are matched
      during parsing and output unchanged during formatting. Special
      characters, on the other hand, stand for other characters, strings, or
      classes of characters. For example, the '#' character is replaced by a
      localized digit. Often the replacement character is the same as the
      pattern character; in the U.S. locale, the ',' grouping character is
      replaced by ','. However, the replacement is still happening, and if the
      symbols are modified, the grouping character changes. Some special
      characters affect the behavior of the formatter by their presence; for
      example, if the percent character is seen, then the value is multiplied
      by 100 before being displayed.</t>
      <t>To insert a special character in a pattern as a literal, that is,
      without any special meaning, the character must be quoted. There are some
      exceptions to this which are noted below.</t>
      <t>The characters listed here are used in non-localized patterns.
      Localized patterns use the corresponding characters taken from
      corresponding locale symbol collection. Two exceptions are the currency
      sign and quote, which are not localized. 
      <texttable>
       <ttcol>Symbol</ttcol>
       <ttcol>Location</ttcol>
       <ttcol>Localized?</ttcol>
       <ttcol>Meaning</ttcol>
       <c>0</c>
       <c>Number</c>
       <c>Yes</c>
       <c>Digit</c>
       <c>#</c>
       <c>Number</c>
       <c>Yes</c>
       <c>Digit, zero shows as absent.</c>
       <c>.</c>
       <c>Number</c>
       <c>Yes</c>
       <c>Decimal separator or monetary decimal separator.</c>
       <c>-</c>
       <c>Number</c>
       <c>Yes</c>
       <c>Minus sign</c>
       <c>,</c>
       <c>Number</c>
       <c>Yes</c>
       <c>Grouping Separator</c>
       <c>E</c>
       <c>Number</c>
       <c>Yes</c>
       <c>Separates mantizza and exponent in scientific notation. Need not be
       quoted in prefix or suffix.</c>
       <c>;</c>
       <c>Subpattern boundary</c>
       <c>Yes</c>
       <c>Separates positive and negative subpatterns.</c>
       <c>%</c>
       <c>Prefix or suffix</c>
       <c>Yes</c>
       <c>Multiply by 100 and show as percentage.</c>
       <c>\u2030</c>
       <c>Prefix or suffix</c>
       <c>Yes</c>
       <c>Multiply by 1000 and show as per mile.</c>
       <c>¤ (\u00A4)</c>
       <c>Prefix or suffix</c>
       <c>No</c>
       <c>Currency sign, replaced by currency symbol. If doubled, replaced by
       international currency symbol. If present in a pattern, the monetary
       decimal separator is used instead of the decimal separator.</c>
       <c>'</c>
       <c>Prefix or suffix</c>
       <c>No</c>
       <c>Used to quote special characters in a prefix or suffix, for example,
       "'#'#" formats 123 to "#123". To create a single quote itself, use two
       in a row: "# o''clock".</c>
      </texttable>A NumberFormat pattern contains a postive and negative
      subpattern, for example, "#,##0.00;(#,##0.00)". Each subpattern has a
      prefix, a numeric part, and a suffix. If there is no explicit negative
      subpattern, the negative subpattern is the localized minus sign prefixed
      to the positive subpattern. That is, "0.00" alone is equivalent to
      "0.00;-0.00". If there is an explicit negative subpattern, it serves only
      to specify the negative prefix and suffix; the number of digits, minimal
      digits, and other characteristics are ignored in the negative subpattern.
      That means that "#,##0.0#;(#)" has precisely the same result as
      "#,##0.0#;(#,##0.0#)".</t>
      <t>The prefixes, suffixes, and various symbols used for infinity, digits,
      thousands separators, decimal separators, etc. may be set to arbitrary
      values, and they will appear properly during formatting. However, care
      must be taken that the symbols and strings do not conflict, or parsing
      will be unreliable. For example, the decimal separator and thousands
      separator should be distinct characters, or parsing will be
      impossible.</t>
      <t>The grouping separator is a character that separates clusters of
      integer digits to make large numbers more legible. It commonly used for
      thousands, but in some locales it separates ten-thousands. The grouping
      size is the number of digits between the grouping separators, such as 3
      for "100,000,000" or 4 for "1 0000 0000".</t>
      <section title="Pattern BNF">
       <t>
       <figure>
        <artwork xml:space="preserve">
 pattern := subpattern (';' subpattern)?
subpattern := prefix? number exponent? suffix?
 number :=
(integer ('.' fraction)?) | sigDigits
 prefix :=
'\u0000'..'\uFFFD' - specialCharacters
 suffix :=
'\u0000'..'\uFFFD' - specialCharacters
 integer := '#'* '0'*
'0'
 fraction := '0'* '#'*
 sigDigits := '#'* '@'
'@'* '#'*
 exponent := 'E' '+'? '0'* '0'
 padSpec
:= '*' padChar
 padChar := '\u0000'..'\uFFFD' -
quote
 
 Notation:
 X* 0 or more
instances of X
 X? 0 or 1 instances of X
 X|Y
either X or Y
 C..D any character from C up to D,
inclusive
 S-T characters in S, except those in T
</artwork>
       </figure>The first subpattern is for positive numbers. The second
       (optional) subpattern is for negative numbers.</t>
      </section>
     </section>
    </section>
    <section title="Field Details">
     <section title="CURRENCY_PATTERN"
              anchor="gadgets.i18n.CURRENCY_PATTERN">
      <t>&lt;static&gt; Member of: gadgets.i18n.CURRENCY_PATTERN</t>
      <t>Description: Pattern for currency.</t>
     </section>
     <section title="DECIMAL_PATTERN"
              anchor="gadgets.i18n.DECIMAL_PATTERN">
      <t>&lt;static&gt; Member of: gadgets.i18n.DECIMAL_PATTERN</t>
      <t>Description: Pattern for decimal numbers.</t>
     </section>
     <section title="FULL_DATE_FORMAT"
              anchor="gadgets.i18n.FULL_DATE_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.FULL_DATE_FORMAT</t>
      <t>Description: Format for full representations of dates.</t>
     </section>
     <section title="FULL_DATETIME_FORMAT"
              anchor="gadgets.i18n.FULL_DATETIME_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.FULL_DATETIME_FORMAT</t>
      <t>Description: Format for short representations of datetimes.</t>
     </section>
     <section title="FULL_TIME_FORMAT"
              anchor="gadgets.i18n.FULL_TIME_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.FULL_TIME_FORMAT</t>
      <t>Description: Format for full representations of times.</t>
     </section>
     <section title="LONG_DATE_FORMAT"
              anchor="gadgets.i18n.LONG_DATE_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.LONG_DATE_FORMAT</t>
      <t>Description: Format for long representations of dates.</t>
     </section>
     <section title="LONG_DATETIME_FORMAT"
              anchor="gadgets.i18n.LONG_DATETIME_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.LONG_DATETIME_FORMAT</t>
      <t>Description: Format for short representations of datetimes.</t>
     </section>
     <section title="LONG_TIME_FORMAT"
              anchor="gadgets.i18n.LONG_TIME_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.LONG_TIME_FORMAT</t>
      <t>Description: Format for long representations of times.</t>
     </section>
     <section title="MEDIUM_DATE_FORMAT"
              anchor="gadgets.i18n.MEDIUM_DATE_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.MEDIUM_DATE_FORMAT</t>
      <t>Description: Format for medium representations of dates.</t>
     </section>
     <section title="MEDIUM_DATETIME_FORMAT"
              anchor="gadgets.i18n.MEDIUM_DATETIME_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.MEDIUM_DATETIME_FORMAT</t>
      <t>Description: Format for medium representations of datetimes.</t>
     </section>
     <section title="MEDIUM_TIME_FORMAT"
              anchor="gadgets.i18n.MEDIUM_TIME_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.MEDIUM_TIME_FORMAT</t>
      <t>Description: Format for medium representations of times.</t>
     </section>
     <section title="PERCENT_PATTERN"
              anchor="gadgets.i18n.PERCENT_PATTERN">
      <t>&lt;static&gt; Member of: gadgets.i18n.PERCENT_PATTERN</t>
      <t>Description: Pattern for percentages.</t>
     </section>
     <section title="SCIENTIFIC_PATTERN"
              anchor="gadgets.i18n.SCIENTIFIC_PATTERN">
      <t>&lt;static&gt; Member of: gadgets.i18n.SCIENTIFIC_PATTERN</t>
      <t>Description: Pattern for scientific numbers.</t>
     </section>
     <section title="SHORT_DATE_FORMAT"
              anchor="gadgets.i18n.SHORT_DATE_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.SHORT_DATE_FORMAT</t>
      <t>Description: Format for short representations of dates.</t>
     </section>
     <section title="SHORT_DATETIME_FORMAT"
              anchor="gadgets.i18n.SHORT_DATETIME_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.SHORT_DATETIME_FORMAT</t>
      <t>Description: Format for short representations of datetimes.</t>
     </section>
     <section title="SHORT_TIME_FORMAT"
              anchor="gadgets.i18n.SHORT_TIME_FORMAT">
      <t>&lt;static&gt; Member of: gadgets.i18n.SHORT_TIME_FORMAT</t>
      <t>Description: Format for short representations of times.</t>
     </section>
    </section>
    <section title="Method Details">
     <section title="formatDateTime"
              anchor="gadgets.i18n.formatDateTime">
      <t>&lt;static&gt; Type: {string} gadgets.i18n.formatDateTime(pattern,
      date)</t>
      <t>Description: This method formats a "Date" object with provided pattern
      specification. The pattern could be a string using ICU notation or a
      predefined pattern. A string using ICU notation offers the most
      flexibility. Each field as specified in the pattern has locale specific
      behavior. The pattern string is allowed to contain string literals, and
      one type of pattern might not work for all locales. In those case, the
      pattern itself could also be locale specific, thus not good for sharing
      among locales. 
      <figure>
       <preamble>Example</preamble>
       <artwork xml:space="preserve">
date = new Date(2006, 6, 27, 13, 10, 10, 250);
assertEquals("13:10:10", gadgets.i18n.formatDateTime("HH:mm:ss", date));
</artwork>
      </figure></t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>pattern</c>
       <c>string/number</c>
       <c>String to specify patterns or Number used to reference predefined
       pattern that a date should be formatted into.</c>
       <c>date</c>
       <c>Date</c>
       <c>Date object being formatted.</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>string</c>
       <c>string representation of date/time.</c>
      </texttable></t>
     </section>
     <section title="formatNumber"
              anchor="gadgets.i18n.formatNumber">
      <t>&lt;static&gt; Type: {string} gadgets.i18n.formatNumber(pattern,
      value, opt_currencyCode)</t>
      <t>Description: Format number using the pattern specified. The pattern
      could be a string pattern or one of the predefined patterns. The
      formatted string is returned. If an error is encountered, zero will be
      returned. 
      <figure>
       <preamble>Example</preamble>
       <artwork xml:space="preserve">
var str = gadgets.i18n.formatNumber("#,###", 1234567890);
assertEquals("1,234,567,890", str);
var str = gadgets.i18n.formatNumber(gadgets.i18n.CURRRENCY_PATTERN, 1234.569);
assertEquals("$1,234.58", str);
</artwork>
      </figure></t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>pattern</c>
       <c>string/number</c>
       <c>String to specify patterns or Number used to reference predefined
       pattern that a number should be formatted into.</c>
       <c>value</c>
       <c>number</c>
       <c>The number being formatted.</c>
       <c>opt_currencyCode</c>
       <c>string</c>
       <c>optional international currency code, it determines the currency
       code/symbol should be used in format/parse. If not given, the currency
       code for current locale will be used.</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>string</c>
       <c>The formatted string.</c>
      </texttable></t>
     </section>
     <section title="parseDateTime"
              anchor="gadgets.i18n.parseDateTime">
      <t>&lt;static&gt; Type: {number} gadgets.i18n.parseDateTime(pattern,
      text, start, date)</t>
      <t>Description: This method will parse the input string ("text"),
      interpretting it as specified by pattern. The parsed result will be saved
      into a Date object ("date"). "start" indicates from where in the string
      the parse should start. This method returns the number of characters
      consumed. 
      <figure>
       <preamble>Example</preamble>
       <artwork xml:space="preserve">
assertTrue(gadgets.i18n.parseDateTime("yyMMdd", "991202", 0, date) &gt; 0);
assertEquals(1999, date.getFullYear());
assertTrue(date.getMonth() == 12 - 1);
assertTrue(date.getDate() == 02);
assertTrue(gadgets.i18n.parseDateTime("yyyyMMdd", "20051202", 0, date) &gt; 0);
assertEquals(2005, date.getFullYear());
assertTrue(date.getMonth() == 12 - 1);
assertTrue(date.getDate() == 02);   
</artwork>
      </figure>A whole piece of string is usually the target for parsing. But
      in some cases, you might just want to parse part of the string, "start"
      parameter and return value also make it very convenient. For example,
      suppose you want to parse a string like "88/01, 99/03, 98/05, 97/02", the
      following code will do the job. 
      <figure>
       <preamble>Example</preamble>
       <artwork xml:space="preserve">
var date_array = []
var pos = 0;
var text = "88/01, 99/03, 98/05, 97/02";
while(1) {
 var date = new Date;
    var consumed = gadgets.i18n.parseDateTime("yy/MM", text, pos, date);
    if (consumed &lt;= 0) break;
    date_array.push(date);
    pos += consumed;
    if (pos &lt; text.length &amp;&amp; text[pos] == ',') ++pos;
    if (pos &lt; text.length &amp;&amp; text[pos] == ' ') ++pos;
}
</artwork>
      </figure>Similar to the formatting functions, a predefined pattern could
      also be passed in as the first parameter. 
      <figure>
       <preamble>Example</preamble>
       <artwork xml:space="preserve">
//assume locale has already been set to zh_CN
var date = new Date();
gadgets.i18n.parseDateTime(gadgets.i18n.LONG_DATE_FORMAT, "2006年7月24日", 0, date);
assertEquals(date.getFullYear(), 2006);
assertEquals(date.getMonth(), 7 - 1);
assertEquals(date.getDate(), 24);
</artwork>
      </figure></t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>pattern</c>
       <c>string/number</c>
       <c>String to specify patterns or Number used to reference predefined
       pattern that a date should be parsed from.</c>
       <c>text</c>
       <c>string</c>
       <c>The string that need to be parsed.</c>
       <c>start</c>
       <c>number</c>
       <c>The character position in "text" where parse begins.</c>
       <c>date</c>
       <c>Date</c>
       <c>The date object that will hold parsed value.</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>number</c>
       <c>The number of characters advanced or 0 if failed.</c>
      </texttable></t>
     </section>
     <section title="parseNumber"
              anchor="gadgets.i18n.parseNumber">
      <t>&lt;static&gt; Type: {number} gadgets.i18n.parseNumber(pattern, text,
      opt_pos, opt_currencyCode)</t>
      <t>Description: Parse string to get a number the pattern specified. The
      pattern could be a string pattern or one of the predefined patterns. 
      <figure>
       <preamble>Example</preamble>
       <artwork xml:space="preserve">
var value = gadgets.i18n.parseNumber("0E0", "1.2345E+4");
assertEquals(12345.0, value);
//assume locale has already been set to fr
var value = gadgets.i18n.parseNumber(gadgets.i18n.CURRENCY_PATTERN, "0,30 €");
assertEquals(0.30, value);
</artwork>
      </figure></t>
      <t>Parameters: 
      <texttable>
       <ttcol>Name</ttcol>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>pattern</c>
       <c>string/number</c>
       <c>String to specify patterns or Number used to reference predefined
       pattern that a number should be parsed from.</c>
       <c>text</c>
       <c>string</c>
       <c>input text being parsed.</c>
       <c>opt_pos</c>
       <c>Array</c>
       <c>optional one element array that holds position information. It tells
       from where parse should begin. Upon return, it holds parse stop
       position.</c>
       <c>opt_currencyCode</c>
       <c>string</c>
       <c>optional international currency code, it determines the currency
       code/symbol should be used in format/parse. If not given, the currency
       code for current locale will be used.</c>
      </texttable></t>
      <t>Returns:
      <texttable>
       <ttcol>Type</ttcol>
       <ttcol>Description</ttcol>
       <c>number</c>
       <c>Parsed number, 0 if in error.</c>
      </texttable></t>
     </section>
    </section>
   </section>
  </section>
 </middle>
 <back>
  <section title="Gadgets Extended XSD"
           anchor="gadgetsExtendedXSD">
   <t>
    <figure>
     <artwork xml:space="preserve">
&lt;?xml version="1.0"?&gt;
&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;xs:element name="Module"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="ModulePrefs" minOccurs="0"&gt;
          &lt;xs:complexType&gt;
            &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
              &lt;xs:element name="Require" type="GadgetFeatureType"/&gt;
              &lt;xs:element name="Optional" type="GadgetFeatureType"/&gt;
              &lt;xs:element name="Preload"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:attribute name="href" type="xs:string" use="required"/&gt;
                  &lt;xs:attribute name="authz" default="none"&gt;
                    &lt;xs:simpleType&gt;
                      &lt;xs:restriction base="xs:string"&gt;
                        &lt;xs:enumeration value="none"/&gt;
                        &lt;xs:enumeration value="signed"/&gt;
                        &lt;xs:enumeration value="oauth"/&gt;
                      &lt;/xs:restriction&gt;
                    &lt;/xs:simpleType&gt;
                  &lt;/xs:attribute&gt;
                  &lt;xs:attribute name="sign_owner" type="xs:boolean" default="true"/&gt;
                  &lt;xs:attribute name="sign_viewer" type="xs:boolean" default="true"/&gt;
                  &lt;xs:attribute name="views" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="oauth_service_name" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="oauth_token_name" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="oauth_request_token" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="oauth_request_token_secret" type="xs:string" use="optional"/&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="Icon"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:simpleContent&gt;
                    &lt;xs:extension base="xs:string"&gt;
                      &lt;xs:attribute name="mode"&gt;
                        &lt;xs:simpleType&gt;
                          &lt;xs:restriction base="xs:string"&gt;
                            &lt;xs:enumeration value="base64"/&gt;
                          &lt;/xs:restriction&gt;
                        &lt;/xs:simpleType&gt;
                      &lt;/xs:attribute&gt;
                      &lt;xs:attribute name="type" type="xs:string"/&gt;
                    &lt;/xs:extension&gt;
                  &lt;/xs:simpleContent&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="Locale"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:sequence&gt;
                    &lt;xs:element name="msg" minOccurs="0" maxOccurs="unbounded"&gt;
                      &lt;xs:complexType&gt;
                        &lt;xs:simpleContent&gt;
                          &lt;xs:extension base="xs:string"&gt;
                            &lt;xs:attribute name="name" type="xs:string" use="required"/&gt;
                            &lt;xs:attribute name="desc" type="xs:string" use="optional"/&gt;
                          &lt;/xs:extension&gt;
                        &lt;/xs:simpleContent&gt;
                      &lt;/xs:complexType&gt;
                    &lt;/xs:element&gt;
                  &lt;/xs:sequence&gt;
                  &lt;xs:attribute name="lang" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="country" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="messages" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="language_direction"&gt;
                    &lt;xs:simpleType&gt;
                      &lt;xs:restriction base="xs:string"&gt;
                        &lt;xs:enumeration value="ltr"/&gt;
                        &lt;xs:enumeration value="rtl"/&gt;
                      &lt;/xs:restriction&gt;
                    &lt;/xs:simpleType&gt;
                  &lt;/xs:attribute&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="Link"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:attribute name="href" type="xs:string" use="required"/&gt;
                  &lt;xs:attribute name="rel" type="xs:string" use="required"&gt;
                    &lt;xs:simpleType&gt;
                      &lt;xs:restriction base="xs:string"&gt;
                        &lt;xs:enumeration value="gadgets.help"/&gt;
                        &lt;xs:enumeration value="gadgets.support"/&gt;
                        &lt;xs:enumeration value="icon"/&gt;
                      &lt;/xs:restriction&gt;
                    &lt;/xs:simpleType&gt;
                  &lt;/xs:attribute&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="OAuth" minOccurs="0" maxOccurs="1"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:sequence&gt;
                    &lt;xs:element name="Service" maxOccurs="unbounded"&gt;
                      &lt;xs:complexType&gt;
                        &lt;xs:sequence&gt;
                          &lt;xs:element name="Request" type="OAuthResourceType" minOccurs="0"/&gt;
                          &lt;xs:element name="Access" type="OAuthResourceType" minOccurs="0"/&gt;
                          &lt;xs:element name="Authorization" minOccurs="0"&gt;
                            &lt;xs:complexType&gt;
                              &lt;xs:attribute name="url" type="xs:string" use="required"/&gt;
                            &lt;/xs:complexType&gt;
                          &lt;/xs:element&gt;
                        &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                    &lt;/xs:element&gt;
                  &lt;/xs:sequence&gt;
                  &lt;xs:attribute name="name" type="xs:string" use="optional"/&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
            &lt;/xs:choice&gt;
            &lt;xs:attribute name="title" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="title_url" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="description" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author_email" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="screenshot" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="thumbnail" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="directory_title" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author_affiliation" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author_location" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author_photo" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author_aboutme" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author_quote" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author_link" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="show_stats" type="xs:boolean" use="optional"/&gt;
            &lt;xs:attribute name="show_in_directory" type="xs:boolean" use="optional"/&gt;
            &lt;xs:attribute name="string" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="width" type="xs:int" use="optional"/&gt;
            &lt;xs:attribute name="height" type="xs:int" use="optional"/&gt;
            &lt;xs:attribute name="category" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="category2" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="singleton" type="xs:boolean" use="optional"/&gt;
            &lt;xs:attribute name="render_inline" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="scaling" type="xs:boolean" use="optional"/&gt;
            &lt;xs:attribute name="scrolling" type="xs:boolean" use="optional"/&gt;
          &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
        &lt;xs:element name="UserPref" minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:complexType&gt;
            &lt;xs:sequence&gt;
              &lt;xs:element name="EnumValue" minOccurs="0" maxOccurs="unbounded"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:attribute name="value" type="xs:string" use="required"/&gt;
                  &lt;xs:attribute name="display_value" type="xs:string" use="optional"/&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
            &lt;/xs:sequence&gt;
            &lt;xs:attribute name="name" type="xs:string" use="required"/&gt;
            &lt;xs:attribute name="display_name" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="default_value" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="required" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="datatype" default="string"&gt;
              &lt;xs:simpleType&gt;
                &lt;xs:restriction base="xs:string"&gt;
                  &lt;xs:enumeration value="string"/&gt;
                  &lt;xs:enumeration value="hidden"/&gt;
                  &lt;xs:enumeration value="bool"/&gt;
                  &lt;xs:enumeration value="enum"/&gt;
                  &lt;xs:enumeration value="list"/&gt;
                  &lt;xs:enumeration value="number"/&gt;
                  &lt;xs:enumeration value="location"/&gt;
                &lt;/xs:restriction&gt;
              &lt;/xs:simpleType&gt;
            &lt;/xs:attribute&gt;
            &lt;xs:attribute name="urlparam" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="autocomplete_url" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="num_minval" type="xs:double" use="optional"/&gt;
            &lt;xs:attribute name="num_maxval" type="xs:double" use="optional"/&gt;
            &lt;xs:attribute name="str_maxlen" type="xs:int" use="optional"/&gt;
            &lt;xs:attribute name="restrict_to_completions" type="xs:boolean" use="optional"/&gt;
            &lt;xs:attribute name="prefix_match" type="xs:boolean" use="optional"/&gt;
            &lt;xs:attribute name="publish" type="xs:boolean" use="optional"/&gt;
            &lt;xs:attribute name="listen" type="xs:boolean" use="optional"/&gt;
            &lt;xs:attribute name="on_change" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="group" type="xs:string" use="optional"/&gt;
          &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
        &lt;xs:element name="Content" minOccurs="1" maxOccurs="unbounded"&gt;
          &lt;xs:complexType&gt;
            &lt;xs:simpleContent&gt;
              &lt;xs:extension base="xs:string"&gt;
                &lt;xs:attribute name="type" use="optional" default="html"&gt;
                  &lt;xs:simpleType&gt;
                    &lt;xs:restriction base="xs:string"&gt;
                      &lt;xs:enumeration value="html"/&gt;
                      &lt;xs:enumeration value="url"/&gt;
                      &lt;xs:enumeration value="html-inline"/&gt;
                    &lt;/xs:restriction&gt;
                  &lt;/xs:simpleType&gt;
                &lt;/xs:attribute&gt;
                &lt;xs:attribute name="href" type="xs:string" use="optional"/&gt;
                &lt;xs:attribute name="view" type="xs:string" use="optional"/&gt;
                &lt;xs:attribute name="preferred_height" type="xs:integer" use="optional"/&gt;
                &lt;xs:attribute name="preferred_width" type="xs:integer" use="optional"/&gt;
              &lt;/xs:extension&gt;
            &lt;/xs:simpleContent&gt;
          &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:complexType name="GadgetFeatureType"&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element name="Param" minOccurs="0" maxOccurs="unbounded"&gt;
        &lt;xs:complexType&gt;
          &lt;xs:simpleContent&gt;
            &lt;xs:extension base="xs:string"&gt;
              &lt;xs:attribute name="name" type="xs:string" use="required"/&gt;
            &lt;/xs:extension&gt;
          &lt;/xs:simpleContent&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
    &lt;/xs:sequence&gt;
    &lt;xs:attribute name="feature" type="xs:string" use="required"/&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="OAuthResourceType"&gt;
    &lt;xs:attribute name="url" type="xs:string" use="required"/&gt;
    &lt;xs:attribute name="method" use="optional" default="GET"&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:restriction base="xs:string"&gt;
          &lt;xs:enumeration value="GET"/&gt;
          &lt;xs:enumeration value="POST"/&gt;
        &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:attribute&gt;
    &lt;xs:attribute name="param_location" use="optional" default="header"&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:restriction base="xs:string"&gt;
          &lt;xs:enumeration value="header"/&gt;
          &lt;xs:enumeration value="url"/&gt;
          &lt;xs:enumeration value="body"/&gt;
        &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:attribute&gt;
  &lt;/xs:complexType&gt;
&lt;/xs:schema&gt;
</artwork>
    </figure>
   </t>
  </section>
  <section title="Canonical Gadget XSD"
           anchor="canonicalGadgetXSD">
   <t>
    <figure>
     <artwork xml:space="preserve">
&lt;?xml version="1.0"?&gt;
&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;xs:element name="Module"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="ModulePrefs" minOccurs="0"&gt;
          &lt;xs:complexType&gt;
            &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
              &lt;xs:element name="Require" type="GadgetFeatureType"/&gt;
              &lt;xs:element name="Optional" type="GadgetFeatureType"/&gt;
              &lt;xs:element name="Preload"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:attribute name="href" type="xs:string" use="required"/&gt;
                  &lt;xs:attribute name="authz" default="none"&gt;
                    &lt;xs:simpleType&gt;
                      &lt;xs:restriction base="xs:string"&gt;
                        &lt;xs:enumeration value="none"/&gt;
                        &lt;xs:enumeration value="signed"/&gt;
                        &lt;xs:enumeration value="oauth"/&gt;
                      &lt;/xs:restriction&gt;
                    &lt;/xs:simpleType&gt;
                  &lt;/xs:attribute&gt;
                  &lt;xs:attribute name="sign_owner" type="xs:boolean" default="true"/&gt;
                  &lt;xs:attribute name="sign_viewer" type="xs:boolean" default="true"/&gt;
                  &lt;xs:attribute name="views" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="oauth_service_name" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="oauth_token_name" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="oauth_request_token" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="oauth_request_token_secret" type="xs:string" use="optional"/&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="Icon"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:simpleContent&gt;
                    &lt;xs:extension base="xs:string"&gt;
                      &lt;xs:attribute name="mode"&gt;
                        &lt;xs:simpleType&gt;
                          &lt;xs:restriction base="xs:string"&gt;
                            &lt;xs:enumeration value="base64"/&gt;
                          &lt;/xs:restriction&gt;
                        &lt;/xs:simpleType&gt;
                      &lt;/xs:attribute&gt;
                      &lt;xs:attribute name="type" type="xs:string"/&gt;
                    &lt;/xs:extension&gt;
                  &lt;/xs:simpleContent&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="Locale"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:sequence&gt;
                    &lt;xs:element name="msg" minOccurs="0" maxOccurs="unbounded"&gt;
                      &lt;xs:complexType&gt;
                        &lt;xs:simpleContent&gt;
                          &lt;xs:extension base="xs:string"&gt;
                            &lt;xs:attribute name="name" type="xs:string" use="required"/&gt;
                            &lt;xs:attribute name="desc" type="xs:string" use="optional"/&gt;
                          &lt;/xs:extension&gt;
                        &lt;/xs:simpleContent&gt;
                      &lt;/xs:complexType&gt;
                    &lt;/xs:element&gt;
                  &lt;/xs:sequence&gt;
                  &lt;xs:attribute name="lang" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="country" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="messages" type="xs:string" use="optional"/&gt;
                  &lt;xs:attribute name="language_direction"&gt;
                    &lt;xs:simpleType&gt;
                      &lt;xs:restriction base="xs:string"&gt;
                        &lt;xs:enumeration value="ltr"/&gt;
                        &lt;xs:enumeration value="rtl"/&gt;
                      &lt;/xs:restriction&gt;
                    &lt;/xs:simpleType&gt;
                  &lt;/xs:attribute&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="Link"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:attribute name="href" type="xs:string" use="required"/&gt;
                  &lt;xs:attribute name="rel" type="xs:string" use="required"&gt;
                    &lt;xs:simpleType&gt;
                      &lt;xs:restriction base="xs:string"&gt;
                        &lt;xs:enumeration value="gadgets.help"/&gt;
                        &lt;xs:enumeration value="gadgets.support"/&gt;
                        &lt;xs:enumeration value="icon"/&gt;
                      &lt;/xs:restriction&gt;
                    &lt;/xs:simpleType&gt;
                  &lt;/xs:attribute&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="OAuth" minOccurs="0" maxOccurs="1"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:sequence&gt;
                    &lt;xs:element name="Service" maxOccurs="unbounded"&gt;
                      &lt;xs:complexType&gt;
                        &lt;xs:sequence&gt;
                          &lt;xs:element name="Request" type="OAuthResourceType" minOccurs="0"/&gt;
                          &lt;xs:element name="Access" type="OAuthResourceType" minOccurs="0"/&gt;
                          &lt;xs:element name="Authorization" minOccurs="0"&gt;
                            &lt;xs:complexType&gt;
                              &lt;xs:attribute name="url" type="xs:string" use="required"/&gt;
                            &lt;/xs:complexType&gt;
                          &lt;/xs:element&gt;
                        &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                    &lt;/xs:element&gt;
                  &lt;/xs:sequence&gt;
                  &lt;xs:element name="Rating"&gt;
                    &lt;xs:complexType&gt;
                      &lt;xs:attribute name="scheme" type="xs:anyURI" use="optional" default=""/&gt;
                    &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
                  &lt;xs:attribute name="name" type="xs:string" use="optional"/&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
            &lt;/xs:choice&gt;
            &lt;xs:attribute name="title" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="title_url" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="description" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="author_email" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="screenshot" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="thumbnail" type="xs:string" use="optional"/&gt;
          &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
        &lt;xs:element name="UserPref" minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:complexType&gt;
            &lt;xs:sequence&gt;
              &lt;xs:element name="EnumValue" minOccurs="0" maxOccurs="unbounded"&gt;
                &lt;xs:complexType&gt;
                  &lt;xs:attribute name="value" type="xs:string" use="required"/&gt;
                  &lt;xs:attribute name="display_value" type="xs:string" use="optional"/&gt;
                &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
            &lt;/xs:sequence&gt;
            &lt;xs:attribute name="name" type="xs:string" use="required"/&gt;
            &lt;xs:attribute name="display_name" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="default_value" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="required" type="xs:string" use="optional"/&gt;
            &lt;xs:attribute name="datatype" default="string"&gt;
              &lt;xs:simpleType&gt;
                &lt;xs:restriction base="xs:string"&gt;
                  &lt;xs:enumeration value="string"/&gt;
                  &lt;xs:enumeration value="hidden"/&gt;
                  &lt;xs:enumeration value="bool"/&gt;
                  &lt;xs:enumeration value="enum"/&gt;
                  &lt;xs:enumeration value="list"/&gt;
                  &lt;xs:enumeration value="number"/&gt;
                &lt;/xs:restriction&gt;
              &lt;/xs:simpleType&gt;
            &lt;/xs:attribute&gt;
          &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
        &lt;xs:element name="Content" minOccurs="1" maxOccurs="unbounded"&gt;
          &lt;xs:complexType&gt;
            &lt;xs:simpleContent&gt;
              &lt;xs:extension base="xs:string"&gt;
                &lt;xs:attribute name="type" use="optional" default="html"&gt;
                  &lt;xs:simpleType&gt;
                    &lt;xs:restriction base="xs:string"&gt;
                      &lt;xs:enumeration value="html"/&gt;
                      &lt;xs:enumeration value="url"/&gt;
                    &lt;/xs:restriction&gt;
                  &lt;/xs:simpleType&gt;
                &lt;/xs:attribute&gt;
                &lt;xs:attribute name="href" type="xs:string" use="optional"/&gt;
                &lt;xs:attribute name="view" type="xs:string" use="optional"/&gt;
                &lt;xs:attribute name="preferred_height" type="xs:integer" use="optional"/&gt;
                &lt;xs:attribute name="preferred_width" type="xs:integer" use="optional"/&gt;
              &lt;/xs:extension&gt;
            &lt;/xs:simpleContent&gt;
          &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:complexType name="GadgetFeatureType"&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element name="Param" minOccurs="0" maxOccurs="unbounded"&gt;
        &lt;xs:complexType&gt;
          &lt;xs:simpleContent&gt;
            &lt;xs:extension base="xs:string"&gt;
              &lt;xs:attribute name="name" type="xs:string" use="required"/&gt;
            &lt;/xs:extension&gt;
          &lt;/xs:simpleContent&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
    &lt;/xs:sequence&gt;
    &lt;xs:attribute name="feature" type="xs:string" use="required"/&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="OAuthResourceType"&gt;
    &lt;xs:attribute name="url" type="xs:string" use="required"/&gt;
    &lt;xs:attribute name="method" use="optional" default="GET"&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:restriction base="xs:string"&gt;
          &lt;xs:enumeration value="GET"/&gt;
          &lt;xs:enumeration value="POST"/&gt;
        &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:attribute&gt;
    &lt;xs:attribute name="param_location" use="optional" default="auth-header"&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:restriction base="xs:string"&gt;
          &lt;xs:enumeration value="auth-header"/&gt;
          &lt;xs:enumeration value="uri-query"/&gt;
          &lt;xs:enumeration value="post-body"/&gt;
        &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:attribute&gt;
  &lt;/xs:complexType&gt;
&lt;/xs:schema&gt;
</artwork>
    </figure>
   </t>
  </section>
  <section title="Message Bundle Schema"
           anchor="messageBundleSchema">
   <t>
    <figure>
     <artwork xml:space="preserve">
&lt;?xml version="1.0"?&gt;
&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;xs:element name="messagebundle"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="msg" minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:complexType&gt;
            &lt;xs:simpleContent&gt;
              &lt;xs:extension base="xs:string"&gt;
                &lt;xs:attribute name="name" type="xs:string" use="required"/&gt;
                &lt;xs:attribute name="desc" type="xs:string" use="optional"/&gt;
              &lt;/xs:extension&gt;
            &lt;/xs:simpleContent&gt;
          &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
&lt;/xs:schema&gt;
</artwork>
    </figure>
   </t>
  </section>
  <references>
   <reference anchor='RFC2119'>
    <front>
     <title>Key words for use in RFCs to Indicate Requirement Levels</title>
     <author initials='S.'
             surname='Bradner'
             fullname='Scott Bradner'>
      <organization abbrev='HarvardU'>Harvard University</organization>
     </author>
     <date month='March'
           year='1997' />
    </front>
    <seriesInfo name='RFC'
                value='2119' />
   </reference>
   <reference anchor='RFC2606'>
    <front>
     <title>Reserved Top Level DNS Names</title>
     <author initials='D.'
             surname='Eastlake'
             fullname='Donald E. Eastlake 3rd'>
      <organization abbrev='IBM'>IBM</organization>
     </author>
     <author initials='A.'
             surname='Panitz'
             fullname='Aliza R. Panitz'></author>
     <date month='June'
           year='1999' />
    </front>
    <seriesInfo name='RFC'
                value='2606' />
   </reference>
   <reference anchor='RFC2616'>
    <front>
     <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
     <author initials='R.'
             surname='Fielding'>
      <organization>UC Irvine</organization>
     </author>
     <author initials='J.'
             surname='Gettys'>
      <organization>Compaq/W3C</organization>
     </author>
     <author initials='J.'
             surname='Mogul'>
      <organization>Compaq</organization>
     </author>
     <author initials='H.'
             surname='Frystyk'>
      <organization>W3C/MIT</organization>
     </author>
     <author initials='L.'
             surname='Masinter'>
      <organization>Xerox</organization>
     </author>
     <author initials='P.'
             surname='Leach'>
      <organization>Microsoft</organization>
     </author>
     <author initials='T.'
             surname='Berners-Lee'>
      <organization>W3C/MIT</organization>
     </author>
     <date month='June'
           year='1999' />
    </front>
    <seriesInfo name='RFC'
                value='2616' />
   </reference>
   <reference anchor='Caja'
              target="http://code.google.com/p/google-caja/">
    <front>
     <title>Caja Project</title>
     <date month='January'
           year='2009' />
    </front>
   </reference>
   <reference anchor="JSON-RPC"
              target="./RPC-Protocol.xml">
    <front>
     <title>OpenSocial JSON RPC Protocol Specification 0.9</title>
     <author initials='o.'
             surname='social'
             fullname='OpenSocial and Gadgets Specification Group &lt;opensocial-and-gadgets-spec@googlegroups.com&gt;'>
     </author>
     <date month='November'
           year='2007' />
    </front>
   </reference>
   <reference anchor="xsdpart1"
              target="http://www.w3.org/TR/xmlschema-1/">
    <front>
     <title>XML Schema Part 1: Structures Second Edition</title>
     <author initials='H.S.'
             surname='Thompson'
             fullname='Henry S. Thompson'>
      <organization>University of Edinburgh</organization>
     </author>
     <author initials='D.'
             surname='Beech'
             fullname='David Beech'>
      <organization>Oracle Corporation</organization>
     </author>
     <author initials='M.'
             surname='Maloney'
             fullname='Murray Maloney'>
      <organization>Commerce One</organization>
     </author>
     <author initials='N.'
             surname='Mendelsohn'
             fullname='Noah Mendelsohn'>
      <organization>Lotus Development Corporation</organization>
     </author>
     <date month='October'
           year='2004' />
    </front>
   </reference>
   <reference anchor='OAuth-Core'
              target='http://oauth.net/core/1.0a'>
    <front>
     <title>OAuth Core 1.0 Revision A</title>
     <author fullname='OAuth Core Workgroup'>
      <organization abbrev='OAuth'>OAuth Core Workgroup</organization>
     </author>
     <date month='November'
           year='1999' />
    </front>
   </reference>
  </references>
 </back>
</rfc>
