Understanding alf_data/*.bin filenames?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2006 01:12 PM
The repository content is stored in the alf_data folder, but every file is renamed to a .bin file, with a rather long, confusing filename. However, the filenames seem to be somewhat consistent, and I was wondering if there's some way to get the corresponding information from the database about what the true filename is based on this string. The filenames are of the form: '0ace582a-99bb-11da-9e7e-3136689844e9.bin', and I want to find out what the actual filename of the file is, as well as (hopefully) the version.
Where in the database is this information stored, so I can start homing in on these files?
Thanks,
Sean
Where in the database is this information stored, so I can start homing in on these files?
Thanks,
Sean
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2006 04:34 AM
Hello,
The filename you see is constructed from a GUID relating to the content property meta-data for the node that represents the document+metadata. The content is stored in the file system as you can see, and the meta-data for the node is stored in the database.
The database was created as part of the .sql file you executed during installation. The data schema will be called "alfresco" if you haven't changed anything.
If you have the GUID from the file you are interested in, you can query the database to directly access information from it's meta-data properties, such as:
To change any data programatically, you should use the Alfresco APIs as otherwise you may cause inconsistent data issues (especially if the server is running at the time!)
Given a Node GUID (from the 'guid' column), content can be easily retrieved programmatically through the ContentService APIs, as demonstrated in this class:
http://www.alfresco.org/mediawiki/index.php/URL_Addressability#DownloadContentServlet
Cheers,
Kevin
The filename you see is constructed from a GUID relating to the content property meta-data for the node that represents the document+metadata. The content is stored in the file system as you can see, and the meta-data for the node is stored in the database.
The database was created as part of the .sql file you executed during installation. The data schema will be called "alfresco" if you haven't changed anything.
If you have the GUID from the file you are interested in, you can query the database to directly access information from it's meta-data properties, such as:
select * from node_properties where actual_type='CONTENT' and string_value like '%2e2f0da8-9cb5-11da-a453-590fe1e0c33e%';
You should be able to build reverse queries given the GUID or other node property can locate the folder the content is present in (examine the string_value field for that row).To change any data programatically, you should use the Alfresco APIs as otherwise you may cause inconsistent data issues (especially if the server is running at the time!)
Given a Node GUID (from the 'guid' column), content can be easily retrieved programmatically through the ContentService APIs, as demonstrated in this class:
org.alfresco.example.SimpleExampleWithContent
Content can also be streamed through the DownloadContentServlet which can be used by any external program that can open a URL. Examine the content URLs generated in the web-client for an example or see this page:http://www.alfresco.org/mediawiki/index.php/URL_Addressability#DownloadContentServlet
Cheers,
Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2009 08:16 AM
Dear kevin
I am using Alfresco2.1 community edition. Need few clarifications on what you explained above.
If I am not wrong GUID=UUID, so considering the same
1st thing GUID or UUID present in alf_node table is not there in alf_node_properties table!
Secondly, how should I be able to relate database feilds with file system (alf_data)? So that if I have meta data information I can easily fild my content in alf_data. Mean do you have any example reverse query (as you mentioned above)or any hint regarding the same? Will be kind if you can share the same.
Thanks and regards
Amit karhade.
I am using Alfresco2.1 community edition. Need few clarifications on what you explained above.
If I am not wrong GUID=UUID, so considering the same
select * from node_properties where actual_type='CONTENT' and string_value like '%2e2f0da8-9cb5-11da-a453-590fe1e0c33e%';
1st thing GUID or UUID present in alf_node table is not there in alf_node_properties table!
You should be able to build reverse queries given the GUID or other node property can locate the folder the content is present in (examine the string_value field for that row).
Secondly, how should I be able to relate database feilds with file system (alf_data)? So that if I have meta data information I can easily fild my content in alf_data. Mean do you have any example reverse query (as you mentioned above)or any hint regarding the same? Will be kind if you can share the same.
Thanks and regards
Amit karhade.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2009 08:38 AM
It's a really, really bad idea to try and manipulate the database and the alf_data folder directly.
Please use the public APIs instead.
Thanks,
Mike
Please use the public APIs instead.
Thanks,
Mike

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2009 12:30 AM
Thanks Mike 🙂
Yes, I do agree with you on what you wrote above. But my point is just to have a clear understanding of database. At least how DB's metadatas are relate to file system. As we use Alfresco and somebody question's us tomorow atleast we should be in a position to answer them 🙂
So, please if you can share your knowlege on the Alfresco DB & file system relation, it will be very kind of you!
Thanks
Amit.
Yes, I do agree with you on what you wrote above. But my point is just to have a clear understanding of database. At least how DB's metadatas are relate to file system. As we use Alfresco and somebody question's us tomorow atleast we should be in a position to answer them 🙂
So, please if you can share your knowlege on the Alfresco DB & file system relation, it will be very kind of you!
Thanks
Amit.
