author | Sandrine Ribeau <sandrine.ribeau@logilab.fr> |
Tue, 18 Nov 2008 11:51:22 -0800 | |
changeset 96 | c1d04b2fa8c6 |
parent 93 | 9c919a47e140 |
child 110 | d3005cdc968f |
child 111 | 7a06f06de32f |
permissions | -rw-r--r-- |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
1 |
.. -*- coding: utf-8 -*- |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
2 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
3 |
`CubicWeb` concepts |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
4 |
=================== |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
5 |
|
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
6 |
A little history... |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
7 |
------------------- |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
8 |
|
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
9 |
`CubicWeb` is a web application framework developped by Logilab_ since 2001. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
10 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
11 |
Entirely written in Python, `CubicWeb` publishes data from all sorts |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
12 |
of sources such as SQL database, LDAP directory and versioning system such |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
13 |
as subversion. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
14 |
|
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
15 |
`CubicWeb` user interface was designed to let the final user a huge flexibility |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
16 |
on how to select and how to display content. It allows to browse the knowledge |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
17 |
database and to display the results with the best rendering according to |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
18 |
the context. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
19 |
This interface flexibility gives back the user the control of the |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
20 |
rendering parameters that are usually reserved for developpers. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
21 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
22 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
23 |
We can list a couple of web applications developped with `CubicWeb`, an online |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
24 |
public phone directory (see http://www.118000.fr/), a system for managing |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
25 |
digital studies and simulations for a research lab, a tool for shared children |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
26 |
babysitting (see http://garde-partagee.atoukontact.fr/), a tool to manage |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
27 |
software developpment (see http://www.logilab.org), etc. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
28 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
29 |
In 2008, `CubicWeb` was ported for a new type of source : the datastore |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
30 |
from GoogleAppEngine_. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
31 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
32 |
Global architecture |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
33 |
------------------- |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
34 |
.. image:: images/archi_globale.png |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
35 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
36 |
.. note:: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
37 |
For real, the client and server sides are integrated in the same |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
38 |
process and interact directly, without the needs for distants |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
39 |
calls using Pyro. It is important to note down that those two |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
40 |
sides, client/server, are disjointed and it is possible to execute |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
41 |
a couple of calls in distincts processes to balance the load of |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
42 |
your web site on one or more machines. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
43 |
|
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
44 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
45 |
Terms and vocabulary |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
46 |
-------------------- |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
47 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
48 |
*schema* |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
49 |
the schema defines the data model of an application based on entities |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
50 |
and relations, thanks to the `yams`_ library. This is the core piece |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
51 |
of an application. It is initially defined in the file system and is |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
52 |
stored in the database at the time an instance is created. `CubicWeb` |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
53 |
provides a certain number of system entities included automatically as |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
54 |
it is necessarry for the core of `CubicWeb` and a library of |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
55 |
cubes that can be explicitely included if necessarry. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
56 |
|
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
57 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
58 |
*entity type* |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
59 |
an entity is a set of attributes; the essential attribute of |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
60 |
an entity is its key, named eid |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
61 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
62 |
*relation type* |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
63 |
entities are linked to each others by relations. In `CubicWeb` |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
64 |
relations are binary: by convention we name the first item of |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
65 |
a relation the `subject` and the second the `object`. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
66 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
67 |
*final entity type* |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
68 |
final types corresponds to the basic types such as string of characters, |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
69 |
integers... Those types have a main property which is that they can |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
70 |
only be used as `object` of a relation. The attributes of an entity |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
71 |
(non final) are entities (finals). |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
72 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
73 |
*final relation type* |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
74 |
a relation is said final if its `object` is a final type. This is equivalent |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
75 |
to an entity attribute. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
76 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
77 |
*repository* |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
78 |
this is the RQL server side of `CubicWeb`. Be carefull not to get |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
79 |
confused with a Mercurial repository or a debian repository. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
80 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
81 |
*source* |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
82 |
a data source is a container of data (SGBD, LDAP directory...) integrated in the |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
83 |
`CubicWeb` repository. This repository has at least one source, `system` which |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
84 |
contains the schema of the application, plain-text index and others |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
85 |
vital informations for the system. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
86 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
87 |
*configuration* |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
88 |
it is possible to create differents configurations for an instance: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
89 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
90 |
- ``repository`` : repository only, accessible for clients using Pyro |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
91 |
- ``twisted`` : web interface only, access the repository using Pyro |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
92 |
- ``all-in-one`` : web interface and repository in a single process. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
93 |
The repository could be or not accessible using Pyro. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
94 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
95 |
*cube* |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
96 |
a cube is a model grouping one or multiple data types and/or views |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
97 |
to provide a specific functionnality or a complete `CubicWeb` application |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
98 |
potentially using other cubes. The available subes are located in the file |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
99 |
system at `/path/to/forest/cubicweb/cubes` |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
100 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
101 |
*instance* |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
102 |
an instance is a specific installation of a cube. All the required |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
103 |
configuration files necessarry for the well being of your web application |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
104 |
are grouped in an instance. This will refer to the cube(s) your application |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
105 |
is based on. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
106 |
By example logilab.org and our intranet are two instances of a single |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
107 |
cube jpl, developped internally. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
108 |
The instances are defined in the directory `~/etc/cubicweb.d`. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
109 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
110 |
*application* |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
111 |
the term application is sometime used to talk about an instance |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
112 |
and sometimes to talk of a cube depending on the context. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
113 |
So we would like to avoid using this term and try to use *cube* and |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
114 |
*instance* instead. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
115 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
116 |
*result set* |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
117 |
this object contains the results of an RQL query and information on the query. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
118 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
119 |
*Pyro* |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
120 |
`Python Remote Object`_, distributed objects system similar to Java's RMI |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
121 |
(Remote Method Invocation), which can be used for the dialog between the web |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
122 |
side of the framework and the RQL repository. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
123 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
124 |
.. _`Python Remote Object`: http://pyro.sourceforge.net/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
125 |
.. _`yams`: http://www.logilab.org/project/name/yams/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
126 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
127 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
128 |
`CubicWeb` engine |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
129 |
----------------- |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
130 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
131 |
The web engine in `CubicWeb` is a set of classes managing a set of objects loaded |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
132 |
dynamically at the startup of `CubicWeb`. Those dynamics objects, based on the schema |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
133 |
or the library, are building the final web site. The differents dymanic components are |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
134 |
by example: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
135 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
136 |
* client and server side |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
137 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
138 |
- entities definition, containing the logic which enables application data manipulation |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
139 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
140 |
* client side |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
141 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
142 |
- *views*, or more specifically |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
143 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
144 |
- boxes |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
145 |
- header and footer |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
146 |
- forms |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
147 |
- page templates |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
148 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
149 |
- *actions* |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
150 |
- *controllers* |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
151 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
152 |
* server side |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
153 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
154 |
- notification hooks |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
155 |
- notification views |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
156 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
157 |
The components of the engine are: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
158 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
159 |
* a frontal web (only twisted is available so far), transparent for dynamic objects |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
160 |
* an object that encapsulates the configuration |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
161 |
* a `vregistry` (`cubicweb.cwvreg`) containing the dynamic objects loaded automatically |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
162 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
163 |
|
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
164 |
Details of a recording process |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
165 |
------------------------------ |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
166 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
167 |
At startup, the `vregistry` or registers base, inspects a number of directories |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
168 |
looking for compatible classes definition. After a recording process, the objects |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
169 |
are assigned to registers so that they can be selected dynamically while the |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
170 |
application is running. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
171 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
172 |
The base class of those objects is `AppRsetObject` (module `cubicweb.common.appobject`). |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
173 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
174 |
API Python/RQL |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
175 |
-------------- |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
176 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
177 |
Inspired from the standard db-api, with a Connection object having the methods |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
178 |
cursor, rollback and commit essentially. The most important method is |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
179 |
the `execute` method of a cursor : |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
180 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
181 |
`execute(rqlstring, args=None, eid_key=None, build_descr=True)` |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
182 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
183 |
:rqlstring: the RQL query to execute (unicode) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
184 |
:args: if the query contains substitutions, a dictionnary containing the values to use |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
185 |
:eid_key: |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
186 |
an implementation detail of the RQL queries cache implies that if a substitution |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
187 |
is used to introduce an eid *susceptible to raise the ambiguities in the query |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
188 |
type resolution*, then we have to specify the correponding key in the dictionnary |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
189 |
through this argument |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
190 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
191 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
192 |
The `Connection` object owns the methods `commit` and `rollback`. You *should |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
193 |
never need to use them* during the development of the web interface based on |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
194 |
the `CubicWeb` framework as it determines the end of the transaction depending |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
195 |
on the query execution success. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
196 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
197 |
.. note:: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
198 |
While executing updates queries (SET, INSERT, DELETE), if a query generates |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
199 |
an error related to security, a rollback is automatically done on the current |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
200 |
transaction. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
201 |
|
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
202 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
203 |
The `Request` class (`cubicweb.web`) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
204 |
------------------------------------ |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
205 |
|
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
206 |
A request instance is created when an HTPP request is sent to the web server. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
207 |
It contains informations such as forms parameters, user authenticated, etc. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
208 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
209 |
**Globally, a request represents a user query, either through HTTP or not |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
210 |
(we also talk about RQL queries on the server side by example)** |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
211 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
212 |
An instance of `Request` has the following attributes: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
213 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
214 |
* `user`, instance of `cubicweb.common.utils.User` corresponding to the authenticated |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
215 |
user |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
216 |
* `form`, dictionnary containing the values of a web form |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
217 |
* `encoding`, characters encoding to use in the response |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
218 |
|
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
219 |
But also: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
220 |
|
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
221 |
:Session data handling: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
222 |
* `session_data()`, returns a dictinnary containing all the session data |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
223 |
* `get_session_data(key, default=None)`, returns a value associated to the given |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
224 |
key or the value `default` if the key is not defined |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
225 |
* `set_session_data(key, value)`, assign a value to a key |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
226 |
* `del_session_data(key)`, suppress the value associated to a key |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
227 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
228 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
229 |
:Cookies handling: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
230 |
* `get_cookie()`, returns a dictionnary containing the value of the header |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
231 |
HTTP 'Cookie' |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
232 |
* `set_cookie(cookie, key, maxage=300)`, adds a header HTTP `Set-Cookie`, |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
233 |
with a minimal 5 minutes length of duration by default (`maxage` = None |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
234 |
returns a *session* cookie which will expire when the user closes the browser |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
235 |
window |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
236 |
* `remove_cookie(cookie, key)`, forces a value to expire |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
237 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
238 |
:URL handling: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
239 |
* `url()`, returns the full URL of the HTTP request |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
240 |
* `base_url()`, returns the root URL of the web application |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
241 |
* `relative_path()`, returns the relative path of the request |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
242 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
243 |
:And more...: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
244 |
* `set_content_type(content_type, filename=None)`, adds the header HTTP |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
245 |
'Content-Type' |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
246 |
* `get_header(header)`, returns the value associated to an arbitrary header |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
247 |
of the HTTP request |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
248 |
* `set_header(header, value)`, adds an arbitrary header in the response |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
249 |
* `cursor()` returns a RQL cursor on the session |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
250 |
* `execute(*args, **kwargs)`, shortcut to ``.cursor().execute()`` |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
251 |
* `property_value(key)`, properties management (`EProperty`) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
252 |
* dictionnary `data` to store data to share informations between components |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
253 |
*while a request is executed* |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
254 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
255 |
Please note down that this class is abstract and that a concrete implementation |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
256 |
will be provided by the *frontend* web used (in particular *twisted* as of |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
257 |
today). For the views or others that are executed on the server side, |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
258 |
most of the interface of `Request` is defined in the session associated |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
259 |
to the client. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
260 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
261 |
The `AppObject` class |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
262 |
--------------------- |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
263 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
264 |
In general: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
265 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
266 |
* we do not inherit directly from this class but from a more specific |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
267 |
class such as `AnyEntity`, `EntityView`, `AnyRsetView`, |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
268 |
`Action`... |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
269 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
270 |
* to be recordable, a subclass has to define its own register (attribute |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
271 |
`__registry__`) and its identifier (attribute `id`). Usually we do not have |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
272 |
to take care of the register, only the identifier `id`. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
273 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
274 |
We can find a certain number of attributes and methods defined in this class |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
275 |
and so common to all the application objects: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
276 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
277 |
At the recording, the following attributes are dynamically added to |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
278 |
the *subclasses*: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
279 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
280 |
* `vreg`, the `vregistry` of the application |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
281 |
* `schema`, the application schema |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
282 |
* `config`, the application configuration |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
283 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
284 |
We also find on instances, the following attributes: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
285 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
286 |
* `req`, `Request` instance |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
287 |
* `rset`, the *result set* associated to the object if necessarry |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
288 |
* `cursor`, rql cursor on the session |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
289 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
290 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
291 |
:URL handling: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
292 |
* `build_url(method=None, **kwargs)`, returns an absolute URL based on |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
293 |
the given arguments. The *controller* supposed to handle the response |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
294 |
can be specified through the special parameter `method` (the connection |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
295 |
is theoretically done automatically :). |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
296 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
297 |
* `datadir_url()`, returns the directory of the application data |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
298 |
(contains static files such as images, css, js...) |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
299 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
300 |
* `base_url()`, shortcut to `req.base_url()` |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
301 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
302 |
* `url_quote(value)`, version *unicode safe* of the function `urllib.quote` |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
303 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
304 |
:Data manipulation: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
305 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
306 |
* `etype_rset(etype, size=1)`, shortcut to `vreg.etype_rset()` |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
307 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
308 |
* `eid_rset(eid, rql=None, descr=True)`, returns a *result set* object for |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
309 |
the given eid |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
310 |
* `entity(row, col=0)`, returns the entity corresponding to the data position |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
311 |
in the *result set* associated to the object |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
312 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
313 |
* `complete_entity(row, col=0, skip_bytes=True)`, is equivalent to `entity` but |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
314 |
also call the method `complete()` on the entity before returning it |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
315 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
316 |
:Data formatting: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
317 |
* `format_date(date, date_format=None, time=False)` |
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
318 |
* `format_time(time)` |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
319 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
320 |
:And more...: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
321 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
322 |
* `external_resource(rid, default=_MARKER)`, access to a value defined in the |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
323 |
configuration file `external_resource` |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
324 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
325 |
* `tal_render(template, variables)`, |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
326 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
327 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
328 |
.. note:: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
329 |
When we inherit from `AppObject` (even not directly), you *always* have to use |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
330 |
**super()** to get the methods and attributes of the superclasses, and not |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
331 |
use the class identifier. |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
332 |
By example, instead of writting: :: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
333 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
334 |
class Truc(PrimaryView): |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
335 |
def f(self, arg1): |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
336 |
PrimaryView.f(self, arg1) |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
337 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
338 |
You'd better write: :: |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
339 |
|
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
340 |
class Truc(PrimaryView): |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
341 |
def f(self, arg1): |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
342 |
super(Truc, self).f(arg1) |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
343 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
344 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
345 |
Standard structure for a cube |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
346 |
----------------------------- |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
347 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
348 |
A complex cube is structured as follows: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
349 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
350 |
:: |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
351 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
352 |
mycube/ |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
353 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
354 |
|-- schema.py |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
355 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
356 |
|-- entities/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
357 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
358 |
|-- sobjects/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
359 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
360 |
|-- views/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
361 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
362 |
|-- test/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
363 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
364 |
|-- i18n/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
365 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
366 |
|-- data/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
367 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
368 |
|-- migration/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
369 |
| |- postcreate.py |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
370 |
| \- depends.map |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
371 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
372 |
|-- debian/ |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
373 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
374 |
\-- __pkginfo__.py |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
375 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
376 |
We can use simple Python module instead of packages, by example: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
377 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
378 |
:: |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
379 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
380 |
mycube/ |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
381 |
| |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
382 |
|-- entities.py |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
383 |
|-- hooks.py |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
384 |
\-- views.py |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
385 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
386 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
387 |
where : |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
388 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
389 |
* ``schema`` contains the schema definition (server side only) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
390 |
* ``entities`` contains the entities definition (server side and web interface) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
391 |
* ``sobjects`` contains hooks and/or views notifications (server side only) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
392 |
* ``views`` contains the different components of the web interface (web interface only) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
393 |
* ``test`` contains tests specifics to the application (not installed) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
394 |
* ``i18n`` contains the messages catalog for supported languages (server side and |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
395 |
web interface) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
396 |
* ``data`` contains arbitrary data files served statically |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
397 |
(images, css, javascripts files)... (web interface only) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
398 |
* ``migration`` contains the initialization file for new instances |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
399 |
(``postcreate.py``) and in general a file containing the `CubicWeb` dependancies |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
400 |
of the cube depending on its version (``depends.map``) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
401 |
* ``debian`` contains all the files that manages the debian packaging |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
402 |
(you would find there the classical structure with ``control``, ``rules``, |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
403 |
``changelog``... (not installed) |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
404 |
* the file ``__pkginfo__.py`` provides meta-data on the cube, especially the |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
405 |
distribution name and the current version (server side and web interface) or |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
406 |
also the sub-cubes used by this cube |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
407 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
408 |
The only required files are: |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
409 |
|
96
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
410 |
* the file ``__pkginfo__.py`` |
c1d04b2fa8c6
Add missing images.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
93
diff
changeset
|
411 |
* the schema definition |