javascript and mysql

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2007 04:00 PM
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
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
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2007 04:41 AM
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
http://wiki.alfresco.com/wiki/Custom_Actions
http://wiki.alfresco.com/wiki/JavaScript_API#Actions_API
Hope this helps,
Kevin
