cancel
Showing results for 
Search instead for 
Did you mean: 

Set Property with Rule/Action?

jk3us
Champ in-the-making
Champ in-the-making
Is it possible to set properties with a rule or action?   I have a custom aspect set up and applied to an entire folder structure with a rule, now I need to set certain properties (to a specific value) for all items in space.

I don't see a way to accomplish this in the alfresco web interface.  Am I missing something, or will this require some custom scripting of some sort?
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
Yes You can populate the properties with the values,
by creating one script in which you have specified the aspect along with the porperties with values which you want to give to that properties.
And then creating rule on space to invoke that script when content is added to that page.
Your script file will look like this.

var props = new Array(1);
props["training:hottopic"] = false;
document.addAspect("training:product_information", props);


By this way you have to create the array of properties with values assigned to it,
then set that array in to your aspect. Smiley Happy  pretty simple.

jk3us
Champ in-the-making
Champ in-the-making
Okay, I'm starting to look into scripting and see what all I can do with it… Here's a question I can't find an answer to… could I (the group programmer) write a script that can accept values to assign to all files in a space?  For example, we need to assign the same date to all files a space, and need to do that for several spaces (different dates for each space)… Can I write one script that a user can provide a date to do that each time?  Or must I provide a custom script for each space/date combo?

Edit: I'll provide a potential answer to my question…. If you set properties on the space itself a run a script to "propagate" certain fields to children, I think that will accomplish what I'm looking for.  But if anyone has any advice, I'd love to hear it Smiley Happy

mitpatoliya
Star Collaborator
Star Collaborator
Well i think you are choosing the complicated way.
Better way will be create space/script combo.
then just apply that script to all the contents in perticular space by creating rule.
It seems to be an easier way as in each of scipt there will be just one line change(that is date). Smiley Tongue