cancel
Showing results for 
Search instead for 
Did you mean: 

Content store

olive
Champ in-the-making
Champ in-the-making
Now I found that all contents are stored in the file system. Is it possible for me to store contents in a database without the need to modify the core of alfresco?
7 REPLIES 7

olive
Champ in-the-making
Champ in-the-making
More specifically, if I use a xml database such as Exist, do I need to write the content service for the new content store? I didnot find the documents on how the content store is manipulated by the content service.

kevinr
Star Contributor
Star Contributor
Hello,

Yes out the box Alfresco stores content in files. It is possible to plug-in a different implementation of any of the Alfresco services, including the Content Store, which means you could write to any database you choose, including an XML database. However at present we only have one implementation of the ContentService - so you would need to modify Alfresco to create a new one.

Thanks,

Kevin

olive
Champ in-the-making
Champ in-the-making
Hello, kevin
Thank you very much.
I just went throught the source code of Alfresco. It seems that the content service is wired with some other part of Alfresco. I don't want to rewrite my code each time you upgrade Alfresco.   :cry: Is there a way to totally seperate content service from the other implementation of Alfresco? Moreover, is it possible for the user to choose either service from a configuration file?

derek
Star Contributor
Star Contributor
Hi,

The abstraction is at the ContentStore level, not at the service level.

Currently, we have the FileContentStore and I am busy with a DbContentStore.  We had a MemoryContentStore but there didn't seem to be much point in supporting it.

I would recommend using org.alfresco.repo.content.filestore as a template.  Essentially, you have to write the ContentWriter, ContentReader and ContentStore implementations.  Hopefully the abstract classes and base tests will mean that you can concentrate on the nitty gritty that makes your store different.

Then, to switch to your store, inject an instance of it into the ContentService.


   <bean id="xmlContentStore" class="org.alfresco.repo.content.xml.XmlContentStore">
      <property name="…">
         <value>…</value>
      </property>
   </bean>

   <bean id="contentService" class="org.alfresco.repo.content.RoutingContentService" init-method="init">
      …
      <property name="store">
          <ref bean="xmlContentStore" />
      </property>
      …
   </bean>


I would recommend using the AbstractContentReadWriteTest in the same way that the FileContentStoreTest does.  This should ensure that the ContentStore can reliably use the new store.

Note, the the FileContentReader and FileContentWriter implement the optional random-access-enabling interface.  This is required if you wish to use CIFS, FTP, etc.  There are ways to solve this with existing components; but we can go into that if required.

Regards

paulkeogh
Champ in-the-making
Champ in-the-making
Hi,
DbContentStore.  We had a MemoryContentStore but there didn't seem to be much point in supporting it.

Well, I'm not sure. A 64 bit address space I think will change the way we look at in-memory data. The MySQL 5.0 cluster architecture is as far as I recall based on a replicated in-memory model.

derek
Star Contributor
Star Contributor
Hi,

You are right about the MySQL clustering.

Currently, I can't think of a use case where the content would be written to memory without being replicated, in-transaction, to some other kind of persistent store.  This might be useful if the persistent store didn't support random access and the file store was too slow.

Regards

olive
Champ in-the-making
Champ in-the-making
Hi,derek,
Thank you for the response. Seems I do need to use FTP. But first I wiil try to implement the XML Content store according to your suggestion.


Regards,