teaLocation

This service is available under tea. services. The teaLocation service parses the URL in the browser address bar (based on AngularJS $location) and makes the URL available to your application. Changes to the URL in the address bar are reflected into teaLocation service. Use teaLocation to navigate from one page or view to another.

Note: Do not to directly edit AngularJS $location in your application.

URLs in TIBCO Enterprise Administrator have the following form:http://localhost:8777/tea/view/{agentType}/{objectType}/{viewName}[?{query}]

Dependencies

  • $rootScope
  • $window
  • $location
  • teaObjectService
  • $log

Methods

goto
The goto function causes the browser to navigate to a TIBCO Enterprise Administrator screen that is registered by the specified agent and which displays a particular view of a particular type of object.
Parameters
  • params – {object} – Parameters object containing the following properties ([propKey] indicates that a property is optional):
    • agentType - {string} - The agent name. Used to set agent token in the URL.
    • objectType - {string} - The object type. Used to set objType token in the URL.
    • [viewName] - {string} - The view name. Used to set objView token in the URL. If no view is specified, the view name will be '_'. This property is optional.
    • [query] - {object} - Query object. Specifies name-value pairs that will be added as query parameters within the URL. This property is optional.

Properties

info

This object allows the implementers of statelessly navigable TIBCO Enterprise Administrator screens to bind to the information that was provided in the URL, without having to hard-code the URL structure everywhere.

Parameters appearing in teaLocation.info will have been automatically URL-decoded. TIBCO Enterprise Administrator does not impose any limitations on the characters being used in object keys, query parameters, etc. The query string may contain any valid UTF-8 character. As a result, screen developers should not need to implement URL encoding or decoding for these parameters, as this is provided by teaLocation.

Returns

  • {object} – object with the following properties:
    • agentType - {string} - The agent type token in the URL.
    • objectType - {string} - The object type token in the URL.
    • viewName - {string} - The view name token in the URL. If no view is specified, the view name will be '_'. This property is optional.
    • query - {object} - the query token from the URL, as name-value pairs.

Events

teaLocationChangedSuccess
Broadcasted when the change of URL has been processed by teaLocation.
Type: broadcast
Target: root scope
Parameters
  • event - {object} - Synthetic event object.
  • newInfo - {object} - info property that represents information about the new URL. See teaLocation.info for more information about the attributes of this object.
  • oldInfo - {object} - info property that represents information about the old URL. See teaLocation.info for more information about the attributes of this object.

Usage

The goto method facilitates linking from one screen to another. It allows the implementers of TIBCO Enterprise Administrator screens to support pivoting to related objects, without having to hard-code the URL structure everywhere and without needing to know details of how TIBCO Enterprise Administrator accomplishes the link.

teaLocation.goto() will automatically URL-encode the query string parameters. TIBCO Enterprise Administrator does not impose any limitations on the characters being used in object keys, query parameters, etc. The query string may contain any valid UTF-8 character. As a result, screen developers should not need to implement URL encoding or decoding for these parameters, as this is provided by teaLocation.

Example

One of the BusinessWorks screens within TIBCO Enterprise Administrator displays details about an AppNode. This screen contains a table of Apps that are associated with the AppNode. Each row in the table shows a very brief summary view of one App. The first column in the table shows the App's unique ID from the BusinessWorks object model. This value is rendered as a link. If the user clicks on the link, TIBCO Enterprise Administrator navigates to the TIBCO Enterprise Administrator screen that displays details about a single App.

One of the BusinessWorks screens within TIBCO Enterprise Administrator displays details about a process. This screen contains a table of SAP Adapter Endpoints that are associated with the process. Each row in the table shows a very brief summary view of one SAP Adapter Endpoint, with information retrieved from BusinessWorks's own process model. The first column in the table shows the SAP Adapter Endpoint's ID. This value is rendered as a link. If the user clicks on the link, TIBCO Enterprise Administrator navigates to the screen that displays details about a single SAP Adapter Endpoint. Note that this screen is not contributed to TIBCO Enterprise Administrator by the BusinessWorks agent, but rather by the SAP Adapter agent. The information about this agent - agent name, agent version, available object types, available views, etc - is published as a spec by the Adapters team and used by the BusinessWorks team when developing the BusinessWorks UI.