Become efficient with Coefficient

The Coefficient platform offers developers open source collaboration software

Page 2 of 2

More advanced module techniques

If you managed to create your own module, you are ready to start using Coefficient as a basis for online collaboration. This section summarizes some of the advanced techniques you will need for more complex modules.

Coefficient modules without database access aren't useful. Luckily, Coefficient handles much of the mundane database operations for developers with the help of a tool called Hibernate. Hibernate is a popular object-relation tool; see Resources for more information.

To add a new class or table, you must create a Hibernate data class by adding XDoclet tags. The class is registered with the Coefficient runtime by inserting a static block to your module. Coefficient will handle all table creation and updates automatically at runtime, meaning you never touch any SQL. Refer to the existing modules for database examples.

Coefficient modules can also be used as project modules, meaning they can be added to projects as tools. The Discussion module is a good example of a project module. To develop a project module, you need to add it to the /za/org/coefficient/projects namespace (the Wiki example is in the /za/org/coefficient/navigation namespace) and extend BaseProjectModule. When developing project modules, you must be aware of the current project, which is available from the CoefficientContext object. Refer to the existing Coefficient modules for reference implementations.

The last type of module is a Theme module. Themes are used to determine the look and feel of Coefficient. You can alter the look to correspond to the specific needs of your organization by creating a module that extends the Theme class and adds itself to the /za/org/coefficient/themes namespace. By altering various templates, you will be able to fine-tune the user interface. Refer to PlainWhiteTheme for an example.

Last but not least, is the Coefficient security model. Use the getCurrentUser() method from CoefficientContext to test if the current user is logged in and which user is executing the request. You can also override the module's canExecute() method to check a module's authorization.


Many developers will get involved in online collaboration software during their careers. These developers will either develop collaboration features for their clients, or use collaboration software during the software development lifecycle.

Coefficient is a strong base for online collaboration and is almost immediately useful to a wide range of users. You can easily extend Coefficient to meet any of your organization's collaboration requirements.

Leon Messerschmidt, a Java developer and open source advocate, lives in Pretoria, South Africa with his wife and two dogs. He has been involved in both commercial and open source Web application framework development for many years and currently works for Psybergate.

Learn more about this topic

| 1 2 Page 2