class sap.ui.core.search.OpenSearchProvider

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/core/search/OpenSearchProvider
Application Component: CA-UI5-COR

A SearchProvider which uses the OpenSearch protocol (either JSON or XML).


Constructor

Constructor for a new search/OpenSearchProvider.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.core.search.OpenSearchProvider(sId?, mSettings?)
Param Type Default Value Description
sId? string

id for the new control, generated automatically if no id is given

mSettings? object

initial settings for the new control


Properties

Name Type Default Value Description
suggestType string json

The type of data which is provided by the given suggestUrl: either 'json' or 'xml'.

Visibility: public
suggestUrl sap.ui.core.URI

The URL for suggestions of the search provider. As placeholder for the concrete search queries '{searchTerms}' must be used. For cross domain requests maybe a proxy must be used.

Visibility: public

Borrowed Properties

Name Type Default Value Description
icon string

Icon of the Search Provider

Visibility: public

Borrowed Aggregations

Name Cardinality Type Description
customData 0..n sap.ui.core.CustomData

Custom Data, a data structure like a map containing arbitrary key value pairs.

dependents 0..n sap.ui.core.Element

Dependents are not rendered, but their databinding context and lifecycle are bound to the aggregating Element.

Since: 1.19.

dragDropConfig 0..n sap.ui.core.dnd.DragDropBase

Defines the drag-and-drop configuration. Note: This configuration might be ignored due to control metadata restrictions.

Since: 1.56.

layoutData 0..1 sap.ui.core.LayoutData

Defines the layout constraints for this control when it is used inside a Layout. LayoutData classes are typed classes and must match the embedding Layout. See VariantLayoutData for aggregating multiple alternative LayoutData instances to a single Element.

tooltip 0..1 sap.ui.core.TooltipBase

The tooltip that should be shown for this Element.

In the most simple case, a tooltip is a string that will be rendered by the control and displayed by the browser when the mouse pointer hovers over the control's DOM. In this variant, tooltip behaves like a simple control property.

Controls need to explicitly support this kind of tooltip as they have to render it, but most controls do. Exceptions will be documented for the corresponding controls (e.g. sap.ui.core.HTML does not support tooltips).

Alternatively, tooltip can act like a 0..1 aggregation and can be set to a tooltip control (an instance of a subclass of sap.ui.core.TooltipBase). In that case, the framework will take care of rendering the tooltip control in a popup-like manner. Such a tooltip control can display arbitrary content, not only a string.

UI5 currently does not provide a recommended implementation of TooltipBase as the use of content-rich tooltips is discouraged by the Fiori Design Guidelines. Existing subclasses of TooltipBase therefore have been deprecated. However, apps can still subclass from TooltipBase and create their own implementation when needed (potentially taking the deprecated implementations as a starting point).

See the section Using Tooltips in the Fiori Design Guideline.


Methods Overview

Method Description
sap.ui.core.search.OpenSearchProvider.extend

Creates a new subclass of class sap.ui.core.search.OpenSearchProvider with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.search.SearchProvider.extend.

sap.ui.core.search.OpenSearchProvider.getMetadata

Returns a metadata object for class sap.ui.core.search.OpenSearchProvider.

getSuggestType

Gets current value of property suggestType.

The type of data which is provided by the given suggestUrl: either 'json' or 'xml'.

Default value is 'json'.

getSuggestUrl

Gets current value of property suggestUrl.

The URL for suggestions of the search provider. As placeholder for the concrete search queries '{searchTerms}' must be used. For cross domain requests maybe a proxy must be used.

setSuggestType

Sets a new value for property suggestType.

The type of data which is provided by the given suggestUrl: either 'json' or 'xml'.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 'json'.

setSuggestUrl

Sets a new value for property suggestUrl.

The URL for suggestions of the search provider. As placeholder for the concrete search queries '{searchTerms}' must be used. For cross domain requests maybe a proxy must be used.

When called with a value of null or undefined, the default value of the property will be restored.

suggest

Call this function to get suggest values from the search provider. The given callback function is called with the suggest value (type 'string', 1st parameter) and an array of the suggestions (type '[string]', 2nd parameter).

sap.ui.core.search.OpenSearchProvider.extend

Creates a new subclass of class sap.ui.core.search.OpenSearchProvider with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.search.SearchProvider.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

sap.ui.core.search.OpenSearchProvider.getMetadata

Returns a metadata object for class sap.ui.core.search.OpenSearchProvider.

getSuggestType

Gets current value of property suggestType.

The type of data which is provided by the given suggestUrl: either 'json' or 'xml'.

Default value is 'json'.

getSuggestUrl

Gets current value of property suggestUrl.

The URL for suggestions of the search provider. As placeholder for the concrete search queries '{searchTerms}' must be used. For cross domain requests maybe a proxy must be used.

setSuggestType

Sets a new value for property suggestType.

The type of data which is provided by the given suggestUrl: either 'json' or 'xml'.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 'json'.

Param Type DefaultValue Description
sSuggestType string 'json'

New value for property suggestType

setSuggestUrl

Sets a new value for property suggestUrl.

The URL for suggestions of the search provider. As placeholder for the concrete search queries '{searchTerms}' must be used. For cross domain requests maybe a proxy must be used.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sSuggestUrl sap.ui.core.URI

New value for property suggestUrl

suggest

Call this function to get suggest values from the search provider. The given callback function is called with the suggest value (type 'string', 1st parameter) and an array of the suggestions (type '[string]', 2nd parameter).

Param Type DefaultValue Description
sValue string

The value for which suggestions are requested.

fCallback function

The callback function which is called when the suggestions are available.