author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Wed, 12 Nov 2008 16:07:40 +0100 | |
changeset 28 | 9b7067bfaa15 |
parent 22 | 50f20cf0f440 |
child 40 | 0857f1fd76cf |
permissions | -rw-r--r-- |
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
1 |
Mise en place d'un environnement de développement Erudi |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
2 |
======================================================= |
0 | 3 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
4 |
.. toctree:: |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
5 |
:maxdepth: 1 |
0 | 6 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
7 |
sect_mercurial.txt |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
8 |
sect_installation.txt |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
9 |
sect_cubicweb-ctl.txt |
0 | 10 |
|
11 |
||
12 |
||
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
13 |
Création d'un composant |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
14 |
----------------------- |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
15 |
Commençons par créer un squelette qui nous servira de base au développement de |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
16 |
notre composant ou application :: |
0 | 17 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
18 |
cd ~/hg |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
19 |
erudi-ctl newtemplate moncomposant |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
20 |
# répondre aux questions |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
21 |
hg init moncomposant |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
22 |
cd moncomposant |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
23 |
hg add . |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
24 |
hg ci |
0 | 25 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
26 |
A partir de là si tout va bien, votre composant devrait être affiché par |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
27 |
`erudi-ctl list` dans la section *Available components*, si ce n'est pas le cas |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
28 |
revoir la section `Configuration de l'environnement`_. |
0 | 29 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
30 |
Pour utiliser un composant, il faut le mentionner dans la variable |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
31 |
__use__ du fichier __pkginfo__ de l'application. Cette variable |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
32 |
contrôle à la fois le packaging de l'application (dépendances gérées |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
33 |
par les utilitaires système comme les outils APT) et les composants |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
34 |
effectivement utilisables lors de la création de la base |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
35 |
(import_erschema('Moncomposant') ne fonctionne pas sinon). |
0 | 36 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
37 |
Création d'une instance de développement |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
38 |
---------------------------------------- |
0 | 39 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
40 |
Maintenant que nous avons notre squelette de modèle, on peut en créer une |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
41 |
instance afin de voir ce que tout ça donne dans un simple navigateur web. |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
42 |
Nous allons utiliser une configuration `all-in-one` afin de simplifier les |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
43 |
choses :: |
0 | 44 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
45 |
erudi-ctl create -c all-in-one moncomposant moninstance |
0 | 46 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
47 |
Une série de questions vont être posées, la réponse par défaut est généralement |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
48 |
suffisante. Vous pourrez de toute façon modifier la configuration par la suite |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
49 |
en éditant les fichiers générés. Lorsqu'un login/mot de passe d'accès au sgbd |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
50 |
vous est demandé, il est recommandé d'utilisé l'utilisateur créé lors de la |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
51 |
`Configuration Postgres`_. |
0 | 52 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
53 |
Il est important de distinguer ici l'utilisateur utilisé pour accéder au sgbd, |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
54 |
et l'utilisateur utilisé pour s'authentifier dans l'application erudi. Lorsque |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
55 |
l'application erudi démarre, elle utilise le login/mot de passe sgdb pour |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
56 |
récupérer le schéma et gérer les transactions bas-niveau. En revanche, lorsque |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
57 |
`erudi-ctl create` vous demande un login/mot de passe `manager` pour erudi, il |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
58 |
s'agit d'un utilisateur qui sera créé dans l'application `erudi` pour pouvoir |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
59 |
s'y connecter dans un premier temps et l'administrer. Il sera par la suite possible |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
60 |
de créer des utilisateurs différents pour l'application. |
0 | 61 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
62 |
A l'issue de cette commande, la définition de votre instance se trouve dans |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
63 |
*~/etc/erudi.d/moninstance/*. Pour la lancer, il suffit de taper :: |
0 | 64 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
65 |
erudi-ctl start -D moninstance |
0 | 66 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
67 |
L'option `-D` indique le *debug mode* : l'instance ne passe pas en mode serveur |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
68 |
et ne se déconnecte pas du terminal, ce qui simplifie le dépannage en cas de non |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
69 |
démarrage de l'instance. Vous pouvez ensuite allez voir ce que ça donne en |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
70 |
pointant votre navigateur sur l'url `http://localhost:8080` (le n° de port |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
71 |
dépend de votre configuration). Pour vous authentifier vous pouvez utiliser le |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
72 |
login/mot de passe administrateur que vous avez spécifié lors de la création de |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
73 |
l'instance. |
0 | 74 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
75 |
Pour arrêter l'instance, un Ctrl-C dans la fenêtre où vous l'avez lancé |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
76 |
suffit. Si l'option `-D` a été omise, il faut taper :: |
0 | 77 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
78 |
erudi-ctl stop moninstance |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
79 |
|
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
80 |
Voilà, tout est en place pour démarrer le développement du modèle... |
0 | 81 |
|
82 |
||
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
83 |
Utilisation de erudi-liveserver |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
84 |
------------------------------- |
0 | 85 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
86 |
Afin de tester rapidement un nouveau composant, on peut également |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
87 |
utiliser le script `erudi-liveserver` qui permet de créer une |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
88 |
application en mémoire (utilisant une base de données SQLite par |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
89 |
défaut) et la rendre accessible via un serveur web:: |
0 | 90 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
91 |
erudi-liveserver moncomposant |
0 | 92 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
93 |
ou bien, pour utiliser une base de données existante (SQLite ou postgres):: |
0 | 94 |
|
22
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
95 |
erudi-liveserver -s monfichier_sources moncomposant |
50f20cf0f440
Merged chap_fondements_cubicweb and chap_bases_framework_cubicweb as they were both describing differents aspects of CubicWeb framework.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
96 |