Class: LinkerClient

Linker Client

Public API for The Linker Service


The Linker client acts as an API between components and the Linker Service. The linker client allows for sharing of data between components.

TODO
  • catch refesh events so that we can close down the linker window if open

Methods

createGroup
(groupName, cb)

clients/linkerClient.js, line 43

Create a new linker group

Name Type Description
groupName string

The name of the new group

cb LinkerClient~groupCB optional

callback to be called on success

Example
LinkerClient.createGroup("groupname",callback)

getGroup
(groupName, cb)

clients/linkerClient.js, line 143

Get a new linker group

Name Type Description
groupName string

The name of the new group

cb LinkerClient~groupCB optional

callback to be called on success

Example
LinkerClient.getGroup("groupname",callback)

getGroups
(cb)

clients/linkerClient.js, line 162

Get a new linker group

Name Type Description
cb LinkerClient~groupsCB optional

callback to be called on success

Example
LinkerClient.getGroups(callback)
clients/linkerClient.js, line 181

Get all links for a window

Name Type Description
cb LinkerClient~linksCB optional

callback to be called on success

Example
LinkerClient.getLinks(callback)

openLinkerWindow
(cb)

clients/linkerClient.js, line 223

Opens the linker popup and sends the current windows information

Name Type Description
cb function optional

callback to be called on success

Example
LinkerClient.openLinkerWindow(cb)

publish
(params, cb)

clients/linkerClient.js, line 304

Publish data to all listeners for a group and data type.

Name Type Description
params Object

the name of the group subscribing to

Name Type Description
dataType String

The data type sending

data any

the data being transmitted

cb function optional

callback to be called on success

Example
LinkerClient.publish({dataType:"symbol",data:"AAPL"})

registerGroup
(group, client, cb)

clients/linkerClient.js, line 90

Register a client to a groups. Clients will receive all transmits for a registered group.

Name Type Description
group LinkerClient~group

The old group

client string

The window name of the client

cb LinkerClient~linksCB optional

Returns all the links for the client

Example
LinkerClient.registerGroup({name:"group1",receive:[],transmit:[]},"windowNameHere",callback)

subscribe
(groupName, dataType, cb)

clients/linkerClient.js, line 276

Add a listener to the specified group and data type

Name Type Description
groupName String

the name of the group subscribing to

dataType String

The data type be subscribed to

cb function optional

callback to be called on success

Example
LinkerClient.subscribe("symbol", cb)

unRegisterGroup
(group, client, cb)

clients/linkerClient.js, line 118

Removes a client from a groups.

Name Type Description
group LinkerClient~group

The old group

client string

The window name of the client

cb LinkerClient~linksCB optional

Returns all the links for the client

Example
LinkerClient.unRegisterGroup({name:"group1",receive:[],transmit:[]},"windowNameHere",callback)

updateGroup
(previousGroup, newGroup, cb)

clients/linkerClient.js, line 66

Update a groups info. Currenlty, only the name is used.

Name Type Description
previousGroup LinkerClient~group

The old group

newGroup LinkerClient~group

The name of the new group

cb LinkerClient~groupCB optional
Example
LinkerClient.createGroup({name:"group1",receive:[],transmit:[]},{name:"group2",receive:[],transmit:[]},callback)
clients/linkerClient.js, line 203

Get all links for a window

Name Type Description
msg Object
Name Type Description
client String
dataType String
group String
value boolean
cb LinkerClient~linksCB optional

callback to be called on success

Example
LinkerClient.updateLink(msg,callback)

Type Definitions

dataTypeObject

Linker data Type

Properties:
Name Type Description
link LinkerClient~links

groupObject

Linker group

Properties:
Name Type Description
name string
receive Array
transmit Array

groupCB
(err, responseMessage)

clients/linkerClient.js, line 462
Name Type Description
err Object
responseMessage LinkerClient~group

groupsCB
(err, responseMessage)

clients/linkerClient.js, line 467
Name Type Description
err Object
responseMessage Array.<LinkerClient~group>

linkGroupObject

Linker link group

Properties:
Name Type Description
dataType LinkerClient~dataType

Linker link

Properties:
Name Type Description
receive boolean
transmit boolean

Linker links

Properties:
Name Type Description
group LinkerClient~linkGroup

linksCB
(err, responseMessage)

clients/linkerClient.js, line 472
Name Type Description
err Object
responseMessage LinkerClient~links