Class ContentObjectAPI
Defined in: abstract-content-object.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
<static> |
ContentObjectAPI.WRITEABLE_PROPS
|
Method Attributes | Method Name and Description |
---|---|
<static> |
ContentObjectAPI.clear()
Clears this object from its constructor's cache so that the next
attempt to access this object will result in a brand new instance
being initialized and placed in the cache.
|
<static> |
ContentObjectAPI.decode(str, success, error)
For a given string, replace all occurances of "
|
<static> |
ContentObjectAPI.encode(An, A)
Replaces tag blocks with appropriate "
|
<static> |
ContentObjectAPI.folder(success, error)
Get this content object's parent folder.
|
<static> |
ContentObjectAPI.id()
Gets this object's id.
|
<static> |
ContentObjectAPI.localize(success, error)
Get a channel-local copy of this content object.
|
<static> |
ContentObjectAPI.node(success, error)
Get this content object's node.
|
<static> |
ContentObjectAPI.nodeId()
Gets this object's node id.
|
<static> |
ContentObjectAPI.prop(property, value)
Reads the proporty `property' of this content object if this
property is among those in the WRITEABLE_PROPS array.
|
<static> |
ContentObjectAPI.remove(success, error)
Deletes this content object from its containing parent.
|
<static> |
ContentObjectAPI.save(settings, success, error)
Saves changes made to this content object to the backend.
|
<static> |
ContentObjectAPI.unlocalize(success, error)
Remove this channel-local object, and delete its local copy in the
backend.
|
Field Detail
<static>
{Writeable properties for all content objects.}
ContentObjectAPI.WRITEABLE_PROPS
Method Detail
<static>
ContentObjectAPI.clear()
Clears this object from its constructor's cache so that the next
attempt to access this object will result in a brand new instance
being initialized and placed in the cache.
<static>
ContentObjectAPI.decode(str, success, error)
For a given string, replace all occurances of "" with
appropriate HTML markup, allowing notated tags to be rendered within
the surrounding HTML content.
The success() handler will receives a string containing the contents
of the `str' string with references to "" having been inflated
into their appropriate tag rendering.
- Parameters:
- {string} str
- The content string, in which "
" tags will be inflated with their HTML rendering. - {function(ContentObjectAPI))} success
- Success callback that will receive the decoded string.
- {function(GCNError):boolean=} error
- Optional custom error handler.
<static>
{string}
ContentObjectAPI.encode(An, A)
Replaces tag blocks with appropriate "" notation in a given
string.
Given an element whose innerHTML is:
"My Tag",
encode() will return:
"".
- Parameters:
- {!jQuery} An
- element whose contents are to be encoded.
- {?function(!Element): string} A
- function that returns the serialized contents of the given element as a HTML string, excluding the start and end tag of the element. If not provided, jQuery.html() will be used.
- Returns:
- {string} The encoded HTML string.
<static>
{FolderAPI}
ContentObjectAPI.folder(success, error)
Get this content object's parent folder.
Defined in: abstract-tag-container.js.
Defined in: abstract-tag-container.js.
- Parameters:
- {funtion(FolderAPI)=} success
- Optional callback to receive a FolderAPI object as the only argument.
- {function(GCNError):boolean=} error
- Optional custom error handler.
- Returns:
- {FolderAPI} This object's parent folder.
<static>
{number}
ContentObjectAPI.id()
Gets this object's id. We'll return the id of the object when it has
been loaded. This can only be a localid. Otherwise we'll return the
id which was provided by the user. This can either be a localid or a
globalid.
- Returns:
- {number}
<static>
ContentObjectAPI.localize(success, error)
Get a channel-local copy of this content object.
- Parameters:
- {funtion(ContentObjectAPI)=} success
- Optional callback to receive this content object as the only argument.
- {function(GCNError):boolean=} error
- Optional custom error handler.
<static>
{NodeAPI}
ContentObjectAPI.node(success, error)
Get this content object's node.
Defined in: abstract-tag-container.js.
Defined in: abstract-tag-container.js.
- Parameters:
- {funtion(NodeAPI)=} success
- Optional callback to receive a NodeAPI object as the only argument.
- {function(GCNError):boolean=} error
- Optional custom error handler.
- Returns:
- {NodeAPI} This object's node.
<static>
{number}
ContentObjectAPI.nodeId()
Gets this object's node id.
- Returns:
- {number} The channel to which this object is set. 0 if no channel is set.
<static>
{?*}
ContentObjectAPI.prop(property, value)
Reads the proporty `property' of this content object if this
property is among those in the WRITEABLE_PROPS array. If a send
argument is provided, them the property is updated with that value.
- Parameters:
- {String} property
- Name of the property to be read or updated.
- {String} value
- Value to be set property to.
- Throws:
- UNFETCHED_OBJECT_ACCESS
- READONLY_ATTRIBUTE
- Returns:
- {?*} Meta attribute.
<static>
ContentObjectAPI.remove(success, error)
Deletes this content object from its containing parent.
- Parameters:
- {function(ContentObjectAPI)=} success
- Optional callback that receives this object as its only argument.
- {function(GCNError):boolean=} error
- Optional customer error handler.
<static>
ContentObjectAPI.save(settings, success, error)
Saves changes made to this content object to the backend.
- Parameters:
- {object=} settings
- Optional settings to pass on to the ajax function.
- {function(ContentObjectAPI)=} success
- Optional callback that receives this object as its only argument.
- {function(GCNError):boolean=} error
- Optional customer error handler.
<static>
ContentObjectAPI.unlocalize(success, error)
Remove this channel-local object, and delete its local copy in the
backend.
- Parameters:
- {funtion(ContentObjectAPI)=} success
- Optional callback to receive this content object as the only argument.
- {function(GCNError):boolean=} error
- Optional custom error handler.