doc/book/devrepo/cubes/cc-newcube.rst
author Philippe Pepiot <ph@itsalwaysdns.eu>
Tue, 31 Mar 2020 19:15:03 +0200
changeset 12957 0c973204033a
parent 11689 213f60272d49
permissions -rw-r--r--
[server] prevent returning closed cursor to the database pool In since c8c6ad8 init_repository use repo.internal_cnx() instead of repo.system_source.get_connection() so it use the pool and we should not close cursors from the pool before returning it back. Otherwise we may have "connection already closed" error. This bug only trigger when connection-pool-size = 1. Since we are moving to use a dynamic pooler we need to get this fixed. This does not occur with sqlite since the connection wrapper instantiate new cursor everytime, but this occur with other databases.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6928
62b8ef1e859a [doc/book] simplify & fix the overview chapter
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5608
diff changeset
     1
Creating a new cube from scratch
62b8ef1e859a [doc/book] simplify & fix the overview chapter
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5608
diff changeset
     2
--------------------------------
1714
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
     3
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
     4
Let's start by creating the cube environment in which we will develop ::
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
     5
11689
213f60272d49 [doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11687
diff changeset
     6
  cd ~/myproject
4437
21f2e01fdd6a update exemples using the 3.6 api and add/fix some sections (schema, vreg, talk about CW_MODE in concepts...). So much to do :'(
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2280
diff changeset
     7
  # use cubicweb-ctl to generate a template for the cube
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
     8
  # will ask some questions, most with nice default
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
     9
  cubicweb-ctl newcube mycube
4437
21f2e01fdd6a update exemples using the 3.6 api and add/fix some sections (schema, vreg, talk about CW_MODE in concepts...). So much to do :'(
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2280
diff changeset
    10
  # makes the cube source code managed by mercurial
11689
213f60272d49 [doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11687
diff changeset
    11
  cd cubicweb-mycube
4437
21f2e01fdd6a update exemples using the 3.6 api and add/fix some sections (schema, vreg, talk about CW_MODE in concepts...). So much to do :'(
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2280
diff changeset
    12
  hg init
1714
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    13
  hg add .
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    14
  hg ci
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    15
2280
31269a9b9ec4 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2172
diff changeset
    16
If all went well, you should see the cube you just created in the list
6928
62b8ef1e859a [doc/book] simplify & fix the overview chapter
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5608
diff changeset
    17
returned by ``cubicweb-ctl list`` in the  *Available cubes* section.
5608
f9ab62103ad4 proof read documentation
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5400
diff changeset
    18
If not, please refer to :ref:`ConfigurationEnv`.
1714
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    19
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    20
To reuse an existing cube, add it to the list named
5608
f9ab62103ad4 proof read documentation
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5400
diff changeset
    21
``__depends_cubes__`` which is defined in :file:`__pkginfo__.py`.
f9ab62103ad4 proof read documentation
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5400
diff changeset
    22
This variable is used for the instance packaging (dependencies handled
f9ab62103ad4 proof read documentation
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5400
diff changeset
    23
by system utility tools such as APT) and to find used cubes when the
10517
fa9a0c80556d [schema] drop old backward compat code
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 10491
diff changeset
    24
database for the instance is created.