You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.
Implement I(Channel)ContentManager
To create a custom content manager, customers should implement either the IContentManager
or the IChannelContentManager
interface. As described in Storing and retrieving content, it is advised to implement an IChannelContentManager
from Blueriq 17.4 onwards. Consult the Javadoc to see which methods must be implemented, globally the following functionality is expected.
- Create new content based on the given data and metadata
- Read content, data and metadata are read separately
- Update existing content, it is possible to update only data or only properties, or both at the same time
- Delete content based on a given id
- Move content between ContentManagers
Implement IContentManagerFactory
The IContentManagerFactory consists of a single method which creates an IContentManager implementation for a given connection. If the given connection is not supported it may raise an exception. To implement this method, you may also need to create your own IConnection which can be used by your content manager.
You only need to support the additional connections and content managers that you want to add, if a customn factory does not support a given connection Blueriq will fallback on its default implementations.
Register your IContentManagerFactory implementation
Java
Annotate your implementation with the AquimaContentManagerFactory annotation and make sure the class will be scanned by Spring. Blueriq will automatically pick it up and use it where needed.
A simple example is shown below:
@AquimaContentManagerFactory public class CustomContentManagerFactory implements IContentManagerFactory { public IContentManager create(IConnection connection) throws UnsupportedConnectionException { if (connection instanceof ICustomConnection) { return new CustomContentManager((ICustomConnection) connection); } else { throw new UnsupportedConnectionException(connection); } } }