# HG changeset patch # User Aurelien Campeas # Date 1253182299 -7200 # Node ID 4f53eb3f1331ec052a6bc19f87b5daea3706d529 # Parent 6536ee4f37f71617ee6e772ae71b250dd9f967fb more doc diff -r 6536ee4f37f7 -r 4f53eb3f1331 doc/book/en/development/datamodel/definition.rst --- a/doc/book/en/development/datamodel/definition.rst Wed Sep 16 16:52:47 2009 +0200 +++ b/doc/book/en/development/datamodel/definition.rst Thu Sep 17 12:11:39 2009 +0200 @@ -89,7 +89,7 @@ * `*`: 0..n - `meta` : boolean indicating that the relation is a meta-relation (false by - default) + default, will disappear in *CubicWeb* 3.5) * optional properties for attributes : @@ -216,8 +216,8 @@ of the cube (``migration/precreate.py``). -Use of RQL expression for writing rights -````````````````````````````````````````` +Use of RQL expression for write permissions +``````````````````````````````````````````` It is possible to define RQL expression to provide update permission (`add`, `delete` and `update`) on relation and entity types. @@ -249,7 +249,7 @@ * we can also defined rights on attributes of an entity (non-final relation), knowing that : - - to defines RQL expression, we have to use the class `RQLExpression` + - to define RQL expression, we have to use the class `RQLExpression` in which X represents the entity the attribute belongs to - the permissions `add` and `delete` are equivalent. Only `add`/`read` @@ -321,7 +321,7 @@ 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` +a list of the attribute needs to statisfy (see :ref:`properties` for more details). @@ -434,6 +434,6 @@ * in such case, we have to protect both the entity type "Version" and the relation associating a version to a project ("version_of") -* because of the genricity of the entity type `CWPermission`, we have to execute +* because of the genericity of the entity type `CWPermission`, we have to execute a unification with the groups and/or the states if necessary in the expression ("U in_group G, P require_group G" in the above example) diff -r 6536ee4f37f7 -r 4f53eb3f1331 doc/book/en/development/devweb/js.rst --- a/doc/book/en/development/devweb/js.rst Wed Sep 16 16:52:47 2009 +0200 +++ b/doc/book/en/development/devweb/js.rst Thu Sep 17 12:11:39 2009 +0200 @@ -3,16 +3,70 @@ Javascript ---------- -XXX jquery... +*CubicWeb* uses quite a bit of javascript in its user interface and +ships with jquery (1.3.x) and parts of the jquery UI +library, plus a number of homegrown files and also other thirparty +libraries. + +All javascript files are stored in cubicweb/web/data/. There are +around thirty js files there. In a cube it goes to data/. + +Obviously one does not want javascript pieces to be loaded all at +once, hence the framework provides a number of mechanisms and +conventions to deal with javascript resources. Conventions ~~~~~~~~~~~ -XXX external_resources variable - naming convention - request.add_js +It is good practice to name cube specific js files after the name of +the cube, like this : 'cube.mycube.js', so as to avoid name clashes. +XXX external_resources variable (which needs love) CubicWeb javascrip api ~~~~~~~~~~~~~~~~~~~~~~ -XXX explain diffenrent files and main functions + +Javascript resources are typically loaded on demand, from views. The +request object (available as self.req from most application objects, +for instance views and entities objects) has a few methods to do that: + +* `add_js(self, jsfiles, localfile=True)` which takes a sequence of + javascript files and writes proper entries into the HTML header + section. The localfile parameter allows to declare resources which + are not from web/data (for instance, residing on a content delivery + network). + +* `add_onload(self, jscode)` which adds one raw javascript code + snippet inline in the html headers. This is quite useful for setting + up early jQuery(document).ready(...) initialisations. + +Overview of what's available +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* jquery.* : jquery and jquery UI library + +* cubicweb.python.js : adds a number of practical extension to stdanrd + javascript objects (on Date, Array, String, some list and dictionary + operations), and a pythonesque way to build classes. Defines a + CubicWeb namespace. + +* cubicweb.htmlhelpers.js : a small bag of convenience functions used + in various other cubicweb javascript resources (baseuri, progress + cursor handling, popup login box, html2dom function, etc.) + +* cubicweb.ajax.js : concentrates all ajax related facilities (it + extends jQuery with the loahxhtml function, provides a handfull of + high-level ajaxy operations like asyncRemoteExec, reloadComponent, + replacePageChunk, getDomFromResponse) + +* cubicweb.widgets.js : provides a widget namespace and constructors + and helpers for various widgets (mainly facets and timeline) + +* cubicweb.edition.js : used by edition forms + +* cubicweb.preferences.js : used by the preference form + +* cubicweb.facets.js : used by the facets mechanism + +xxx massmailing, gmap, fckcwconfig, timeline-bundle, timeline-ext, +calendar, goa, flotn tazy, tabs, bookmarks diff -r 6536ee4f37f7 -r 4f53eb3f1331 doc/book/en/development/entityclasses/data-as-objects.rst --- a/doc/book/en/development/entityclasses/data-as-objects.rst Wed Sep 16 16:52:47 2009 +0200 +++ b/doc/book/en/development/entityclasses/data-as-objects.rst Thu Sep 17 12:11:39 2009 +0200 @@ -1,7 +1,8 @@ Access to persistent data -------------------------- -XXX is provided by the :class:`Entity ` class +Python-level access to persistent data is provided by the +:class:`Entity ` class. An entity class is bound to a schema entity type. Descriptors are added when classes are registered in order to initialize the class according to its schema: @@ -22,8 +23,6 @@ * `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')`, returns a string enabling the display of an attribute value in a given format (the value is automatically recovered if necessary) @@ -33,7 +32,7 @@ * `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 + * `complete(skip_bytes=True)`, executes a request that recovers all at once all the missing attributes of an entity * `get_value(name)`, returns the value associated to the attribute name given @@ -52,9 +51,6 @@ * `copy_relations(ceid)`, copies the relations of the entities having the eid given in the parameters on the current entity - * `last_modified(view)`, returns the date the object has been modified - (used by HTTP cache handling) - * `delete()` allows to delete the entity @@ -66,24 +62,25 @@ in `mycube.entities` module (or in a submodule if we want to split code among multiple files) so that it will be available on both server and client side. -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 class `AnyEntity` is a sub-class of Entity that add methods to it, +and helps specializing (by further subclassing) the handling of a +given entity type. -The methods defined for `AnyEntity` or `Entity` are the following ones: +The methods defined for `AnyEntity`, in addition to `Entity`, are the +following ones: :Standard meta-data (Dublin Core): - * `dc_title()`, returns a unicode string corresponding to the meta-data - `Title` (used by default the first attribute non-meta of the entity - schema) + * `dc_title()`, returns a unicode string corresponding to the + meta-data `Title` (used by default is the first non-meta attribute + of the entity schema) * `dc_long_title()`, same as dc_title but can return a more - detailled title + detailed title * `dc_description(format='text/plain')`, returns a unicode string - corresponding to the meta-data `Description` (look for a description - attribute by default) + corresponding to the meta-data `Description` (looks for a + description attribute by default) * `dc_authors()`, returns a unicode string corresponding to the meta-data `Authors` (owners by default) diff -r 6536ee4f37f7 -r 4f53eb3f1331 doc/book/en/intro/concepts/index.rst --- a/doc/book/en/intro/concepts/index.rst Wed Sep 16 16:52:47 2009 +0200 +++ b/doc/book/en/intro/concepts/index.rst Thu Sep 17 12:11:39 2009 +0200 @@ -243,6 +243,10 @@ ** *CubicWeb* is data driven ** +The view system is loosely coupled to data through a selection +system. Views are, in essence, defined by an id, a selection predicate +and an entry point (generaly producing html). + XXX feed me.