Class: OpenSearchUrl

OpenSearchUrl()

Represents an OpenSearch URL. The OpenSearch URL describes an interface by which a client can make requests for an external resource, such as search results, or additional description documents. This object holds as properties the fields for a OpenSearch URL node. Most fields can be accessed as properties named according to their document names converted to camel case.

Constructor

new OpenSearchUrl()

Constructs an OpenSearchUrl.
Source:

Members

encType :String

The encoding for POST or PUT requests.
Type:
  • String
Source:

indexOffset :Number

The index number of the first search result.
Type:
  • Number
Default Value:
  • 1
Source:

method :String

A valid HTTP verb for this URL.
Type:
  • String
Source:

pageOffset :Number

The page number of the first set of search results.
Type:
  • Number
Default Value:
  • 1
Source:

parameters :Array.<OpenSearchParameter>

The list of parameters.
Type:
Source:

relations :Array.<String>

The role of the resource being described in relation to the description document.
Type:
  • Array.<String>
Default Value:
  • ['results']
Source:

template :String

The parameterized form of the URL by which a search engine is queried.
Type:
  • String
Source:

type :String

The mime type of the resource being described.
Type:
  • String
Source:

Methods

(static) createUrlParser() → {HTMLElement}

Internal use. Applications should not call this method. Creates an URL parser as an anchor element.
Source:
Returns:
The anchor element.
Type
HTMLElement

createQueryParts(searchParams) → {Object}

Internal use. Applications should not call this method. Creates an key-value pair object with the name and value of the search parameters.
Parameters:
Name Type Description
searchParams Array | null The list of search parameters.
Source:
Returns:
The resulting object.
Type
Object

createRequestBody(searchParams) → {FormData}

Internal use. Applications should not call this method. Creates the request body for the supplied search parameters to be used for POST or PUT requests.
Parameters:
Name Type Description
searchParams Array | null The list of search parameters.
Source:
Returns:
The resulting request body.
Type
FormData

createRequestUrl(searchParams) → {String}

Internal use. Applications should not call this method. Creates a query URL for the supplied search parameters to be used for GET requests.
Parameters:
Name Type Description
searchParams Array | null The list of search parameters.
Source:
Returns:
The resulting URL.
Type
String

isCompatible(searchParams) → {Boolean}

Internal use. Applications should not call this method. Checks if this URL is compatible with the specified search parameters.
Parameters:
Name Type Description
searchParams Array The list of search parameters.
Source:
Returns:
Type
Boolean

parse(node) → {OpenSearchUrl}

Internal use. Applications should not call this method. Parses an URL node.
Parameters:
Name Type Description
node Node The URL node to parse.
Source:
Returns:
The resulting OpenSearchUrl.
Type
OpenSearchUrl

parseAttributes(node)

Internal use. Applications should not call this method. Parses the attributes of an URL node and stores the result in this OpenSearchUrl instance.
Parameters:
Name Type Description
node Node The URL node to parse.
Source:

parseNodeParams(node) → {Array.<OpenSearchParameter>}

Internal use. Applications should not call this method. Parses an URL node and extracts the parameters from the Parameter node introduced by the OpenSearch Parameter extension.
Parameters:
Name Type Description
node Node The URL to parse.
Source:
Returns:
The list of search parameters.
Type
Array.<OpenSearchParameter>

parseTemplate(template) → {Array.<OpenSearchParameter>|undefined}

Internal use. Applications should not call this method. Parses an URL template and extracts its search parameters.
Parameters:
Name Type Description
template String The URL template to parse.
Source:
Returns:
The list of search parameters.
Type
Array.<OpenSearchParameter> | undefined

serializeParam(value) → {String}

Internal use. Applications should not call this method. Serializes a value to be used for a GET request.
Parameters:
Name Type Description
value Any The value to be serialized.
Source:
Returns:
The serialized value.
Type
String