Class Index | File Index

Classes


Namespace chip.url

The namespace for the CHIP API's url contract, which allows you convert relative URLs into absolute ones.
Defined in: url.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
chip.url.addSystemToServiceUrl(sServiceUrl, sSystem)
Makes the given server-relative service URL point to the system given as parameter sSystem or to the system of this CHIP's catalog if sSystem is empty.
<static>  
Returns the system of this CHIP's catalog where application data for this CHIP is typically located.
<static>  
chip.url.toAbsoluteUrl(sUrl)
Makes the given relative URL absolute.
Namespace Detail
chip.url
Since:
1.2.0
Method Detail
<static> {string} chip.url.addSystemToServiceUrl(sServiceUrl, sSystem)
Makes the given server-relative service URL point to the system given as parameter sSystem or to the system of this CHIP's catalog if sSystem is empty. Server-relative URL means a URL starting with exactly one "/" (also known as absolute-path URL).

The function is typically used if the CHIP has been loaded from a remote catalog. In this case, a CHIP wants to perform service calls to the system providing the remote catalog: it must convert the corresponding URLs via this method. The function may also be used for CHIPs loaded from a local catalog to perform service calls to a different system.

The system is added via segment parameter o to the last URL segment of the service URL. It is also possible to make this function put the system to a different URL path segment of the service URL by specifying the empty segment parameter o. If both sSystem is empty and the CHIP is loaded from a local catalog, no system is added and the empty segment parameter o is removed.
Example 1: /sap/opu/odata/MyService/?p1=v1 is converted to /sap/opu/odata/MyService;o=SYS/?p1=v1 if the corresponding CHIP has been loaded via a remote catalog with system ID "SYS". However it remains unchanged if the CHIP has been loaded from the logon system and the parameter sSystem is empty.
Example 2: /sap/opu/odata/MyService;o=/MyEntities/$count?p1=v1 is converted to /sap/opu/odata/MyService;o=sid(SYS.123)/MyEntities/$count?p1=v1 if parameter sSystem is set to "sid(SYS.123)".

The URL is in no way normalized.

Parameters:
{string} sServiceUrl
a server-relative service URL (to be used when addressing the system directly)
{string} sSystem Optional
a system specification like "SYS" or "sid(SYS.123)"; if empty the system of the CHIP's catalog is used
Since:
1.19.1
Throws:
Error if the URL is not server-relative such as ./something, http://foo.bar/something, ...)
Returns:
{string} the service URL pointing to the system specified in parameter sSystem or to the system from which the CHIP's catalog has been loaded

<static> {string} chip.url.getApplicationSystem()
Returns the system of this CHIP's catalog where application data for this CHIP is typically located. This API is needed in scenarios where a CHIP navigates to another application and needs to transfer system information so that the application can use the same application system.
Since:
1.19.1
Returns:
{string} the system of this CHIP's catalog or undefined if there is no such catalog
See:
chip.url.addSystemToServiceUrl

<static> {string} chip.url.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

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