cancel
Showing results for 
Search instead for 
Did you mean: 

Automate Space creation using Template

shyamsundar1_g
Champ in-the-making
Champ in-the-making
I'm new to Alfresco.I need to automate the process of space creation when a new space is created.I define the template inside space template folder in Data Dictionary.But i do not how to automate the application of this template under User Homes folder.

I'm looking any one of this options.

Option 1: Create Rule that apply the space template to the new space that is created under a particular parent.

Option 2:I'm using OpenCMIS API.If through OpenCMIS if i can create the pass the template object to createfolder function and apply the template.

Please let me is it possible to do the requirement through any of the above options.

Thanks Shyam
1 REPLY 1

marco_altieri
Star Contributor
Star Contributor
Hi,

I think that option 1 works and it is very easy to implement.
You can, for example, define a rule to execute the following script:

    var template = companyhome.childByNamePath("Data Dictionary/Space Templates/test");
    template.copy(document, true);


when a folder is created in "User Homes".
The script executes a deep copy of the template folder to the newly create space: the "document" object is actually the the user home space.