Class: TraversalResults

Gitana. TraversalResults

Provides access to traversal results


new TraversalResults(branch [, Object])

Parameters:
Name Type Argument Description
branch Gitana.Branch
Object <optional>

object

Source:

Extends

Methods


__copyState()

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

Inherited From:
Source:

association(id)

Hands back a single association.

Parameters:
Name Type Description
id
Source:

associationCount(callback)

Counts the number of associations in teh traversal results

Parameters:
Name Type Description
callback
Source:

associations()

Hands back a map of all of the associations in the traversal results

Source:

center()

Looks up the node around which this traversal is centered.

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
Inherited From:
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
Inherited From:
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
Inherited From:
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
Inherited From:
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
Inherited From:
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
Inherited From:
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
Inherited From:
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
Inherited From:
Source:

chainPost(chainable, uri, params, payload)

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
Inherited From:
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"

Inherited From:
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
Inherited From:
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)

Inherited From:
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
Inherited From:
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
Inherited From:
Source:

getBranch()

Gets the Gitana Branch object.

Source:
Returns:

The Gitana Branch object

Type
Gitana.Branch

getBranchId()

Gets the Gitana Branch id.

Source:
Returns:

The Gitana Branch id

Type
String

getRepository()

Gets the Gitana Repository object.

Source:
Returns:

The Gitana Repository object

Type
Gitana.Repository

getRepositoryId()

Gets the Gitana Repository id.

Source:
Returns:

The Gitana Repository id

Type
String

handleResponse(response)

Parameters:
Name Type Description
response
Inherited From:
Overrides:
Source:

handleSystemProperties()

Gets called after the response is handled and allows the object to pull out special values from
the "object" field so that they don't sit on the JSON object

Inherited From:
Source:

json()

Hands back a cleanup, properties-only JSON simple object.

Inherited From:
Source:

node(nodeId)

Hands back a single node

Parameters:
Name Type Description
nodeId
Source:

nodeCount(callback)

Counts the number of nodes in the traversal results

Parameters:
Name Type Description
callback
Source:

nodes()

Hands back a map of all of the nodes in the traversal results

Source: