03-01-2019 05:53 AM
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 ?
03-01-2019 08:52 AM
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.
03-01-2019 09:43 AM
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 ".
03-02-2019 03:52 PM
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...
Explore our Alfresco products with the links below. Use labels to filter content by product module.