Utilities for working with URLs
Methods
-
staticbcdui.util.url.extractFolderFromURL(url){string}
util/urlPackage.js, line 102 -
Gets the folder containing the document identified by the URL. So if the URL is for example "http://xxxxx/root/data.xml" it returns "http://xxxxx/root/". If the URL is already pointing to a folder (ending with "/") it simply returns this URL.
Name Type Description urlstring The URL the folder is computed from. Returns:
Type Description string The parent folder of the element denoted by the URL or the URL itself if it is already a folder (ending with slash "/"). -
staticbcdui.util.url.isAbsoluteURL(url){boolean}
util/urlPackage.js, line 88 -
Tests if the specified URL is an absolute URL or null. In this case it returns true and false otherwise.
Name Type Description urlstring The URL to be inspected. Returns:
Type Description boolean True if the URL is either null or an absolute URL. -
staticbcdui.util.url.resolveToFullURLPathWithCurrentURL(url){String}
util/urlPackage.js, line 74 -
Converts a relative URL (like ../Ziplet) to a full URL path (like (/myApp/ZipLet), based on the current page location.
Name Type Description urlString The (relative or absolute) url to a full URL path. Returns:
Type Description String The full URL path which is the absolute URL without the host/protocol/port part, starting with slash. -
staticbcdui.util.url.resolveURLWithXMLBase(DomElement, url){string}
util/urlPackage.js, line 120 -
Resolves a URL with its correct xml:base. To compute the xml:base for the URL it may be necessary to resolve the xml:base with its ancestor xml:base elements unless one of them is an absolute URL.
Name Type Description DomElementDomElement The point where the xml:base resolution should start. urlstring The URL to be resolved. Returns:
Type Description string The URL resolved with all xml:base elements of the element itself and its ancestor elements. -
staticbcdui.util.url.translateRelativeURL(relativeBaseUrl, relativeUrl){string}
util/urlPackage.js, line 35 -
This utility function applies a relative URL to a base URL and returns the resulting URL. It is quite useful to compute for example the value of the xml:base attribute of XIncludes, because the xml:base URL it the model's data URL applied to the browser's href. For example if the relativeBaseUrl is "/myProject/reports/myReport.jsp" and the relativeUrl is "../include/data.xml" the result will be "/myProject/include/data.xml".
Name Type Description relativeBaseUrlstring The URL the relativeUrl is based on. This may be a relative or an absolute URL. relativeUrlstring The relative URL to be resolved. Returns:
Type Description string The result of applying the relativeUrl to the relativeBaseUrl.