equal
deleted
inserted
replaced
1 .. -*- coding: utf-8 -*- |
1 .. -*- coding: utf-8 -*- |
2 |
2 |
3 .. _components: |
3 .. _components: |
4 |
4 |
5 Components |
5 Components |
6 =========== |
6 ---------- |
7 |
|
8 XXXFIXME TURN THIS INTO A CHAPTER |
|
9 |
7 |
10 What is a component |
8 What is a component |
11 ------------------- |
9 ~~~~~~~~~~~~~~~~~~~ |
12 |
10 |
13 A component is a model grouping one or more entity types and/or views associated |
11 A component is a model grouping one or more entity types and/or views associated |
14 in order to provide a specific feature or even a complete application using |
12 in order to provide a specific feature or even a complete application using |
15 others components. |
13 others components. |
16 You can decide to write your own set of components if you wish to re-use the |
14 You can decide to write your own set of components if you wish to re-use the |
17 entity types you develop. By default, LAX comes with its owns set of components |
15 entity types you develop. By default, LAX comes with its owns set of components |
18 that you can start using right away. |
16 that you can start using right away. |
19 |
17 |
20 |
18 |
21 Standard library |
19 Standard library |
22 ---------------- |
20 ~~~~~~~~~~~~~~~~ |
23 |
21 |
24 A library of standard components is part of the `LAX` release (look at |
22 A library of standard components is part of the `LAX` release (look at |
25 ``lax/skel/ginco-apps``). Components provide entities and views. With |
23 ``lax/skel/ginco-apps``). Components provide entities and views. With |
26 ``lax-0.4``, you should get a set of application entities and system |
24 ``lax-0.4``, you should get a set of application entities and system |
27 entities you can re-use. |
25 entities you can re-use. |
58 * ecomment: Comment (to attach comment threads to entities) |
56 * ecomment: Comment (to attach comment threads to entities) |
59 |
57 |
60 |
58 |
61 |
59 |
62 Adding comments to BlogDemo |
60 Adding comments to BlogDemo |
63 --------------------------- |
61 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
64 |
62 |
65 To import a component in your application just change the line in the |
63 To import a component in your application just change the line in the |
66 ``app.conf`` file. For example:: |
64 ``app.conf`` file. For example:: |
67 |
65 |
68 included-yams-components=ecomment |
66 included-yams-components=ecomment |
79 to the definition of a ``BlogEntry`` will be enough. |
77 to the definition of a ``BlogEntry`` will be enough. |
80 |
78 |
81 Clear the datastore and restart. |
79 Clear the datastore and restart. |
82 |
80 |
83 Component structure |
81 Component structure |
84 ------------------- |
82 ~~~~~~~~~~~~~~~~~~~ |
85 |
83 |
86 A complex component is structured as follows: |
84 A complex component is structured as follows: |
87 :: |
85 :: |
88 |
86 |
89 mycomponent/ |
87 mycomponent/ |