1 Creating a new cube from scratch using :command:`cubicweb-ctl newcube` |
1 Creating a new cube from scratch |
2 ---------------------------------------------------------------------- |
2 -------------------------------- |
3 |
3 |
4 Let's start by creating the cube environment in which we will develop :: |
4 Let's start by creating the cube environment in which we will develop :: |
5 |
5 |
6 cd ~/cubes |
6 cd ~/cubes |
7 # use cubicweb-ctl to generate a template for the cube |
7 # use cubicweb-ctl to generate a template for the cube |
12 hg init |
12 hg init |
13 hg add . |
13 hg add . |
14 hg ci |
14 hg ci |
15 |
15 |
16 If all went well, you should see the cube you just created in the list |
16 If all went well, you should see the cube you just created in the list |
17 returned by ``cubicweb-ctl list`` in the *Available cubes* section. |
17 returned by ``cubicweb-ctl list`` in the *Available cubes* section. |
18 If not, please refer to :ref:`ConfigurationEnv`. |
18 If not, please refer to :ref:`ConfigurationEnv`. |
19 |
19 |
20 To reuse an existing cube, add it to the list named |
20 To reuse an existing cube, add it to the list named |
21 ``__depends_cubes__`` which is defined in :file:`__pkginfo__.py`. |
21 ``__depends_cubes__`` which is defined in :file:`__pkginfo__.py`. |
22 This variable is used for the instance packaging (dependencies handled |
22 This variable is used for the instance packaging (dependencies handled |
23 by system utility tools such as APT) and to find used cubes when the |
23 by system utility tools such as APT) and to find used cubes when the |
24 database for the instance is created (import_erschema('MyCube') will |
24 database for the instance is created (import_erschema('MyCube') will |
25 not properly work otherwise). |
25 not properly work otherwise). |
|
26 |
|
27 On a Unix system, the available cubes are usually stored in the |
|
28 directory :file:`/usr/share/cubicweb/cubes`. If you are using the |
|
29 cubicweb mercurial repository (:ref:`SourceInstallation`), the cubes |
|
30 are searched in the directory |
|
31 :file:`/path/to/cubicweb_toplevel/cubes`. In this configuration |
|
32 cubicweb itself ought to be located at |
|
33 :file:`/path/to/cubicweb_toplevel/cubicweb`. |
26 |
34 |
27 .. note:: |
35 .. note:: |
28 |
36 |
29 Please note that if you do not wish to use default directory for your cubes |
37 Please note that if you do not wish to use default directory for your cubes |
30 library, you should set the :envvar:`CW_CUBES_PATH` environment variable to |
38 library, you should set the :envvar:`CW_CUBES_PATH` environment variable to |