Access DB Alfresco

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2016 06:06 AM
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
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
Labels:
- Labels:
-
Archive
7 REPLIES 7

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2016 11:24 AM
Okay, it's good i have my answer ! Sorry to disturb you ! 😧
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2016 03:26 PM
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!

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2016 06:39 AM
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.
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.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2016 09:52 AM
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
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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2016 05:55 AM
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).
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).
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2016 10:40 AM
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
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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2016 08:34 AM
My bad, i didn't check on their github. Thanks for your help steven.okennedy !
