1 Creating a new cube from scratch using :command:`cubicweb-ctl newcube` |
1 Creating a new cube from scratch using :command:`cubicweb-ctl newcube` |
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 ~/hg |
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 |
8 cubicweb-ctl newcube mycube # will ask some questions, most with nice default |
8 # will ask some questions, most with nice default |
|
9 cubicweb-ctl newcube mycube |
9 # makes the cube source code managed by mercurial |
10 # makes the cube source code managed by mercurial |
10 cd mycube |
11 cd mycube |
11 hg init |
12 hg init |
12 hg add . |
13 hg add . |
13 hg ci |
14 hg ci |
14 |
15 |
15 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 |
16 returned by ``cubicweb-ctl list`` in the section *Available cubes*, |
17 returned by ``cubicweb-ctl list`` in the section *Available cubes*, |
17 and if it is not the case please refer to :ref:`ConfigurationEnv`. |
18 and if it is not the case please refer to :ref:`ConfigurationEnv`. |
18 |
19 |
19 To reuse an existing cube, add it to the list named ``__use__`` and defined in |
20 To reuse an existing cube, add it to the list named |
20 :file:`__pkginfo__.py`. This variable is used for the instance packaging |
21 ``__depends_cubes__`` and defined in :file:`__pkginfo__.py`. This |
21 (dependencies handled by system utility tools such as APT) and the usable cubes |
22 variable is used for the instance packaging (dependencies handled by |
22 at the time the base is created (import_erschema('MyCube') will not properly |
23 system utility tools such as APT) and the usable cubes at the time the |
23 work otherwise). |
24 base is created (import_erschema('MyCube') will not properly work |
|
25 otherwise). |
24 |
26 |
25 .. note:: |
27 .. note:: |
26 |
28 |
27 Please note that if you do not wish to use default directory for your cubes |
29 Please note that if you do not wish to use default directory for your cubes |
28 library, you should set the :envvar:`CW_CUBES_PATH` environment variable to |
30 library, you should set the :envvar:`CW_CUBES_PATH` environment variable to |