-
Notifications
You must be signed in to change notification settings - Fork 42
URI Broker
The URI Broker is an object in the App web framework which facilitates calls to the App server by constructing URIs utilizing the context from the calling App.
This object is accessible independent of other frameworks involved such as Angular, and is even accessible via iframe. This is because it is hung off of a global when within the Virtual Desktop. Access the URI Broker via one of two locations:
window.ZoweZLUX.uriBroker
window.parent.ZoweZLUX.uriBroker
The URI Broker builds different categories of URIs depending upon what the App wishes to call. Each category is listed below.
Dataservices can be either based on HTTP (REST) or Websocket.
pluginRESTUri(plugin:ZLUX.Plugin, serviceName: string, relativePath:string): string
Returns: A URI for making an HTTP service request
pluginWSUri(plugin: ZLUX.Plugin, serviceName:string, relativePath:string): string
Returns: A URI for making a Websocket connection to the service
Defaults and user storage may exist for an App such that they can be retrieved via the Configuration Dataservice. There are different scopes and actions to take with this service, and therefore there are a few URIs that can be built:
pluginConfigUri(pluginDefinition: ZLUX.Plugin, resourcePath:string, resourceName?:string): string
Returns: A URI for accessing the requested resource under the user's storage.
pluginConfigForScopeUri(pluginDefinition: ZLUX.Plugin, scope: string, resourcePath:string, resourceName?:string): string
Returns: A URI for accessing a specific scope for a given resource.
Content under an App's web directory is static content accessible by a browser. This can be accessed via:
pluginResourceUri(pluginDefinition: ZLUX.Plugin, relativePath: string): string
Returns: A URI for getting static content
Static content and services are accessed off of the root URI of an App. If there are other points that you need to access on that App, you can get the root:
pluginRootUri(pluginDefinition: ZLUX.Plugin): string
Returns: A URI to the root of the App.
A client can find different information about a server's configuration or the configuration as seen by the current user by accessing specific APIs.
pluginListUri(pluginType: ZLUX.PluginType): string
Returns: A URI which when accessed will return the list of existing Plugins on the server by the type specified, such as "Application" or "all".