Class: Backend

Backend

This class is responsible to manage all app.

Constructor

new Backend()

Source:

Methods

appendNewSectionObjectByUID(cbparentuid, typesection) → {String}

Create new section and append into section indicate. This section is identifier string instead of CBSection object.
Parameters:
Name Type Description
cbparentuid String Section identifier where new section will be added
typesection String Type of section to create.
Source:
Returns:
Identifier that section created
Type
String

checkProjectExists(projectname) → {Boolean}

Check if project exists
Parameters:
Name Type Description
projectname String Project name
Source:
Returns:
True exists project, False not exists
Type
Boolean

createProject(projectname)

Create new project with its folder. Also add information into userconfig.
Parameters:
Name Type Description
projectname String Project name
Source:

initSections() → {String}

Initalize sections. This void Sections namespace and render initial section
Source:
Returns:
Identifier initial section created by default
Type
String

loadComponentExtraCss(pluginpath, infobutton)

On component metadata file may be field "external_css" . This field include style files that may be included to decorate component function or elements created by component . This method is reponsible read metadata info to be include all files indicate on "external_scripts". This files are loaded
Parameters:
Name Type Description
pluginpath String relative path to root component
infobutton Object JSON created from metadata file.
Properties
Name Type Description
external_css Array.<String> List paths to be included. This not support folders, only files.
Source:

loadComponentExtraScripts(pluginpath, infobutton)

On component metadata file may be field "external_scripts" . This field include libraries must be included on head file to work component fine. This method is reponsible read metadata info to be include all files indicate on "external_scripts". This files are loaded
Parameters:
Name Type Description
pluginpath String relative path to root component
infobutton Object JSON created from metadata file.
Properties
Name Type Description
external_scripts Array.<String> List paths to be included. This not support folders, only files.
Source:

loadComponents()

Go over components path to find components and append this components on Project.Actions namespace.
Source:

loadComponentsRecursive(componentpath)

Go over components path to find components and append this components on Cloudbook.Actions with id Also load extra scripts needed to components work fine
Parameters:
Name Type Description
componentpath String Path to load component
Source:

loadContent(id)

Empty targetcontent and render objects from section id indicate into targetcontent.
Parameters:
Name Type Description
id String Section id.
Source:

loadProject(projectPath)

Load project from path. This method void project and discard not saved changes.
Parameters:
Name Type Description
projectPath String
Source:

loadSectionsObjects()

Load all sections available
Source:

prepareWorkspace()

Check exists workspace and userconfig. If any not exists, create it.
Source:

regenerateSubsection(sectionid, subsectionsids)

Replace subsections of a section by subsections indicate into argument.
Parameters:
Name Type Description
sectionid String Id of section
subsectionsids Array.<String> Id's subsections
Source:

saveProject(projectPath)

Save project into path indicate. This function don't save binary files. This files are stored into folder created for this purpose on workspace folder.
Parameters:
Name Type Description
projectPath String Path where project will be stored
Source:

updateSectionName(name, cbsectionid)

Update section name.
Parameters:
Name Type Description
name String New section name
cbsectionid String Section identifier to update name.
Source:

voidProject()

Empty project sections
Source: