|Support Status||Full Support|
|Architecture Information||Platform Architecture|
|Description||The 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 the DbContentStreamListener, should implement the org.alfresco.service.cmr.repository.ContentStreamListener interface. 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.
|File Storage Buckets||
The default behaviour of the FileContentStore is to store content files in a content URL with the following URL format:
store://<Year>/<Month>/<Day>/<Hour>/<Minute>/<UUID>.binFor example, for content stored in 17th June 2016 at 10:38pm, the content URL used would be:
To create a custom FileContentStore content URL provider, implement the interface FileContentUrlProvider and the method with the following signature:
public String createNewFileStoreUrl()
This method must return a URL beginning with the scheme store, for example, store://<any unique path>. The resulting FileContentUrlProvider may then be wired up to any FileContentStore instance.
To customize the behaviour of fileContentStore, set the following properties in the alfresco-global.properties file:
|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 All-in-One SDK project.||