I connected my allinone project to MySql database, I created a table and added some data.
How can I retrieve that data using javascript backed webscript ?
Hi,
Can you describe what actually you are wanted to do with that data which you entered in the database manually?
If i talk about the alfresco best practice whatever data you want to use that should goes in to alfresco table with the help of content model(in some case its okay to connect with some other database and get the data from there).
Thanks,
Shyam Ghodasra.
I didn't add the data manually, I created a behaviour, When someone add a file, I save the filename, and username to a table. Now I want to display a message to the share telling that " username added filename ".
First, realize this is not the greatest idea. Don't create tables in Alfresco's database. Create them in a separate database. With that said, you wrote a behavior to save the data, so what is the problem trying to get it out?
If the problem is that you need to query the data from JavaScript, you can write a base scope processor extension to expose a Java class as a root-scoped JavaScript object. The Java class can query the data from the database and return it. Then, in JavaScript you can just call the root scoped object to get the data.
If you are not sure how to do a custom root scoped object, there are many examples in public source code. Here's one that I did for the acl-templates project: alfresco-acl-templates/acl-templates-repo/src/main/java/com/conexiam/acl/templates/service at master...
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.