cancel
Showing results for 
Search instead for 
Did you mean: 

Add aspect when a folder is created

guilherme_souza
Champ in-the-making
Champ in-the-making
Hello,

i'm new in Alfresco and i use the version 4.0.d. I've created a new aspect and i want that when a folder is created, this new aspect will be added automatically or something like a check button, but this i can edit later. I just want to know if it's possible i add the aspect when the folder is created.
7 REPLIES 7

afaust
Legendary Innovator
Legendary Innovator
Hello,

yes - something like this can be achieved either by configuring a content rule or implementing a content policy. For rules see the Alfresco Documentation on Using Rules.

Regards
Axel

guilherme_souza
Champ in-the-making
Champ in-the-making
So, i think that i can't do it with a rule. I want to put a check box in the create folder form and when this check box is selected, the aspect will be added to the folder.

afaust
Legendary Innovator
Legendary Innovator
Hello,

ok, then a Form Filter would be the way I'd go - that would require implementing a piece of Java code. Still, this could also be done via a rule. You could set up the checkbox as a boolean property on your folder and have a rule that applies the aspect based on the value of that boolean property.

Regards
Axel

guilherme_souza
Champ in-the-making
Champ in-the-making
Thanks man, but, can you help me with this code? What's the code to add the aspect to the folder created?

afaust
Legendary Innovator
Legendary Innovator
Hello,

hmm, for that kind of rule, you should not need code as this simple example should be realizable via pure rule configuration. Again, please see the documentation on that matter. If you have to use a JavaScript action (because you want to do more than possible via pure configuration) you should have a look at the JavaScript API wiki page.

Regards
Axel

guilherme_souza
Champ in-the-making
Champ in-the-making
Ok, thank you for the help.

sindhu
Champ in-the-making
Champ in-the-making
Thank you..