cancel
Showing results for 
Search instead for 
Did you mean: 

Executing a script

slothrop
Champ in-the-making
Champ in-the-making
I would like to have users copy the contents of a space to another space  using Javascript in v. 2.1.  The only way I know how to do this currently is by the following sequence of events from the space details page:

Run Action > Select "Execute a Script" from a dropdown > Set Values and Add > Select the script from a dropdown.

I would prefer to simplify this process somehow.  Clicking on an icon or a link from the space Details page would be good.  How would I proceed to do this?
13 REPLIES 13

vasuki
Champ in-the-making
Champ in-the-making
Hey Patrik…
I also could not figure out how to send the node's path to a Javascript through contextPath. However, using the code you pasted, I was able to send the nodeRef to the script. I used a different parameter name instead of contextPath (I used "node").

Then, in my Javascript, I was able to retrieve the document node using this line:

var node = search.findNode(args["node"]);

Perhaps you may be able to use this in your script as well… Good luck!

patrik
Champ on-the-rise
Champ on-the-rise
Thanks Vasuki! It worked perfectly!

I only need to find a way so that i don't come to the page with the return from the script. Anyone who has any ideas?

mikeh
Star Contributor
Star Contributor
I only need to find a way so that i don't come to the page with the return from the script. Anyone who has any ideas?
Kevin posted a solution to this earlier in the thread…
http://forums.alfresco.com/viewtopic.php?p=28860#28860


Mike

patrik
Champ on-the-rise
Champ on-the-rise
Oops, that looks like an example of my ability to filter things that i don't think concern me at the moment!

Thanks