doc/book/en/B1022-views-stdlib.en.txt
changeset 316 99943acb44af
parent 308 73a352526577
child 1280 ebf1d748ed5a
equal deleted inserted replaced
315:210f99896a5b 316:99943acb44af
       
     1 .. -*- coding: utf-8 -*-
       
     2 
       
     3 Predefined views in the library
       
     4 ```````````````````````````````
       
     5 A certain number of views are used to build the web interface, which apply
       
     6 to one or more entities. Their identifier is what distinguish them from
       
     7 each others and the main ones are:
       
     8 
       
     9 *primary*
       
    10     Primary view of an entity, this is the view called by default when a single
       
    11     non final entity is in the result set and needs to be displayed. 
       
    12     This view is supposed to render a maximum of informations about the entity.
       
    13 
       
    14 *text*
       
    15     This is the simplest text view for an entity. It displays the 
       
    16     title of an entity. It should not contain HTML.
       
    17 
       
    18 *oneline*
       
    19     This is a hyper linked *text* view. Similar to the `secondary` view, 
       
    20     but called when we want the view to stand on a single line, or just 
       
    21     get a brief view. By default this view uses the
       
    22     parameter `MAX_LINE_CHAR` to control the result size.
       
    23 
       
    24 *secondary*
       
    25     This is a combinaison of an icon and a *oneline* view.
       
    26     By default it renders the two first attributes of the entity as a 
       
    27     clickable link redirecting to the primary view.
       
    28 
       
    29 *incontext, outofcontext*
       
    30     Similar to the `secondary` view, but called when an entity is considered
       
    31     as in or out of context. By default it respectively returns the result of 
       
    32     `textincontext` and `textoutofcontext` wrapped in a link leading to 
       
    33     the primary view of the entity.
       
    34 
       
    35 *textincontext, textoutofcontext*
       
    36     Similar to the `text` view, but called when an entity is considered out or
       
    37     in context. By default it returns respectively the result of the 
       
    38     methods `.dc_title` and `.dc_long_title` of the entity.
       
    39 
       
    40 *list*
       
    41     This view displays a list of entities by creating a HTML list (`<ul>`) 
       
    42     and call the view `listitem` for each entity of the result set.
       
    43 
       
    44 *listitem*
       
    45     This view redirects by default to the `outofcontext` view.
       
    46 
       
    47 *rss*
       
    48     Creates a RSS/XML view and call the view `rssitem` for each entity of
       
    49     the result set.
       
    50 
       
    51 *rssitem*
       
    52     Create a RSS/XML view for each entity based on the results of the dublin core
       
    53     methods of the entity (`dc_*`)
       
    54 
       
    55 *sidebox*
       
    56   This view displays usually a side box of some related entities 
       
    57   in a primary view.
       
    58 
       
    59 Start view:
       
    60 
       
    61 *index*
       
    62     This view defines the home page of your application. It does not require
       
    63     a result set to apply to.
       
    64 
       
    65 *schema*
       
    66     A view dedicated to the display of the schema of the application
       
    67 
       
    68 Special views:
       
    69 
       
    70 *noresult*
       
    71     This view is the default view used when no result has been found
       
    72     (e.g. empty result set).
       
    73 
       
    74 *final*
       
    75     Display the value of a cell without trasnformation (in case of a non final
       
    76     entity, we see the eid). Applicable on any result set.
       
    77 
       
    78 *table*
       
    79     Creates a HTML table (`<table>`) and call the view `cell` for each cell of
       
    80     the result set. Applicable on any result set.
       
    81 
       
    82 *cell*
       
    83     By default redirects to the `final` view if this is a final entity or
       
    84     `outofcontext` view otherwise
       
    85 
       
    86 *null*
       
    87     This view is the default view used when nothing needs to be rendered.
       
    88     It is always applicable and it does not return anything