Class sap.ui2.srvc.Factory
Defined in: factory.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
sap.ui2.srvc.Factory(oPbs)
Constructs a new factory based on the given page building service.
|
| Method Attributes | Method Name and Description |
|---|---|
|
addRemoteCatalogService(sBaseUrl, oRemoteCatalogService)
Registers a remote catalog service for the given base URL.
|
|
|
createCatalog(vCatalogData, fnSuccess, fnFailure)
Creates a new catalog with the given ID and returns the stub.
|
|
|
createChip(oRawChip, fnSuccess, fnFailure)
Creates a CHIP instance for the given raw CHIP representation as loaded
via the page building service.
|
|
|
createChipInstance(oRawChipInstance, fnSuccess, fnFailure, oPage)
Creates a new CHIP instance instance for the given raw CHIP instance
representation as loaded via the page building service.
|
|
|
createNewCatalog(oCatalogData, fnSuccess, fnFailure)
Creates a new catalog in the backend based on the given raw data.
|
|
|
createNewPageBasedCatalog(sDomainId, sTitle, fnSuccess, fnFailure)
Creates a new catalog in the backend, based on a catalog page and using the given domain ID
and title.
|
|
|
createPage(sPageId, fnSuccess, fnFailure, bPartially)
Creates a new page with the given ID and returns the stub.
|
|
|
createPageSet(sPageSetId, fnSuccess, fnFailure)
Creates a new page set with the given ID and returns the stub.
|
|
|
Returns this factory's page building service.
|
|
|
toString(bVerbose)
Returns this factory's string representation.
|
All factory methods are able to create stubs synchronously. Those stubs need to be loaded asynchronously in order to become complete.
Note: All error handlers are optional and default to
getPageBuildingService().getDefaultErrorHandler()
- Parameters:
- {sap.ui2.srvc.PageBuildingService} oPbs
- the page building service
- Since:
- 1.2.0
- Parameters:
- {string} sBaseUrl
- the base URL
- {sap.ui2.srvc.RemoteCatalogService} oRemoteCatalogService
- the remote catalog service compatible to sap.ui2.srvc.RemoteCatalogService
- Since:
- 1.19.1
- Throws:
- Error if the base URL is already registered
Caches the created catalog, so that a subsequent request for a catalog with the same ID will be answered from the cache.
Note: All contained CHIPs will typically be stubs only!
Note: If the catalog is a remote catalog and a success handler is given, an attempt is made to load the chips. If this load attempts failed, the promise is rejected with the 2nd argument being the (semi-)instantiated catalog with an *empty* chip collection! This catalog is not a stub itself!
- Parameters:
- {string|object} vCatalogData
- the catalog ID or the raw catalog representation as loaded via the page building service
- {function (sap.ui2.srvc.Catalog)} fnSuccess Optional
- success handler for asynchronous loading
- {function (string|[sap.ui2.srvc.Catalog]|[object])} fnFailure
- error handler, taking an error message, an optional sap.ui2.srvc.Catalog
instance and, since version 1.28.6, an optional object containing the
complete error information.
See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError for more details about the complete error information parameter. If fnFailure is not givensap.ui2.srvc.ODataService#getDefaultErrorHandleris used.
- Since:
- 1.2.0
- Returns:
- {sap.ui2.srvc.Catalog} the newly created catalog, as a stub
Caches the created CHIPs, so that a subsequent request for a CHIP with the same ID will be answered from the cache.
- Parameters:
- {object} oRawChip
- the raw CHIP representation as loaded via the page building service
- {function (sap.ui2.srvc.Chip)} fnSuccess Optional
- success handler for asynchronous loading
- {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#getDefaultErrorHandleris used
- Since:
- 1.2.0
- Returns:
- {sap.ui2.srvc.Chip} the newly created CHIP, as a stub
- Parameters:
- {object} oRawChipInstance
- the raw CHIP instance representation as loaded via the page building service
- {function (sap.ui2.srvc.ChipInstance)} fnSuccess Optional
- success handler for asynchronous loading
- {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#getDefaultErrorHandleris used - {sap.ui2.srvc.Page} oPage Optional
- (since 1.9.0) the page to which this CHIP instance belongs; this is passed on to the CHIP instance itself, see sap.ui2.srvc.ChipInstance#getPage
- Since:
- 1.2.0
- Returns:
- {sap.ui2.srvc.ChipInstance} the newly created CHIP instance, as a stub
Creating a remote catalog requires two steps: first the catalog data is created via the factory's page building service, then the catalog's CHIPs are loaded from the appropriate remote catalog service (see sap.ui2.srvc.Factory#addRemoteCatalogService). If the second step fails, the error handler is called with an error message and the new catalog instance (since 1.20). In this case the catalog is still a stub and does not know its CHIPs, but it knows more than just its ID and it can be updated!
- Parameters:
- {object} oCatalogData
- the raw catalog representation for the page building service (
__metadatanot needed!), e.g.{ baseUrl: "/sap/hba/apps/kpi/s/odata/hana_chip_catalog.xsodata/", domainId: "Z_REMOTE_HANA_CATALOG", remoteId: "HANA_CATALOG", systemAlias: "sanssouci", title: "Remote HANA catalog", type: "REMOTE" } - {function (sap.ui2.srvc.Catalog)} fnSuccess
- success handler for asynchronous creation
- {function (string|[sap.ui2.srvc.Catalog]|[object])} fnFailure
- error handler, taking an error message, an optional sap.ui2.srvc.Catalog
instance and, since version 1.28.6, an optional object containing the
complete error information.
See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError for more details about the complete error information parameter.
- Since:
- 1.19.1
- Parameters:
- {string} sDomainId
- the catalog's domain-specific ID
- {string} sTitle Optional
- the catalog's title
- {function (sap.ui2.srvc.Catalog)} fnSuccess
- success handler for asynchronous creation
- {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#getDefaultErrorHandleris used
- Since:
- 1.19.1
- Parameters:
- {string} sPageId
- the page ID
- {function (sap.ui2.srvc.Page)} fnSuccess Optional
- success handler for asynchronous loading
- {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#getDefaultErrorHandleris used - {boolean} bPartially Optional, Default: false
- whether to load the page only partially (instead of completely, including its CHIP instances)
- Since:
- 1.2.0
- Returns:
- {sap.ui2.srvc.Page} the newly created page, as a stub
- Parameters:
- {string} sPageSetId
- the page set ID
- {function (sap.ui2.srvc.PageSet)} fnSuccess Optional
- success handler for asynchronous loading
- {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#getDefaultErrorHandleris used
- Since:
- 1.11.0
- Returns:
- {sap.ui2.srvc.PageSet} the newly created page set, as a stub
- Since:
- 1.2.0
- Returns:
- {sap.ui2.srvc.PageBuildingService} this factory's page building service
- Parameters:
- {boolean} bVerbose Optional, Default: false
- flag whether to show all properties
- Since:
- 1.2.0
- Returns:
- {string} this factory's string representation