Execute a system command from a rule
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2009 07:41 AM
Hello,
I'd like to know if it's possible to execute a script (bash, python, perl, ruby, no matter) when a rule is triggered.
In particular, when a zip file is droped in a space, it should be unzipped and have some some text files modified before being zipped again. I've written a simple bash script doing that, but I have no clue how to integrate that on Alfresco (Labs 3 stable).
I've seen a 'select a script' option when creating a rule, but every script there is a javascript one.
Is such operation possible? Any ideas or directions are welcomed.
Thanks,
Ilias.
I'd like to know if it's possible to execute a script (bash, python, perl, ruby, no matter) when a rule is triggered.
In particular, when a zip file is droped in a space, it should be unzipped and have some some text files modified before being zipped again. I've written a simple bash script doing that, but I have no clue how to integrate that on Alfresco (Labs 3 stable).
I've seen a 'select a script' option when creating a rule, but every script there is a javascript one.
Is such operation possible? Any ideas or directions are welcomed.
Thanks,
Ilias.
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2009 09:17 AM
Hi,
one way to do this could be to install the PHP-Integration AMP and upload a PHP script into "Company Home > Data Dictionary > Scripts". From this script you could call arbitrary commands (e.g. other scripts in the file system) via the PHP exec call.
Cheers,
p.
one way to do this could be to install the PHP-Integration AMP and upload a PHP script into "Company Home > Data Dictionary > Scripts". From this script you could call arbitrary commands (e.g. other scripts in the file system) via the PHP exec call.
Cheers,
p.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2009 09:45 AM
You can define a custom transformation. Take a look at org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer and how that has been configured.
More info on the wiki http://wiki.alfresco.com/wiki/Content_Transformations#RuntimeExecutableContentTransformer
More info on the wiki http://wiki.alfresco.com/wiki/Content_Transformations#RuntimeExecutableContentTransformer
