equal
deleted
inserted
replaced
1 """xbel views |
1 """xbel views |
2 |
2 |
3 :organization: Logilab |
3 :organization: Logilab |
4 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 """ |
6 """ |
7 __docformat__ = "restructuredtext en" |
7 __docformat__ = "restructuredtext en" |
8 _ = unicode |
8 _ = unicode |
9 |
9 |
10 from logilab.mtconverter import html_escape |
10 from logilab.mtconverter import html_escape |
11 |
11 |
12 from cubicweb.selectors import implements |
12 from cubicweb.selectors import implements |
13 from cubicweb.web.views.baseviews import XmlView, EntityView |
13 from cubicweb.view import EntityView |
|
14 from cubicweb.web.views.xmlrss import XmlView |
14 |
15 |
15 |
16 |
16 class XbelView(XmlView): |
17 class XbelView(XmlView): |
17 id = 'xbel' |
18 id = 'xbel' |
18 title = _('xbel') |
19 title = _('xbel') |
44 self.w(u' <title>%s</title>' % html_escape(entity.dc_title())) |
45 self.w(u' <title>%s</title>' % html_escape(entity.dc_title())) |
45 self.w(u'</bookmark>') |
46 self.w(u'</bookmark>') |
46 |
47 |
47 def url(self, entity): |
48 def url(self, entity): |
48 return entity.absolute_url() |
49 return entity.absolute_url() |
|
50 |
49 |
51 |
50 class XbelItemBookmarkView(XbelItemView): |
52 class XbelItemBookmarkView(XbelItemView): |
51 __select__ = implements('Bookmark') |
53 __select__ = implements('Bookmark') |
52 |
54 |
53 def url(self, entity): |
55 def url(self, entity): |