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
(group, cb)

clients/linkerClient.js, line 42

Create a new linker group

Name Type Description
group LinkerClient~group

An object that describes the new group. Needs name, color and border properties

cb LinkerClient~groupCB optional

callback to be called on success

Example
LinkerClient.createGroup("groupname",callback)

deleteGroup
(groupName, cb)

clients/linkerClient.js, line 65

Delete a linker group.

Name Type Description
groupName string

The name of the group

cb LinkerClient~groupCB optional
Example
LinkerClient.updateGroup("group1",{name:"newGroup1",color:"black",border:"white",receive:[],transmit:[]},callback)

getAllLinksForGroup
(String, cb)

clients/linkerClient.js, line 239

Get all links for a group

TODO
  • Coming soon
Name Type Description
String

groupName - Group Name

cb LinkerClient~linksCB optional
Example
LinkerClient.getAllLinksForGroup("group1",callback)

getGroup
(groupName, cb)

clients/linkerClient.js, line 179

Get a 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 198

Get all linker groups

Name Type Description
cb LinkerClient~groupsCB optional

callback to be called on success

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

Get all links for a window. Links are are group:dataType

Name Type Description
cb LinkerClient~linksCB optional

callback to be called on success

Example
LinkerClient.getLinks(callback)

openLinkerWindow
(cb)

clients/linkerClient.js, line 287

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 356

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 115

Add a client to a group. Clients will receive all transmits for a registered group. This creates the initial link.

Name Type Description
group LinkerClient~group

Group to add to

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)

unRegisterGroup
(group, client, cb)

clients/linkerClient.js, line 149

Removes a client from a group.

Name Type Description
group LinkerClient~group

Group to remove

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
(groupName, newGroup, cb)

clients/linkerClient.js, line 91

Update a linker group's info.

Name Type Description
groupName string

The name of the group

newGroup LinkerClient~group

Properties of the new group

cb LinkerClient~groupCB optional
Example
LinkerClient.updateGroup("group1",{name:"newGroup1",color:"black",border:"white",receive:[],transmit:[]},callback)
clients/linkerClient.js, line 267

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
color string
border string
receive Array
transmit Array

groupCB
(err, responseMessage)

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

groupsCB
(err, responseMessage)

clients/linkerClient.js, line 524
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 529
Name Type Description
err Object
responseMessage LinkerClient~links