Class GCN
Base namespace for GCN Library.
Defined in: core.js.
Constructor Attributes | Constructor Name and Description |
---|---|
GCN()
|
Field Attributes | Field Name and Description |
---|---|
<inner> | |
<static> |
GCN.settings
|
<static> | |
<static> |
GCN.settings.channel
|
<static> |
GCN.settings.lang
|
<static> | |
<static> |
Method Attributes | Method Name and Description |
---|---|
<static> |
GCN.ajax(settings)
Wraps the `jQuery.ajax()' method.
|
<static> |
GCN.channel(channelid)
set channel if a parameter is given
retrieve it if not
if you don't want to work on a channel just
set it to false, which is the default value
|
<static> |
GCN.createError(code, message, data)
Returns an object containing the formal error fields.
|
<static> |
GCN.error(error, error, additional)
Tigger an error message 'error-encountered'
|
<static> |
GCN.exposeAPI(clazz)
Generates a factory method for chainback classes.
|
<static> |
GCN.getChainback(clazz, hash, chainlink, args)
|
<static> |
GCN.handleError(error, handler)
Tiggers the GCN error event.
|
<static> |
GCN.handleHttpError(xhr, msg, handler)
Handles the ajax transport error.
|
<static> |
GCN.handleResponseError(reponse, handler)
Handles error that occur when an ajax request succeeds but the
backend responds with an error.
|
<static> |
GCN.linksRenderMode(mode)
set links render mode if a parameter is given
retrieve it if not
|
<static> |
GCN.pub(message, params)
Publish a message
|
<static> |
GCN.sub(message, handler)
Subscribe to a message channel
|
Field Detail
<inner>
{An internal flag that stores whether an authentication
handler has been set.}
hasAuthenticationHandler
<static>
{Settings for the gcn library.}
GCN.settings
<static>
{Default GCN backend path. Do not add a trailing
slash here.}
GCN.settings.BACKEND_PATH
<static>
{Set a channelid to work on for multichannelling
or false if no channel should be used}
GCN.settings.channel
- Default Value:
- false
<static>
{The language code with which to render tags.}
GCN.settings.lang
<static>
{Determines whether links will be rendered as
back-end urls or front-end urls. Can either be
set to "backend" or "frontend".}
GCN.settings.linksRenderMode
<static>
{The keyword for the construct that defines Aloha
Editor links. In most Content.Node installations
this will be "gtxalohapagelink", but can be
otherwise defined.}
GCN.settings.MAGIC_LINK
Method Detail
<static>
GCN.ajax(settings)
Wraps the `jQuery.ajax()' method.
- Parameters:
- {object} settings
- Throws:
- HTTP_ERROR
<static>
{string}
GCN.channel(channelid)
set channel if a parameter is given
retrieve it if not
if you don't want to work on a channel just
set it to false, which is the default value
- Parameters:
- {string} channelid
- to be set
- Returns:
- {string} current channel
<static>
{GCNError}
GCN.createError(code, message, data)
Returns an object containing the formal error fields. The object
contains a `toString' method to print any uncaught exceptions nicely.
- Parameters:
- {string} code
- {string} message
- {object} data
- Returns:
- {GCNError}
<static>
GCN.error(error, error, additional)
Tigger an error message 'error-encountered'
- Parameters:
- {string} error
- code
- {string} error
- message
- {object} additional
- error data
<static>
GCN.exposeAPI(clazz)
Generates a factory method for chainback classes. The method signature
used with this factory function will match that of the target class'
constructor. Therefore this function is expected to be invoked with the
follow combination of arguments ...
Examples for GCN.pages api:
To get an array containing 1 page:
pages(1)
pages(1, function () {})
To get an array containing 2 pages:
pages([1, 2])
pages([1, 2], function () {})
To get an array containing any and all pages:
pages()
pages(function () {})
To get an array containing no pages:
pages([])
pages([], function () {});
Defined in: abstract-content-object.js.
Defined in: abstract-content-object.js.
- Parameters:
- {Chainback} clazz
- The Chainback class we want to expose.
- Throws:
- UNKNOWN_ARGUMENT
<static>
GCN.getChainback(clazz, hash, chainlink, args)
Defined in: chainback.js.
- Parameters:
- clazz
- hash
- chainlink
- args
<static>
{boolean}
GCN.handleError(error, handler)
Tiggers the GCN error event.
- Parameters:
- {GCNError} error
- {function(GCNError):boolean} handler
- Custom error handler.
- Returns:
- {boolean} Whether or not to the exception was thrown.
<static>
GCN.handleHttpError(xhr, msg, handler)
Handles the ajax transport error. It will invoke the custom error
handler if one is provided, and propagate the error onto the global
handler if the an error handler does not return `false'.
- Parameters:
- {object} xhr
- {string} msg
- The error message
- {function} handler
- Custom error handler.
- Throws:
- HTTP_ERROR
<static>
GCN.handleResponseError(reponse, handler)
Handles error that occur when an ajax request succeeds but the
backend responds with an error.
- Parameters:
- {object} reponse
- The REST API response object.
- {function(GCNError):boolean} handler
- Custom error handler.
<static>
{string}
GCN.linksRenderMode(mode)
set links render mode if a parameter is given
retrieve it if not
- Parameters:
- {string} mode
- Returns:
- {string} mode
<static>
GCN.pub(message, params)
Publish a message
- Parameters:
- {string} message
- channel name
- {*=} params
<static>
GCN.sub(message, handler)
Subscribe to a message channel
- Parameters:
- {string} message
- channel name
- {function} handler
- function - message parameters will be passed