Class: Application

Gitana. Application

Application


new Application(platform [, Object])

Parameters:
Name Type Argument Description
platform Gitana.Platform
Object <optional>

object json object (if no callback required for populating)

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:

chainCopyState(otherObject)

Override to include:

__system

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:

chainDelete(chainable, uri, params)

Executes an HTTP delete for this object and continues the chain with the chainable.

Parameters:
Name Type Description
chainable
uri
params
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:

chainPatch(chainable, uri, params, payload)

Performs a PATCH 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:

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:

chainReload(uri, params)

Reloads this object from the server and then passes control to the chainable.

Parameters:
Name Type Description
uri
params
Inherited From:
Source:

chainUpdate(chainable, uri, params)

Executes an update (write + read) of this object and then passes control 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:

checkAuthority(principal, authorityId, callback)

Checks whether the given principal has a granted authority for this object.
This passes the result (true/false) to the chaining function.

Parameters:
Name Type Description
principal Gitana.DomainPrincipal | String

the principal or the principal id

authorityId String

the id of the authority

callback
Inherited From:
Source:

checkEmailAuthorities(checks, callback)

Performs a bulk check of authorities against permissioned objects of type email.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"authorityId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"authorityId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

checkEmailPermissions(checks, callback)

Performs a bulk check of permissions against permissioned objects of type email.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"permissionId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"permissionId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

checkEmailProviderAuthorities(checks, callback)

Performs a bulk check of authorities against permissioned objects of type emailprovider.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"authorityId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"authorityId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

checkEmailProviderPermissions(checks, callback)

Performs a bulk check of permissions against permissioned objects of type emailprovider.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"permissionId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"permissionId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

checkMessageAuthorities(checks, callback)

Performs a bulk check of authorities against permissioned objects of type message.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"authorityId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"authorityId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

checkMessagePermissions(checks, callback)

Performs a bulk check of permissions against permissioned objects of type message.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"permissionId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"permissionId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

checkPageRenditionAuthorities(string, checks, callback)

Performs a bulk check of authorities against permissioned objects of type page rendition.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"authorityId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"authorityId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
string String

deployment key

checks
callback
Source:

checkPageRenditionPermissions(string, checks, callback)

Performs a bulk check of permissions against permissioned objects of type page rendition.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"permissionId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"permissionId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
string String

deployment key

checks
callback
Source:

checkPermission(principal, permissionId, callback)

Checks whether the given principal has a permission against this object.
This passes the result (true/false) to the chaining function.

Parameters:
Name Type Description
principal Gitana.DomainPrincipal | String

the principal or the principal id

permissionId String

the id of the permission

callback
Inherited From:
Source:

checkRegistrationAuthorities(checks, callback)

Performs a bulk check of authorities against permissioned objects of type registration.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"authorityId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"authorityId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

checkRegistrationPermissions(checks, callback)

Performs a bulk check of permissions against permissioned objects of type registration.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"permissionId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"permissionId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

checkSettingAuthorities(checks, callback)

Performs a bulk check of authorities against permissioned objects of type settings.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"authorityId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"authorityId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

checkSettingPermissions(checks, callback)

Performs a bulk check of permissions against permissioned objects of type settings.

Example of checks array:

[{
"permissionedId": "",
"principalId": "",
"permissionId": ""
}]

The callback receives an array of results, example:

[{
"permissionedId": "",
"principalId": "",
"permissionId": "",
"result": true
}]

The order of elements in the array will be the same for checks and results.

Parameters:
Name Type Description
checks
callback
Source:

clone()

Source:

copy(target, asynchronous, config)

Copies this object into the target.

Parameters:
Name Type Description
target
asynchronous
config
Inherited From:
Source:

createEmail( [Object])

Create email

Parameters:
Name Type Argument Description
Object <optional>

object JSON object

Source:

createEmailProvider( [Object])

Create email provider

Parameters:
Name Type Argument Description
Object <optional>

object JSON object

Source:

createMessage( [Object])

Create message

Parameters:
Name Type Argument Description
Object <optional>

object JSON object

Source:

createPageRendition(string [, Object])

Create page rendition

Parameters:
Name Type Argument Description
string String

deployment key

Object <optional>

object JSON object

Source:

createRegistration( [Object])

Create registration

Parameters:
Name Type Argument Description
Object <optional>

object JSON object

Source:

createSettings( [Object])

Create settings

Parameters:
Name Type Argument Description
Object <optional>

object JSON object

Source:

del()

Delete

Inherited From:
Source:

deploy(deploymentKey)

Deploys the application to the environment described by the deployment key.

Parameters:
Name Type Description
deploymentKey
Source:

exportArchive(settings)

Exports an archive.

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

findDeployedApplication(deploymentKey)

Finds the deployed application instance for a given target deployment key.

Parameters:
Name Type Description
deploymentKey
Source:

get(key)

Get a json property

Parameters:
Name Type Description
key
Inherited From:
Source:

getDescription()

The description for the object.

Inherited From:
Source:
Returns:

the description

Type
String

getId()

Hands back the ID ("_doc") of this object.

Inherited From:
Source:
Returns:

id

Type
String

getProxiedUri()

Hands back the URI of this object as referenced by the browser.

Inherited From:
Source:

getSystemMetadata()

Hands back the system metadata for this object.

Inherited From:
Source:
Returns:

system metadata

Type
Gitana.SystemMetadata

getTitle()

The title for the object.

Inherited From:
Source:
Returns:

the title

Type
String

getType()

Inherited From:
Overrides:
Source:

getUri()

Inherited From:
Overrides:
Source:

grantAuthority(principal, authorityId)

Grants an authority to a principal against this object.

Parameters:
Name Type Description
principal Gitana.DomainPrincipal | String

the principal or the principal id

authorityId String

the id of the authority

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:

importArchive(settings [, Function])

Imports an archive.

Parameters:
Name Type Argument Description
settings Object
Function <optional>

reportFn

Inherited From:
Source:

invalidateAllPageRenditions(deploymentKey)

Invalidates all page renditions for a given deployment

Parameters:
Name Type Description
deploymentKey
Source:

json()

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

Inherited From:
Source:

listAuthorities(principal, callback)

Retrieve list of authorities and pass into chaining method.

Parameters:
Name Type Description
principal Gitana.DomainPrincipal | String

the principal or the principal id

callback
Inherited From:
Source:

listAutoClientMappingObjects(callback, pagination)

Lists the auto-client mappings maintained for this application.

Parameters:
Name Type Description
callback

the callback function

pagination
Source:

listEmailProviders(pagination)

Lists the email providers.

Parameters:
Name Type Description
pagination
Source:

listEmails(pagination)

Lists the emails.

Parameters:
Name Type Description
pagination
Source:

listMessages(pagination)

Lists the messages.

Parameters:
Name Type Description
pagination
Source:

listPageRenditions(string, pagination)

Lists the page renditions.

Parameters:
Name Type Description
string String

deployment key

pagination
Source:

listRegistrations(pagination)

Lists the registrations.

Parameters:
Name Type Description
pagination
Source:

listSettings(pagination)

Lists the settings.

Parameters:
Name Type Description
pagination
Source:

listTrustedDomainMappingObjects(callback, pagination)

Lists the trusted domain mappings maintained for this application.

Parameters:
Name Type Description
callback

the callback function

pagination
Source:

loadACL(callback)

Retrieve full ACL and pass into chaining method.

Parameters:
Name Type Description
callback
Inherited From:
Source:

loadAuthorityGrants(callback)

Loads the authority grants for a given set of principals.

Parameters:
Name Type Description
callback
Inherited From:
Source:

loadDeploymentInfo(deploymentKey)

Retrieves information about a deployed application.

Parameters:
Name Type Description
deploymentKey
Source:

loadFrom(anotherObject)

Helper method that loads this object from another object of the same type.

For example, loading a node from another loaded node.

Parameters:
Name Type Description
anotherObject
Inherited From:
Source:

queryEmailProviders(query [, Object])

Queries for email providers.

Parameters:
Name Type Argument Description
query Object
Object <optional>

pagination pagination (optional)

Source:

queryEmails(query [, Object])

Queries for emails.

Parameters:
Name Type Argument Description
query Object
Object <optional>

pagination pagination (optional)

Source:

queryMessages(query [, Object])

Queries for messages.

Parameters:
Name Type Argument Description
query Object
Object <optional>

pagination pagination (optional)

Source:

queryPageRenditions(string, query [, Object])

Queries for page renditions.

Parameters:
Name Type Argument Description
string String

deployment key

query Object
Object <optional>

pagination pagination (optional)

Source:

queryRegistrations(query [, Object])

Queries for registrations.

Parameters:
Name Type Argument Description
query Object
Object <optional>

pagination pagination (optional)

Source:

querySettings(query [, Object])

Queries for settings.

Parameters:
Name Type Argument Description
query Object
Object <optional>

pagination pagination (optional)

Source:

readApplicationPrincipalSettings()

Reads the principal settings. It takes either a single Gitana.DomainPrincipal parameter
or a domain Id parameter and a principal Id parameter.

Source:

readApplicationSettings(scope, key)

Reads the application settings for the given scope and key.
If the settings doesn't exist, creates an empty one.

Parameters:
Name Type Description
scope String

(optional)

key String

(optional)

Source:

readEmail(emailId)

Reads an email.

Parameters:
Name Type Description
emailId
Source:

readEmailProvider(emailProviderId)

Reads an email provider.

Parameters:
Name Type Description
emailProviderId
Source:

readMessage(messageId)

Reads a message.

Parameters:
Name Type Description
messageId
Source:

readPageRendition(string, pageRenditionIdOrKey)

Reads a page rendition.

Parameters:
Name Type Description
string String

deployment key

pageRenditionIdOrKey
Source:

readRegistration(registrationId)

Reads a registration.

Parameters:
Name Type Description
registrationId
Source:

readSettings(settingId)

Reads an setting.

Parameters:
Name Type Description
settingId
Source:

ref()

Inherited From:
Source:
Returns:

a string denoting a reference to this object.

Type
String

reload()

Reload

Inherited From:
Source:

replacePropertiesWith(object)

Replaces all of the properties of this object with those of the given object.
This method should be used to update the state of this object.

Any functions from the incoming object will not be copied.

Parameters:
Name Type Description
object Object

object containing the properties

Inherited From:
Source:

revokeAllAuthorities(principal)

Revokes all authorities for a principal against the server.

Parameters:
Name Type Description
principal Gitana.Principal | String

the principal or the principal id

Inherited From:
Source:

revokeAuthority(principal, authorityId)

Revokes an authority from a principal against this object.

Parameters:
Name Type Description
principal Gitana.DomainPrincipal | String

the principal or the principal id

authorityId String

the id of the authority

Inherited From:
Source:

set(key, value)

Set a json property

Parameters:
Name Type Description
key
value
Inherited From:
Source:

stringify(pretty)

Helper function to convert the object portion to JSON

Parameters:
Name Type Description
pretty
Inherited From:
Source:

undeploy(deploymentKey)

Undeploys the application from the environment described by the deployment key.

Parameters:
Name Type Description
deploymentKey
Source:

update()

Update

Inherited From:
Source: