cancel
Showing results for 
Search instead for 
Did you mean: 

javascript and mysql

tonytony
Champ in-the-making
Champ in-the-making
I need a hint,
when a user places a file in an inbound space i need to move it to another space based on its filename. I have over 400 filenames that can be placed in one of 36 subdirectories that sit under three directories.


I can just set a rule to call a javascript script, dump all the possible file names into an array and loop around it, but it would be nicer to send the filename to the mysql database that is already running and get the location of where to move the file from there.

Is there a simple way to query the mysql database from javascript? I could code this in PHP in my sleep, is there a way to call a PHP script from javascript to query the database and move the files in the alfresco space? Or am I overthinking this and missing a simple solution to this problem?

TIA
1 REPLY 1

kevinr
Star Contributor
Star Contributor
There is no way to access an external MySQL DB from the JavaScript integration. However you could write a custom Action that does the work you need, and you can call any action from JavaScript:
http://wiki.alfresco.com/wiki/Custom_Actions
http://wiki.alfresco.com/wiki/JavaScript_API#Actions_API

Hope this helps,

Kevin