|Support Status||Full Support|
|Architecture Information||Platform Architecture|
|Description||The Alfresco Repository consists of content, metadata, and index. The content,
which is the physical file that you upload to Alfresco, is by default stored in the
file system. This is handled by the so called File Content Store, which gets
information about where to store files from configuration in the
alfresco-global.properties file (for example,
It is also possible to store content files in other places, and there are other content store implementations available out-of-the- box to support that:
Besides these content store implementations there are also others that adds features to a content store solution:
It is quite common to combine content stores, such as the S3 Content Store and the Caching Content Store.
If none of the out-of-the-box content stores suites the needs, then a custom content store can be implemented.
To do this is quite simple, the following classes need to be implemented:
When implementing the custom content store class, such as a DbContentStore, extend the org.alfresco.repo.content.AbstractContentStore class so the basic content store functionality is included by default. Then implement the following methods:
When implementing the custom content reader class, such as a DbContentReader, extend the org.alfresco.repo.content.AbstractContentReader class so the basic content reader functionality is included by default. Then implement the following methods:
When implementing the custom content writer class, such as a DbContentWriter, extend the org.alfresco.repo.content.AbstractContentWriter class so the basic content writer functionality is included by default. Then implement the following methods:
The content writer implementation does not actually write/save the file to the new storage. This is handled via a content stream listener that is registered via the content writer implementation. The custom content stream listener , such as a DbContentStreamListener, should extend the org.alfresco.service.cmr.repository.ContentStreamListener class so the basic functionality is inherited as with the other classes. Then implement the following methods:
When all the necessary classes have been implemented it is easy to enable the new content store. Just override the fileContentStore bean with the new custom content store bean. Here is an example of how that looks like:
<bean id="fileContentStore" class="org.alfresco.tutorial.contentstore.DbContentStore"> <property name="databaseAdapter" ref="org.alfresco.tutorial.content.store.databaseAdapter" /> </bean>
If you need to read and write content files from many different types of stores, then more than one store implementation can be used to create the required solution. Maybe some files should come from S3,other files from the local file system etc. We can then use something called Content Store Selectors. They can be used to set up a content storage solution with multiple storage implementations active at the same time.
|Deployment - App Server||A custom content store implementation requires some Java coding so it is not suitable for direct deployment into the App server. Implement as an AMP instead.|
|Deployment - SDK Project||
|Alfresco Developer Blogs||None|