Class: J

jclient/js/core~J(serv)

Jclient.js API Java equivalent of io.odysz.jclient.Clients; io.odysz.jclient.SessionClient;

Constructor

new J(serv)

Parameters:
Name Type Description
serv string serv path root, e.g. 'http://localhost/semantic-jserv'
Properties:
Name Type Description
cfg the configurations,
cfg.connId,
cfg.verbose,
cfg.defaultServ:
where defaultserv is the serv root, will be concated with port name for different poert.
Source:

Methods

(static) checkResponse(resp)

Check Response form jserv
Parameters:
Name Type Description
resp any
Source:

init(urlRoot, connId)

initialize with url and default connection id
Parameters:
Name Type Description
urlRoot stirng root url
connId string connection Id
Source:

login(usrId, pswd, onLogin, on)

Login to jserv
Parameters:
Name Type Description
usrId string
pswd string
onLogin function on login ok handler
on function failed
Source:

post(jreq, onOk, onErr)

Post a request, using Ajax.
Parameters:
Name Type Description
jreq JMessage
onOk function
onErr function
Source:

respCols(resp, the) → {array}

Get the cols from jserv's rows (response from port returning SResultsets)
Parameters:
Name Type Description
resp SemanticObject
the ix rs index
Source:
Returns:
array of column names
Type
array

respObjs(resp, the, len) → {array}

Get the objects from jserv's rows (response from port returning SResultsets)
Parameters:
Name Type Description
resp SemanticObject
the ix rs index
len int max length
Source:
Returns:
array of objects
e.g [ [col1: cell1], ...]
Type
array

respRows(resp, the) → {array}

Get the rows from jserv's rows (response from port returning SResultsets)
Parameters:
Name Type Description
resp SemanticObject
the ix rs index
Source:
Returns:
array of rows
Type
array

servUrl(port)

Get port url of the port.
Parameters:
Name Type Description
port string the port name
Source:
Returns:
the url

understandPorts(new) → {J}

Understand the prots' name of the calling app's.
As jclient defined the basice ports, more ports extension shoould been understood by the API lib. This function must been callded to extned port's names.
Parameters:
Name Type Description
new string Ports
Source:
Returns:
this
Type
J