Class Index | File Index

Classes


Class FolderAPI


Extends ContentObjectAPI, TagContainerAPI.

Defined in: folder.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
This method will inspect the json and decide whether the onSuccess or onError should be called.
<static>  
FolderAPI.page
Returns page of the given id which resides in this folder.
<static>  
FolderAPI.parent
Gets this folder's parent folder.
<static>  
FolderAPI.perm
Check if a given permission is available for a folder.
<static>  
FolderAPI.uploadURL
Get the upload URL that is capable of dealing with multipart form data.
<static>  
FolderAPI.uploadURL
Get a URL for uploading files into this folder.
<static>  
FolderAPI.WRITEABLE_PROPS
Method Summary
Method Attributes Method Name and Description
<static>  
FolderAPI.createFolder(name, settings, success, error)
Create a sub folder within this folder, with the option of also automatically creating a startpage for this folder.
<static>  
FolderAPI.createPage(templateId, options, success, error)
Creates a new page inside this folder.
<static>  
FolderAPI.files(success, error)
Retreive a list of all files in this folder.
<static>  
FolderAPI.folders(success, error)
Retreive a list of all sub folders of this folder.
<static>  
FolderAPI.images(success, error)
Retreive a list of all images in this folder.
<static>  
FolderAPI.pages(success, error)
Retreive a list of all pages this folder.
<static>  
FolderAPI.remove(success, error)
Removes the folder and all its parent objects
<static>  
FolderAPI.save(success, error)
Persist changes made to the page object in Gentics Content.Node .
Class Detail
FolderAPI()
Field Detail
<static> FolderAPI.handleUploadResponse
This method will inspect the json and decide whether the onSuccess or onError should be called. A file or image api object will be passed to the success handler.

<static> {PageAPI} FolderAPI.page
Returns page of the given id which resides in this folder.

<static> {FolderAPI} FolderAPI.parent
Gets this folder's parent folder. If this folder does not have a parent, then the returned object will be an API to an object that does not exists. Only when attempting to perform read/write operations on this object on the server will a `NOTFOUND' error be encountered. We recognize that this is relatively late for the use to find out that this folder has no parent; if the use need to guarentee that a parent folder exists before further operations, they are simply to pass a callback into this function.

<static> {boolean|Array.} FolderAPI.perm
Check if a given permission is available for a folder. If no name is provided an array of available permissions is returned.

<static> {string} FolderAPI.uploadURL
Get the upload URL that is capable of dealing with multipart form data.

<static> {string} FolderAPI.uploadURL
Get a URL for uploading files into this folder.

<static> {Writable properties for the folder object.} FolderAPI.WRITEABLE_PROPS
Method Detail
<static> FolderAPI.createFolder(name, settings, success, error)
Create a sub folder within this folder, with the option of also automatically creating a startpage for this folder.
Parameters:
{string} name
the folder name
{object} settings
pass in an optional settings object possible options are:
    {
       // optional description for the folder
       description: 'this is my folder',
       // set a publish directory for the folder
       publishDir: '/this/is/my/folder/',
       // adding a template id will automatically create a new
       // startpage for the folder
       templateId: 5,
       // provide a language code for the start page. optional.
       language: 'en',
       // when true creating the folder will fail if a folder with
       // that name exists. otherwise conflicting names will be
       // postfixed with an increasing number. defaults to false.
       failOnDuplicate: false
    }
    
{function(FolderAPI)=} success
Optional callback that will receive a FolderAPI object as its only argument.
{function(GCNError):boolean=} error
Optional custom error handler.
Throws:
UNKNOWN_ARGUMENT Thrown when unexpected arguments are provided.

<static> {PageAPI} FolderAPI.createPage(templateId, options, success, error)
Creates a new page inside this folder.
Parameters:
{number} templateId
The id of the template to be used for the page.
{object} options
Set all the options to create a page the following options are allowed:
GCN.folder(4711).createPage(13, {
    // set a language code for the new page like 'en', 'de', ...
    // if you don't supply a language code the page will have
    // no language assigned
    language: 'en',
    // id of the page this page should be a variant of
    variantId: 42
  });
{function(PageAPI)=} success
Optional callback that will receive a PageAPI object as its only argument.
{function(GCNError):boolean=} error
Optional custom error handler.
Returns:
{PageAPI} The newly created page.

<static> FolderAPI.files(success, error)
Retreive a list of all files in this folder.
Parameters:
{function(Array.FileAPI)=} success
Optional callback that will receive an array of FileAPI objects as its only argument.
{function(GCNError):boolean=} error
Optional custom error handler.

<static> FolderAPI.folders(success, error)
Retreive a list of all sub folders of this folder.
Parameters:
{function(Array.FolderAPI)=} success
Optional callback that will receive an array of FolderAPI objects as its only argument.
{function(GCNError):boolean=} error
Optional custom error handler.

<static> FolderAPI.images(success, error)
Retreive a list of all images in this folder.
Parameters:
{function(Array.ImageAPI)=} success
Optional callback that will receive an array of ImageAPI objects as its only argument.
{function(GCNError):boolean=} error
Optional custom error handler.

<static> FolderAPI.pages(success, error)
Retreive a list of all pages this folder.
Parameters:
{function(Array.PageAPI)=} success
Optional callback that will receive an array of PageAPI objects as its only argument.
{function(GCNError):boolean=} error
Optional custom error handler.

<static> FolderAPI.remove(success, error)
Removes the folder and all its parent objects
Parameters:
{function(FolderAPI)=} success
Optional callback that will receive this object as its only argument.
{function(GCNError):boolean} error
Optional custom error handler.

<static> FolderAPI.save(success, error)
Persist changes made to the page object in Gentics Content.Node .
Parameters:
{function(FolderAPI)=} success
Optional callback that will receive this object as its only argument.
{function(GCNError):boolean} error
Optional custom error handler.

Documentation generated by JsDoc Toolkit 2.3.2 on Fri Nov 16 2012 16:59:12 GMT+0100 (CET)