Class: Gitana

Gitana

Gitana

Configuration options should look like:

{
"clientKey": {String} the oauth2 client id,
"clientSecret": [String] the oauth2 client secret,
"baseURL": [String] the relative URI path of the base URL (assumed to be "/proxy"),
"locale": [String] optional locale (assumed to be en_US),
"storage": [String|Object] Gitana.OAuth2.Storage implementation or a string identifying where to store
Gitana OAuth2 tokens ("local", "session", "memory") or empty for memory-only storage
}


new Gitana()

Source:

Classes

AbstractApplicationObject
AbstractClusterObject
AbstractDirectoryObject
AbstractDomainObject
AbstractMap
AbstractNode
AbstractObject
AbstractPersistable
AbstractPlatformDataStore
AbstractPlatformObject
AbstractPlatformObjectMap
AbstractRegistrarObject
AbstractRepositoryObject
AbstractSelfableACLObject
AbstractSelfableObject
AbstractVaultObject
AbstractWebHostObject
AccessPolicy
AccessPolicyMap
Activity
ActivityMap
AppHelper
Application
ApplicationMap
Archive
ArchiveMap
Association
AuthenticationGrant
AuthenticationGrantMap
AuthInfo
AutoClientMapping
AutoClientMappingMap
BillingProviderConfiguration
BillingProviderConfigurationMap
BinaryAttachment
Branch
BranchMap
Chainable
Changeset
ChangesetMap
Client
ClientMap
Cluster
Connection
ConnectionMap
ContainedDataStore
Context
CopyJob
DataStore
Definition
Deletion
DeletionMap
DeployedApplication
DeployedApplicationMap
DeploymentPackage
DeploymentPackageMap
DeploymentReceiver
DeploymentReceiverMap
DeploymentStrategy
DeploymentStrategyMap
DeploymentTarget
DeploymentTargetMap
Descriptor
DescriptorMap
Directory
DirectoryMap
Domain
DomainMap
DomainPrincipal
Email
EmailMap
EmailProvider
EmailProviderMap
Form
HasFormAssociation
HasTranslationAssociation
Http
Identity
IdentityMap
Job
JobMap
LogEntry
LogEntryMap
MergeConflict
MergeConflictMap
Message
MessageMap
Meter
MeterMap
Node
NodeAttachment
NodeAttachmentMap
NodeMap
OAuth2Http
PageRendition
PageRenditionMap
Person
Plan
PlanMap
Platform
PlatformDataStoreMap
PrincipalMap
Project
ProjectMap
Registrar
RegistrarMap
Registration
RegistrationMap
Release
ReleaseMap
Report
ReportMap
Repository
RepositoryMap
Response
ResultMap
Role
RoleMap
ScheduledWork
ScheduledWorkMap
Settings
SettingsMap
Stack
StackMap
SystemMetadata
Team
TeamMap
TeamMember
TeamMemberMap
Tenant
TenantMap
Timestamp
TransferExportJob
TransferImportJob
TraversalResults
TrustedDomainMapping
TrustedDomainMappingMap
UIConfig
UIConfigMap
Vault
VaultMap
WebHost
WebHostMap
WorkflowComment
WorkflowCommentMap
WorkflowInstance
WorkflowInstanceMap
WorkflowModel
WorkflowModelMap
WorkflowTask
WorkflowTaskMap

Methods


<static> copyInto(target, source)

Copies the members of the source object into the target object.
This includes both properties and functions from the source object.

Parameters:
Name Type Description
target Object

Target object.

source Object

Source object.

Source:

<static> copyKeepers(target, source)

Copies only those members that are already represented on the target.

Parameters:
Name Type Description
target Object

Target object.

source Object

Source object.

Source:

<static> deleteCookie(name, path)

Deletes a cookie.

Parameters:
Name Type Description
name
path
Source:

<static> deleteProperties(object)

Deletes any owned properties of the given object. If specified, owned functions will also be deleted.

Parameters:
Name Type Description
object Object

object

Source:

<static> isBoolean(arg)

Determines whether the given argument is a Boolean.

Parameters:
Name Type Description
arg

argument

Source:
Returns:

whether it is a Boolean

Type
Boolean

<static> isFunction(arg)

Determines whether the given argument is a Function.

Parameters:
Name Type Description
arg

argument

Source:
Returns:

whether it is a Function

Type
Boolean

<static> isNumber(arg)

Determines whether the given argument is a Number.

Parameters:
Name Type Description
arg

argument

Source:
Returns:

whether it is a Number

Type
Boolean

<static> isObject(obj)

Determines whether the given argument is an Object.

Parameters:
Name Type Description
obj
Source:
Returns:

whether it is an Object

Type
boolean

<static> isString(arg)

Determines whether the given argument is a String.

Parameters:
Name Type Description
arg

argument

Source:
Returns:

whether it is a String

Type
Boolean

<static> makeArray(arguments)

Builds an array from javascript method arguments.

Parameters:
Name Type Description
arguments arguments
Source:
Returns:

an array

Type
Array

<static> MemoryXHRCache()

Simple memory XHR Cache

Source:
Returns:
Type
function

<static> stampInto(target, source)

Stamps the functions and properties from the source object to the target object.

Parameters:
Name Type Description
target Object

Target object.

source Object

Source object.

Source:

<static> startsWith(text, prefix)

Determines whether a bit of text starts with a given prefix.

Parameters:
Name Type Description
text String

A bit of text.

prefix String

The prefix.

Source:
Returns:

whether the text starts with the prefix.

Type
Boolean

<static> stringify(object, pretty)

Serializes a object into a JSON string and optionally makes it pretty by indenting.

Parameters:
Name Type Description
object Object

The javascript object.

pretty Boolean

Whether the resulting string should have indentation.

Source:
Returns:

string

Type
String

<static> writeCookie(name, value [, String] [, Number] [, String])

Writes a cookie.

Parameters:
Name Type Argument Description
name String
value String
String <optional>

path optional path (assumed "/" if not provided)

Number <optional>

days optional # of days to store cookie
if null or -1, assume session cookie
if 0, assume expired cookie
if > 0, assume # of days

String <optional>

domain optional domain (otherwise assumes wildcard base domain)

Source:

ajax(method, url [, contentType] [, data] [, headers] [, successCallback] [, failureCallback])

Performs Ajax communication with the Gitana server.

NOTE: For the most part, you shouldn't have to use this function since most of the things you'd want
to do with the Gitana server are wrapped by helper functions.

Parameters:
Name Type Argument Description
method String

The kind of method to invoke - "get", "post", "put", or "del"

url String

The full URL to the resource being requested (i.e. "http://server:port/uri"}

contentType String <optional>

In the case of a payload carrying request (i.e. not GET), the content type being sent.

data Object <optional>

In the case of a payload carrying request (i.e. not GET), the data to plug into the payload.

headers Object <optional>

A key/value map of headers to place into the request.

successCallback function <optional>

The function to call if the operation succeeds.

failureCallback function <optional>

The function to call if the operation fails. If none provided, the default driver callback is used.

Source:
See:
  • Gitana.Driver#gitanaGet
  • Gitana.Driver#gitanaPost
  • Gitana.Driver#gitanaPut
  • Gitana.Driver#gitanaDel
  • Gitana.Driver#gitanaRequest

authenticate(settings [, Function])

Authenticates as the supplied user.

A user can either be authenticated using username/password credentials or via an authentication code.

Authorization Code flow:

{
"code": "",
"redirectUri": ""
}
Username/password flow:

{
"username": "",
"password": ""
}

Implicit flow:

{
"accessToken": "",
"redirectUri": ""
}

Using Gitana Ticket from a cookie:

{
"cookie": true
}

Using Gitana Ticket (explicitly provided):

{
"ticket": ""
}

An authentication failure handler can be passed as the final argument

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

authentication failure handler

Source:

clearAuthentication()

Clears any authentication for the driver.

Source:

defaultFailureCallback()

Default AJAX failure callback

Source:

destroy()

Destructor function, called at the end of the driver instance's lifecycle

Source:

getAuthInfo()

Sets the authentication info

Source:

getLocale()

Retrieves the default locale being used by this driver.

Source:
Returns:

locale string

Type
String

gitanaDelete(url, params [, successCallback] [, failureCallback])

Sends an HTTP DELETE request to the Gitana server.

Parameters:
Name Type Argument Description
url String

Either a full URL (i.e. "http://server:port/uri") or a URI against the driver's server URL (i.e. /repositories/...)

params Object

request parameters

successCallback function <optional>

The function to call if the operation succeeds.

failureCallback function <optional>

The function to call if the operation fails.

Source:

gitanaDownload(url, params [, successCallback] [, failureCallback])

Sends an HTTP GET request to the Gitana server.

Parameters:
Name Type Argument Description
url String

Either a full URL (i.e. "http://server:port/uri") or a URI against the driver's server URL (i.e. /repositories/...)

params Object

request parameters

successCallback function <optional>

The function to call if the operation succeeds.

failureCallback function <optional>

The function to call if the operation fails.

Source:

gitanaGet(url, params, headers [, successCallback] [, failureCallback])

Sends an HTTP GET request to the Gitana server.

Parameters:
Name Type Argument Description
url String

Either a full URL (i.e. "http://server:port/uri") or a URI against the driver's server URL (i.e. /repositories/...)

params Object

request parameters

headers Object

request headers

successCallback function <optional>

The function to call if the operation succeeds.

failureCallback function <optional>

The function to call if the operation fails.

Source:

gitanaPatch(url, params [, jsonData] [, successCallback] [, failureCallback])

Sends an HTTP PATCH request to the Gitana server.

Parameters:
Name Type Argument Description
url String

Either a full URL (i.e. "http://server:port/uri") or a URI against the driver's server URL (i.e. /repositories/...)

params Object

request parameters

jsonData Object <optional>

The JSON to plug into the payload.

successCallback function <optional>

The function to call if the operation succeeds.

failureCallback function <optional>

The function to call if the operation fails.

Source:

gitanaPost(url, params [, jsonData] [, successCallback] [, failureCallback])

Sends an HTTP POST request to the Gitana server.

Parameters:
Name Type Argument Description
url String

Either a full URL (i.e. "http://server:port/uri") or a URI against the driver's server URL (i.e. /repositories/...)

params Object

request parameters

jsonData Object <optional>

The JSON to plug into the payload.

successCallback function <optional>

The function to call if the operation succeeds.

failureCallback function <optional>

The function to call if the operation fails.

Source:

gitanaPut(url, params [, jsonData] [, successCallback] [, failureCallback])

Sends an HTTP PUT request to the Gitana server.

Parameters:
Name Type Argument Description
url String

Either a full URL (i.e. "http://server:port/uri") or a URI against the driver's server URL (i.e. /repositories/...)

params Object

request parameters

jsonData Object <optional>

The JSON to plug into the payload.

successCallback function <optional>

The function to call if the operation succeeds.

failureCallback function <optional>

The function to call if the operation fails.

Source:

gitanaRequest(method, url, params [, String], data [, successCallback] [, failureCallback])

Send an HTTP request via AJAX to the Gitana Server.

This method will additionally make sure of the following:

1) That the Gitana Driver authentication ticket is plugged onto the request.
2) That the Gitana Driver locale is plugged onto the request.
3) That full object data is returned (including metadata).

Parameters:
Name Type Argument Description
method String

The kind of method to invoke - "get", "post", "put", or "del"

url String

Either a full URL (i.e. "http://server:port/uri") or a URI against the driver's server URL (i.e. /repositories/...)

params Object

parameter map

String <optional>

contentType If the case of a payload carrying request (i.e. not GET), the content type being sent.

data Object

In the case of a payload carrying request (i.e. not GET), the JSON to plug into the payload.

successCallback function <optional>

The function to call if the operation succeeds.

failureCallback function <optional>

The function to call if the operation fails.

Source:

gitanaUpload(url, params, contentType [, jsonData] [, successCallback] [, failureCallback])

Sends an HTTP POST request to the Gitana server.

Parameters:
Name Type Argument Description
url String

Either a full URL (i.e. "http://server:port/uri") or a URI against the driver's server URL (i.e. /repositories/...)

params Object

request parameters

contentType String

content type being sent

jsonData Object <optional>

The JSON to plug into the payload.

successCallback function <optional>

The function to call if the operation succeeds.

failureCallback function <optional>

The function to call if the operation fails.

Source:

refreshAuthentication(callback)

Refreshes the authentication access token.

Parameters:
Name Type Description
callback
Source:

setLocale(locale)

Sets the default locale for interactions with the Gitana server by this driver.

Parameters:
Name Type Description
locale String

locale string

Source: