Class Index | File Index

Classes


Class sap.ui2.srvc.Factory


Defined in: factory.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Constructs a new factory based on the given page building service.
Method Summary
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.
Class Detail
sap.ui2.srvc.Factory(oPbs)
Constructs a new factory based on the given page building service. A factory for creating wrapper objects corresponding to catalogs, pages, CHIP instances, or CHIPs loaded from a page building service.

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
See:
sap.ui2.srvc.ODataService#getDefaultErrorHandler
#getPageBuildingService
Method Detail
addRemoteCatalogService(sBaseUrl, oRemoteCatalogService)
Registers a remote catalog service for the given base URL.
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

{sap.ui2.srvc.Catalog} createCatalog(vCatalogData, fnSuccess, fnFailure)
Creates a new catalog with the given ID and returns the stub. If a success handler is given, the catalog will be loaded automatically from the page building service, calling one of the given handlers.

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 given sap.ui2.srvc.ODataService#getDefaultErrorHandler is used.
Since:
1.2.0
Returns:
{sap.ui2.srvc.Catalog} the newly created catalog, as a stub

{sap.ui2.srvc.Chip} createChip(oRawChip, fnSuccess, fnFailure)
Creates a CHIP instance for the given raw CHIP representation as loaded via the page building service. If a success handler is given, the CHIP will be loaded automatically, calling one of the given handlers.

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#getDefaultErrorHandler is used
Since:
1.2.0
Returns:
{sap.ui2.srvc.Chip} the newly created CHIP, as a stub

{sap.ui2.srvc.ChipInstance} 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. If a success handler is given, the CHIP instance will be loaded automatically, calling one of the given handlers.

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#getDefaultErrorHandler is 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

createNewCatalog(oCatalogData, fnSuccess, fnFailure)
Creates a new catalog in the backend based on the given raw data. The success handler is called as soon as the catalog has been created and the sap.ui2.srvc.Catalog is not a stub anymore. Typically, this will be used to create "remote catalogs", i.e. pointers to existing catalogs on a remote server.

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 (__metadata not 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

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. The success handler is called as soon as the catalog has been created and the sap.ui2.srvc.Catalog is not a stub anymore. Access the new catalog in order to learn the resulting ID! Use sap.ui2.srvc.Catalog#getCatalogPage to access the corresponding catalog page which is initially a stub.
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#getDefaultErrorHandler is used
Since:
1.19.1

{sap.ui2.srvc.Page} createPage(sPageId, fnSuccess, fnFailure, bPartially)
Creates a new page with the given ID and returns the stub. If a success handler is given, the page will be loaded automatically from the page building service, calling one of the given handlers.
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#getDefaultErrorHandler is 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

{sap.ui2.srvc.PageSet} createPageSet(sPageSetId, fnSuccess, fnFailure)
Creates a new page set with the given ID and returns the stub. If a success handler is given, the page set will be loaded automatically from the page building service, calling one of the given handlers.
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#getDefaultErrorHandler is used
Since:
1.11.0
Returns:
{sap.ui2.srvc.PageSet} the newly created page set, as a stub

{sap.ui2.srvc.PageBuildingService} getPageBuildingService()
Returns this factory's page building service.
Since:
1.2.0
Returns:
{sap.ui2.srvc.PageBuildingService} this factory's page building service

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

©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)