cancel
Showing results for 
Search instead for 
Did you mean: 

Access DB Alfresco

zazugue
Champ in-the-making
Champ in-the-making
Hello guys, sorry if it's not the right place to ask this question. I am using Alfresco Community 5.0 and i have to get some Users data (ID, password, mail, …) from the database.
I saw in some post, Alfresco doesn't use SQL command to communicate with the DB server but by hibernate.

So my question is: this is revelant again cause the post are from 2010-2012 even if which way are you advice me to do my schedule ?

Thank you in advance
7 REPLIES 7

zazugue
Champ in-the-making
Champ in-the-making
Okay, it's good i have my answer ! Sorry to disturb you ! 😧

jneeve
Champ in-the-making
Champ in-the-making
It's always good when you find the answer, to post it though, so that others who may come across this will have it too!

zazugue
Champ in-the-making
Champ in-the-making
Oups sorry ! So i found a lot of information about that. I found Alfresco doesn't use anymore Hibernate and they are migrate to MyBatis.
http://fr.slideshare.net/slemarchand/using-mybatis-in-alfresco-custom-extensions-alfresco-devcon-201...

The problems, information from 2012 and there are no data talking about that somewhere (wiki.alfresco or doc.alfresco).
I understood Alfresco only is using Webscripts to modify data with many API.( http://docs.alfresco.com/community5.0/references/API-JS-Scripting-API.html ) or with Data list.

Maybe i am wrong so correct me in case. Smiley Surprised

steven_okennedy
Star Contributor
Star Contributor
Hi zazugue,

It's reasonably correct to say that Alfresco primarily uses APIs to get and modify data stored within, and that yes underneath Alfresco uses myBatis as part of its own DAO implementation  and SQL below that again obviously) but it's generally not considered a supported option to use SQL to extract information from the system.  Obviously, you can - it's your database - but you won't find much around a formal definition or explanation of the Alfresco schema around so it will be up to you to pull that info together based on what you see.

The APIs however that Alfresco does provide are not just limited to Webscripts, although there are a lot of webscripts exposed via the public API.  There is also the new RESTful API as well as the standard CMIS 1.1 endpoints and these are effectively layers on top of a fundamental, base set of Java APIs that provide consistency and regulation across the entire repository. There are also options for non-API access as well e.g. WebDav, FTP, CIFS etc. but I think these are probably less useful for the type of problem you were talking about.

I suppose the real question is whether there is an explicit need to avoid APIs or if its just the perceived complexity of getting something done quickly.  If this is the case, have a look at the Javascript Console addon, which allows you to create and run scripts and get outputs very quickly and easily using the core Javascript services (https://addons.alfresco.com/addons/javascript-console) and will give you faster results than getting to grips (correctly) with the complexities of the Alfresco DB schema

Regards

Steven

Thank you for your explication. Look like a lot of way to access to Alfresco's Data but the best way now is to use RESTful API.
Unfortunately, i am working on Alfresco 5.0d, the Javascript Console addons it's not compatible with my version (after i don't really know if we have to matter or not about the Alfresco version).

Hi Zazugue,

I'd suggest to take a look at the actual github page for the project (https://github.com/share-extras/js-console) which is linked to from the addons page.  That gives a more complete view of what versions of Alfresco are supported by the tool.  As far as I know, all versions from 4.0 to 5.1 (community & enterprise) are supported.

Regards

Steven

zazugue
Champ in-the-making
Champ in-the-making
My bad, i didn't check on their github. Thanks for your help steven.okennedy !