ColdBricks 1.1 Update: Custom Resource Libraries & Extension Modules
A new update to ColdBricks CMS is now available for everyone to download and play. This is still part of the greater 1.1 release but it adds some new interesting features that I thought would be interesting to blog about. Besides the obligatory bug fixes/performance enhancements, the two most prominent features are Custom Resource Libraries and the completion of a full modular architecture, including the option to install/uninstall modules directly by the end user.
Custom Resource Libraries
Resource Libraries are used to maintain catalogs of resources that can be used on a site. Resources can be things like images, RSS feeds, or content blocks. You can even create your own types of resources using ColdBricks. For example you can create a resource type to track things that are important to your site, like inventory items.
Sites in ColdBricks, can use resources from any number of resource libraries.
By default Resource Libraries are stored on the file system. A typical resource library has a root directory and then a number of subdirectories for each resource type that it contains. Resource files are stored in these subdirectories.
Although using the filesystem works fine, and provides a simple and intuitive base for managing resources, what about if the file system is not a good option? for example you want to have your resources on a database or you are deploying to a cluster and need a more distributed type of storage.
To address those concerns, ColdBricks now provides support for different types of resource libraries. This means that you could have multiple implementations of the resource library interface. For example, you could have a resource library to store its data on a relational database instead of the file system.
The Amazon S3 Resource Library Adapter
As an initial proof of concept of a different implementation of a Resource Library, there is an adapter to use Amazon S3 (Simple Storage Service) as the backend storage for a resource library.
Using Amazon S3 for storing your resources provides several interesting benefits, such as practically infinite growth capacity, reliable storage of your data and of course the possibility to have multiple ColdBricks instances on several boxes all pointing to the same resource library (without having to worry about content replication)
The S3 Adapter is packaged and distributed as a ColdBricks Module (see next section for more on extending ColdBricks), so its pretty easy to incorporate to your sites. You will, of course, need an existing S3 account to use it. The adapter prompts you for the name of an S3 bucket to use as the root of your library, and the keys used to access it, then adds the necessary settings to your site's config file. After that you just use your new library like any other resource library in ColdBricks.
By the way, the S3 Adapter uses a modified version of the Amazon S3 REST Wrapper by Joe Danzinger. Great stuff Joe!
Creating You Own Custom Resource Library Type
This part is for the more technically inclined folks. To create your own custom resource library type, what you need to do is create a component that implements the homePortals.components.resourceLibrary interface. This interface dictates all the operations that a Resource Library must provide.
After you have created your implementation you need to add it to the config file for the site in which you wish to use it (or to the global config file if you want it to be available for all sites in the server)
The following example shows how to add a resource library type:
<resourceLibraryTypes>
...
<resourceLibraryType prefix="db" path="path.to.reslib.implementation">
<property name="somename" value="somevalue" />
<property name="somename" value="somevalue" />
</resourceLibraryType>
...
</resourceLibraryTypes>
The prefix is used to indicate to ColdBricks what type of library are you going to use. For example for the S3 library, which has a prefix of "s3", the resource library path would be:
No prefix implies a regular file-system resource library.
Extension Modules
This update also includes the migration to a full modular architecture for ColdBricks. This means that every "feature" or section in the program is an independent module that can be added or removed. Of course some of the modules are pretty esential, but it gives the flexibility for creating custom builds of ColdBricks to suit different needs.
ColdBricks provides a set of features and services that allow modules to register themselves and add their own contributions to the main user interface.
Modules in ColdBricks come in two flavors: External Modules and Internal Modules. Both are pretty much the same, and only differ on where they are located. Internal modules are located inside the ColdBricks main tree, in the /modules subdirectory. Each module is contained in its own directory.
External modules are located outside of the ColdBricks application, on a directory named /ColdBricksModules. When the application starts, it checks for the existence of this directory. If it does, then loads any module located in there.
You can read more about how to build modules in the ColdBricks docs.
New Module: ModuleManager
Of course, what good is having a modular architecture if you are not gonna have fun installing and uninstalling modules at will? That's why your first module to install should be the "ModuleManager", this module allows you to view your installed modules, and install or uninstall modules at will.
The ModuleManager allows you to uninstall external modules only, since the internal ones are considered the "core" functionality. And similarly, any module that you install with it would be installed as an external module.
You can find modules for download on the Downloads section of the ColdBricks website.
Contributing Modules
Do you have an idea for a module? Do you want to try your hand in a different type of open source project? If you want to create a module and want your module posted in the ColdBricks website for everyone to share, send me a line to info@coldbricks.com or leave a comment here.
There are no comments for this entry.
[Add Comment]