Class GCN
Base namespace for the Gentics Content.Node JavaScript API.
Defined in: core.js.
Constructor Attributes | Constructor Name and Description |
---|---|
GCN()
|
Field Attributes | Field Name and Description |
---|---|
<static> |
GCN.Admin
Exposes an instance of the AdminAPI via GCN.Admin.
|
<static> |
GCN.global
Reference to the global context.
|
<static> |
GCN.settings
Settings for the Gentics Content.Node JavaScript API.
|
<static> |
Default GCN backend path.
|
<static> |
GCN.settings.channel
Set a channelid to work on for multichannelling or false if no
channel should be used
|
<static> |
GCN.settings.lang
The language code with which to render tags.
|
<static> |
Determines whether links will be rendered as back-end urls or
front-end urls.
|
<static> |
The keyword for the construct that defines Aloha Editor links.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
GCN.ajax(settings)
Wraps the `jQuery.ajax()' method.
|
<static> |
GCN.channel(channel)
Set channel if a parameter is given retrieve it otherwise.
|
<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(ctor)
Generates a factory method for chainback classes.
|
<static> |
GCN.file()
Creates a new instance of FileAPI.
|
<static> |
GCN.folder()
Creates a new instance of FolderAPI.
|
<inner> |
GCNError(code, message, data)
|
<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.image()
Creates a new instance of ImageAPI.
|
<static> |
GCN.linksRenderMode(mode)
Set links render mode if a parameter is given
retrieve it if not
|
<static> |
GCN.Message()
MessageAPI namespace.
|
<static> |
GCN.node()
Creates a new instance of NodeAPI.
|
<static> |
GCN.page()
Creates a new instance of PageAPI.
|
<static> |
GCN.pub(message, params)
Publish a message
|
<static> |
GCN.sub(message, handler)
Subscribe to a message channel
|
<static> |
GCN.template()
Creates a new instance of TemplateAPI.
|
Field Detail
GCN.Admin
Exposes an instance of the AdminAPI via GCN.Admin.
Defined in: admin.js.
Defined in: admin.js.
- See:
- AdminAPI
GCN.global
Reference to the global context.
GCN.settings
Settings for the Gentics Content.Node JavaScript API.
GCN.settings.BACKEND_PATH
Default GCN backend path. Do not add a trailing slash here.
- Default Value:
- '/CNPortletapp'
GCN.settings.channel
Set a channelid to work on for multichannelling or false if no
channel should be used
- Default Value:
- false
GCN.settings.lang
The language code with which to render tags.
- Default Value:
- 'en'
GCN.settings.linksRenderMode
Determines whether links will be rendered as back-end urls or
front-end urls. Can either be set to "backend" or "frontend".
- Default Value:
- 'backend'
GCN.settings.MAGIC_LINK
The keyword for the construct that defines Aloha Editor links. In
most Content.Node installations this will be "gtxalohapagelink",
but can be otherwise defined.
- Default Value:
- 'gtxalohapagelink'
Method Detail
GCN.ajax(settings)
Wraps the `jQuery.ajax()' method.
- Parameters:
- {object} settings
- Throws:
- HTTP_ERROR
{string} GCN.channel(channel)
Set channel if a parameter is given retrieve it otherwise.
If you don't want to work on a channel just set it to false, which
is the default value.
- Parameters:
- {string|boolean} channel
- The id of the channel to be set or false to unset the channel.
- Returns:
- {string} current channel id.
{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}
GCN.error(error, error, additional)
Tigger an error message 'error-encountered'.
- Parameters:
- {string} error
- code
- {string} error
- message
- {object} additional
- error data
GCN.exposeAPI(ctor)
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} ctor
- The Chainback constructor we want to expose.
- Throws:
- UNKNOWN_ARGUMENT
GCN.file()
Creates a new instance of FileAPI. See the FileAPI constructor for detailed information.
Defined in: file.js.
Defined in: file.js.
- See:
- FileAPI
GCN.folder()
Creates a new instance of FolderAPI. See the FolderAPI constructor for detailed information.
Defined in: folder.js.
Defined in: folder.js.
- See:
- FolderAPI
GCNError(code, message, data)
- Parameters:
- code
- message
- data
{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.
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
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.
GCN.image()
Creates a new instance of ImageAPI. See the ImageAPI constructor for detailed information.
Defined in: image.js.
Defined in: image.js.
- See:
- ImageAPI
{string} GCN.linksRenderMode(mode)
Set links render mode if a parameter is given
retrieve it if not
- Parameters:
- {string} mode
- Returns:
- {string} mode
GCN.Message()
MessageAPI namespace. See the MessageAPI constructor for detailed information.
Defined in: message.js.
Defined in: message.js.
- See:
- MessageAPI
GCN.node()
Creates a new instance of NodeAPI. See the NodeAPI constructor for detailed information.
Defined in: node.js.
Defined in: node.js.
- See:
- NodeAPI
GCN.page()
Creates a new instance of PageAPI.
See the PageAPI constructor for detailed information.
Defined in: page.js.
Defined in: page.js.
- See:
- PageAPI
GCN.pub(message, params)
Publish a message
- Parameters:
- {string} message
- channel name
- {*=} params
GCN.sub(message, handler)
Subscribe to a message channel
- Parameters:
- {string} message
- channel name
- {function} handler
- function - message parameters will be passed.
GCN.template()
Creates a new instance of TemplateAPI. See the TemplateAPI constructor for detailed information.
Defined in: template.js.
Defined in: template.js.
- See:
- TemplateAPI