web/views/xmlrss.py
changeset 6141 b8287e54b528
parent 6140 65a619eb31c4
child 6142 8bc6eac1fac1
equal deleted inserted replaced
6140:65a619eb31c4 6141:b8287e54b528
    27 from cubicweb.selectors import (is_instance, non_final_entity, one_line_rset,
    27 from cubicweb.selectors import (is_instance, non_final_entity, one_line_rset,
    28                                 appobject_selectable, adaptable)
    28                                 appobject_selectable, adaptable)
    29 from cubicweb.view import EntityView, EntityAdapter, AnyRsetView, Component
    29 from cubicweb.view import EntityView, EntityAdapter, AnyRsetView, Component
    30 from cubicweb.view import implements_adapter_compat
    30 from cubicweb.view import implements_adapter_compat
    31 from cubicweb.uilib import simple_sgml_tag
    31 from cubicweb.uilib import simple_sgml_tag
    32 from cubicweb.web import httpcache, box
    32 from cubicweb.web import httpcache, component
    33 
    33 
    34 
    34 
    35 # base xml views ##############################################################
    35 # base xml views ##############################################################
    36 
    36 
    37 class XMLView(EntityView):
    37 class XMLView(EntityView):
   146     def feed_url(self):
   146     def feed_url(self):
   147         entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
   147         entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
   148         return entity.cw_adapt_to('IFeed').rss_feed_url()
   148         return entity.cw_adapt_to('IFeed').rss_feed_url()
   149 
   149 
   150 
   150 
   151 class RSSIconBox(box.Box):
   151 class RSSIconBox(component.CtxComponent):
   152     """just display the RSS icon on uniform result set"""
   152     """just display the RSS icon on uniform result set"""
   153     __regid__ = 'rss'
   153     __regid__ = 'rss'
   154     __select__ = (box.Box.__select__
   154     __select__ = (component.CtxComponent.__select__
   155                   & appobject_selectable('components', 'rss_feed_url'))
   155                   & appobject_selectable('components', 'rss_feed_url'))
   156 
   156 
   157     visible = False
   157     visible = False
   158     order = 999
   158     order = 999
   159 
   159