cancel
Showing results for 
Search instead for 
Did you mean: 

Use database or not with Alfresco

chungley
Champ in-the-making
Champ in-the-making
Hi,

We will be storing XML contents/documents in Alfresco.  Within the XML contents, there are certain "elements" that I want to capture and create attribute/status data around.  Every time the XML document is changed, I will need to sync up these elements (new, delete, update).

My initially thoughts/assumptions is that I will need to extend/customize the loading of the document such that during each load, it will parse those special information out and update that in a SQL database such as Oracle.  However, I am very new to Alfresco and my project schedule is tight (3 months) and don't know if this is my best options.  I was wondering if someone can give me some pointers or links where I can read up this sort of things.

Thank you.
8 REPLIES 8

zaizi
Champ in-the-making
Champ in-the-making
You are on the right path.
- Work out the custom metadata you want to extract and store / make it searchable.
- Create a custom aspect to store your metadata; http://wiki.alfresco.com/wiki/Step-By-Step:_Creating_A_Custom_Model
- Add metadata extraction to parse your XML and pull out the required information and put it in the aspect (NB: XML metadata extraction is available for WCM. You can base your implementation on that); http://wiki.alfresco.com/wiki/Metadata_Extraction
- Write web scripts to search the meta-data and report results. http://wiki.alfresco.com/wiki/Web_Scripts

Save the license on the Oracle database. Depending on the complexity of your XMLs, this should be about few days of development effort.

Good luck.

norgan
Champ in-the-making
Champ in-the-making
You could use "behaviors" for that, triggering your update-classes. This was, your business logic can be called after/before/on create/update/delete/move/……..

Search the wiki for more details on that.

Norgan

chungley
Champ in-the-making
Champ in-the-making
Thanks for all the responses…

I think I know how to research for my options (1. It can be done within Alfresco's meta data without Oracle.  2. It can also be done with Oracle).  However, I am sorry, but I forgot to mention that there are existing Oracle database system which will need to link to these special data that I extracted from the XML file.  Given that, would you still recommend to go with the Alfresco's meta data.  I liked the idea of using the Alfresco's meta data for this storage, but wasn't sure how easy/accessible is that data?  For instance, can users do a real time "query"?

If anyone have experience using the customized meta data, can you share your thoughts?

norgan
Champ in-the-making
Champ in-the-making
Hi,
doing realtime queries is the main use of the Alfresco repository. The Alfresco explorer is an application accessing the Alfresco repository - same as Alfresco share, docasu, flex-air-spaces and and and are. They all do these realtime access things. And what you get is the content object, beeing the set of metadata plus - in case of content type "cm:content", the binary (your XML file e.g.). The folders are just contenttypes "cm:folder" without the cm:content field, containing the binary, and instead, has a list of "children objects".

The question is rather, can you access the proper method from your requester side using SOAP/REST/CMIS/….

Does that answer your metadata question ?

chungley
Champ in-the-making
Champ in-the-making
Thanks again Norgan.

I have been developing relational database applications and I tend to think in terms of that…  For instance, when I query against the database, I can link the revelant tables together and run just one query…  With part of the data in an Oracle database, and part of that in Alfresco, if I want to pull say 1000 "master" records from Oracle, and all its "relevant" information from Alfresco using some sort of record key, is there any way to do that without going to Alfresco 1000 times for each of the record that I pulled from Oracle?  Sorry, I am really new to CMS.

norgan
Champ in-the-making
Champ in-the-making
First of all - I hope my posts did not sound to patronizing to you then, sorry if that was the case.
For the exact implementation, someone else will answer here I guess. I am not deep enough into the APIS, but from concept, I would create my 1000-records set and query Alfresoc with that list as parameter. Including alfresco content into the "where" clause for filtering however might be a bit challenging though. But lets see, what the programming gurus say about that Smiley Happy

Regards, Norgan

zaizi
Champ in-the-making
Champ in-the-making
Yes, it is possible to query across Oracle and Alfresco using a data virtualization tool such as JBoss Tiied. However, it might be an over kill if you only require two systems to share the same data.

Once, you extract the required data you can just connect to Oracle and insert the meta-data directly into a table. This can be triggered by the policy. Easiest way to do this is create your own JDBC connection to Oracle and do the insert the data. You can Google for how to connect to Oracle from Spring.

chungley
Champ in-the-making
Champ in-the-making
Thank you again to both Norgan and Zaizi.

Norgan, your posts did not sound at all patronizing to meSmiley Happy