cancel
Showing results for 
Search instead for 
Did you mean: 

create new folder based on space template via javascript?

targa2000
Champ in-the-making
Champ in-the-making
Can we programmatically create a new space based on a space template with javascript?

I can use createFolder(string name) to create a folder.  But can I create a new folder based on a template?
2 REPLIES 2

alex54
Champ on-the-rise
Champ on-the-rise
The solution is not to create a folder (with createFolder function) from scratch, but create a folder by copying a space template node  Smiley Tongue

Example:

var nodeParent= companyhome.childByNamePath("/the/parent/node/where/to/create/the/new/folder");
var nodeTemplate = companyhome.childByNamePath("/The/Path/to/the/template/node/name");        
var nodeNew = nodeTemplate.copy(nodeParent, true);

Please let me know hoe this can be done using OpenCMIS.I have created a space template under data dictionary folder and like to check how i can apply the template while creating folder through OpenCMIS API.

Thanks,