Provides an object that owns content resources, tracks their changes and loads and destroys the content built from the content resources.
Constructor for a new ContentConnector.
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.vk.ContentConnector(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new ContentConnector object. Generated automatically if no ID is given. |
|
mSettings? | object | Initial settings for the new ContentConnector object. |
Default Aggregation: contentResources
Name | Cardinality | Type | Description |
---|---|---|---|
contentManagers | 0..n | sap.ui.vk.ContentManager |
Content managers. |
contentResources (default) | 0..n | sap.ui.vk.ContentResource |
Content resources to load and display. |
viewStateManagers | 0..n | sap.ui.vk.ViewStateManager |
View state managers. |
Event | Description |
---|---|
contentChangesFinished |
This event will be fired when any content resource or the contentResources aggregation has been changed and processed. |
contentChangesProgress |
This event will be fired to report the progress of content changes. |
contentChangesStarted |
This event will be fired when content resource changes are about to be processed. |
contentDestroying |
This event will be fired when the current content is about to be destroyed. |
contentLoadingFinished |
This event will be fired when content loading is finished. |
contentReplaced |
This event will be fired when the current content is completely rebuilt or destroyed as a result of changes in content resources. |
This event will be fired when any content resource or the contentResources aggregation has been changed and processed.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
content | any |
The content created or updated. The content can be of type HTMLImageElement, sap.ui.vk.Scene etc. |
failureReason | any |
The failure reason if any.
|
This event will be fired to report the progress of content changes.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
phase | string |
The name of the loading phase. It can be e.g. 'downloading', 'building the scene' etc. It might be null if reporting this parameter does not make sense. |
percentage | float |
The overall percentage of the loading process. |
source | any |
The content resource currently being loaded. It might be null if reporting this parameter does not make sense. |
This event will be fired when content resource changes are about to be processed.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
This event will be fired when the current content is about to be destroyed.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
content | any |
The content to be destroyed. The content can be of type HTMLImageElement, sap.ui.vk.Scene etc. |
preventGarbageCollection | function |
Returns a |
This event will be fired when content loading is finished.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
source | any | |
node | any |
This event will be fired when the current content is completely rebuilt or destroyed as a result of changes in content resources.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
newContent | any |
New content. The content can be of type HTMLImageElement, sap.ui.vk.Scene etc. |
oldContent | any |
Old content. The content can be of type HTMLImageElement, sap.ui.vk.Scene etc. |
Method | Description |
---|---|
sap.ui.vk.ContentConnector.addContentManagerResolver |
Adds a new content manager resolver. The last added resolver will be executed the first. Content manager resolver analyzes the content resource definition and returns the type of the content manager to use for loading the content resource. The simplest resolver tests the content resource source type. The test can be either a string comparison or a regular expression. A more sophisticated resolver is a function that can use the full content resource definition to find a proper content manager dynamically, e.g. the resolver can use the 'HEAD' HTTP request to get the 'Content-Type' header to find out the type of the content resource. |
addContentResource |
Adds some contentResource to the aggregation contentResources. |
addViewStateManager |
Adds some viewStateManager to the aggregation viewStateManagers. |
attachContentChangesFinished |
Attaches event handler When called, the context of the event handler (its This event will be fired when any content resource or the contentResources aggregation has been changed and processed. |
attachContentChangesProgress |
Attaches event handler When called, the context of the event handler (its This event will be fired to report the progress of content changes. |
attachContentChangesStarted |
Attaches event handler When called, the context of the event handler (its This event will be fired when content resource changes are about to be processed. |
attachContentDestroying |
Attaches event handler When called, the context of the event handler (its This event will be fired when the current content is about to be destroyed. |
attachContentLoadingFinished |
Attaches event handler When called, the context of the event handler (its This event will be fired when content loading is finished. |
attachContentReplaced |
Attaches event handler When called, the context of the event handler (its This event will be fired when the current content is completely rebuilt or destroyed as a result of changes in content resources. |
bindContentResources |
Binds aggregation contentResources to model data. See ManagedObject.bindAggregation for a detailed description of the possible properties of |
destroyContentResources |
Destroys all the contentResources in the aggregation contentResources. |
destroyViewStateManagers |
Destroys all the viewStateManagers in the aggregation viewStateManagers. |
detachContentChangesFinished |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachContentChangesProgress |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachContentChangesStarted |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachContentDestroying |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachContentLoadingFinished |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachContentReplaced |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.vk.ContentConnector.extend |
Creates a new subclass of class sap.ui.vk.ContentConnector with name
|
fireContentChangesFinished |
Fires event contentChangesFinished to attached listeners. |
fireContentChangesProgress |
Fires event contentChangesProgress to attached listeners. |
fireContentChangesStarted |
Fires event contentChangesStarted to attached listeners. |
fireContentDestroying |
Fires event contentDestroying to attached listeners. |
fireContentLoadingFinished |
Fires event contentLoadingFinished to attached listeners. |
fireContentReplaced |
Fires event contentReplaced to attached listeners. |
getContent |
Gets the content currently loaded. |
getContentManager |
Gets the content manager used to load the current content. |
getContentResources |
Gets content of aggregation contentResources. Content resources to load and display. |
sap.ui.vk.ContentConnector.getMetadata |
Returns a metadata object for class sap.ui.vk.ContentConnector. |
getViewStateManagers |
Gets content of aggregation viewStateManagers. View state managers. |
indexOfContentResource |
Checks for the provided |
indexOfViewStateManager |
Checks for the provided |
insertContentResource |
Inserts a contentResource into the aggregation contentResources. |
insertViewStateManager |
Inserts a viewStateManager into the aggregation viewStateManagers. |
sap.ui.vk.ContentConnector.removeAllContentManagerResolvers |
Removes all content manager resolvers. |
removeAllContentResources |
Removes all the controls from the aggregation contentResources. Additionally, it unregisters them from the hosting UIArea. |
removeAllViewStateManagers |
Removes all the controls from the aggregation viewStateManagers. Additionally, it unregisters them from the hosting UIArea. |
sap.ui.vk.ContentConnector.removeContentManagerResolver |
Removes a content manager resolver. If there are more than one content manager resolver matching the |
removeContentResource |
Removes a contentResource from the aggregation contentResources. |
removeViewStateManager |
Removes a viewStateManager from the aggregation viewStateManagers. |
setAuthorizationHandler |
Sets a callback function which will be used to obtain authorization token when connected to remote server. |
setDecryptionHandler |
Sets an object that decrypts content of encrypted models. |
setRetryCount |
Sets the maximum number of retry attempts for a download operation if the initial request to retrieve a model from a remote server could not be fulfilled and the error with which the request failed is considered recoverable. Retry Mechanism Requests to retrieve (download) a model from a remote server may not always be fulfilled. If the request failed with an error that is considered recoverable then the download manager will keep on trying issuing new requests until the request is fulfilled or the specified The default number of retry attempts is 1, unless specified otherwise by calling this method. Note that, specifying 0 as Timing of retry attempts: There is no delay between subsequent attempts. Events fired: The download manager will not fire any events between subsequent attempts. For each requested item there will be a single Recoverable errors: The following errors are considered recoverable:
|
unbindContentResources |
Unbinds aggregation contentResources from model data. |
Adds a new content manager resolver.
The last added resolver will be executed the first.
Content manager resolver analyzes the content resource definition and returns the type of the content manager to use for loading the content resource.
The simplest resolver tests the content resource source type. The test can be either a string comparison or a regular expression.
A more sophisticated resolver is a function that can use the full content resource definition to find a proper content manager dynamically, e.g. the resolver can use the 'HEAD' HTTP request to get the 'Content-Type' header to find out the type of the content resource.
Param | Type | DefaultValue | Description |
---|---|---|---|
resolver | function object |
Object that defines how to find out the content manager class name.
resolver is an object then it has the following properties:
|
|
pattern | string RegExp |
The pattern the sourceType property of the content resource is compared with. |
|
dimension | int |
Dimension of models of this source type. E.g. 2 or 3. |
|
contentManagerClassName | string |
Name of the content manager class to use for loading content resources of this type. E.g. sap.ui.vk.dvl.ContentManager, sap.ui.vk.threejs.ContentManager, sap.ui.vk.ImageContentManager. |
|
settings | object |
Optional settings specific to the content manager class. |
Adds some contentResource to the aggregation contentResources.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContentResource | sap.ui.vk.ContentResource |
The contentResource to add; if empty, nothing is inserted |
Adds some viewStateManager to the aggregation viewStateManagers.
Param | Type | DefaultValue | Description |
---|---|---|---|
oViewStateManager | sap.ui.vk.ViewStateManager |
The viewStateManager to add; if empty, nothing is inserted |
Attaches event handler fnFunction
to the contentChangesFinished event of this sap.ui.vk.ContentConnector
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vk.ContentConnector
itself.
This event will be fired when any content resource or the contentResources aggregation has been changed and processed.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the contentChangesProgress event of this sap.ui.vk.ContentConnector
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vk.ContentConnector
itself.
This event will be fired to report the progress of content changes.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the contentChangesStarted event of this sap.ui.vk.ContentConnector
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vk.ContentConnector
itself.
This event will be fired when content resource changes are about to be processed.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the contentDestroying event of this sap.ui.vk.ContentConnector
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vk.ContentConnector
itself.
This event will be fired when the current content is about to be destroyed.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the contentLoadingFinished event of this sap.ui.vk.ContentConnector
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vk.ContentConnector
itself.
This event will be fired when content loading is finished.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the contentReplaced event of this sap.ui.vk.ContentConnector
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vk.ContentConnector
itself.
This event will be fired when the current content is completely rebuilt or destroyed as a result of changes in content resources.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Binds aggregation contentResources to model data.
See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo
.
Param | Type | DefaultValue | Description |
---|---|---|---|
oBindingInfo | sap.ui.base.ManagedObject.AggregationBindingInfo |
The binding information |
Detaches event handler fnFunction
from the contentChangesFinished event of this sap.ui.vk.ContentConnector
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the contentChangesProgress event of this sap.ui.vk.ContentConnector
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the contentChangesStarted event of this sap.ui.vk.ContentConnector
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the contentDestroying event of this sap.ui.vk.ContentConnector
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the contentLoadingFinished event of this sap.ui.vk.ContentConnector
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the contentReplaced event of this sap.ui.vk.ContentConnector
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Creates a new subclass of class sap.ui.vk.ContentConnector 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.Element.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 |
Fires event contentChangesFinished to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
content | any |
The content created or updated. The content can be of type HTMLImageElement, sap.ui.vk.Scene etc. |
|
failureReason | any |
The failure reason if any.
|
Fires event contentChangesProgress to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
phase | string |
The name of the loading phase. It can be e.g. 'downloading', 'building the scene' etc. It might be null if reporting this parameter does not make sense. |
|
percentage | float |
The overall percentage of the loading process. |
|
source | any |
The content resource currently being loaded. It might be null if reporting this parameter does not make sense. |
Fires event contentChangesStarted to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event contentDestroying to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
content | any |
The content to be destroyed. The content can be of type HTMLImageElement, sap.ui.vk.Scene etc. |
|
preventGarbageCollection | function |
Returns a |
Fires event contentLoadingFinished to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
source | any | ||
node | any |
Fires event contentReplaced to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
newContent | any |
New content. The content can be of type HTMLImageElement, sap.ui.vk.Scene etc. |
|
oldContent | any |
Old content. The content can be of type HTMLImageElement, sap.ui.vk.Scene etc. |
Gets content of aggregation contentResources.
Content resources to load and display.
Returns a metadata object for class sap.ui.vk.ContentConnector.
Checks for the provided sap.ui.vk.ContentResource
in the aggregation contentResources. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContentResource | sap.ui.vk.ContentResource |
The contentResource whose index is looked for |
Checks for the provided sap.ui.vk.ViewStateManager
in the aggregation viewStateManagers. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oViewStateManager | sap.ui.vk.ViewStateManager |
The viewStateManager whose index is looked for |
Inserts a contentResource into the aggregation contentResources.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContentResource | sap.ui.vk.ContentResource |
The contentResource to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Inserts a viewStateManager into the aggregation viewStateManagers.
Param | Type | DefaultValue | Description |
---|---|---|---|
oViewStateManager | sap.ui.vk.ViewStateManager |
The viewStateManager to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Removes all the controls from the aggregation contentResources.
Additionally, it unregisters them from the hosting UIArea.
Removes all the controls from the aggregation viewStateManagers.
Additionally, it unregisters them from the hosting UIArea.
Removes a content manager resolver.
If there are more than one content manager resolver matching the resolver
the last added is removed.
Param | Type | DefaultValue | Description |
---|---|---|---|
resolver | function string RegExp object |
Object that defines how to find out the content manager class name. |
Removes a contentResource from the aggregation contentResources.
Param | Type | DefaultValue | Description |
---|---|---|---|
vContentResource | int string sap.ui.vk.ContentResource |
The contentResource to remove or its index or id |
Removes a viewStateManager from the aggregation viewStateManagers.
Param | Type | DefaultValue | Description |
---|---|---|---|
vViewStateManager | int string sap.ui.vk.ViewStateManager |
The viewStateManager to remove or its index or id |
Sets a callback function which will be used to obtain authorization token when connected to remote server.
Param | Type | DefaultValue | Description |
---|---|---|---|
handler | sap.ui.vk.AuthorizationHandler |
An application defined callback function that can provide authorization token. |
Sets an object that decrypts content of encrypted models.
Param | Type | DefaultValue | Description |
---|---|---|---|
handler | sap.ui.vk.DecryptionHandler |
An object that decrypts content of encrypted models. |
Sets the maximum number of retry attempts for a download operation if the initial request to retrieve a model from a remote server could not be fulfilled and the error with which the request failed is considered recoverable.
Requests to retrieve (download) a model from a remote server may not always be fulfilled. If the request failed with an error that is considered recoverable then the download manager will keep on trying issuing new requests until the request is fulfilled or the specified retryCount
is exceeded.
The default number of retry attempts is 1, unless specified otherwise by calling this method. Note that, specifying 0 as retryCount
disables the retry mechanism altogether.
Timing of retry attempts: There is no delay between subsequent attempts.
Events fired: The download manager will not fire any events between subsequent attempts. For each requested item there will be a single itemSucceeded
or itemFailed
event fired when the download operation for that given item finishes.
Recoverable errors: The following errors are considered recoverable:
Param | Type | DefaultValue | Description |
---|---|---|---|
retryCount | int |
Maximum number of retry attempts. Value must be non-negative. The default retry count is 1, unless specified otherwise by calling this method and passing in the desired value. Passing in 0 disables any retry attempts. |