doc/book/en/B1030-form-management.en.txt
changeset 466 bef394c66f10
parent 301 e47150482ac1
equal deleted inserted replaced
465:1158231e7360 466:bef394c66f10
    11 * forms ``edition`` and ``creation``
    11 * forms ``edition`` and ``creation``
    12 
    12 
    13 The form generated by default does not fit your needs? You are not
    13 The form generated by default does not fit your needs? You are not
    14 required to re-do all by hands! :)
    14 required to re-do all by hands! :)
    15 
    15 
    16 * rtags primary, secondary, generated, generic, 
    16 * rtags primary, secondary, generated, generic,
    17   `Entity.relation_category(rtype, x='subject')`
    17   `Entity.relation_category(rtype, x='subject')`
    18 * inline_view (now a rtag?)
    18 * inline_view (now a rtag?)
    19 * widget specification
    19 * widget specification
    20 
    20 
    21 Editing controller behavior by default (id: `edit`)
    21 Editing controller behavior by default (id: `edit`)
    34 
    34 
    35 1. Retrieval of entities to edit by looking for the forms parameters
    35 1. Retrieval of entities to edit by looking for the forms parameters
    36    starting by `eid:` and also having a parameter `__type` associated
    36    starting by `eid:` and also having a parameter `__type` associated
    37    (also *qualified* by eid)
    37    (also *qualified* by eid)
    38 
    38 
    39 2. For all the attributes and the relations of an entity to edit: 
    39 2. For all the attributes and the relations of an entity to edit:
    40    
    40 
    41    1. search for a parameter `edits-<relation name>` or `edito-<relation name>`
    41    1. search for a parameter `edits-<relation name>` or `edito-<relation name>`
    42       qualified in the case of a relation where the entity is object
    42       qualified in the case of a relation where the entity is object
    43    2. if found, the value returned is considered as the initial value
    43    2. if found, the value returned is considered as the initial value
    44       for this relaiton and we then look for the new value(s)  in the parameter
    44       for this relaiton and we then look for the new value(s)  in the parameter
    45       <relation name> (qualified)
    45       <relation name> (qualified)
    48 
    48 
    49 3. For each entity to edit:
    49 3. For each entity to edit:
    50 
    50 
    51    1. if a qualified parameter `__linkto` is specified, its value has to be
    51    1. if a qualified parameter `__linkto` is specified, its value has to be
    52       a string (or a list of string) such as: ::
    52       a string (or a list of string) such as: ::
    53         
    53 
    54         <relation type>:<eids>:<target>
    54         <relation type>:<eids>:<target>
    55       
    55 
    56       where <target> is either `subject` or `object` and each eid could be
    56       where <target> is either `subject` or `object` and each eid could be
    57       separated from the others by a `_`. Target specifies if the *edited entity*
    57       separated from the others by a `_`. Target specifies if the *edited entity*
    58       is subject or object of the relation and each relation specified will
    58       is subject or object of the relation and each relation specified will
    59       be inserted.
    59       be inserted.
    60 
    60 
    61     2. if a qualified parameter `__clone_eid` is specified for an entity, the
    61     2. if a qualified parameter `__clone_eid` is specified for an entity, the
    62        relations of the specified entity passed as value of this parameter are 
    62        relations of the specified entity passed as value of this parameter are
    63        copied on the edited entity.
    63        copied on the edited entity.
    64 
    64 
    65     3. if a qualified parameter `__delete` is specified, its value must be
    65     3. if a qualified parameter `__delete` is specified, its value must be
    66        a string or a list of string such as follows: ::
    66        a string or a list of string such as follows: ::
    67           
    67 
    68           <ssubjects eids>:<relation type>:<objects eids>
    68           <ssubjects eids>:<relation type>:<objects eids>
    69 
    69 
    70        where each eid subject or object can be seperated from the other 
    70        where each eid subject or object can be seperated from the other
    71        by `_`. Each relation specified will be deleted.
    71        by `_`. Each relation specified will be deleted.
    72 
    72 
    73     4. if a qualified parameter `__insert` is specified, its value should
    73     4. if a qualified parameter `__insert` is specified, its value should
    74        follow the same pattern as `__delete`, but each relation specified is
    74        follow the same pattern as `__delete`, but each relation specified is
    75        inserted.
    75        inserted.
    82    and `eid`, this one is interpreted by using the value specified for `eid`
    82    and `eid`, this one is interpreted by using the value specified for `eid`
    83    to designate the entity on which to add the relations.
    83    to designate the entity on which to add the relations.
    84 
    84 
    85 
    85 
    86 .. note::
    86 .. note::
    87    
    87 
    88    * If the parameter `__action_delete` is found, all the entities specified
    88    * If the parameter `__action_delete` is found, all the entities specified
    89      as to be edited will be deleted.
    89      as to be edited will be deleted.
    90    
    90 
    91    * If the parameter`__action_cancel` is found, no action is completed.
    91    * If the parameter`__action_cancel` is found, no action is completed.
    92 
    92 
    93    * If the parameter `__action_apply` is found, the editing is applied 
    93    * If the parameter `__action_apply` is found, the editing is applied
    94      normally but the redirection is done on the form 
    94      normally but the redirection is done on the form
    95      (see :ref:`RedirectionControl`).
    95      (see :ref:`RedirectionControl`).
    96 
    96 
    97    * The parameter `__method` is also supported as for the main template
    97    * The parameter `__method` is also supported as for the main template
    98      (XXX not very consistent, maybe __method should be dealed in the view
    98      (XXX not very consistent, maybe __method should be dealed in the view
    99      controller).
    99      controller).
   118 * `__redirectpath`: path of the URL (relative to the root URL of the site,
   118 * `__redirectpath`: path of the URL (relative to the root URL of the site,
   119   no form parameters
   119   no form parameters
   120 
   120 
   121 * `__redirectparams`: forms parameters to add to the path
   121 * `__redirectparams`: forms parameters to add to the path
   122 
   122 
   123 * `__redirectrql`: redirection RQL request 
   123 * `__redirectrql`: redirection RQL request
   124 
   124 
   125 * `__redirectvid`: redirection view identifier
   125 * `__redirectvid`: redirection view identifier
   126 
   126 
   127 * `__errorurl`: initial form URL, used for redirecting in case a validation
   127 * `__errorurl`: initial form URL, used for redirecting in case a validation
   128   error is raised during editing. If this one is not specified, an error page
   128   error is raised during editing. If this one is not specified, an error page
   130   responsible for displaying the errors)
   130   responsible for displaying the errors)
   131 
   131 
   132 * `__form_id`: initial view form identifier, used if `__action_apply` is
   132 * `__form_id`: initial view form identifier, used if `__action_apply` is
   133   found
   133   found
   134 
   134 
   135 In general we use either `__redirectpath` and `__redirectparams` or 
   135 In general we use either `__redirectpath` and `__redirectparams` or
   136 `__redirectrql` and `__redirectvid`.
   136 `__redirectrql` and `__redirectvid`.
   137 
   137