doc/book/en/devweb/views/xmlrss.rst
branchstable
changeset 5394 105011657405
parent 5312 d2dbba898a96
child 8032 bcb87336c7d2
equal deleted inserted replaced
5393:875bdc0fe8ce 5394:105011657405
       
     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    Any X ORDERBY D WHERE X is BlogEntry, X creation_date D
       
    26 
       
    27 and you get a list of blog entries.
       
    28 
       
    29 Click on your login at the top right corner. Chose "user preferences",
       
    30 then "boxes", then "possible views box" and check "visible = yes"
       
    31 before validating your changes.
       
    32 
       
    33 Enter the same query in the search box and you will see the same list,
       
    34 plus a box titled "possible views" in the left column. Click on
       
    35 "entityview", then "RSS".
       
    36 
       
    37 You just applied the "RSS" view to the RQL selection you requested.
       
    38 
       
    39 That's it, you have a RSS channel for your blog.
       
    40 
       
    41 Try again with::
       
    42 
       
    43     Any X ORDERBY D WHERE X is BlogEntry, X creation_date D,
       
    44     X entry_of B, B title "MyLife"
       
    45 
       
    46 Another RSS channel, but a bit more focused.
       
    47 
       
    48 A last one for the road::
       
    49 
       
    50     Any C ORDERBY D WHERE C is Comment, C creation_date D LIMIT 15
       
    51 
       
    52 displayed with the RSS view, that's a channel for the last fifteen
       
    53 comments posted.
       
    54 
       
    55 [WRITE ME]
       
    56 
       
    57 * show that the RSS view can be used to display an ordered selection
       
    58   of blog entries, thus providing a RSS channel
       
    59 
       
    60 * show that a different selection (by category) means a different channel