doc/book/en/A03a-concepts.en.txt
changeset 280 ce829abf7c29
parent 272 06077d56f2c4
child 296 65564e83853e
equal deleted inserted replaced
277:a11a3c231050 280:ce829abf7c29
   339   
   339   
   340       class Truc(PrimaryView):
   340       class Truc(PrimaryView):
   341           def f(self, arg1):
   341           def f(self, arg1):
   342               super(Truc, self).f(arg1)
   342               super(Truc, self).f(arg1)
   343 
   343 
       
   344 .. _cubesConcepts:
       
   345 
       
   346 Cubes
       
   347 ~~~~~
       
   348 
       
   349 What is a cube ?
       
   350 ````````````````
       
   351 
       
   352 A cube is a model grouping one or more entity types and/or views associated
       
   353 in order to provide a specific feature or even a complete application using
       
   354 others cubes.
       
   355 
       
   356 You can decide to write your own set of cubes if you wish to re-use the 
       
   357 entity types you develop. Lots of cubes are available from the `CubicWeb
       
   358 Forge`_ under a free software license.
       
   359 
       
   360 .. _`CubicWeb Forge`: http://www.cubicweb.org/project/
       
   361 
       
   362 
   344 
   363 
   345 Standard structure for a cube
   364 Standard structure for a cube
   346 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   365 `````````````````````````````
   347 
   366 
   348 A complex cube is structured as follows:
   367 A complex cube is structured as follows:
   349 
   368 
   350 ::
   369 ::
   351   
   370   
   387 where :
   406 where :
   388 
   407 
   389 * ``schema`` contains the schema definition (server side only)
   408 * ``schema`` contains the schema definition (server side only)
   390 * ``entities`` contains the entities definition (server side and web interface)
   409 * ``entities`` contains the entities definition (server side and web interface)
   391 * ``sobjects`` contains hooks and/or views notifications (server side only)
   410 * ``sobjects`` contains hooks and/or views notifications (server side only)
   392 * ``views`` contains the different components of the web interface (web interface only)
   411 * ``views`` contains the web interface components (web interface only)
   393 * ``test`` contains tests specifics to the application (not installed)
   412 * ``test`` contains tests related to the application (not installed)
   394 * ``i18n`` contains the messages catalog for supported languages (server side and 
   413 * ``i18n`` contains messages catalogs for supported languages (server side and
   395   web interface) 
   414   web interface)
   396 * ``data`` contains arbitrary data files served statically
   415 * ``data`` contains data files for static content (images, css, javascripts)
   397   (images, css, javascripts files)... (web interface only)
   416   ...(web interface only)
   398 * ``migration`` contains the initialization file for new instances
   417 * ``migration`` contains initialization file for new instances (``postcreate.py``)
   399   (``postcreate.py``) and in general a file containing the `CubicWeb` dependancies 
   418   and a file containing dependencies of the component depending on the version
   400   of the cube depending on its version (``depends.map``)
   419   (``depends.map``)
   401 * ``debian`` contains all the files that manages the debian packaging
   420 * ``debian`` contains all the files managing debian packaging (you will find
   402   (you would find there the classical structure with ``control``, ``rules``, 
   421   the usual files ``control``, ``rules``, ``changelog``... not installed)
   403   ``changelog``... (not installed)
   422 * file ``__pkginfo__.py`` provides component meta-data, especially the distribution
   404 * the file ``__pkginfo__.py`` provides meta-data on the cube, especially the 
   423   and the current version (server side and web interface) or sub-cubes used by
   405   distribution name and the current version (server side and web interface) or
   424   the cube.
   406   also the sub-cubes used by this cube
   425  
   407 
   426  
   408 The only required files are:
   427 At least you should have:
   409 
   428 
   410 * the file ``__pkginfo__.py``
   429 * the file ``__pkginfo__.py``
   411 * the schema definition
   430 * the schema definition
   412   XXX false, we may want to have cubes which are only adding a service, no persistent data (eg embeding for instance)
   431   XXX false, we may want to have cubes which are only adding a service, no persistent data (eg embeding for instance)
   413 
   432 
       
   433 
       
   434 Standard library
       
   435 ````````````````
       
   436 
       
   437 A library of standard cubes are available from `CubicWeb Forge`_
       
   438 Cubes provide entities and views.
       
   439 
       
   440 The available application entities are:
       
   441 
       
   442 * addressbook: PhoneNumber and PostalAddress
       
   443 
       
   444 * basket: Basket (like a shopping cart)
       
   445 
       
   446 * blog: Blog (a *very* basic blog)
       
   447 
       
   448 * classfolder: Folder (to organize things but grouping them in folders)
       
   449 
       
   450 * classtags: Tag (to tag anything)
       
   451 
       
   452 * file: File (to allow users to upload and store binary or text files)
       
   453 
       
   454 * link: Link (to collect links to web resources)
       
   455 
       
   456 * mailinglist: MailingList (to reference a mailing-list and the URLs
       
   457   for its archives and its admin interface)
       
   458 
       
   459 * person: Person (easily mixed with addressbook)
       
   460 
       
   461 * task: Task (something to be done between start and stop date)
       
   462 
       
   463 * zone: Zone (to define places within larger places, for example a
       
   464   city in a state in a country)
       
   465 
       
   466 The available system entities are:
       
   467 
       
   468 * comment: Comment (to attach comment threads to entities)
       
   469 
       
   470