Class sap.ui2.srvc.PageBuildingService
Extends
sap.ui2.srvc.ODataService.
Defined in: PageBuildingService.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
sap.ui2.srvc.PageBuildingService(vODataBase, fnDefaultFailure, bIsPersonalization)
Constructs a facade to the page building service with the given
base URI, providing all needed CRUD operations based on OData for the
entities page, catalog, bag, CHIP, and CHIP instance.
|
| Method Attributes | Method Name and Description |
|---|---|
|
cloneCatalog(sCatalogId, sNewDomainId, sNewTitle, fnSuccess, fnFailure)
Creates a new catalog in the backend as a clone of the catalog with given ID, using the
given new domain ID.
|
|
|
clonePageChipInstance(sSourcePageId, sSourceChipInstanceId, sTargetPageId, fnSuccess, fnFailure)
Adds a reference CHIP instance to the page with ID
sTargetPageId. |
|
|
createCatalog(oCatalog, fnSuccess, fnFailure)
Creates a new catalog based on the given raw data.
|
|
|
createPage(sId, sCatalogId, sLayout, sTitle, fnSuccess, fnFailure)
Creates a new page with the given properties.
|
|
|
createPageBasedCatalog(sDomainId, sTitle, fnSuccess, fnFailure)
Creates a new catalog based on a catalog page, using the given domain ID and title.
|
|
|
createPageChipInstance(sPageId, sInstanceId, sChipId, sTitle, sConfiguration, sLayoutData, fnSuccess, fnFailure)
Creates a CHIP instance with the given properties inside the page with given ID.
|
|
|
createPageChipInstanceFromRawData(oChipInstance, fnSuccess, fnFailure)
Creates a CHIP instance with the given properties inside the page with given ID.
|
|
|
createProperty(vParent, sBagId, sPropertyName, sValue, sTranslatable, fnSuccess, fnFailure)
Creates a new property with the given value.
|
|
|
deleteBag(vParent, sBagId, fnSuccess, fnFailure)
Deletes the bag with given IDs.
|
|
|
deleteCatalog(oCatalog, fnSuccess, fnFailure)
Deletes the catalog with the given representation which must be the result of a previous
create or read operation.
|
|
|
deletePage(sId, fnSuccess, fnFailure)
Deletes the page with the given ID.
|
|
|
deletePageChipInstance(sPageId, sInstanceId, fnSuccess, fnFailure)
Deletes the CHIP instance with the given ID inside the page with given ID.
|
|
|
deleteProperty(oProperty, fnSuccess, fnFailure)
Deletes the property with the given representation which must be the result of
a previous create or read operation.
|
|
| <inner> |
encodeODataFilterValue(sString)
Encodes a sting to be used in an OData $filter parameter.
|
|
getReferencingCatalogIds(sReferencedChipId, fnSuccess, fnFailure)
Detect if a CHIP is referenced by other CHIPs, also within other catalogs.
|
|
|
Tells whether this facade is reading from and writing to the "PERSONALIZATION" scope.
|
|
|
readAllCatalogs(sPageId, fnSuccess, fnFailure, sFilter, sSorting)
Reads the "allCatalogs" collection (ordered by ID) that belongs to the page with the given
ID.
|
|
|
readBag(vParent, sBagId, fnSuccess, fnFailure)
Reads the bag with the given IDs.
|
|
|
readCatalog(sCatalogId, fnSuccess, fnFailure, bNoChips, bNoChipBags)
Reads the catalog with the given ID including all contained CHIPs (unless specified
otherwise).
|
|
|
readCatalogChips(sCatalogId, aChipIds, fnSuccess, fnFailure)
Reads the given CHIPs from the catalog with the given ID.
|
|
|
readCatalogs(fnSuccess, fnFailure, sFilter)
Reads all catalogs ordered by ID.
|
|
|
readChip(sChipId, fnSuccess, fnFailure)
Reads the CHIP with the given ID.
|
|
|
readMetadata(fnSuccess, fnFailure, bNoCache)
Reads the metadata document of the page building service.
|
|
|
readPage(sId, fnSuccess, fnFailure, sCustomExpand)
Reads the page with the given ID including all contained
- CHIP instances and their CHIPs, - bags and properties (page, CHIP and CHIP instance bags), - RemoteCatalog data. |
|
|
readPages(fnSuccess, fnFailure, bNoCatalogs)
Reads all pages ordered by ID including all contained catalogs (unless specified otherwise).
|
|
|
updateBagProperties(oParent, sBagId, aChangedProperties, aNewProperties, aResetProperties, fnSuccess, fnFailure)
Updates all changed properties for the specified bag using a single batch request.
|
|
|
updateCatalog(oCatalog, fnSuccess, fnFailure)
Updates the catalog with the given representation which must be the result of a previous
create or read operation.
|
|
|
updatePage(oPage, fnSuccess, fnFailure)
Updates the page with the given representation which must be the result of
a previous create or read operation.
|
|
|
updatePageChipInstance(oChipInstance, fnSuccess, fnFailure)
Updates the CHIP instance with the given representation which must be the
result of a previous create or read operation.
|
|
|
updateProperty(oProperty, fnSuccess, fnFailure)
Updates the property with the given representation which must be the result of
a previous create or read operation.
|
- Methods borrowed from class sap.ui2.srvc.ODataService:
- getCsrfToken, getDefaultErrorHandler, openBatchQueue, refreshCsrfToken, setCsrfToken, setDefaultErrorHandler, submitBatchQueue, toString
Ensure that datajs library is available at runtime. If SAPUI5 is available this script automatically imports their datajs implementation.
This facade automatically takes care of Gateway's CSRF protection mechanism via a token. Please perform a read request first, because read requests acquire this token. Otherwise write requests will have fail on first attempt, but automatically acquire this token via reading the service document before repeating the write request. This is a slight performance penalty.
The objects returned by this facade are de-serialized JSON representations of the entities in question, as converted from the OData's response by datajs. They may be decorated with new properties as long as the property names start with a dollar symbol ("$"). This is needed to tell original properties and decorations apart for the purpose of update operations.
- Parameters:
- {string|sap.ui2.srvc.ODataWrapper} vODataBase
- either the base URI of the page building service or (since 1.19.0) a corresponding
sap.ui2.srvc.ODataWrapper - {function (string|[object])} fnDefaultFailure 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.
- {boolean} bIsPersonalization Optional, Default: false
- defines the return value of #isPersonalization; nothing else (since 1.16.1)
- Since:
- 1.2.0
- Parameters:
- {string} sCatalogId
- the old catalog's ID as returned from the page building service
- {string} sNewDomainId
- the new catalog's domain-specific ID which must not contain a colon
- {string} sNewTitle Optional
- the new catalog's title; if the parameter is
undefined, the old catalog's title will be used - {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data (BEWARE: the Chips relation is not expanded, but still deferred!)
- {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. Default: see #getDefaultErrorHandler
- Since:
- 1.19.1
sTargetPageId. The new
reference refers to the CHIP instance with the given ID located on the source page with the
given ID.
- Parameters:
- {string} sSourcePageId
- ID of the source page the CHIP instance with ID
sSourceChipInstanceIdis located on - {string} sSourceChipInstanceId
- ID of the CHIP instance referenced to
- {string} sTargetPageId
- ID of the page where the reference CHIP Instance shall be added to
- {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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. Default: see #getDefaultErrorHandler
- Since:
- 1.21.1
- Parameters:
- {object} oCatalog
- the raw catalog representation (
__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 (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- Since:
- 1.19.1
- Parameters:
- {string} sId
- ID of the new page
- {string} sCatalogId
- ID of the catalog for the new page
- {string} sLayout
- value of the layout property for the new page
- {string} sTitle
- title of the new page
- {function (object)} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- Since:
- 1.2.0
- Parameters:
- {string} sDomainId
- the catalog's domain-specific ID
- {string} sTitle Optional
- the catalog's title, also used for the catalog page
- {function (object)} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking the processed data (as a catalog, not as a page)
- {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. Default: see #getDefaultErrorHandler
- Since:
- 1.19.1
- Parameters:
- {string} sPageId
- ID of page containing the new CHIP instance
- {string} sInstanceId Optional
- ID of new CHIP instance (optional, a UUID will be created as a default)
- {string} sChipId
- ID of CHIP to be used
- {string} sTitle
- title of CHIP instance
- {string} sConfiguration
- configuration of CHIP instance
- {string} sLayoutData
- layout data of CHIP instance
- {function (object)} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking the processed data (Note: The instance's "Chips" relation will not be expanded!)
- {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.
- Since:
- 1.2.0
- Parameters:
- {object} oChipInstance
- the de-serialized JSON representing the CHIP instance to be created
- {string} oChipInstance.pageId
- ID of page containing the new CHIP instance
- {string} oChipInstance.instanceId Optional
- ID of new CHIP instance (optional, a UUID will be created as a default)
- {string} oChipInstance.chipId
- ID of CHIP to be used
- {string} oChipInstance.title Optional
- title of CHIP instance
- {string} oChipInstance.configuration Optional
- configuration of CHIP instance
- {string} oChipInstance.layoutData Optional
- layout data of CHIP instance
- {function (object)} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking the processed data (Note: The instance's "Chips" relation will not be expanded!)
- {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.
- Since:
- 1.9.0
- Parameters:
- {string|object} vParent
- ID of the page or parent object (either page or page CHIP instance; must be the result of a previous create or read operation) of the bag for which a property needs to be created
- {string} sBagId
- ID of the bag
- {string} sPropertyName
- the property name
- {string} sValue
- the property value
- {string} sTranslatable Optional
- determines if the new property is a translatable one (since 1.19.0)
Note: this is treated here as a plain string by intent, although the backend will
treat it like a boolean (
" "vs."X") - {function (object)} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- Since:
- 1.3.0
- Parameters:
- {string|object} vParent
- ID of the page or parent object (either page or page CHIP instance; must be the result of a previous create or read operation) of the bag to be deleted
- {string} sBagId
- ID of the bag to be deleted
- {function ()} fnSuccess Optional
- a callback function that is executed if delete succeeds, taking no data
- {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.
- Since:
- 1.3.0
- Parameters:
- {object} oCatalog
- the de-serialized JSON representing the catalog to be deleted
- {function ()} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking no data
- {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. Default: see #getDefaultErrorHandler
- Since:
- 1.19.1
- Parameters:
- {string} sId
- ID of page to be deleted
- {function ()} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking no data
- {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.
- Since:
- 1.2.0
- Parameters:
- {string} sPageId
- ID of page from which CHIP instance is to be deleted
- {string} sInstanceId
- ID of CHIP instance to be deleted
- {function ()} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking no data
- {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.
- Since:
- 1.2.0
- Parameters:
- {object} oProperty
- the de-serialized JSON representing the property to be deleted
- {function ()} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking no data
- {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.
- Since:
- 1.19.0
- Parameters:
- {string} sString
- string to be encoded.
- Since:
- 1.28.0
- Returns:
- {string} the encoded string
- Parameters:
- {string} sReferencedChipId
- ID of the CHIP for which references are searched
- {function (array)} fnSuccess
- A callback function that is executed if the request succeeds. It is taking an array of catalog IDs which contain the referenced CHIP ID. The list may be in arbitrary order, notably not the order of the initial array
- {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.
- Since:
- 1.28.0
- Since:
- 1.16.1
- Returns:
- {boolean} whether this facade is reading from and writing to the "PERSONALIZATION" scope
- Parameters:
- {string} sPageId
- ID of the page
- {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- {string} sFilter Optional
- filter value as defined by OData specification e.g. "type eq 'H'" for HANA catalogs. Filter has been introduced with version 1.16.2.
- {string} sSorting
- name of the field to be sorted on via $orderby as defined by OData specification. If not defined the dafault sorting would be on the field id (since 1.44)
- Since:
- 1.7.0
- Parameters:
- {string|object} vParent
- ID of the page or parent object (either page or page CHIP instance; must be the result of a previous create or read operation) of the bag to be read
- {string} sBagId
- ID of the bag to be read. If the bag does not exist the error handler will be called.
- {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- Since:
- 1.3.0
- Parameters:
- {string} sCatalogId
- ID of the catalog to be loaded
- {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- {boolean} bNoChips Optional, Default: false
- whether to avoid including all contained CHIPs
- {boolean} bNoChipBags Optional, Default: false
- whether to avoid including CHIP bags and properties
- Since:
- 1.2.0
- Parameters:
- {string} sCatalogId
- ID of the catalog to be loaded
- {string[]} aChipIds Optional
- the IDs of the CHIPs to be loaded. If
undefined, all CHIPs will be loaded. - {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- Since:
- 1.16.4
- Throws:
- Error if an empty array is given for filtering
- Parameters:
- {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- {string} sFilter Optional
- filter value as defined by OData specification e.g. "type eq 'H'" for HANA catalogs. Filter has been introduced with version 1.26.0
- Since:
- 1.2.0
- Parameters:
- {string} sChipId
- ID of the CHIP to be loaded
- {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- Since:
- 1.2.0
- Parameters:
- {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- {boolean} bNoCache
- (since 1.5.0) whether to avoid caching
- Deprecated:
- Since 1.17.0 it is no longer necessary to fetch a CSRF token first; this is done automatically.
- Since:
- 1.2.0
- CHIP instances and their CHIPs,
- bags and properties (page, CHIP and CHIP instance bags),
- RemoteCatalog data.
Via the parameter sCustomExpand you can specify a different $expand statement.
- Parameters:
- {string} sId
- ID of the page to be read
- {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- {string} sCustomExpand Optional, Default: "Bags/Properties,PageChipInstances/Chip/ChipBags/ChipProperties,PageChipInstances/RemoteCatalog,PageChipInstances/ChipInstanceBags/ChipInstanceProperties"
- (since 1.30.0) can be used to overwrite the default $expand value. If "" is used, the entire $expand parameter will be skipped
- Since:
- 1.2.0
- Parameters:
- {function (object)} fnSuccess
- a callback function that is executed if the request succeeds, taking the processed data
- {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.
- {boolean} bNoCatalogs Optional, Default: false
- whether to avoid including all contained catalogs
- Since:
- 1.2.0
- Parameters:
- {object} oParent
- parent of the bag to be updated (either page or page CHIP instance)
- {string} sBagId
- ID of the bag
- {array} aChangedProperties Optional, Default: []
- array of existing properties to be changed
- {array} aNewProperties Optional, Default: []
- array of properties to be created
- {array} aResetProperties Optional, Default: []
- array of properties to be reset (since 1.17.1)
- {function(array|array|array)} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking three arrays of response objects for changed, new and reset properties respectively. For a successful creation, the response object is the new entity. For a successful change, it is undefined. For a successful reset it is the entity from the underlying scope or undefined if this does not exist. For a failed request, it is the corresponding error message.
- {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.
NOTE: it is called only in case the whole$batchrequest fails!)
- Deprecated:
- Use sap.ui2.srvc.ODataService#openBatchQueue instead.
- Since:
- 1.11.0
- Parameters:
- {object} oCatalog
- the de-serialized JSON representing the catalog to be updated
- {function ()} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking no data
- {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.
- Since:
- 1.19.1
- Parameters:
- {object} oPage
- the de-serialized JSON representing the page to be updated
- {function ()} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking no data
- {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.
- Since:
- 1.2.0
- Parameters:
- {object} oChipInstance
- the de-serialized JSON representing the CHIP instance to be updated
- {function ()} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking no data
- {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.
- Since:
- 1.2.0
- Parameters:
- {object} oProperty
- the de-serialized JSON representing the property to be updated
- {function ()} fnSuccess Optional
- a callback function that is executed if the request succeeds, taking no data
- {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.
- Since:
- 1.3.0