1.1. What is a Cube?#

A cube is the equivalent of a module or a component but for CubicWeb. A website made with CubicWeb is generally an instance based on a cube that is just an assembly of already existing cubes with some domain specific logics. If you need a functionality that is not available, then you write a new Cube for it (and hopefully share it with the community).

A cube is made of mainly four parts:

  • its data model stored in schema.py,

  • its logic added to the data stored in entities

  • its logic concerning dataflow stored in hooks,

  • its user interface stored in views.

A cube can also define:

  • its internationalization stored in the i18n/,

  • new cubicweb commands stored in ccplugin.py.

A cube can use other cubes as building blocks and assemble them to provide a whole with richer functionnalities than its parts. The cubes cubicweb-blog and cubicweb-comment could be used to make a cube named myblog with commentable blog entries.

The CubicWeb.org Forge offers a large number of cubes developed by the community and available under a free software license. They are designed with the KISS principle as each cube usually adds a single functionality. Usually an application is an instance based on a regular cube that is just an assembly of existing cubes with some specific logics.

Note

The command cubicweb-ctl list displays the list of available cubes.