Class Index | File Index

Classes


Class sap.ui2.srvc.Chip


Defined in: chip.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
sap.ui2.srvc.Chip(oAlterEgo, oFactory)
Constructs a new representation (wrapper) of the CHIP with the given CHIP data as loaded from the page building service.
Method Summary
Method Attributes Method Name and Description
<static>  
sap.ui2.srvc.Chip.addContract(sName, fnInitializer)
Adds a contract to the list of known contracts which can be consumed by CHIPs.
 
createApi(oChipInstance, oContractsByName)
Creates the API object for a CHIP instance.
 
Returns the id of this CHIP's base CHIP as defined by the page building service.
 
Returns the catalog by which this CHIP was loaded.
 
Gets the value of a configuration parameter.
 
Returns this CHIP's description as defined by the page building service.
 
Returns this CHIP's ID.
 
Returns this CHIP instance's implementation of type SAPUI5 as a control.
 
Returns the catalog by which this remote CHIP was loaded.
 
Returns this CHIP's title as defined by the page building service or the CHIP definition XML (if available).
 
isBasedOn(oChipInstance)
Checks whether this CHIP is based on the given CHIP instance.
 
Tells whether this CHIP is a broken reference, as indicated by referenceChipId being set to "O" (Orphaned)
 
Tells whether this CHIP is a reference, pointing to its original CHIP.
 
Tells whether this CHIP is still only a stub and does not yet know its CHIP definition XML.
 
load(fnSuccess, fnFailure)
Loads the CHIP definition XML in case this has not yet been done.
 
refresh(fnSuccess, fnFailure)
Refreshes the CHIP from the OData service.
 
Makes the given relative URL absolute.
 
toString(bVerbose)
Returns this CHIP's string representation.
 
updateConfiguration(mParameters, vConfigurationUpdates)
Updates the given parameter map from the given JSON string.
Class Detail
sap.ui2.srvc.Chip(oAlterEgo, oFactory)
Constructs a new representation (wrapper) of the CHIP with the given CHIP data as loaded from the page building service.

Initially a stub is created which can load its CHIP definition XML later on in an asynchronous fashion.

CHIPs are currently read-only and cannot be updated through the page building service. (see sap.ui2.srvc.PageBuildingService)

Parameters:
{object} oAlterEgo
the CHIP data as loaded via page building service
{sap.ui2.srvc.Factory} oFactory
the factory
Since:
1.2.0
Method Detail
<static> sap.ui2.srvc.Chip.addContract(sName, fnInitializer)
Adds a contract to the list of known contracts which can be consumed by CHIPs.
Parameters:
{string} sName
The name of the contract.
{function (sap.ui2.srvc.ChipInstance)} fnInitializer
This function will initialize the contract for a CHIP instance. When the API object for a CHIP instance requesting this contract is initialized, a sub-object with the contract's name is added to the API. The initializer is then called with this sub-object as this and the CHIP instance as parameter.
Since:
1.2.0

{object} createApi(oChipInstance, oContractsByName)
Creates the API object for a CHIP instance. Can only be called if the CHIP is not a stub anymore.
Parameters:
{sap.ui2.srvc.ChipInstance} oChipInstance
the CHIP instance
{sap.ui2.srvc.Map} oContractsByName Optional
CHIP instance's map from contract name to contract interface for page builder (since 1.11.0)
Since:
1.2.0
Returns:
{object} the API object
See:
#isStub()
sap.ui2.srvc.ChipInstance#getContract()

{string} getBaseChipId()
Returns the id of this CHIP's base CHIP as defined by the page building service. Returns the empty String if the CHIP does not have a base CHIP.
Since:
1.11.0
Returns:
{string} the id of this CHIP's base CHIP. Empty string in case the CHIP has no base CHIP.
See:
#isBasedOn()

{sap.ui2.srvc.Catalog} getCatalog()
Returns the catalog by which this CHIP was loaded. The result may be undefined if the CHIP is only a proxy and the actual instance has been deleted in the backend server. This may happen for CHIPs referenced by a chip instance.
Since:
1.19.0
Returns:
{sap.ui2.srvc.Catalog} this CHIP's catalog or undefined

{string} getConfigurationParameter(sKey)
Gets the value of a configuration parameter. Can only be called if the CHIP is not a stub anymore.
Parameters:
{string} sKey
the name of the parameter
Since:
1.2.0
Returns:
{string} the value of the parameter or undefined if it does not exist
See:
#isStub()

{string} getDescription()
Returns this CHIP's description as defined by the page building service.
Since:
1.2.0
Returns:
{string} this CHIP's description

{string} getId()
Returns this CHIP's ID.
Since:
1.2.0
Returns:
{string} this CHIP's ID

{sap.ui.core.Control} getImplementationAsSapui5(oApi)
Returns this CHIP instance's implementation of type SAPUI5 as a control. This control represents the root of this CHIP instance's UI from a page builder point of view. Can only be called if the CHIP is not a stub anymore.
Parameters:
{object} oApi
the CHIP instance specific API
Since:
1.2.0
Returns:
{sap.ui.core.Control} this CHIP instance's SAPUI5 implementation as a control
See:
#isStub()

{sap.ui2.srvc.Catalog} getRemoteCatalog()
Returns the catalog by which this remote CHIP was loaded. This catalog is undefined if the CHIP is from the same system as the catalog.
Since:
1.9.0
Returns:
{sap.ui2.srvc.Catalog} this CHIP's remote catalog or undefined

{string} getTitle()
Returns this CHIP's title as defined by the page building service or the CHIP definition XML (if available).
Since:
1.2.0
Returns:
{string} this CHIP's title

{boolean} isBasedOn(oChipInstance)
Checks whether this CHIP is based on the given CHIP instance. This can happen because there is a catalog type which is built on a catalog page. In such a case the ABAP backend maps each CHIP instance on that page to a CHIP in the resulting catalog.

Note: This CHIP's baseChipId is exactly non-empty if the CHIP is catalog-page based. Then it is the ID of the CHIP used to build the CHIP instance. (This is recursive. So if that CHIP is again catalog-page based...)

Parameters:
{sap.ui2.srvc.ChipInstance} oChipInstance
the CHIP instance to compare with
Since:
1.19.1
Returns:
{boolean} true iff the CHIP is based on the given CHIP instance
See:
#refresh()

{boolean} isBrokenReference()
Tells whether this CHIP is a broken reference, as indicated by referenceChipId being set to "O" (Orphaned)
Since:
1.23.1
Returns:
{boolean} whether this CHIP is a broken reference

{boolean} isReference()
Tells whether this CHIP is a reference, pointing to its original CHIP. Note: A refresh on the CHIP may be needed before calling this method, but only if the CHIP is based on a catalog page and that corresponding catalog page may be updated in your use case after the CHIP has been loaded.
Since:
1.19.1
Returns:
{boolean} whether this CHIP is a reference
See:
#refresh()

{boolean} isStub()
Tells whether this CHIP is still only a stub and does not yet know its CHIP definition XML.
Since:
1.2.0
Returns:
{boolean} whether this CHIP is still only a stub
See:
#load()

load(fnSuccess, fnFailure)
Loads the CHIP definition XML in case this has not yet been done. If this CHIP is not a stub anymore this method fails!
Parameters:
{function ()} fnSuccess
no-args success handler
{function (string|[object])} fnFailure Optional
error handler taking an error message and, since version 1.28.6, an optional object containing the complete error information as delivered by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError for more details. If not given sap.ui2.srvc.ODataService#getDefaultErrorHandler is used.
Since:
1.2.0
See:
#isStub()

refresh(fnSuccess, fnFailure)
Refreshes the CHIP from the OData service. Use this only for CHIPs that you received via a catalog. When called on a CHIP received via a page, the function may fail.

This method is intended to refresh a CHIP in a catalog based on a catalog page. Such a CHIP is based on a CHIP instance of this catalog page. If such a CHIP instance is changed this method can be used to refresh the corresponding CHIP.

Note: This method does not replace the #load method, as the CHIP definition is not loaded. Thus, if the CHIP was a stub before the refresh, it is still a stub afterwards.

Parameters:
{function ()} fnSuccess
no-args success handler
{function (string|[object])} fnFailure Optional
error handler taking an error message and, since version 1.28.6, an optional object containing the complete error information as delivered by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError for more details. If not given sap.ui2.srvc.ODataService#getDefaultErrorHandler is used
Since:
1.16.5
See:
#load()
#isStub()
#isBasedOn()

{string} toAbsoluteUrl(sUrl)
Makes the given relative URL absolute. URLs containing host and/or protocol and URLs with an absolute path remain unchanged. The URL is in no way normalized; the function takes the URL of the CHIP definition XML as base.
Parameters:
{string} sUrl
the (possibly server-relative) URL
Since:
1.2.0
Returns:
{string} the absolute URL

{string} toString(bVerbose)
Returns this CHIP's string representation.
Parameters:
{boolean} bVerbose Optional, Default: false
flag whether to show all properties
Since:
1.2.0
Returns:
{string} this CHIP's string representation

updateConfiguration(mParameters, vConfigurationUpdates)
Updates the given parameter map from the given JSON string. All parameters that actually were defined in the CHIP definition XML are accepted. All others will raise a warning to the log.
Parameters:
{map} mParameters
the parameter map to fill
{map|string} vConfigurationUpdates
the configuration updates as parameter map or as JSON string

If one parameter value is undefined (which can only happen by supplying a map) then this property is removed from mParameters.

Since:
1.2.0

©Copyright (c) 2009-2014 SAP SE, All Rights Reserved
Documentation generated by JsDoc Toolkit 2.4.0 on Tue Mar 14 2017 08:48:14 GMT-0000 (UTC)