# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1238849163 -7200 # Node ID 9f2760f15000e4dbf178bb2f93724f90e03dea6a # Parent 25cd18899830b64c1e3f4b0627a209580ee1a015# Parent e8b7c7407edfc0e16f6056879d8753f71cf2416d merge diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/A000-introduction.en.txt --- a/doc/book/en/A000-introduction.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/A000-introduction.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -1,5 +1,6 @@ .. -*- coding: utf-8 -*- +.. _Part1: =================================== Part I - Introduction to `CubicWeb` diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/A03a-concepts.en.txt --- a/doc/book/en/A03a-concepts.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/A03a-concepts.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -12,18 +12,18 @@ `CubicWeb` framework is a server/client application framework. Those two -parties communicates through RQL (`CubicWeb` query language implementation) +parts communicate through RQL (`CubicWeb` query language implementation) and ResultSet (which will be explained in :ref:`TermsVocabulary`). The server manages all interactions with sources. .. note:: - For real, the client and server sides are integrated in the same - process and interact directly, without the needs for distants - calls using Pyro. It is important to note down that those two + Usually, the client and server sides are integrated in the same + process and interact directly, without the need for distant + calls using Pyro. But, it is important to note that those two sides, client/server, are disjointed and it is possible to execute - a couple of calls in distincts processes to balance the load of + a couple of calls in distinct processes to balance the load of your web site on one or more machines. .. _TermsVocabulary: @@ -42,8 +42,8 @@ classes based on `yams`_ library. This is the core piece of an application. It is initially defined in the file system and is stored in the database at the time an instance is created. `CubicWeb` - provides a certain number of system entities included automatically as - it is necessary for the core of `CubicWeb` and a library of + provides a certain number of system entities included automatically + (necessary for the core of `CubicWeb`) and a library of cubes (which defined application entities) that can be explicitely included if necessary. @@ -57,7 +57,7 @@ a relation the `subject` and the second the `object`. *final entity type* - Final types corresponds to the basic types such as string of characters, + Final types correspond to the basic types such as string of characters, integers... Those types have a main property which is that they can only be used as `object` of a relation. The attributes of an entity (non final) are entities (finals). @@ -78,11 +78,11 @@ A data source is a container of data (SGBD, LDAP directory, `Google App Engine`'s datastore ...) integrated in the `CubicWeb` repository. This repository has at least one source, `system` which - contains the schema of the application, plain-text index and others + contains the schema of the application, plain-text index and other vital informations for the system. *configuration* - It is possible to create differents configurations for an instance: + It is possible to create different configurations for an instance: - ``repository`` : repository only, accessible for clients using Pyro - ``twisted`` : web interface only, access the repository using Pyro @@ -91,15 +91,15 @@ *cube* A cube is a model grouping one or multiple data types and/or views - to provide a specific functionnality or a complete `CubicWeb` application + to provide a specific functionality or a complete `CubicWeb` application potentially using other cubes. The available cubes are located in the file - system at `/path/to/forest/cubicweb/cubes` for a Mercurial forest installation, - for a debian packages installation they will be located in + system at `/path/to/forest/cubicweb/cubes` for a Mercurial forest installation. + For a debian packages installation they will be located in `/usr/share/cubicweb/cubes`. - Larger applications can be built faster by importing cubes, - adding entities and relationships and overriding the - views that need to display or edit informations not provided by - cubes. + Larger applications can be built quite fast by importing cubes, + adding entities and relationships, overriding the + *views* that display the cubes or by editing informations not provided by + the cubes. *instance* An instance is a specific installation of one or multiple cubes. All the required @@ -107,11 +107,11 @@ are grouped in an instance. This will refer to the cube(s) your application is based on. For example logilab.org and our intranet are two instances of a single - cube jpl, developped internally. + cube "jpl", developped internally. The instances are defined in the directory `/etc/cubicweb.d`. *application* - The term application is sometime used to talk about an instance + The term application is sometimes used to talk about an instance and sometimes to talk of a cube depending on the context. So we would like to avoid using this term and try to use *cube* and *instance* instead. @@ -143,9 +143,9 @@ the same identifier. *rql* - Relation Query Language in order to empasize the way of browsing relations. - This query language is inspired by SQL but is highest level, its implementation - generates SQL. + Relation Query Language in order to emphasize the way of browsing relations. + This query language is inspired by SQL but is on a higher level; + its implementation generates SQL. .. _`Python Remote Object`: http://pyro.sourceforge.net/ @@ -156,9 +156,9 @@ ~~~~~~~~~~~~~~~~~ The engine in `CubicWeb` is a set of classes managing a set of objects loaded -dynamically at the startup of `CubicWeb` (*appobjects*). Those dynamics objects, +dynamically at the startup of `CubicWeb` (*appobjects*). Those dynamic objects, based on the schema or the library, are building the final application. -The differents dymanic components are for example: +The different dynamic components are for example: * client and server side @@ -200,11 +200,11 @@ `execute(rqlstring, args=None, eid_key=None, build_descr=True)` :rqlstring: the RQL query to execute (unicode) -:args: if the query contains substitutions, a dictionnary containing the values to use +:args: if the query contains substitutions, a dictionary containing the values to use :eid_key: - an implementation detail of the RQL queries cache implies that if a substitution + an implementation detail of the RQL cache implies that if a substitution is used to introduce an eid *susceptible to raise the ambiguities in the query - type resolution*, then we have to specify the correponding key in the dictionnary + type resolution*, then we have to specify the corresponding key in the dictionary through this argument @@ -214,7 +214,7 @@ on the query execution success. .. note:: - While executing updates queries (SET, INSERT, DELETE), if a query generates + While executing update queries (SET, INSERT, DELETE), if a query generates an error related to security, a rollback is automatically done on the current transaction. @@ -223,7 +223,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A request instance is created when an HTTP request is sent to the web server. -It contains informations such as forms parameters, user authenticated, etc. +It contains informations such as form parameters, user authenticated, etc. **Globally, a request represents a user query, either through HTTP or not (we also talk about RQL queries on the server side for example).** @@ -232,13 +232,13 @@ * `user`, instance of `cubicweb.common.utils.User` corresponding to the authenticated user -* `form`, dictionnary containing the values of a web form -* `encoding`, characters encoding to use in the response +* `form`, dictionary containing the values of a web form +* `encoding`, character encoding to use in the response But also: :Session data handling: - * `session_data()`, returns a dictionnary containing all the session data + * `session_data()`, returns a dictionary containing all the session data * `get_session_data(key, default=None)`, returns a value associated to the given key or the value `default` if the key is not defined * `set_session_data(key, value)`, assign a value to a key @@ -246,7 +246,7 @@ :Cookies handling: - * `get_cookie()`, returns a dictionnary containing the value of the header + * `get_cookie()`, returns a dictionary containing the value of the header HTTP 'Cookie' * `set_cookie(cookie, key, maxage=300)`, adds a header HTTP `Set-Cookie`, with a minimal 5 minutes length of duration by default (`maxage` = None @@ -268,7 +268,7 @@ * `cursor()` returns a RQL cursor on the session * `execute(*args, **kwargs)`, shortcut to ``.cursor().execute()`` * `property_value(key)`, properties management (`EProperty`) - * dictionnary `data` to store data to share informations between components + * dictionary `data` to store data to share informations between components *while a request is executed* Please note that this class is abstract and that a concrete implementation @@ -372,7 +372,7 @@ A cube is a model grouping one or more entity types and/or views associated in order to provide a specific feature or even a complete application using -others cubes. +other cubes. You can decide to write your own set of cubes if you wish to re-use the entity types you develop. Lots of cubes are available from the `CubicWeb @@ -460,7 +460,7 @@ * ``sobjects`` contains hooks and/or views notifications (server side only) * ``views`` contains the web interface components (web interface only) * ``test`` contains tests related to the application (not installed) -* ``i18n`` contains messages catalogs for supported languages (server side and +* ``i18n`` contains message catalogs for supported languages (server side and web interface) * ``data`` contains data files for static content (images, css, javascripts) ...(web interface only) @@ -479,7 +479,7 @@ * the file ``__pkginfo__.py`` * the schema definition XXX false, we may want to have cubes which are only adding a service, - no persistent data (eg embeding for instance) + no persistent data (eg embedding for instance) Standard library diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/B000-development.en.txt --- a/doc/book/en/B000-development.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/B000-development.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -1,5 +1,6 @@ .. -*- coding: utf-8 -*- +.. _Part2: ===================== Part II - Development diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/B0012-schema-definition.en.txt --- a/doc/book/en/B0012-schema-definition.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/B0012-schema-definition.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -222,7 +222,7 @@ `````````````````````` Setting permissions is done with the attribute `permissions` of entities and -relation types. It defines a dictionnary where the keys are the access types +relation types. It defines a dictionary where the keys are the access types (action), and the values are the authorized groups or expressions. For an entity type, the possible actions are `read`, `add`, `update` and diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/B0020-define-workflows.en.txt --- a/doc/book/en/B0020-define-workflows.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/B0020-define-workflows.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -2,26 +2,19 @@ .. _Workflow: -Workflow definition -=================== - -[TODO : All this is too obscure and often not very understandable...] +An Example: Workflow definition +=============================== General ------- -[XXX define what a "Workflow" is: states, transitions, transition graph ] - -Example of a simple workflow ----------------------------- +A workflow describes how certain entities have to evolve between +different states. Hence we have a set of states, and a "transition graph", +i.e. a list of possible transitions from one state to another state. -Please see the tutorial to view an example of a simple workflow. - - -[Create a simple workflow for BlogDemo, to have a moderator approve new blog -entry to be published. This implies specifying a dedicated group of blog -moderator as well as hiding the view of a blog entry to the user until -it reaches the state published] +We will define a simple workflow for a blog, with only the following +two states: `submitted` and `published`. So first, we create a simple +`CubicWeb` in ten minutes (see :ref:`BlogTenMinutes`). Set-up a workflow ----------------- diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/B0030-data-as-objects.en.txt --- a/doc/book/en/B0030-data-as-objects.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/B0030-data-as-objects.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -120,14 +120,14 @@ *rtags* allow to specify certain behaviors of relations relative to a given entity type (see later). They are defined on the entity class by the attribute -`rtags` which is a dictionnary with as keys the triplets :: +`rtags` which is a dictionary with as keys the triplets :: , , and as values a `set` or a tuple of markers defining the properties that apply to this relation. -It is possible to simplify this dictionnary: +It is possible to simplify this dictionary: * if we want to specifiy a single marker, it is not necessary to use a tuple as value, the marker by itself (character string) @@ -139,9 +139,9 @@ we have to use the string `*` as target entity type -Please note that this dictionnary is *treated at the time the class is created*. +Please note that this dictionary is *treated at the time the class is created*. It is automatically merged with the parent class(es) (no need to copy the -dictionnary from the parent class to modify it). Also, modifying it after the +dictionary from the parent class to modify it). Also, modifying it after the class is created will not have any effect... .. include:: B0031-define-entities.en.txt diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/B1060-templates.en.txt --- a/doc/book/en/B1060-templates.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/B1060-templates.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -181,7 +181,7 @@ whatever the number of entities to display * `__method`, if the result set to render contains only one entity and this parameter is set, it refers to a method to call on the entity by passing it - the dictionnary of the forms parameters, before going the classic way (through + the dictionary of the forms parameters, before going the classic way (through step 1 and 2 described juste above) The MainTemplate is a bit complex as it tries to accomodate many diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/C000-administration.en.txt --- a/doc/book/en/C000-administration.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/C000-administration.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -1,5 +1,6 @@ .. -*- coding: utf-8 -*- +.. _Part3: ========================== Part III - Administration diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/C010-setup.en.txt --- a/doc/book/en/C010-setup.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/C010-setup.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -1,6 +1,6 @@ .. -*- coding: utf-8 -*- -.. _MiseEnPlaceEnv: +.. _SetUpEnv: =================================================== Installation and set-up of a `CubicWeb` environment diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/D000-annex.en.txt --- a/doc/book/en/D000-annex.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/D000-annex.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -1,5 +1,6 @@ .. -*- coding: utf-8 -*- +.. _Part4: ==================== Part IV - Appendixes diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/Z013-blog-less-ten-minutes.en.txt --- a/doc/book/en/Z013-blog-less-ten-minutes.en.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/Z013-blog-less-ten-minutes.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -1,5 +1,7 @@ .. -*- coding: utf-8 -*- +.. BlogTenMinutes: + Have a blog ready in less than ten minutes! ------------------------------------------- diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/index.txt --- a/doc/book/en/index.txt Sat Apr 04 14:45:12 2009 +0200 +++ b/doc/book/en/index.txt Sat Apr 04 14:46:03 2009 +0200 @@ -31,22 +31,28 @@ The impatient will go strait away to :ref:`QuickInstall`. -The impatient developper will move right away to :ref:`MiseEnPlaceEnv`. +The impatient developper will move right away to :ref:`SetUpEnv`. .. _Logilab: http://www.logilab.fr/ .. _forge: http://www.cubicweb.org/project/ .. _Python: http://www.python.org/ -Table of contents -================= - +The book +======== .. toctree:: + :maxdepth: 2 A000-introduction.en.txt B000-development.en.txt C000-administration.en.txt - D000-annex.en.txt + D000-annex.en.txt + + +Table of Contents +----------------- + +Complete :ref:`TOC`. Indices and tables ================== diff -r 25cd18899830 -r 9f2760f15000 doc/book/en/toc.en.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/book/en/toc.en.txt Sat Apr 04 14:46:03 2009 +0200 @@ -0,0 +1,15 @@ +.. -*- coding: utf-8 -*- + +.. _TOC: + +Table of contents +================= + + +.. toctree:: + + A000-introduction.en.txt + B000-development.en.txt + C000-administration.en.txt + D000-annex.en.txt + diff -r 25cd18899830 -r 9f2760f15000 web/widgets.py --- a/web/widgets.py Sat Apr 04 14:45:12 2009 +0200 +++ b/web/widgets.py Sat Apr 04 14:46:03 2009 +0200 @@ -589,7 +589,7 @@ self.vocabfunc = vocabfunc def vocabulary(self, entity): - choices = self.vocabfunc(entity) + choices = self.vocabfunc(entity=entity) if self.sort: choices = sorted(choices) if self.rschema.rproperty(self.subjtype, self.objtype, 'internationalizable'):