Class: Chainable

Gitana. Chainable

Provides common chaining functions used by various interface methods


new Chainable(driver)

Parameters:
Name Type Description
driver Gitana.Driver
Source:

Methods


__copyState()

Override the Chain.__copyState method so that it utilizes a base method that we can override
on a per-class basis.

Source:

chainCopyState(otherObject)

Used internally during chain copy going forward or backward through the chain.

This is wired into the Chain.__copyState method and allows a convenient way to override
chain copy behavior on a per-object-type basis.

Parameters:
Name Type Description
otherObject
Source:

chainCreate(chainable, object, uri, params)

Creates an object on the server (write + read).
Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
object
uri
params
Source:

chainCreateEx(chainable, object, createUri, readUri)

Creates an object on the server using one URL and then reads it back using another URL.
This exists because the security responses don't include _doc fields like other responses.

Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
object
createUri
readUri
Source:

chainGet(chainable, uri, params)

Performs a GET from the server and populates the chainable.
Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
uri
params
Source:

chainGetResponse(chainable, uri, params)

Performs a GET to the server and pushes the response into the chain.
Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
uri
params
Source:

chainGetResponseRows(chainable, uri, params)

Performs a GET to the server and pushes the "rows" response attribute into the chain.
Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
uri
params
Source:

chainGetResponseText(chainable, uri, params)

Performs a GET to the server and pushes the text response to the callback.

Parameters:
Name Type Description
chainable
uri
params
Source:

chainHasResponseRow(chainable, uri, value)

Performs a GET to the server and checks whether the "rows" array attribute of the response
has the given value.

Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
uri
value
Source:

chainPost(chainable, uri, params, payload, handleFn)

Performs a POST to the server and populates the chainable with results.
Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
uri
params
payload
handleFn
Source:

chainPostEmpty(chainable, uri, params, payload, contentType)

Performs a POST to the server. The response is not handled.
Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
uri
params
payload

(optional)

contentType

(optional) - example "text/plain"

Source:

chainPostResponse(chainable, uri, params)

Performs a POST to the server and pushes the response into the chain.
Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
uri
params
Source:

chainUpload(chainable, uri, params, contentType, payload)

Performs a POST to the server. The response is not handled.
Proceeds with the chain as bound to the chainable.

Parameters:
Name Type Description
chainable
uri
params
contentType

(optional) - example "text/plain"

payload

(optional)

Source:

extractPrincipalDomainQualifiedId(principal)

Helper to gets the principal id for a principal object, json structure or principal id itself.
This returns something like "domainId/principalId"

Parameters:
Name Type Description
principal
Source:

extractPrincipalIdentifiers(principal, defaultDomainId)

Helper to gets the principal id for a principal object, json structure or principal id itself.
This returns something like "domainId/principalId"

Parameters:
Name Type Description
principal

principal object or string (principal id or domain qualified principal id)

defaultDomainId
Source: