Constructor
new OpenSearchUrl()
Constructs an OpenSearchUrl.
Members
encType :String
The encoding for POST or PUT requests.
Type:
- String
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
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:
- Array.<OpenSearchParameter>
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
type :String
The mime type of the resource being described.
Type:
- String
Methods
(static) createUrlParser() → {HTMLElement}
Internal use. Applications should not call this method.
Creates an URL parser as an anchor element.
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
Returns:
The serialized value.
- Type
- String