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.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| 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> |
chip.url.getApplicationSystem()
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.
|
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
sSystemor to the system from which the CHIP's catalog has been loaded
- Since:
- 1.19.1
- Returns:
- {string} the system of this CHIP's catalog or
undefinedif there is no such catalog
- Parameters:
- {string} sUrl
- the (possibly server-relative) URL
- Since:
- 1.2.0
- Returns:
- {string} the absolute URL