Class: ReportMap

Gitana. ReportMap

Map of reports


new ReportMap(platform [, Object])

Parameters:
Name Type Argument Description
platform Gitana.Platform

Gitana platform instance.

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:

buildObject(json)

Parameters:
Name Type Description
json
Overrides:
Source:

chainCopyState(otherObject)

Override to include:

keys totalRows
size offset

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, 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
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:

clone()

Source:

count()

Counts the number of elements in the map and fires it into a callback function.

Inherited From:
Source:

each(callback)

Iterates over the map and fires the callback function in SERIAL for each element in the map.
The scope for the callback is the object from the map (i.e. repository object, node object).

The arguments to the callback function are (key, value) where value is the same as "this".

NOTE: This works against elements in the map in SERIAL. One at a time. If you are doing concurrent
remote operations for members of the set such that each operation is independent, you may want to use
the eachX() method.

Parameters:
Name Type Description
callback
Inherited From:
Source:

eachX(callback)

Iterates over the map and fires the callback function in PARALLEL for each element in the map.
The scope for the callback is the object from the map (i.e. repository object, node object).

The arguments to the callback function are (key, value) where value is the same as "this".

NOTE: This works against elements in the map in PARALLEL. All map members are fired against at the same
time on separate timeouts. There is no guaranteed order for their completion. If you require serial
execution, use the each() method.

Parameters:
Name Type Description
callback
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:

filter(callback)

Iterates over the map and applies the callback filter function to each element.
It should hand back true if it wants to keep the value and false to remove it.

NOTE: the "this" for the callback is the object from the map.

Parameters:
Name Type Description
callback
Inherited From:
Source:

handleResponse(response)

Parameters:
Name Type Description
response
Inherited From:
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:

keepOne()

Keeps the first element in the map

Inherited From:
Source:

limit(size)

Limits the number of elements in the map.

Parameters:
Name Type Description
size
Inherited From:
Source:

paginate(pagination)

Paginates elements in the map.

Parameters:
Name Type Description
pagination
Inherited From:
Source:

select(key)

Selects an individual element from the map and continues the chain.

Parameters:
Name Type Description
key
Inherited From:
Source:

sort(comparator)

Applies a comparator to sort the map.

If no comparator is applied, the map will be sorted by its modification timestamp (if possible).

The comparator can be a string that uses dot-notation to identify a field in the JSON that
should be sorted. (example: "title" or "property1.property2.property3")

Finally, the comparator can be a function. It takes (previousValue, currentValue) and hands back:
-1 if the currentValue is less than the previousValue (should be sorted lower)
0 if they are equivalent
1 if they currentValue is greater than the previousValue (should be sorted higher)

Parameters:
Name Type Description
comparator
Inherited From:
Source: