doc/book/en/devweb/views/xmlrss.rst
changeset 10491 c67bcee93248
parent 10490 76ab3c71aff2
child 10492 68c13e0c0fc5
equal deleted inserted replaced
10490:76ab3c71aff2 10491:c67bcee93248
     1 .. _XmlAndRss:
       
     2 
       
     3 XML and RSS views
       
     4 -----------------
       
     5 
       
     6 (:mod:`cubicweb.web.views.xmlrss`)
       
     7 
       
     8 Overview
       
     9 +++++++++
       
    10 
       
    11 *rss*
       
    12     Creates a RSS/XML view and call the view `rssitem` for each entity of
       
    13     the result set.
       
    14 
       
    15 *rssitem*
       
    16     Create a RSS/XML view for each entity based on the results of the dublin core
       
    17     methods of the entity (`dc_*`)
       
    18 
       
    19 RSS Channel Example
       
    20 ++++++++++++++++++++
       
    21 
       
    22 Assuming you have several blog entries, click on the title of the
       
    23 search box in the left column. A larger search box should appear. Enter:
       
    24 
       
    25 .. sourcecode:: sql
       
    26 
       
    27    Any X ORDERBY D WHERE X is BlogEntry, X creation_date D
       
    28 
       
    29 and you get a list of blog entries.
       
    30 
       
    31 Click on your login at the top right corner. Chose "user preferences",
       
    32 then "boxes", then "possible views box" and check "visible = yes"
       
    33 before validating your changes.
       
    34 
       
    35 Enter the same query in the search box and you will see the same list,
       
    36 plus a box titled "possible views" in the left column. Click on
       
    37 "entityview", then "RSS".
       
    38 
       
    39 You just applied the "RSS" view to the RQL selection you requested.
       
    40 
       
    41 That's it, you have a RSS channel for your blog.
       
    42 
       
    43 Try again with:
       
    44 
       
    45 .. sourcecode:: sql
       
    46 
       
    47     Any X ORDERBY D WHERE X is BlogEntry, X creation_date D,
       
    48     X entry_of B, B title "MyLife"
       
    49 
       
    50 Another RSS channel, but a bit more focused.
       
    51 
       
    52 A last one for the road:
       
    53 
       
    54 .. sourcecode:: sql
       
    55 
       
    56     Any C ORDERBY D WHERE C is Comment, C creation_date D LIMIT 15
       
    57 
       
    58 displayed with the RSS view, that's a channel for the last fifteen
       
    59 comments posted.
       
    60 
       
    61 [WRITE ME]
       
    62 
       
    63 * show that the RSS view can be used to display an ordered selection
       
    64   of blog entries, thus providing a RSS channel
       
    65 
       
    66 * show that a different selection (by category) means a different channel