Class: OpenSearchDescription

OpenSearchDescription(values)

Class to parse the OpenSearchDescription XML document and get the saerch URLs

Constructor

new OpenSearchDescription(values)

Create an OpenSearchDescription object
Parameters:
Name Type Description
values object The object containing the parsed description
Properties
Name Type Attributes Description
shortName string <optional>
The short name of the OpenSearch service
description string <optional>
The description of the service
tags string <optional>
The associated tags of the service
contact string <optional>
The contact information of the service
urls Array.<OpenSearchUrl> <optional>
The parsed URLs of the service
longName string <optional>
The long name of the service
images Array.<object> <optional>
The associated images of the service
queries Array.<object> <optional>
Prepared queries for the service
developer string <optional>
The developer information of the service
attribution string <optional>
The attribution for the service
syndicationRight string <optional>
Syndication rights for the service
adultContent string <optional>
Information about the adult content of the service
language string <optional>
The language settings for the service
outputEncoding string <optional>
The output encoding
inputEncoding string <optional>
The input encoding
Source:

Methods

(static) deserialize(values) → {OpenSearchDescription}

Deserialize an OpenSearch description from an object.
Parameters:
Name Type Description
values object The serialized description
Source:
Returns:
The deserialized description
Type
OpenSearchDescription

(static) fromXml(xml) → {OpenSearchDescription}

Parse an OpenSearch Description XML Document.
Parameters:
Name Type Description
xml string The XML String to parse.
Source:
Returns:
The parsed description document
Type
OpenSearchDescription

getUrl(parametersopt, typeopt, methodopt) → {OpenSearchUrl|null}

Get the OpenSearchUrl for the given parameters, mime type and HTTP method. Return the first matching URL or null.
Parameters:
Name Type Attributes Default Description
parameters object <optional>
null An object containing search parameters
type string <optional>
null The mime-type for the URL
method string <optional>
'GET' The preferred HTTP method of the URL
Source:
Returns:
Type
OpenSearchUrl | null

getUrls(parametersopt, typeopt, methodopt) → {Array.<OpenSearchUrl>}

Get an array of OpenSearchUrl for the given parameters, mime type and HTTP method.
Parameters:
Name Type Attributes Default Description
parameters object <optional>
null An object containing search parameters
type string | Array <optional>
null The mime-type for the URL
method string | Array <optional>
null The preferred HTTP method of the URL
Source:
Returns:
Type
Array.<OpenSearchUrl>

serialize() → {object}

Serialize the OpenSearch description to a simple object.
Source:
Returns:
The serialized description
Type
object