teaObjectService

This is a service available under tea.services. The objectService is a factory which creates TeaObjects providing data from TIBCO Enterprise Administrator Server and agents.

Dependencies

  • $q
  • $http
  • $rootScope

Methods

load
The load function causes the browser to emit an AJAX call to the server to retrieve a TIBCO Enterprise Administrator object.
Parameters
  • paramsObject – {object} – Parameters object containing the following properties ([propKey] indicates that a property is optional):
    • agentType - {string} - The agent type name. Used to set agent type token in the Object ID.
    • objectType - {string} - The object type. Used to set objType token in the Object ID.
    • [agentID] – {string} – The agent ID. Used to set agentID in the Object ID. Not needed if there is only one agent of a given agentType.
    • [objectKey] – {string} – The object key. Used to set objectKey in the Object ID. Not needed if the object is a singleton.
Returns

{Promise} – Returns a promise that will be resolved with the object requested as TeaObject

loadPath
The loadPath function causes the browser to emit an AJAX call to the server to retrieve a TeaObject.
Parameters

path – {string} – path of the object following members relation from the root object.

Returns

{Promise} – Returns a promise that will be resolved with the object requested as TeaObject

loadType
The loadType function causes the browser to emit an AJAX call to the server to retrieve a TeaObject type.
Parameters

typeName – {string} – typeName string following the format agentType:agentVersion:objectType.

Returns

{Promise} – Returns a promise that will be resolved with the object requested as TeaObjectType

invoke
The invoke method invokes an operation on an object. An AJAX call is made to the server that uses object meta-data to invoke the object operation on the agent managing this object.
Parameters
paramsObject – {object} – Parameters object containing the following properties ([propKey] indicates that a property is optional):
  • agentType – {string} – The agent type name. Used to set agent type token in the Object ID.
  • objectType – {string} – The object type. Used to set objType token in the Object ID.
  • [agentID] – {string} – The agent ID. Used to set agentID in the Object ID. Not needed if there is only one agent of a given agentType.
  • [objectKey] – {string} – The object key. Used to set objectKey in the Object ID. Not needed if the object is a singleton.
  • operation – {string} – String parameter defining the operation name to invoke
  • methodType – {string} – String parameter defining the method type i.e. READ, UPDATE or DELETE
  • params – {object} – Object parameter defining arguments of the operation invocation.

requireHeaders - {boolean} - If this parameter is true, then the returned Promise will be resolved with object containing response and http headers.

Returns

{Promise} – Returns a promise that will be resolved with the response object of the operation.

query
The query method queries the agent and retrieves an array of TeaObject instances. An AJAX call is made to the server that uses object meta-data to retrieve the object data from the agent managing the specified type of object.

The intended use case for this query is to support lists.

The query operation invokes the agent READ operation named query on the given object. That operation can be defined using standard mechanism to define object operations inside TIBCO Enterprise Administrator agents.

Parameters
paramsObject – {object} – Parameters object containing the following properties ([propKey] indicates that a property is optional):
  • agentType – {string} – The agent type name. Used to set agent type token in the Object ID.
  • objectType – {string} – The object type. Used to set objType token in the Object ID.
  • [agentID] – {string} – The agent ID. Used to set agentID in the Object ID. Not needed if there is only one agent of a given agentType.
  • [objectKey] – {string} – The object key. Used to set objectKey in the Object ID. Not needed if the object is a singleton.
  • params – {object} – Object parameter defining arguments of the operation invocation.
Returns

{Promise} – Returns a promise that will be resolved with the objects requested as Array<TeaObject>

reference
The reference operation queries the agent and retrieves an array of TeaAgent instances. An AJAX call is made to the server that uses object meta-data to retrieve the object data from the agent managing the specified type of object.

The intended use case for this reference is to support relationship lists. query needs parameters while reference is named. A reference is navigable which means that the TIBCO Enterprise Administrator server can retrieve the list of objects based only on meta-data. This allows the reference results to be indexed.

Parameters
paramsObject – {object} – Parameters object containing the following properties ([propKey] indicates that a property is optional):
  • agentType – {string} – The agent type name. Used to set agent type token in the Object ID.
  • objectType – {string} – The object type. Used to set objType token in the Object ID.
  • [agentID] – {string} – The agent ID. Used to set agentID in the Object ID. Not needed if there is only one agent of a given agentType.
  • [objectKey] – {string} – The object key. Used to set objectKey in the Object ID. Not needed if the object is a singleton.
  • reference – {string} – String parameter defining the name of the reference to retrieve.
Returns

{Promise} – Returns a promise that will be resolved with the objects requested as Array<TeaObject>

isProductRegistered
The isProductRegistered function causes the browser to send an AJAX call to the server to check whether the product is registered with the TIBCO Enterprise Administrator server.
Parameters
  • paramsObject – {object} – Parameters object containing the following properties:
    • agentTypeName - {string} - The agent type name of the product.
    • agentTypeVersion - {string} - The agentTypeVersion of the product.
Returns {Promise} – Returns a promise that will be resolved with a boolean value indicating whether the product is registered or not.

Usage

The typical usage of the object service is to retrieve objects needed to render the view.