doc/book/devweb/views/xmlrss.rst
author Philippe Pepiot <ph@itsalwaysdns.eu>
Tue, 31 Mar 2020 18:22:05 +0200
changeset 12966 6cd938c29ca3
parent 10491 c67bcee93248
permissions -rw-r--r--
[server] Make connection pooler configurable and set better default values Drop the configuration connections-pool-size and add new configurations options: * connections-pool-min-size. Set to 0 by default so we open connections only when needed. This avoid opening min-size*processes connections at startup, which is, it think, a good default. * connections-pool-max-size. Set to 0 (unlimited) by default, so we move the bottleneck to postgresql. * connections-idle-timeout. Set to 10 minutes. I don't have arguments about this except that this is the default in pgbouncer.

.. _XmlAndRss:

XML and RSS views
-----------------

(:mod:`cubicweb.web.views.xmlrss`)

Overview
+++++++++

*rss*
    Creates a RSS/XML view and call the view `rssitem` for each entity of
    the result set.

*rssitem*
    Create a RSS/XML view for each entity based on the results of the dublin core
    methods of the entity (`dc_*`)

RSS Channel Example
++++++++++++++++++++

Assuming you have several blog entries, click on the title of the
search box in the left column. A larger search box should appear. Enter:

.. sourcecode:: sql

   Any X ORDERBY D WHERE X is BlogEntry, X creation_date D

and you get a list of blog entries.

Click on your login at the top right corner. Chose "user preferences",
then "boxes", then "possible views box" and check "visible = yes"
before validating your changes.

Enter the same query in the search box and you will see the same list,
plus a box titled "possible views" in the left column. Click on
"entityview", then "RSS".

You just applied the "RSS" view to the RQL selection you requested.

That's it, you have a RSS channel for your blog.

Try again with:

.. sourcecode:: sql

    Any X ORDERBY D WHERE X is BlogEntry, X creation_date D,
    X entry_of B, B title "MyLife"

Another RSS channel, but a bit more focused.

A last one for the road:

.. sourcecode:: sql

    Any C ORDERBY D WHERE C is Comment, C creation_date D LIMIT 15

displayed with the RSS view, that's a channel for the last fifteen
comments posted.

[WRITE ME]

* show that the RSS view can be used to display an ordered selection
  of blog entries, thus providing a RSS channel

* show that a different selection (by category) means a different channel