# HG changeset patch # User Sylvain Thénault # Date 1246052303 -7200 # Node ID 9d7bfbf70ed660c6a1a582f91c09c9566140e425 # Parent a73bf75a1ef98c2c9e7f4f29a25e89484508095c# Parent 3454adb6164a8f7dedad51f4e25a389e50efc5ec merge diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 common/mail.py --- a/common/mail.py Fri Jun 26 23:38:00 2009 +0200 +++ b/common/mail.py Fri Jun 26 23:38:23 2009 +0200 @@ -19,7 +19,7 @@ def addrheader(uaddr, uname=None): # even if an email address should be ascii, encode it using utf8 since # application tests may generate non ascii email address - addr = uaddr.encode('UTF-8') + addr = uaddr.encode('UTF-8') if uname: return '%s <%s>' % (header(uname).encode(), addr) return addr diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 devtools/repotest.py --- a/devtools/repotest.py Fri Jun 26 23:38:00 2009 +0200 +++ b/devtools/repotest.py Fri Jun 26 23:38:23 2009 +0200 @@ -117,7 +117,7 @@ def tearDown(self): ExecutionPlan._check_permissions = _orig_check_permissions rqlannotation._select_principal = _orig_select_principal - + def set_debug(self, debug): set_debug(debug) diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/B000-development.en.txt --- a/doc/book/en/B000-development.en.txt Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/B000-development.en.txt Fri Jun 26 23:38:23 2009 +0200 @@ -6,7 +6,7 @@ Part II - Development ===================== -This part is about developing web applications with the `CubicWeb` framework. +This part is about developing web applications with the *CubicWeb* framework. .. toctree:: :maxdepth: 1 diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/B0015-define-permissions.en.txt --- a/doc/book/en/B0015-define-permissions.en.txt Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/B0015-define-permissions.en.txt Fri Jun 26 23:38:23 2009 +0200 @@ -11,7 +11,7 @@ * permissions (read, update, create, delete) * permissions are assigned to groups (and not to users) -For `CubicWeb` in particular: +For *CubicWeb* in particular: * we associate rights at the enttities/relations schema level * for each entity, we distinguish four kind of permissions: read, diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/MERGE_ME-tut-create-gae-app.en.txt --- a/doc/book/en/MERGE_ME-tut-create-gae-app.en.txt Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/MERGE_ME-tut-create-gae-app.en.txt Fri Jun 26 23:38:23 2009 +0200 @@ -7,7 +7,7 @@ Ce tutoriel va vous guider pas à pas a construire une apllication web de gestion de Blog afin de vous faire découvrir les fonctionnalités de -`CubicWeb`. +*CubicWeb*. Nous supposons que vous avec déjà suivi le guide :ref:`installationGAE`. @@ -23,7 +23,7 @@ cubicweb-ctl newgapp blogdemo -`newgapp` est la commande permettant de créer une instance `CubicWeb` pour +`newgapp` est la commande permettant de créer une instance *CubicWeb* pour le datastore. Assurez-vous que votre variable d'environnement ``PYTHONPATH`` est correctement @@ -32,7 +32,7 @@ Définissez un schéma -------------------- -Le modèle de données ou schéma est au coeur d'une application `CubicWeb`. +Le modèle de données ou schéma est au coeur d'une application *CubicWeb*. C'est là où vous allez devoir définir le type de contenu que votre application devra gérer. @@ -180,7 +180,7 @@ :alt: displaying the detailed view of a blogentry Rappelez-vous que pour le moment, tout a été géré par la plate-forme -`CubicWeb` et que la seule chose qui a été fournie est le schéma de +*CubicWeb* et que la seule chose qui a été fournie est le schéma de données. D'ailleurs pour obtenir une vue graphique du schéma, exécutez la commande ``laxctl genschema blogdemo`` et vous pourrez visualiser votre schéma a l'URL suivante : http://localhost:8080/schema diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/Z010-beginners.en.txt --- a/doc/book/en/Z010-beginners.en.txt Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/Z010-beginners.en.txt Fri Jun 26 23:38:23 2009 +0200 @@ -2,7 +2,7 @@ .. _QuickInstall: -Quick Installation of a `CubicWeb` instance +Quick Installation of a *CubicWeb* instance =========================================== .. include:: C010-setup.en.txt diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/Z012-create-instance.en.txt --- a/doc/book/en/Z012-create-instance.en.txt Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/Z012-create-instance.en.txt Fri Jun 26 23:38:23 2009 +0200 @@ -7,7 +7,7 @@ What is an instance? -------------------- -A `CubicWeb` instance is a container that +A *CubicWeb* instance is a container that refers to cubes and configuration parameters for your web application. Each instance is stored as a directory in ``~/etc/cubicweb.d`` which enables us to run your application. @@ -26,12 +26,12 @@ a debian package installation. For example, the 'blog' cube defines the entities blogs and blogentries. -When an `CubicWeb` instance is created, you list the cubes that you want to use. +When an *CubicWeb* instance is created, you list the cubes that you want to use. Using a cube means having the entities defined in your cube's schema available in your instance as well as their views and workflows. -Creating a basic `CubicWeb` Instance +Creating a basic *CubicWeb* Instance ------------------------------------ We can create an instance to view our @@ -55,10 +55,10 @@ (:ref:`ConfigurationPostgres`). It is important to distinguish here the user used to access the database and -the user used to login to the cubicweb application. When a `CubicWeb` application +the user used to login to the cubicweb application. When a *CubicWeb* application starts, it uses the login/psswd for the database to get the schema and handle low level transaction. But, when ``cubicweb-ctl create`` asks for -a manager login/psswd of `CubicWeb`, it refers to an application user +a manager login/psswd of *CubicWeb*, it refers to an application user to administrate your web application. The configuration files are stored in *~/etc/cubicweb.d/myblog/*. diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/admin/create-instance.rst --- a/doc/book/en/admin/create-instance.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/admin/create-instance.rst Fri Jun 26 23:38:23 2009 +0200 @@ -7,7 +7,7 @@ ----------------- Now that we created our cube, we can create an instance to view our -application in a web browser. To do so we will use a `all-in-one` +application in a web browser. To do so we will use a `all-in-one` configuration to simplify things :: cubicweb-ctl create -c all-in-one mycube myinstance @@ -27,7 +27,7 @@ user used to login to the cubicweb application. When an instance starts, it uses the login/psswd for the database to get the schema and handle low level transaction. But, when :command:`cubicweb-ctl create` asks for a manager -login/psswd of `CubicWeb`, it refers to the user you will use during the +login/psswd of *CubicWeb*, it refers to the user you will use during the development to administrate your web application. It will be possible, later on, to use this user to create others users for your final web application. @@ -45,8 +45,8 @@ The option `-D` specify the *debug mode* : the instance is not running in server mode and does not disconnect from the termnial, which simplifies debugging in case the instance is not properly launched. You can see how it looks by -visiting the URL `http://localhost:8080` (the port number depends of your -configuration). To login, please use the cubicweb administrator login/psswd you +visiting the URL `http://localhost:8080` (the port number depends of your +configuration). To login, please use the cubicweb administrator login/psswd you defined when you created the instance. To shutdown the instance, Crtl-C in the terminal window is enough. @@ -59,5 +59,6 @@ upgrade ~~~~~~~ -XXX feed me +XXX write me + diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/admin/gae.rst --- a/doc/book/en/admin/gae.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/admin/gae.rst Fri Jun 26 23:38:23 2009 +0200 @@ -9,9 +9,9 @@ `Google AppEngine`_ is provided with a partial port of the `Django` framework, but Google stated at Google IO 2008 that it would not support a specific Python web framework and that all -community-supported frameworks would be more than welcome [1]_. +community-supported frameworks would be more than welcome [1]_. -Therefore `Logilab`_ ported `CubicWeb` to run on top of `Google AppEngine`'s +Therefore `Logilab`_ ported *CubicWeb* to run on top of `Google AppEngine`'s datastore. .. _`Google AppEngine`: http://code.google.com/appengine/docs/whatisgoogleappengine.html @@ -25,8 +25,8 @@ http://code.google.com/appengine/downloads.html -Please follow instructions on how to install `CubicWeb` framework -(:ref:`CubicWebInstallation`). +Please follow instructions on how to install *CubicWeb* framework +(:ref:`CubicWebInstallation`). Installation ------------ @@ -37,7 +37,7 @@ cubicweb-ctl newgapp This will create a directory containing :: - + `-- myapp/ |-- app.conf |-- app.yaml @@ -73,17 +73,17 @@ |-- yams/ `-- yapps/ - + This skeleton directory is a working `AppEngine` application. You will recognize the files ``app.yaml`` and ``main.py``. All the rest is the -`CubicWeb` framework and its third-party libraries. You will notice that +*CubicWeb* framework and its third-party libraries. You will notice that the directory ``cubes`` is a library of reusable cubes. The main directories that you should know about are: - - ``cubes`` : this is a library of reusable yams cubes. To use - those cubes you will list them in the variable - `included-yams-cubes` of ``app.conf``. See also :ref:`cubes`. + - ``cubes`` : this is a library of reusable yams cubes. To use + those cubes you will list them in the variable + `included-yams-cubes` of ``app.conf``. See also :ref:`cubes`. - [WHICH OTHER ONES SHOULD BE LISTED HERE?] Dependencies @@ -91,7 +91,7 @@ Before starting anything, please make sure the following packages are installed: - yaml : by default google appengine is providing yaml; make sure you can - import it. We recommend you create a symbolic link yaml instead of installing + import it. We recommend you create a symbolic link yaml instead of installing and using python-yaml: yaml -> full/path/to/google_appengine/lib/yaml/lib/yaml/ - gettext @@ -99,13 +99,13 @@ Setup ~~~~~ -Once you executed ``cubicweb-ctl newgapp ``, you can use that ``myapp/`` +Once you executed ``cubicweb-ctl newgapp ``, you can use that ``myapp/`` as an application directory and do as follows. -This installation directory provides a configuration for an instance of `CubicWeb` -ported for Google App Engine. It is installed with its own command ``laxctl`` -which is a port of the command tool ``cubicweb-ctl`` originally developped for -`CubicWeb`. +This installation directory provides a configuration for an instance of *CubicWeb* +ported for Google App Engine. It is installed with its own command ``laxctl`` +which is a port of the command tool ``cubicweb-ctl`` originally developped for +*CubicWeb*. You can have the details of available commands by running :: @@ -115,11 +115,11 @@ Generating translation files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -`CubicWeb` is fully internationalized. Translation catalogs are found in +*CubicWeb* is fully internationalized. Translation catalogs are found in ``myapp/i18n``. To compile the translation files, use the `gettext` tools or the ``laxctl`` command :: - $ python myapp/bin/laxctl i18ncube + $ python myapp/bin/laxctl i18ncube $ python myapp/bin/laxctl i18ninstance Ignore the errors that print "No translation file found for domain @@ -132,7 +132,7 @@ You will never need to add new entries in the translation catalog. Instead we would recommand you to use ``self.req._("msgId")`` in your application code to flag new message id to add to the catalog, where ``_`` refers to -xgettext that is used to collect new strings to translate. +xgettext that is used to collect new strings to translate. While running ``laxctl i18ncube``, new string will be added to the catalogs. Generating the data directory @@ -165,7 +165,7 @@   # does this application rely on google authentication service or not. use-google-auth=no - + In ``app.yaml`` comment the `login: required` set by default in the handler:: - url: .* @@ -187,8 +187,8 @@ $ python /path/to/google_appengine/dev_appserver.py /path/to/myapp/ -Once the local server is started, visit `http://MYAPP_URL/_load `_ and sign in as administrator. -This will initialize the repository and enable you to log in into +Once the local server is started, visit `http://MYAPP_URL/_load `_ and sign in as administrator. +This will initialize the repository and enable you to log in into the application and continue the installation. You should be redirected to a page displaying a message `content initialized`. @@ -197,7 +197,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~ You, then, want to visit `http://MYAPP_URL/?vid=authinfo `_ . -If you selected not to use google authentication, you will be prompted to a +If you selected not to use google authentication, you will be prompted to a login form where you should initialize the administrator login (recommended to use admin/admin at first). You will then be redirected to a page providing you the value to provide to ``./bin/laxctl --cookie``. @@ -212,21 +212,21 @@ :alt: displaying the detailed view of the cookie values returned -.. note:: In case you are not redirected to a page providing the - option --cookie value, please visit one more time +.. note:: In case you are not redirected to a page providing the + option --cookie value, please visit one more time `http://MYAPP_URL/?vid=authinfo `_ . Once, you have this value, then return to the shell and execute :: - + $ python myapp/bin/laxctl db-init --cookie='dev_appserver_login=test@example.com:True; __session=7bbe973a6705bc5773a640f8cf4326cc' localhost:8080 .. note:: In the case you are not using google authentication, the value returned - by `http://MYAPP_URL/?vid=authinfo `_ + by `http://MYAPP_URL/?vid=authinfo `_ will look like : --cookie='__session=2b45d1a9c36c03d2a30cedb04bc37b6d' Log out by clicking in the menu at the top right corner -and restart browsing from `http://MYAPP_URL/ `_ +and restart browsing from `http://MYAPP_URL/ `_ as a normal user. Unless you did something to change it, http://MYAPP_URL should be diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/admin/index.rst --- a/doc/book/en/admin/index.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/admin/index.rst Fri Jun 26 23:38:23 2009 +0200 @@ -6,7 +6,7 @@ Part III - Administration ------------------------- -This part is for installation and administration of the `CubicWeb` framework and +This part is for installation and administration of the *CubicWeb* framework and applications based on that framework. .. toctree:: @@ -25,7 +25,7 @@ RQL logs -------- -You can configure the `CubicWeb` application to keep a log +You can configure the *CubicWeb* application to keep a log of the queries executed against your database. To do so, edit the configuration file of your application ``.../etc/cubicweb.d/myapp/all-in-one.conf`` and uncomment the diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/admin/instance-config.rst --- a/doc/book/en/admin/instance-config.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/admin/instance-config.rst Fri Jun 26 23:38:23 2009 +0200 @@ -51,7 +51,7 @@ RewriteCond %(REQUEST_URI) ^/demo RewriteRule ^/demo$ /demo/ RewriteRule ^/demo/(.*) http://127.0.0.1:8080/$1 [L,P] - + and for the https::: RewriteCond %(REQUEST_URI) ^/ demo diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/admin/setup.rst --- a/doc/book/en/admin/setup.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/admin/setup.rst Fri Jun 26 23:38:23 2009 +0200 @@ -3,13 +3,13 @@ .. _SetUpEnv: =================================================== -Installation and set-up of a `CubicWeb` environment +Installation and set-up of a *CubicWeb* environment =================================================== Installation of `Cubicweb` and its dependencies ----------------------------------------------- -`CubicWeb` is packaged for Debian and Ubuntu, but can be installed from source +*CubicWeb* is packaged for Debian and Ubuntu, but can be installed from source using a tarball or the Mercurial version control system. .. _DebianInstallation: @@ -35,7 +35,7 @@ You can now install the required packages with the following command:: - apt-get update + apt-get update apt-get install cubicweb cubicweb-dev `cubicweb` installs the framework itself, allowing you to create @@ -88,13 +88,13 @@ Environment configuration ------------------------- -If you installed `CubicWeb` by cloning the Mercurial forest, then you -will need to update the environment variable PYTHONPATH by adding +If you installed *CubicWeb* by cloning the Mercurial forest, then you +will need to update the environment variable PYTHONPATH by adding the path to the forest ``cubicweb``: Add the following lines to either `.bashrc` or `.bash_profile` to configure your development environment :: - + export PYTHONPATH=/full/path/to/cubicweb-forest If you installed the debian packages, no configuration is required. @@ -134,34 +134,34 @@ $ initdb -D /path/to/pgsql - Once initialized, start the database server Postgres + Once initialized, start the database server Postgres with the command:: - + $ postgres -D /path/to/psql If you cannot execute this command due to permission issues, please make sure that your username has write access on the database. :: - + $ chown username /path/to/pgsql * The database authentication can be either set to `ident sameuser` - or `md5`. + or `md5`. If set to `md5`, make sure to use an existing user of your database. If set to `ident sameuser`, make sure that your client's operating system user name has a matching user in the database. If not, please do as follow to create a user:: - + $ su $ su - postgres $ createuser -s -P username The option `-P` (for password prompt), will encrypt the password with - the method set in the configuration file ``pg_hba.conf``. + the method set in the configuration file ``pg_hba.conf``. If you do not use this option `-P`, then the default value will be null and you will need to set it with:: - + $ su postgres -c "echo ALTER USER username WITH PASSWORD 'userpasswd' | psql" This login/password will be requested when you will create an diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/admin/site-config.rst --- a/doc/book/en/admin/site-config.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/admin/site-config.rst Fri Jun 26 23:38:23 2009 +0200 @@ -14,12 +14,12 @@ This menu provides you a way to adjust some navigation options depending on your needs, such as the number of entities to display by page of results. Follows the detailled list of available options : - + * navigation.combobox-limit : maximum number of entities to display in related combo box (sample format: 23) -* navigation.page-size : maximum number of objects displayed by page of results +* navigation.page-size : maximum number of objects displayed by page of results (sample format: 23) -* navigation.related-limit : maximum number of related entities to display in +* navigation.related-limit : maximum number of related entities to display in the primary view (sample format: 23) * navigation.short-line-size : maximum number of characters in short description (sample format: 23) @@ -47,17 +47,17 @@ Actions ~~~~~~~ This menu provides a way to configure the context in which you expect the actions -to be displayed to the user and if you want the action to be visible or not. -You must have notice that when you view a list of entities, an action box is -available on the left column which display some actions as well as a drop-down -menu for more actions. +to be displayed to the user and if you want the action to be visible or not. +You must have notice that when you view a list of entities, an action box is +available on the left column which display some actions as well as a drop-down +menu for more actions. The context available are : * mainactions : actions listed in the left box * moreactions : actions listed in the `more` menu of the left box * addrelated : add actions listed in the left box -* useractions : actions listed in the first section of drop-down menu +* useractions : actions listed in the first section of drop-down menu accessible from the right corner user login link * siteactions : actions listed in the second section of drop-down menu accessible from the right corner user login link @@ -65,15 +65,15 @@ Boxes ~~~~~ -The application has already a pre-defined set of boxes you can use right away. +The application has already a pre-defined set of boxes you can use right away. This configuration section allows you to place those boxes where you want in the -application interface to customize it. +application interface to customize it. The available boxes are : * actions box : box listing the applicable actions on the displayed data -* boxes_blog_archives_box : box listing the blog archives +* boxes_blog_archives_box : box listing the blog archives * possible views box : box listing the possible views for the displayed data @@ -81,7 +81,7 @@ * search box : search box -* startup views box : box listing the configuration options available for +* startup views box : box listing the configuration options available for the application site, such as `Preferences` and `Site Configuration` Components diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/annexes/cookbook.rst --- a/doc/book/en/annexes/cookbook.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/annexes/cookbook.rst Fri Jun 26 23:38:23 2009 +0200 @@ -7,10 +7,10 @@ life easier. -* How to import LDAP users in `CubicWeb`? +* How to import LDAP users in *CubicWeb*? Here is a very useful script which enables you to import LDAP users - into your `CubicWeb` application by running the following: :: + into your *CubicWeb* application by running the following: :: import os @@ -70,11 +70,11 @@ you would not be able to use dbapi. :: from cubicweb import dbapi - + cnx = dbapi.connection(database='instance-id', user='admin', password='admin') cur = cnx.cursor() for name in ('Personal', 'Professional', 'Computers'): cur.execute('INSERT Blog B: B name %s', name) cnx.commit() - + diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/annexes/cubicweb-ctl.rst --- a/doc/book/en/annexes/cubicweb-ctl.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/annexes/cubicweb-ctl.rst Fri Jun 26 23:38:23 2009 +0200 @@ -5,7 +5,7 @@ ``cubicweb-ctl`` tool ===================== -`cubicweb-ctl` is the swiss knife to manage `CubicWeb` instances. +`cubicweb-ctl` is the swiss knife to manage *CubicWeb* instances. The general syntax is :: cubicweb-ctl [options command] @@ -15,7 +15,7 @@ cubicweb-ctl cubicweb-ctl --help -Please note that the commands available depends on the `CubicWeb` packages +Please note that the commands available depends on the *CubicWeb* packages and cubes that have been installed. To view the help menu on specific command :: @@ -28,7 +28,7 @@ * ``newcube``, create a new cube on the file system based on the name given in the parameters. This command create a cube from an application skeleton that includes default files required for debian packaging. - + Command to create an instance ----------------------------- @@ -62,7 +62,7 @@ Commands to maintain instances ------------------------------ * ``upgrade``, launches the existing instances migration when a new version - of `CubicWeb` or the cubes installed is available + of *CubicWeb* or the cubes installed is available * ``shell``, opens a migration shell for manual maintenance of the instance * ``db-dump``, creates a dump of the system database * ``db-restore``, restores a dump of the system database @@ -73,9 +73,9 @@ Commands to maintain i18n catalogs ---------------------------------- -* ``i18ncubicweb``, regenerates messages catalogs of the `CubicWeb` library +* ``i18ncubicweb``, regenerates messages catalogs of the *CubicWeb* library * ``i18ncube``, regenerates the messages catalogs of a cube -* ``i18ninstance``, recompiles the messages catalogs of an instance. +* ``i18ninstance``, recompiles the messages catalogs of an instance. This is automatically done while upgrading. See also chapter :ref:`internationalisation`. @@ -116,7 +116,7 @@ This will create a new cube in ``/path/to/forest/cubicweb/cubes/`` for a Mercurial forest installation, or in ``/usr/share/cubicweb/cubes`` -for a debian packages installation, and then create an instance as +for a debian packages installation, and then create an instance as explained just above. diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/annexes/faq.rst --- a/doc/book/en/annexes/faq.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/annexes/faq.rst Fri Jun 26 23:38:23 2009 +0200 @@ -18,12 +18,12 @@ preferred template language if you want. [explain how to use a template language] - `CubicWeb` does not define its own templating language as this was + *CubicWeb* does not define its own templating language as this was not our goal. Based on our experience, we realized that we could gain productivity by letting designers use design tools and developpers develop without the use of the templating language as an intermediary that could not be anyway efficient for both parties. - Python is the templating language that we use in `CubicWeb`, but again, + Python is the templating language that we use in *CubicWeb*, but again, it does not prevent you from using a templating language. The reason template languages are not used in this book is that @@ -46,14 +46,14 @@ robust application. Why do you use the LGPL license to prevent me from doing X ? ------------------------------------------------------------ +------------------------------------------------------------ LGPL means that *if* you redistribute your application, you need to redistribute the changes you made to CubicWeb under the LGPL licence. Publishing a web site has nothing to do with redistributing source code. A fair amount of companies use modified LGPL code - for internal use. And someone could publish a `CubicWeb` component + for internal use. And someone could publish a *CubicWeb* component under a BSD licence for others to plug into a LGPL framework without any problem. The only thing we are trying to prevent here is someone taking the framework and packaging it as closed source to his own @@ -92,26 +92,28 @@ [copy answer from forum, explain why similar to sparql and why better than django and SQL] -which ajax library ------------------- -[we use jquery and things on top of that] +which ajax library is CubicWeb using ? +-------------------------------------- + +[CubicWeb uses jQuery and adds a thin layer on top of that] -How to implement security? --------------------------- +How is security implemented ? +------------------------------ This is an example of how it works in our framework:: class Version(EntityType): - """a version is defining the content of a particular project's - release""" - # definition of attributes is voluntarily missing - permissions = {'read': ('managers', 'users', 'guests',), - 'update': ('managers', 'logilab', 'owners',), - 'delete': ('managers', ), - 'add': ('managers', 'logilab', - ERQLExpression('X version_of PROJ, U in_group G, PROJ - require_permission P, P name "add_version", P require_group G'),)} + """a version is defining the content of a particular project's + release""" + # definition of attributes is voluntarily missing + permissions = {'read': ('managers', 'users', 'guests',), + 'update': ('managers', 'logilab', 'owners',), + 'delete': ('managers', ), + 'add': ('managers', 'logilab', + ERQLExpression('X version_of PROJ, U in_group G, ' + 'PROJ require_permission P, ' + 'P name "add_version", P require_group G'),)} The above means that permission to read a Version is granted to any user that is part of one of the groups 'managers', 'users', 'guests'. @@ -124,7 +126,7 @@ """link a version to its project. A version is necessarily linked to one and only one project. """ # some lines voluntarily missing - permissions = {'read': ('managers', 'users', 'guests',), + permissions = {'read': ('managers', 'users', 'guests',), 'delete': ('managers', ), 'add': ('managers', 'logilab', RRQLExpression('O require_permission P, P name "add_version", @@ -135,8 +137,9 @@ [XXX what does the second example means in addition to the first one?] -`Error while publishing rest text ...` --------------------------------------- +What is `Error while publishing rest text ...` ? +------------------------------------------------ + While modifying the description of an entity, you get an error message in the application `Error while publishing ...` for Rest text and plain text. The server returns a traceback like as follows :: @@ -152,8 +155,8 @@ This can be fixed by applying the patch described in : http://code.google.com/p/googleappengine/issues/detail?id=48 -What are hooks used for? ------------------------- +What are hooks used for ? +------------------------- Hooks are executed around (actually before or after) events. The most common events are data creation, update and deletion. They @@ -166,8 +169,8 @@ Other kinds of hooks, called Operations, are available for execution just before commit. -When should you define an HTML template rather than define a graphical component? ---------------------------------------------------------------------------------- +When should you define an HTML template rather than define a graphical component ? +---------------------------------------------------------------------------------- An HTML template cannot contain code, hence it is only about static content. A component is made of code and operations that apply on a @@ -180,15 +183,15 @@ `AppRsetObject` instances are selected on a request and a result set. `AppObject` instances are directly selected by id. -How to update a database after a schema modification? ------------------------------------------------------ +How to update a database after a schema modification ? +------------------------------------------------------ It depends on what has been modified in the schema. - * Update of an attribute permissions and properties: + * Update of an attribute permissions and properties: ``synchronize_eschema('MyEntity')``. - * Update of a relation permissions and properties: + * Update of a relation permissions and properties: ``synchronize_rschema('MyRelation')``. * Add an attribute: ``add_attribute('MyEntityType', 'myattr')``. @@ -196,8 +199,8 @@ * Add a relation: ``add_relation_definition('SubjRelation', 'MyRelation', 'ObjRelation')``. -How to create an anonymous user? --------------------------------- +How to create an anonymous user ? +--------------------------------- This allows to bypass authentication for your site. In the ``all-in-one.conf`` file of your instance, define the anonymous user @@ -222,8 +225,8 @@ decribed above. -How to change the application logo? ------------------------------------ +How to change the application logo ? +------------------------------------ There are two ways of changing the logo. @@ -239,11 +242,11 @@ LOGO = DATADIR/path/to/mylogo.gif - where DATADIR is ``mycubes/data``. + where DATADIR is ``mycube/data``. -How to configure LDAP source? -------------------------------- +How to configure a LDAP source ? +-------------------------------- Your instance's sources are defined in ``/etc/cubicweb.d/myapp/sources``. Configuring an LDAP source is about declaring that source in your @@ -269,7 +272,7 @@ Any change applied to configuration file requires to restart your application. -I get NoSelectableObject exceptions: how do I debug selectors ? +I get NoSelectableObject exceptions, how do I debug selectors ? --------------------------------------------------------------- You just need to put the appropriate context manager around view/component @@ -296,28 +299,28 @@ 2009-01-09 16:43:52 - (cubicweb.selectors) WARNING: selector one_line_rset returned 0 for -How to format an entity date attribute? ---------------------------------------- +How to format an entity date attribute ? +---------------------------------------- If your schema has an attribute of type Date or Datetime, you might want to format it. First, you should define your preferred format using the site configuration panel ``http://appurl/view?vid=systempropertiesform`` and then set ``ui.date`` and/or ``ui.datetime``. Then in the view code, use:: - + self.format_date(entity.date_attribute) Can PostgreSQL and CubicWeb authentication work with kerberos ? ---------------------------------------------------------------- - If you have postgresql set up to accept kerberos authentication, you can set + If you have PostgreSQL set up to accept kerberos authentication, you can set the db-host, db-name and db-user parameters in the `sources` configuration - file while leaving the password blank. It should be enough for your instance - to connect to postgresql with a kerberos ticket. + file while leaving the password blank. It should be enough for your + application to connect to postgresql with a kerberos ticket. - -How to load data from a script? -------------------------------- + +How to load data from a script ? +-------------------------------- The following script aims at loading data within a script assuming pyro-nsd is running and your application is configured with ``pyro-server=yes``, otherwise @@ -331,8 +334,8 @@ cur.execute('INSERT Blog B: B name %s', name) cnx.commit() -What is the CubicWeb datatype corresponding to GAE datastore's UserProperty? ----------------------------------------------------------------------------- +What is the CubicWeb datatype corresponding to GAE datastore's UserProperty ? +----------------------------------------------------------------------------- If you take a look at your application schema and click on "display detailed view of metadata" you will see that there @@ -348,8 +351,8 @@ mapping Google Accounts to local Euser entities automatically] -How to reset the password for user joe? ---------------------------------------- +How to reset the password for user joe ? +---------------------------------------- You need to generate a new encrypted password:: @@ -357,7 +360,7 @@ >>> from cubicweb.server.utils import crypt_password >>> crypt_password('joepass') 'qHO8282QN5Utg' - >>> + >>> and paste it in the database:: diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/annexes/index.rst --- a/doc/book/en/annexes/index.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/annexes/index.rst Fri Jun 26 23:38:23 2009 +0200 @@ -7,7 +7,7 @@ -------------------- The following chapters are reference material. - + .. toctree:: :maxdepth: 1 diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/annexes/mercurial.rst --- a/doc/book/en/annexes/mercurial.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/annexes/mercurial.rst Fri Jun 26 23:38:23 2009 +0200 @@ -12,7 +12,7 @@ next, and so on). Locally, we have a repository containing revisions tree, and a working directory. It is possible to put in its working directory, one of the versions of its local repository, -modify and then push it in its repository. +modify and then push it in its repository. It is also possible to get revisions from another repository or to export its own revisions from the local repository to another repository. @@ -83,7 +83,7 @@ hg incoming ssh://myhost//home/src/repo -* See what is the revision of the local repository which has been taken out +* See what is the revision of the local repository which has been taken out from the working directory and amended:: hg parent @@ -114,8 +114,8 @@ Installation of the forest extension ```````````````````````````````````` -Set up the forest extension by getting a copy of the sources -from http://hg.akoha.org/hgforest/ and adding the following +Set up the forest extension by getting a copy of the sources +from http://hg.akoha.org/hgforest/ and adding the following lines to your ``~/.hgrc``: :: [extensions] diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/annexes/rql/implementation.rst --- a/doc/book/en/annexes/rql/implementation.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/annexes/rql/implementation.rst Fri Jun 26 23:38:23 2009 +0200 @@ -53,7 +53,7 @@ relation ::= 'NOT'? VARIABLE R_TYPE COMP_OP? expression | 'NOT'? R_TYPE VARIABLE 'IN' '(' expression (',' expression)* ')' - + expression ::= var_or_func_or_const (MATH_OP var_or_func_or_const) * | '(' expression ')' @@ -83,7 +83,7 @@ Internal representation (syntactic tree) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The tree research does not contain the selected variables +The tree research does not contain the selected variables (e.g. there is only what follows "WHERE"). The insertion tree does not contain the variables inserted or relations @@ -156,7 +156,7 @@ Document class Type <-> Document occurence_of Fiche class Type Sheet class Type <-> Form collection Collection class Type - + Therefore 1. becomes:: Document X where diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/annexes/rql/intro.rst --- a/doc/book/en/annexes/rql/intro.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/annexes/rql/intro.rst Fri Jun 26 23:38:23 2009 +0200 @@ -11,8 +11,8 @@ user should see virtually no difference between an attribute and a relation). -RQL is inspired by SQL but is the highest level. A knowledge of the -`CubicWeb` schema defining the application is necessary. +RQL is inspired by SQL but is the highest level. A knowledge of the +*CubicWeb* schema defining the application is necessary. Comparison with existing languages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -21,8 +21,8 @@ ``` RQL builds on the features of SQL but is at a higher level (the current implementation of RQL generates SQL). For that it is limited -to the way of browsing relations and introduces variables. -The user does not need to know the model underlying SQL, but the `CubicWeb` +to the way of browsing relations and introduces variables. +The user does not need to know the model underlying SQL, but the *CubicWeb* schema defining the application. Versa @@ -30,16 +30,16 @@ We should look in more detail, but here are already some ideas for the moment ... Versa_ is the language most similar to what we wanted to do, but the model underlying data being RDF, there is some -number of things such as namespaces or handling of the RDF types which +number of things such as namespaces or handling of the RDF types which does not interest us. On the functionality level, Versa_ is very comprehensive including through many functions of conversion and basic types manipulation, -which may need to be guided at one time or another. +which may need to be guided at one time or another. Finally, the syntax is a little esoteric. Sparql `````` The query language most similar to RQL is SPARQL_, defined by the W3C to serve -for the semantic web. +for the semantic web. The different types of queries @@ -59,7 +59,7 @@ Delete entities or relationship (`DELETE`) Remove entities or relations existing in the database. - + .. _Versa: http://uche.ogbuji.net/tech/rdf/versa/ diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/annexes/rql/language.rst --- a/doc/book/en/annexes/rql/language.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/annexes/rql/language.rst Fri Jun 26 23:38:23 2009 +0200 @@ -67,7 +67,7 @@ of logical operators (see :ref:`PriorityOperators`). Mathematical Operators -```````````````````` +``````````````````````` :: +, -, *, / @@ -81,7 +81,7 @@ * The operator `=` is the default operator. * The operator `LIKE` equivalent to `~=` can be used with the - special character `%` in a string to indicate that the chain + special character `%` in a string to indicate that the chain must start or finish by a prefix/suffix: :: @@ -90,11 +90,11 @@ * The operator `IN` provides a list of possible values: :: - + Any X WHERE X name IN ( 'chauvat', 'fayolle', 'di mascio', 'thenault') -XXX nico: "A trick <> 'bar'" wouldn't it be more convenient than +XXX nico: "A trick <> 'bar'" wouldn't it be more convenient than "NOT A trick 'bar'" ? .. _PriorityOperators: @@ -130,7 +130,7 @@ Type of selected variables. The special type `Any` is equivalent to not specify a type. :restriction: - list of conditions to test successively + list of conditions to test successively `V1 relation V2 | ` :orderterms: Definition of the selection order: variable or column number followed by @@ -167,7 +167,7 @@ Identity ```````` -You can use the special relation `identity` in a query to +You can use the special relation `identity` in a query to add an identity constraint between two variables. This is equivalent to ``is`` in python:: @@ -181,23 +181,23 @@ Limit / offset `````````````` :: - + Any P ORDERBY N LIMIT 5 OFFSET 10 WHERE P is Person, P firstname N Function calls `````````````` :: - + Any UPPER(N) WHERE P firstname N Functions on string: UPPER, LOWER - + Exists `````` :: - + Any X ORDERBY PN,N - WHERE X num N, X version_of P, P name PN, + WHERE X num N, X version_of P, P name PN, EXISTS(X in_state S, S name IN ("dev", "ready")) OR EXISTS(T tags X, T name "priority") @@ -219,12 +219,12 @@ Any C, P WHERE C is Card, P? documented_by C Any T,P,V WHERE T is Ticket, T concerns P, T done_in V? - - + + Having `````` :: - + Any X GROUPBY X WHERE X knows Y HAVING COUNT(Y) > 10 Subqueries @@ -232,14 +232,14 @@ :: (Any X WHERE X is Person) UNION (Any X WHERE X is Company) - + DISTINCT Any W, REF - WITH W, REF BEING + WITH W, REF BEING ( - (Any W, REF WHERE W is Workcase, W ref REF, + (Any W, REF WHERE W is Workcase, W ref REF, W concerned_by D, D name "Logilab") - UNION + UNION (Any W, REF WHERE W is Workcase, W ref REF, ' W split_into WP, WP name "WP1") ) @@ -317,7 +317,7 @@ The restriction can define variables used in assignments. -Caution, if a restriction is specified, the insertion is done for +Caution, if a restriction is specified, the insertion is done for *each line result returned by the restriction*. - *Insert a new person named 'foo'* @@ -331,7 +331,7 @@ INSERT Person X, Person Y: X name 'foo', Y name 'nice', X friend Y -- *Insert a new person named 'foo' and a 'friend' relation with an existing +- *Insert a new person named 'foo' and a 'friend' relation with an existing person called 'nice'* :: @@ -350,7 +350,7 @@ SET X name 'bar', X first_name 'original' WHERE X is Person, X name 'foo' -- *Insert a relation of type 'know' between objects linked by +- *Insert a relation of type 'know' between objects linked by the relation of type 'friend'* :: diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/cubes/cc-newcube.rst --- a/doc/book/en/development/cubes/cc-newcube.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/cubes/cc-newcube.rst Fri Jun 26 23:38:23 2009 +0200 @@ -7,7 +7,7 @@ cubicweb-ctl newcube mycube - # answer questions + # answer questions hg init moncube cd mycube hg add . @@ -31,12 +31,12 @@ the source code of your cube: ``cubicweb-ctl newcube --directory=/path/to/cubes/library cube_name`` - + Usage of :command:`cubicweb-ctl liveserver` ------------------------------------------- To quickly test a new cube, you can also use the `liveserver` command for cubicweb-ctl -which allows to create an instance in memory (using an SQLite database by +which allows to create an instance in memory (using an SQLite database by default) and make it accessible through a web server :: cubicweb-ctl live-server mycube diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/datamodel/baseschema.rst --- a/doc/book/en/development/datamodel/baseschema.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/datamodel/baseschema.rst Fri Jun 26 23:38:23 2009 +0200 @@ -3,7 +3,7 @@ ---------------------------------- The library defines a set of entity schemas that are required by the system -or commonly used in `CubicWeb` applications. +or commonly used in *CubicWeb* applications. Entity types used to store the schema @@ -24,7 +24,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * `State`, workflow state * `Transition`, workflow transition -* `TrInfo`, record of a transition trafic for an entity +* `TrInfo`, record of a transition trafic for an entity Other entity types ~~~~~~~~~~~~~~~~~~ diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/datamodel/define-workflows.rst --- a/doc/book/en/development/datamodel/define-workflows.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/datamodel/define-workflows.rst Fri Jun 26 23:38:23 2009 +0200 @@ -8,30 +8,30 @@ General ------- -A workflow describes how certain entities have to evolve between -different states. Hence we have a set of states, and a "transition graph", +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. -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`). +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:`BlogFiveMinutes`). Set-up a workflow ----------------- -We want to create a workflow to control the quality of the BlogEntry +We want to create a workflow to control the quality of the BlogEntry submitted on your application. When a BlogEntry is created by a user its state should be `submitted`. To be visible to all, it has to be in the state `published`. To move it from `submitted` to `published`, we need a transition that we can call `approve_blogentry`. A BlogEntry state should not be modifiable by every user. -So we have to define a group of users, `moderators`, and +So we have to define a group of users, `moderators`, and this group will have appropriate permissions to publish a BlogEntry. There are two ways to create a workflow: from the user interface, -or by defining it in ``migration/postcreate.py``. -This script is executed each time a new ``cubicweb-ctl db-init`` is done. +or by defining it in ``migration/postcreate.py``. +This script is executed each time a new ``cubicweb-ctl db-init`` is done. We strongly recommand to create the workflow in ``migration/postcreate.py`` and we will now show you how. Read `Under the hood`_ to understand why. @@ -60,13 +60,13 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``postcreate.py`` script is executed in a special environment, adding -several `CubicWeb` primitives that can be used. +several *CubicWeb* primitives that can be used. They are all defined in the ``class ServerMigrationHelper``. We will only discuss the methods we use to create a workflow in this example. To define our workflow for BlogDemo, please add the following lines to ``migration/postcreate.py``:: - + _ = unicode moderators = add_entity('CWGroup', name=u"moderators") @@ -88,12 +88,12 @@ add_transition(_('approve_blogentry'), 'BlogEntry', (submitted,), published, ('moderators', 'managers'),) -``add_transition`` expects +``add_transition`` expects * as the first argument the name of the transition, then the entity type on which the transition can be applied, * then the list of states on which the transition can be trigged, - * the target state of the transition, + * the target state of the transition, * and the permissions (e.g. a list of user groups who can apply the transition; the user has to belong to at least one of the listed group to perform the action). @@ -106,11 +106,11 @@ Do not forget to add the `_()` in front of all states and transitions names while creating a workflow so that they will be identified by the i18n catalog scripts. -In addition to the user group condition, we could have added a RQL condition. -In this case, the user can only perform the action if -the two conditions are satisfied. +In addition to the user group condition, we could have added a RQL condition. +In this case, the user can only perform the action if +the two conditions are satisfied. -If we use a RQL condition on a transition, we can use the following +If we use a RQL condition on a transition, we can use the following variables: * `%(eid)s`, object's eid @@ -123,7 +123,7 @@ You can notice that in the action box of a BlogEntry, the state is now listed as well as the possible transitions defined by the workflow. The transitions will only be displayed for users having the right permissions. -In our example, the transition `approve_blogentry` will only be displayed +In our example, the transition `approve_blogentry` will only be displayed for the users belonging to the group `moderators` or `managers`. @@ -131,7 +131,7 @@ ~~~~~~~~~~~~~~ A workflow is a collection of entities of type ``State`` and of type ``Transition`` -which are standard `CubicWeb` entity types. +which are standard *CubicWeb* entity types. For instance, the following lines:: submitted = add_state(_('submitted'), 'BlogEntry', initial=True) @@ -141,7 +141,7 @@ with name 'published'. Whereas:: add_transition(_('approve_blogentry'), 'BlogEntry', (submitted,), published, ('moderators', 'managers'),) - + will create an entity of type ``Transition`` with name 'approve_blogentry' which will be linked to the ``State`` entities created before. As a consequence, we could use the administration interface to do these operations. @@ -151,8 +151,8 @@ Indeed, if you create the states and transitions through the user interface, next time you initialize the database -you will have to re-create all the entities. -The user interface should only be a reference for you to view the states +you will have to re-create all the entities. +The user interface should only be a reference for you to view the states and transitions, but is not the appropriate interface to define your application workflow. diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/datamodel/definition.rst --- a/doc/book/en/development/datamodel/definition.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/datamodel/definition.rst Fri Jun 26 23:38:23 2009 +0200 @@ -3,23 +3,23 @@ Yams *schema* ------------- -The **schema** is the core piece of a `CubicWeb` application as it defines +The **schema** is the core piece of a *CubicWeb* application as it defines the handled data model. It is based on entity types that are either already -defined in the `CubicWeb` standard library; or more specific types, that -`CubicWeb` expects to find in one or more Python files under the directory +defined in the *CubicWeb* standard library; or more specific types, that +*CubicWeb* expects to find in one or more Python files under the directory `schema`. At this point, it is important to make clear the difference between *relation type* and *relation definition*: a *relation type* is only a relation -name with potentially other additionnal properties (see XXXX), whereas a -*relation definition* is a complete triplet -" ". -A relation type could have been implied if none is related to a +name with potentially other additionnal properties (see XXXX), whereas a +*relation definition* is a complete triplet +" ". +A relation type could have been implied if none is related to a relation definition of the schema. -All `CubicWeb` built-in types are available : `String`, `Int`, `Float`, -`Decimal`, `Boolean`, `Date`, `Datetime`, `Time`, `Interval`, `Byte` +All *CubicWeb* built-in types are available : `String`, `Int`, `Float`, +`Decimal`, `Boolean`, `Date`, `Datetime`, `Time`, `Interval`, `Byte` and `Password`. They are implicitely imported (as well as the special the function "_" for translation :ref:`internationalization`). @@ -67,7 +67,7 @@ RelationSchema.rproperties() RelationSchema.rproperty(subjtype, objtype, property name) -* Optional properties for attributes and relations : +* Optional properties for attributes and relations : - `description` : a string describing an attribute or a relation. By default this string will be used in the editing form of the entity, which means @@ -79,7 +79,7 @@ - `cardinality` : a two character string which specify the cardinality of the relation. The first character defines the cardinality of the relation on - the subject, and the second on the object. When a relation can have + the subject, and the second on the object. When a relation can have multiple subjects or objects, the cardinality applies to all, not on a one-to-one basis (so it must be consistent...). The possible values are inspired from regular expression syntax : @@ -92,24 +92,24 @@ - `meta` : boolean indicating that the relation is a meta-relation (false by default) -* optional properties for attributes : +* optional properties for attributes : - `required` : boolean indicating if the attribute is required (false by default) - `unique` : boolean indicating if the value of the attribute has to be unique or not within all entities of the same type (false by default) - - `indexed` : boolean indicating if an index needs to be created for this + - `indexed` : boolean indicating if an index needs to be created for this attribute in the database (false by default). This is useful only if you know that you will have to run numerous searches on the value of this attribute. - `default` : default value of the attribute. In case of date types, the values which could be used correspond to the RQL keywords `TODAY` and `NOW`. - + - `vocabulary` : specify static possible values of an attribute -* optional properties of type `String` : +* optional properties of type `String` : - `fulltextindexed` : boolean indicating if the attribute is part of the full text index (false by default) (*applicable on the type `Byte` @@ -120,11 +120,11 @@ - `maxsize` : integer providing the maximum size of the string (no limit by default) -* optional properties for relations : +* optional properties for relations : - `composite` : string indicating that the subject (composite == 'subject') is composed of the objects of the relations. For the opposite case (when - the object is composed of the subjects of the relation), we just set + the object is composed of the subjects of the relation), we just set 'object' as value. The composition implies that when the relation is deleted (so when the composite is deleted), the composed are also deleted. @@ -137,7 +137,7 @@ * `SizeConstraint` : allows to specify a minimum and/or maximum size on string (generic case of `maxsize`) -* `BoundConstraint` : allows to specify a minimum and/or maximum value on +* `BoundConstraint` : allows to specify a minimum and/or maximum value on numeric types * `UniqueConstraint` : identical to "unique=True" @@ -146,7 +146,7 @@ * `RQLConstraint` : allows to specify a RQL query that has to be satisfied by the subject and/or the object of the relation. In this query the variables - `S` and `O` are reserved for the entities subject and object of the + `S` and `O` are reserved for the entities subject and object of the relation. * `RQLVocabularyConstraint` : similar to the previous type of constraint except @@ -160,7 +160,7 @@ The security model ~~~~~~~~~~~~~~~~~~ -The security model of `cubicWeb` is based on `Access Control List`. +The security model of `cubicWeb` is based on `Access Control List`. The main principles are: * users and groups of users @@ -168,7 +168,7 @@ * permissions (read, update, create, delete) * permissions are assigned to groups (and not to users) -For `CubicWeb` in particular: +For *CubicWeb* in particular: * we associate rights at the enttities/relations schema level * for each entity, we distinguish four kind of permissions: read, @@ -213,13 +213,13 @@ This can only be used for the actions `update` and `delete` of an entity type. -It is also possible to use specific groups if they are defined in the precreate +It is also possible to use specific groups if they are defined in the precreate of the cube (``migration/precreate.py``). Use of RQL expression for writing rights ````````````````````````````````````````` -It is possible to define RQL expression to provide update permission +It is possible to define RQL expression to provide update permission (`add`, `delete` and `update`) on relation and entity types. RQL expression for entity type permission : @@ -232,13 +232,13 @@ respectively on the current entity (on which the action is verified) and on the user who send the request -* it is possible to use, in this expression, a special relation - "has__permission" where the subject is the user and the +* it is possible to use, in this expression, a special relation + "has__permission" where the subject is the user and the object is a any variable, meaning that the user needs to have permission to execute the action on the entities related - to this variable + to this variable -For RQL expressions on a relation type, the principles are the same except +For RQL expressions on a relation type, the principles are the same except for the following : * you have to use the class `RQLExpression` in the case of a non-final relation @@ -248,7 +248,7 @@ which the action is being verified) and the user who executed the query * we can also defined rights on attributes of an entity (non-final relation), - knowing that : + knowing that : - to defines RQL expression, we have to use the class `RQLExpression` in which X represents the entity the attribute belongs to @@ -260,17 +260,17 @@ Potentially, the use of an RQL expression to add an entity or a relation can cause problems for the user interface, because if the expression uses - the entity or the relation to create, then we are not able to verify the + the entity or the relation to create, then we are not able to verify the permissions before we actually add the entity (please note that this is not a problem for the RQL server at all, because the permissions checks are - done after the creation). In such case, the permission check methods - (check_perm, has_perm) can indicate that the user is not allowed to create - this entity but can obtain the permission. + done after the creation). In such case, the permission check methods + (check_perm, has_perm) can indicate that the user is not allowed to create + this entity but can obtain the permission. To compensate this problem, it is usually necessary, for such case, to use an action that reflects the schema permissions but which enables to check properly the permissions so that it would show up if necessary. - + Use of RQL expression for reading rights ```````````````````````````````````````` @@ -315,20 +315,20 @@ `Company` through the semantic `works_for`. The name of the Python attribute corresponds to the name of the attribute -or the relation in `CubicWeb` application. +or the relation in *CubicWeb* application. An attribute is defined in the schema as follows:: - + attr_name = attr_type(properties*) where `attr_type` is one of the type listed above and `properties` is a list of the attribute needs to statisfy (see :ref:`properties` -for more details). +for more details). * relations can be defined by using `ObjectRelation` or `SubjectRelation`. The first argument of `SubjectRelation` or `ObjectRelation` gives respectively - the object/subject entity type of the relation. This could be : + the object/subject entity type of the relation. This could be : * a string corresponding to an entity type @@ -337,7 +337,7 @@ * special string such as follows : - "**" : all types of entities - - "*" : all types of non-meta entities + - "*" : all types of non-meta entities - "@" : all types of meta entities but not system entities (e.g. used for the basic schema description) @@ -356,9 +356,9 @@ A relation is defined by a Python class heriting `RelationType`. The name of the class corresponds to the name of the type. The class then contains -a description of the properties of this type of relation, and could as well +a description of the properties of this type of relation, and could as well contain a string for the subject and a string for the object. This allows to create -new definition of associated relations, (so that the class can have the +new definition of associated relations, (so that the class can have the definition properties from the relation) for example :: class locked_by(RelationType): diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/datamodel/index.rst --- a/doc/book/en/development/datamodel/index.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/datamodel/index.rst Fri Jun 26 23:38:23 2009 +0200 @@ -11,3 +11,4 @@ baseschema .. define-workflows +.. inheritance diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/devcore/appobject.rst --- a/doc/book/en/development/devcore/appobject.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/devcore/appobject.rst Fri Jun 26 23:38:23 2009 +0200 @@ -1,5 +1,5 @@ - + The `AppObject` class ~~~~~~~~~~~~~~~~~~~~~ diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/devcore/dbapi.rst --- a/doc/book/en/development/devcore/dbapi.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/devcore/dbapi.rst Fri Jun 26 23:38:23 2009 +0200 @@ -20,7 +20,7 @@ The `Connection` object owns the methods `commit` and `rollback`. You *should never need to use them* during the development of the web interface based on -the `CubicWeb` framework as it determines the end of the transaction depending +the *CubicWeb* framework as it determines the end of the transaction depending on the query execution success. .. note:: diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/devcore/index.rst --- a/doc/book/en/development/devcore/index.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/devcore/index.rst Fri Jun 26 23:38:23 2009 +0200 @@ -10,7 +10,7 @@ selectors.rst dbapi.rst - + :mod:`Configuration ` ---------------------------------------- diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/devcore/selectors.rst --- a/doc/book/en/development/devcore/selectors.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/devcore/selectors.rst Fri Jun 26 23:38:23 2009 +0200 @@ -7,7 +7,7 @@ essential part of the construction of well behaved cubes. -`CubicWeb` provides its own set of selectors that you can use and here is a +*CubicWeb* provides its own set of selectors that you can use and here is a description of some of the most common used: Of course you will write your own set of selectors as you get familiar with the diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/devcore/vreg.rst --- a/doc/book/en/development/devcore/vreg.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/devcore/vreg.rst Fri Jun 26 23:38:23 2009 +0200 @@ -1,3 +1,5 @@ +.. -*- coding: utf-8 -*- + The VRegistry -------------- @@ -7,21 +9,23 @@ Details of the recording process ```````````````````````````````` -* par défaut on enregistre automatiquement tout les objets +XXX this part needs to be updated and checked + +* by default all objects are registered automatically -* si certains objets doivent remplacer d'autres objets ou être inclus - conditionnellement, - - enregistrement explicite en définissant la fonction `registration_callback(vreg)` - - appel des méthodes d'enregistrement des objets sur le vreg +* if some objects have to replace other objects or be included only if a + condition is true, + - explicitly register the object by defining `registration_callback(vreg)` + - call registration methods on objects listed in the vreg registry + .. note:: Once the function `registration_callback(vreg)` is implemented, all the objects - need to be explicitly registered as it disables the automatic object registering. - -* suppression de l'ancien système quand il ne restera plus de réference au - module registerers dans le code des cubes existants. + have to be explicitly registered as it disables the automatic object registering. +* the old registration mechanism will be removed when there will be no reference + left to the registerers module in cubicweb and the library of cubes. -Examples +Examples: .. code-block:: python @@ -40,6 +44,7 @@ API d'enregistrement des objets ``````````````````````````````` + .. code-block:: python register(obj, registryname=None, oid=None, clear=False) @@ -58,7 +63,8 @@ Defining selectors `````````````````` -The object's selector is defined by itsd `__select__` class attribute. + +The object's selector is defined by its `__select__` class attribute. When two selectors are combined using the `&` operator (former `chainall`), it means that both should return a positive score. On success, the sum of scores is returned. @@ -86,18 +92,20 @@ Example ```````` -Le but final : quand on est sur un Blog, on veut que le lien rss de celui-ci pointe -vers les entrées de ce blog, non vers l'entité blog elle-même. +XXX this part needs to be translated -L'idée générale pour résoudre ça : on définit une méthode sur les classes d'entité +Le but final : quand on est sur un Blog, on veut que le lien rss de celui-ci pointe +vers les entrées de ce blog, non vers l'entité blog elle-même. + +L'idée générale pour résoudre ça : on définit une méthode sur les classes d'entité qui renvoie l'url du flux rss pour l'entité en question. Avec une implémentation -par défaut sur AnyEntity et une implémentation particulière sur Blog qui fera ce +par défaut sur AnyEntity et une implémentation particulière sur Blog qui fera ce qu'on veut. -La limitation : on est embêté dans le cas ou par ex. on a un result set qui contient +La limitation : on est embêté dans le cas ou par ex. on a un result set qui contient plusieurs entités Blog (ou autre chose), car on ne sait pas sur quelle entité appeler la méthode sus-citée. Dans ce cas, on va conserver le comportement actuel (eg appel -à limited_rql) +à limited_rql) Donc : on veut deux cas ici, l'un pour un rset qui contient une et une seule entité, l'autre pour un rset qui contient plusieurs entité. @@ -116,7 +124,7 @@ pour voir le détail) * non_final_entity, qui filtre sur des rset contenant une liste d'entité non finale -ça correspond donc à notre 2eme cas. Reste à fournir un composant plus spécifique +ça correspond donc à notre 2eme cas. Reste à fournir un composant plus spécifique pour le 1er cas :: class EntityRSSIconBox(RSSIconBox): @@ -130,11 +138,11 @@ non sélectionnable). Donc ici, sur un rset avec plusieurs entités, onelinerset_selector rendra la classe EntityRSSIconBox non sélectionnable, et on obtiendra bien la classe RSSIconBox. Pour un rset avec une entité, la classe EntityRSSIconBox aura un -score supérieur à RSSIconBox et c'est donc bien elle qui sera sélectionnée. +score supérieur à RSSIconBox et c'est donc bien elle qui sera sélectionnée. -Voili voilou, il reste donc pour finir tout ça : +Voili voilou, il reste donc pour finir tout ça : -* à définir le contenu de la méthode call de EntityRSSIconBox +* à définir le contenu de la méthode call de EntityRSSIconBox * fournir l'implémentation par défaut de la méthode renvoyant l'url du flux rss sur AnyEntity * surcharger cette methode dans blog.Blog @@ -144,8 +152,8 @@ ``````````````````````` Il faut utiliser les sélecteurs pour faire des choses différentes en -fonction de ce qu'on a en entrée. Dès qu'on a un "if" qui teste la -nature de `self.rset` dans un objet, il faut très sérieusement se +fonction de ce qu'on a en entrée. Dès qu'on a un "if" qui teste la +nature de `self.rset` dans un objet, il faut très sérieusement se poser la question s'il ne vaut pas mieux avoir deux objets différent avec des sélecteurs approprié. diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/devrepo/hooks.rst --- a/doc/book/en/development/devrepo/hooks.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/devrepo/hooks.rst Fri Jun 26 23:38:23 2009 +0200 @@ -10,8 +10,8 @@ *Hooks* are executed before or after updating an entity or a relation in the repository. -Their prototypes are as follows: - +Their prototypes are as follows: + * after_add_entity (session, entity) * after_update_entity (session, entity) * after_delete_entity (session, eid) @@ -23,10 +23,10 @@ * after_delete_relation (session, fromeid, rtype, toeid) * before_add_relation (session, fromeid, rtype, toeid) * before_delete_relation (session, fromeid, rtype, toeid) - + * server_startup * server_shutdown - + * session_open * session_close diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/devweb/form.rst --- a/doc/book/en/development/devweb/form.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/devweb/form.rst Fri Jun 26 23:38:23 2009 +0200 @@ -9,9 +9,9 @@ * `vocabulary(rtype, x='subject', limit=None)`, called by the editing views, it returns a list of couples (label, eid) of entities that could be related to the entity by the relation `rtype` - * `subject_relation_vocabulary(rtype, limit=None)`, called internally + * `subject_relation_vocabulary(rtype, limit=None)`, called internally by `vocabulary` in the case of a subject relation - * `object_relation_vocabulary(rtype, limit=None)`, called internally + * `object_relation_vocabulary(rtype, limit=None)`, called internally by `vocabulary` in the case of an object relation * `relation_vocabulary(rtype, targettype, x, limit=None)`, called internally by `subject_relation_vocabulary` and `object_relation_vocabulary` diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/devweb/views.rst --- a/doc/book/en/development/devweb/views.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/devweb/views.rst Fri Jun 26 23:38:23 2009 +0200 @@ -3,11 +3,11 @@ This chapter aims to describe the concept of a `view` used all along the development of a web application and how it has been implemented -in `CubicWeb`. +in *CubicWeb*. We'll start with a description of the interface providing you with a basic understanding of the classes and methods available, then detail the view -selection principle which makes `CubicWeb` web interface very flexible. +selection principle which makes *CubicWeb* web interface very flexible. A `View` is an object applied to another object such as an entity. @@ -42,19 +42,19 @@ * `dispatch(**context)`, render the view by calling `call` or `cell_call` depending on the given parameters -* `call(**kwargs)`, call the view for a complete result set or null (default +* `call(**kwargs)`, call the view for a complete result set or null (default implementation calls `cell_call()` on each cell of the result set) * `cell_call(row, col, **kwargs)`, call the view for a given cell of a result set * `url()`, returns the URL enabling us to get the view with the current - result set -* `view(__vid, rset, __fallback_vid=None, **kwargs)`, call the view of identifier + result set +* `view(__vid, rset, __fallback_vid=None, **kwargs)`, call the view of identifier `__vid` on the given result set. It is possible to give a view identifier of fallback that will be used if the view requested is not applicable to the result set - + * `wview(__vid, rset, __fallback_vid=None, **kwargs)`, similar to `view` except the flow is automatically passed in the parameters - + * `html_headers()`, returns a list of HTML headers to set by the main template * `page_title()`, returns the title to use in the HTML header `title` @@ -67,17 +67,17 @@ * `EntityView`, view applying to lines or cell containing an entity (e.g. an eid) * `StartupView`, start view that does not require a result set to apply to -* `AnyRsetView`, view applied to any result set +* `AnyRsetView`, view applied to any result set * `EmptyRsetView`, view applied to an empty result set -Examples of views class +Examples of views class ----------------------- - Using `templatable`, `content_type` and HTTP cache configuration .. code-block:: python - + class RSSView(XMLView): id = 'rss' @@ -86,13 +86,13 @@ content_type = 'text/xml' http_cache_manager = MaxAgeHTTPCacheManager cache_max_age = 60*60*2 # stay in http cache for 2 hours by default - + - Using custom selector .. code-block:: python - + class SearchForAssociationView(EntityView): """view called by the edition view when the user asks @@ -111,18 +111,18 @@ We'll show you now an example of a ``primary`` view and how to customize it. -If you want to change the way a ``BlogEntry`` is displayed, just override +If you want to change the way a ``BlogEntry`` is displayed, just override the method ``cell_call()`` of the view ``primary`` in ``BlogDemo/views.py`` :: .. code-block:: python from cubicweb.view import EntityView from cubicweb.selectors import implements - + class BlogEntryPrimaryView(EntityView): id = 'primary' __select__ =implements('Blog') - + def cell_call(self, row, col): entity = self.entity(row, col) self.w(u'

%s

' % entity.title) @@ -131,7 +131,7 @@ self.w(u'

%s

' % entity.text) The above source code defines a new primary view (`line 03`) for -``BlogEntry`` (`line 05`). +``BlogEntry`` (`line 05`). Since views are applied to result sets which can be tables of data, we have to recover the entity from its (row,col)-coordinates (`line 08`). @@ -170,9 +170,9 @@ about the schema and infer that such entities have to be of the ``BlogEntry`` kind and retrieves them. -The request returns a selection of data called a result set. At +The request returns a selection of data called a result set. At `line 10` the view 'primary' is applied to this result set to output -HTML. +HTML. **This is to be compared to interfaces and protocols in object-oriented languages. Applying a given view called 'a_view' to all the entities @@ -186,7 +186,7 @@ :alt: a blog and all its entries **Before we move forward, remember that the selection/view principle is -at the core of `CubicWeb`. Everywhere in the engine, data is requested +at the core of *CubicWeb*. Everywhere in the engine, data is requested using the RQL language, then HTML/XML/text/PNG is output by applying a view to the result set returned by the query. That is where most of the flexibility comes from.** @@ -202,7 +202,7 @@ * create view "blogentry table" with title, publish_date, category -We will show that by default the view that displays +We will show that by default the view that displays "Any E,D,C WHERE E publish_date D, E category C" is the table view. Of course, the same can be obtained by calling self.wview('table',rset) @@ -226,7 +226,7 @@ * set, through the attribute `content_type` of the class, the MIME type generated by the view to `application/octet-stream` -For views dedicated to binary content creation (like dynamically generated +For views dedicated to binary content creation (like dynamically generated images), we have to set the attribute `binary` of the class to `True` (which implies that `templatable == False`, so that the attribute `w` of the view could be replaced by a binary flow instead of unicode). diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/entityclasses/data-as-objects.rst --- a/doc/book/en/development/entityclasses/data-as-objects.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/entityclasses/data-as-objects.rst Fri Jun 26 23:38:23 2009 +0200 @@ -19,18 +19,18 @@ * `absolute_url(**kwargs)`, returns an absolute URL to access the primary view of an entity - + * `rest_path()`, returns a relative REST URL to get the entity * `format(attr)`, returns the format (MIME type) of the field given un parameter - * `printable_value(attr, value=_marker, attrtype=None, format='text/html')`, + * `printable_value(attr, value=_marker, attrtype=None, format='text/html')`, returns a string enabling the display of an attribute value in a given format (the value is automatically recovered if necessary) :Data handling: - * `as_rset()`, converts the entity into an equivalent result set simulating the + * `as_rset()`, converts the entity into an equivalent result set simulating the request `Any X WHERE X eid _eid_` * `complete(skip_bytes=True)`, executes a request that recovers in one time @@ -57,21 +57,21 @@ * `delete()` allows to delete the entity - + Tne :class:`AnyEntity` class ---------------------------- - + To provide a specific behavior for each entity, we have to define a class inheriting from `cubicweb.entities.AnyEntity`. In general, we define this class in a module of `mycube.entities` package of an application so that it will be available on both server and client side. -The class `AnyEntity` is loaded dynamically from the class `Entity` +The class `AnyEntity` is loaded dynamically from the class `Entity` (`cubciweb.entity`). We define a sub-class to add methods or to specialize the handling of a given entity type The methods defined for `AnyEntity` or `Entity` are the following ones: - + :Standard meta-data (Dublin Core): * `dc_title()`, returns a unicode string corresponding to the meta-data @@ -81,15 +81,15 @@ * `dc_long_title()`, same as dc_title but can return a more detailled title - * `dc_description(format='text/plain')`, returns a unicode string + * `dc_description(format='text/plain')`, returns a unicode string corresponding to the meta-data `Description` (look for a description attribute by default) - * `dc_authors()`, returns a unicode string corresponding to the meta-data + * `dc_authors()`, returns a unicode string corresponding to the meta-data `Authors` (owners by default) - * `dc_date(date_format=None)`, returns a unicode string corresponding to + * `dc_date(date_format=None)`, returns a unicode string corresponding to the meta-data `Date` (update date by default) - * `dc_type(form='')`, returns a string to display the entity type by + * `dc_type(form='')`, returns a string to display the entity type by specifying the preferred form (`plural` for a plural form) diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/entityclasses/load-sort.rst --- a/doc/book/en/development/entityclasses/load-sort.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/entityclasses/load-sort.rst Fri Jun 26 23:38:23 2009 +0200 @@ -14,13 +14,13 @@ `None` if we do not want to sort on the attribute given in the parameter. By default, the entities are sorted according to their creation date. -* The class method `fetch_unrelated_order(attr, var)` is similar to the +* The class method `fetch_unrelated_order(attr, var)` is similar to the method `fetch_order` except that it is essentially used to control - the sorting of drop-down lists enabling relations creation in + the sorting of drop-down lists enabling relations creation in the editing view of an entity. The function `fetch_config(fetchattrs, mainattr=None)` simplifies the -definition of the attributes to load and the sorting by returning a +definition of the attributes to load and the sorting by returning a list of attributes to pre-load (considering automatically the attributes of `AnyEntity`) and a sorting function based on the main attribute (the second parameter if specified otherwisethe first attribute from diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/entityclasses/more.rst --- a/doc/book/en/development/entityclasses/more.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/entityclasses/more.rst Fri Jun 26 23:38:23 2009 +0200 @@ -1,12 +1,14 @@ Navigation on deletion ---------------------- + XXX after_deletion_path, pre_web_edit Controlling output url ---------------------- -XXX +----------------------- + +XXX write me Controling notification references ---------------------------------- -XXX +XXX write me diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/index.rst --- a/doc/book/en/development/index.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/index.rst Fri Jun 26 23:38:23 2009 +0200 @@ -4,7 +4,7 @@ Part II - Development --------------------- -This part is about developing web applications with the `CubicWeb` framework. +This part is about developing web applications with the *CubicWeb* framework. .. toctree:: :maxdepth: 2 diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/migration/index.rst --- a/doc/book/en/development/migration/index.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/migration/index.rst Fri Jun 26 23:38:23 2009 +0200 @@ -5,7 +5,7 @@ Migration ========= -One of the main concept in `CubicWeb` is to create incremental applications. +One of the main concept in *CubicWeb* is to create incremental applications. For this purpose, multiple actions are provided to facilitate the improvement of an application, and in particular to handle the changes to be applied to the data model, without loosing existing data. @@ -23,11 +23,11 @@ [_]_.py -in which : +in which : * X.Y.Z is the model version number to which the script enables to migrate. -* *mode* (between the last "_" and the extension ".py") is used for +* *mode* (between the last "_" and the extension ".py") is used for distributed installation. It indicates to which part of the application (RQL server, web server) the script applies. Its value could be : @@ -44,10 +44,10 @@ (schema and data migration for example). Again in the directory `migration`, the file `depends.map` allows to indicate -that for the migration to a particular model version, you always have to first -migrate to a particular `CubicWeb` version. This file can contain comments (lines +that for the migration to a particular model version, you always have to first +migrate to a particular *CubicWeb* version. This file can contain comments (lines starting by `#`) and a dependancy is listed as follows: :: - + : For example: :: @@ -65,7 +65,7 @@ * `config`, instance configuration * `interactive_mode`, boolean indicating that the script is executed in - an interactive mode or not + an interactive mode or not * `appltemplversion`, application model version of the instance @@ -87,7 +87,7 @@ * `repo_schema`, instance persisting schema (e.g. instance schema of the current migration) -* `newschema`, installed schema on the file system (e.g. schema of +* `newschema`, installed schema on the file system (e.g. schema of the updated model and cubicweb) * `sqlcursor`, SQL cursor for very rare cases where it is really @@ -95,30 +95,30 @@ * `repo`, repository object - + Schema migration ---------------- The following functions for schema migration are available in `repository` scripts: * `add_attribute(etype, attrname, attrtype=None, commit=True)`, adds a new - attribute to an existing entity type. If the attribute type is not specified, + attribute to an existing entity type. If the attribute type is not specified, then it is extracted from the updated schema. - + * `drop_attribute(etype, attrname, commit=True)`, removes an attribute from an existing entity type. * `rename_attribute(etype, oldname, newname, commit=True)`, renames an attribute - + * `add_entity_type(etype, auto=True, commit=True)`, adds a new entity type. If `auto` is True, all the relations using this entity type and having a known entity type on the other hand will automatically be added. -* `drop_entity_type(etype, commit=True)`, removes an entity type and all the +* `drop_entity_type(etype, commit=True)`, removes an entity type and all the relations using it. * `rename_entity_type(oldname, newname, commit=True)`, renames an entity type - + * `add_relation_type(rtype, addrdef=True, commit=True)`, adds a new relation type. If `addrdef` is True, all the relations definitions of this type will be added. @@ -136,17 +136,17 @@ * `synchronize_permissions(ertype, commit=True)`, synchronizes permissions on an entity type or relation type. - + * `synchronize_rschema(rtype, commit=True)`, synchronizes properties and permissions on a relation type. - + * `synchronize_eschema(etype, commit=True)`, synchronizes properties and persmissions on an entity type. - + * `synchronize_schema(commit=True)`, synchronizes the persisting schema with the - updated schema (but without adding or removing new entity types, relations types + updated schema (but without adding or removing new entity types, relations types or even relations definitions). - + * `change_relation_props(subjtype, rtype, objtype, commit=True, **kwargs)`, changes properties of a relation definition by using the named parameters of the properties to change. @@ -162,7 +162,7 @@ The following functions for data migration are available in `repository` scripts: * `rql(rql, kwargs=None, cachekey=None, ask_confirm=True)`, executes an arbitrary RQL - query, either to interrogate or update. A result set object is returned. + query, either to interrogate or update. A result set object is returned. * `add_entity(etype, *args, **kwargs)`, adds a nes entity type of the given type. The attribute and relation values are specified using the named and @@ -176,8 +176,8 @@ * `add_state(name, stateof, initial=False, commit=False, **kwargs)`, adds a new state in the workflow. - -* `add_transition(name, transitionof, fromstates, tostate, requiredgroups=(), commit=False, **kwargs)`, + +* `add_transition(name, transitionof, fromstates, tostate, requiredgroups=(), commit=False, **kwargs)`, adds a new transition in the workflow. You can find more details about workflows in the chapter :ref:`Workflow` . @@ -185,7 +185,7 @@ Configuration migration ----------------------- -The following functions for configuration migration are available in all +The following functions for configuration migration are available in all scripts: * `option_renamed(oldname, newname)`, indicates that an option has been renamed @@ -200,8 +200,8 @@ Others migration functions -------------------------- -Those functions are only used for low level operations that could not be -accomplished otherwise or to repair damaged databases during interactive +Those functions are only used for low level operations that could not be +accomplished otherwise or to repair damaged databases during interactive session. They are available in `repository` scripts: * `sqlexec(sql, args=None, ask_confirm=True)`, executes an arbitrary SQL query diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/testing/index.rst --- a/doc/book/en/development/testing/index.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/testing/index.rst Fri Jun 26 23:38:23 2009 +0200 @@ -10,7 +10,7 @@ Unit tests ---------- -`CubicWeb` framework provides essentially two Python test classes in the +*CubicWeb* framework provides essentially two Python test classes in the module `cubicweb.devtools.apptest`: * `EnvBasedTC`, to simulate a complete environment (web + repository) @@ -28,11 +28,11 @@ Email notifications tests ------------------------- When running tests potentially generated e-mails are not really -sent but is found in the list `MAILBOX` of module `cubicweb.devtools.apptest`. +sent but is found in the list `MAILBOX` of module `cubicweb.devtools.apptest`. This list is reset at each test *setUp* (by the setUp of classes `EnvBasedTC` and `RepositoryBasedTC`). - + You can test your notifications by analyzing the contents of this list, which contains objects with two attributes: * `recipients`, the list of recipients diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/webstdlib/autoform.rst --- a/doc/book/en/development/webstdlib/autoform.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/webstdlib/autoform.rst Fri Jun 26 23:38:23 2009 +0200 @@ -2,7 +2,7 @@ --------------------------------------------------------------- It is possible to manage attributes/relations in the simple or multiple -editing form thanks to the following *rtags*: +editing form thanks to the following *rtags*: * `primary`, indicates that an attribute or a relation has to be inserted **in the simple or multiple editing forms**. In the case of @@ -26,6 +26,6 @@ * `generated`, indicates that an attribute is dynamically computed or other, and that it should not be displayed in the editing form. -If necessary, it is possible to overwrite the method +If necessary, it is possible to overwrite the method `relation_category(rtype, x='subject')` to dynamically compute a relation editing category. diff -r a73bf75a1ef9 -r 9d7bfbf70ed6 doc/book/en/development/webstdlib/basetemplates.rst --- a/doc/book/en/development/webstdlib/basetemplates.rst Fri Jun 26 23:38:00 2009 +0200 +++ b/doc/book/en/development/webstdlib/basetemplates.rst Fri Jun 26 23:38:23 2009 +0200 @@ -32,15 +32,15 @@ Let's now move the search box in the header and remove the login form from the header. We'll show how to move it to the left column of the application. -Let's say we do not want anymore the login menu to be in the header, but we +Let's say we do not want anymore the login menu to be in the header, but we prefer it to be in the left column just below the logo. As the left column is -rendered by ``TheMainTemplate``, we will show how to do it in TheMainTemplate_. +rendered by ``TheMainTemplate``, we will show how to do it in TheMainTemplate_. First, to remove the login menu, we just need to comment out the display of the login component such as follows : :: class MyHTMLPageHeader(HTMLPageHeader): - + def main_header(self, view): """build the top menu with authentification info and the rql box""" self.w(u'\n') @@ -101,13 +101,13 @@ if comp and comp.propval('visible'): comp.dispatch(w=self.w, view=view) self.w(u'') - + # logged user and help #self.w(u'