From cf9abb6f419c407ad53036d24c36b50105adeeff Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 22 Sep 2010 12:37:43 +0200 Subject: [PATCH] opds: added search, moved to separate app --- apps/catalogue/urls.py | 8 - apps/catalogue/views.py | 4 + apps/opds/__init__.py | 0 apps/opds/urls.py | 16 ++ apps/{catalogue/feeds.py => opds/views.py} | 235 ++++++--------------- lib/basicauth.py | 100 +++++++++ scripts/fbreader.xml | 65 ++++++ wolnelektury/settings.py | 1 + wolnelektury/static/opensearch.xml | 12 ++ wolnelektury/urls.py | 1 + 10 files changed, 264 insertions(+), 178 deletions(-) create mode 100644 apps/opds/__init__.py create mode 100644 apps/opds/urls.py rename apps/{catalogue/feeds.py => opds/views.py} (63%) create mode 100644 lib/basicauth.py create mode 100644 scripts/fbreader.xml create mode 100644 wolnelektury/static/opensearch.xml diff --git a/apps/catalogue/urls.py b/apps/catalogue/urls.py index 53a70c3de..70d5fd8e4 100644 --- a/apps/catalogue/urls.py +++ b/apps/catalogue/urls.py @@ -3,7 +3,6 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.conf.urls.defaults import * -from catalogue.feeds import RootFeed, ByCategoryFeed, ByTagFeed, UserFeed, UserSetFeed urlpatterns = patterns('catalogue.views', @@ -23,13 +22,6 @@ urlpatterns = patterns('catalogue.views', # tools url(r'^zegar', 'clock', name='clock'), - # OPDS interface - url(r'^opds/$', RootFeed(), name="opds_authors"), - url(r'^opds/user/$', UserFeed(), name="opds_user"), - url(r'^opds/set/(?P[a-zA-Z0-9-]+)/$', UserSetFeed(), name="opds_user_set"), - url(r'^opds/(?P[a-zA-Z0-9-]+)/$', ByCategoryFeed(), name="opds_by_category"), - url(r'^opds/(?P[a-zA-Z0-9-]+)/(?P[a-zA-Z0-9-]+)/$', ByTagFeed(), name="opds_by_tag"), - # Public interface. Do not change this URLs. url(r'^lektura/(?P[a-zA-Z0-9-]+)\.html$', 'book_text', name='book_text'), url(r'^lektura/(?P[a-zA-Z0-9-]+)/$', 'book_detail', name='book_detail'), diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index d74ca7544..1180ab2fd 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -359,6 +359,10 @@ def _get_result_type(match): return type +def books_starting_with(prefix): + prefix = prefix.lower() + return models.Book.objects.filter(_word_starts_with('title', prefix)) + def find_best_matches(query, user=None): """ Finds a Book, Tag or Bookstub best matching a query. diff --git a/apps/opds/__init__.py b/apps/opds/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/opds/urls.py b/apps/opds/urls.py new file mode 100644 index 000000000..1a316b6be --- /dev/null +++ b/apps/opds/urls.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from django.conf.urls.defaults import * +from opds.views import RootFeed, ByCategoryFeed, ByTagFeed, UserFeed, UserSetFeed, SearchFeed + + +urlpatterns = patterns('opds.views', + url(r'^$', RootFeed(), name="opds_authors"), + url(r'^search/$', SearchFeed(), name="opds_search"), + url(r'^user/$', UserFeed(), name="opds_user"), + url(r'^set/(?P[a-zA-Z0-9-]+)/$', UserSetFeed(), name="opds_user_set"), + url(r'^(?P[a-zA-Z0-9-]+)/$', ByCategoryFeed(), name="opds_by_category"), + url(r'^(?P[a-zA-Z0-9-]+)/(?P[a-zA-Z0-9-]+)/$', ByTagFeed(), name="opds_by_tag"), +) diff --git a/apps/catalogue/feeds.py b/apps/opds/views.py similarity index 63% rename from apps/catalogue/feeds.py rename to apps/opds/views.py index 886966836..a51b5b187 100644 --- a/apps/catalogue/feeds.py +++ b/apps/opds/views.py @@ -2,96 +2,6 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # - -############################################################################# -# from: http://djangosnippets.org/snippets/243/ - -import base64 - -from django.http import HttpResponse -from django.contrib.auth import authenticate, login - -# -def view_or_basicauth(view, request, test_func, realm = "", *args, **kwargs): - """ - This is a helper function used by 'logged_in_or_basicauth' and - 'has_perm_or_basicauth' (deleted) that does the nitty of determining if they - are already logged in or if they have provided proper http-authorization - and returning the view if all goes well, otherwise responding with a 401. - """ - if test_func(request.user): - # Already logged in, just return the view. - # - return view(request, *args, **kwargs) - - # They are not logged in. See if they provided login credentials - # - if 'HTTP_AUTHORIZATION' in request.META: - auth = request.META['HTTP_AUTHORIZATION'].split() - if len(auth) == 2: - # NOTE: We are only support basic authentication for now. - # - if auth[0].lower() == "basic": - uname, passwd = base64.b64decode(auth[1]).split(':') - user = authenticate(username=uname, password=passwd) - if user is not None: - if user.is_active: - login(request, user) - request.user = user - return view(request, *args, **kwargs) - - # Either they did not provide an authorization header or - # something in the authorization attempt failed. Send a 401 - # back to them to ask them to authenticate. - # - response = HttpResponse() - response.status_code = 401 - response['WWW-Authenticate'] = 'Basic realm="%s"' % realm - return response - - -# -def logged_in_or_basicauth(realm = ""): - """ - A simple decorator that requires a user to be logged in. If they are not - logged in the request is examined for a 'authorization' header. - - If the header is present it is tested for basic authentication and - the user is logged in with the provided credentials. - - If the header is not present a http 401 is sent back to the - requestor to provide credentials. - - The purpose of this is that in several django projects I have needed - several specific views that need to support basic authentication, yet the - web site as a whole used django's provided authentication. - - The uses for this are for urls that are access programmatically such as - by rss feed readers, yet the view requires a user to be logged in. Many rss - readers support supplying the authentication credentials via http basic - auth (and they do NOT support a redirect to a form where they post a - username/password.) - - Use is simple: - - @logged_in_or_basicauth - def your_view: - ... - - You can provide the name of the realm to ask for authentication within. - """ - def view_decorator(func): - def wrapper(request, *args, **kwargs): - return view_or_basicauth(func, request, - lambda u: u.is_authenticated(), - realm, *args, **kwargs) - return wrapper - return view_decorator - - -############################################################################# - - from base64 import b64encode import os.path @@ -103,7 +13,9 @@ from django.conf import settings from django.http import Http404 from django.contrib.sites.models import Site +from basicauth import logged_in_or_basicauth, factory_decorator from catalogue.models import Book, Tag +from catalogue.views import books_starting_with _root_feeds = ( @@ -145,36 +57,37 @@ _root_feeds = ( ) -def factory_decorator(decorator): - """ generates a decorator for a function factory class - if A(*) == f, factory_decorator(D)(A)(*) == D(f) - """ - def fac_dec(func): - def wrapper(*args, **kwargs): - return decorator(func(*args, **kwargs)) - return wrapper - return fac_dec +def full_url(url): + return "http://%s%s" % (Site.objects.get_current().domain, url) class OPDSFeed(Atom1Feed): link_rel = u"subsection" link_type = u"application/atom+xml" - _book_parent_img = "http://%s%s" % (Site.objects.get_current().domain, os.path.join(settings.STATIC_URL, "img/book-parent.png")) + _book_parent_img = full_url(os.path.join(settings.STATIC_URL, "img/book-parent.png")) try: _book_parent_img_size = unicode(os.path.getsize(os.path.join(settings.STATIC_ROOT, "img/book-parent.png"))) except: _book_parent_img_size = '' - _book_img = "http://%s%s" % (Site.objects.get_current().domain, os.path.join(settings.STATIC_URL, "img/book.png")) + _book_img = full_url(os.path.join(settings.STATIC_URL, "img/book.png")) try: _book_img_size = unicode(os.path.getsize(os.path.join(settings.STATIC_ROOT, "img/book.png"))) except: _book_img_size = '' + def add_root_elements(self, handler): super(OPDSFeed, self).add_root_elements(handler) - handler.addQuickElement(u"link", u"", {u"href": reverse("opds_authors"), u"rel": u"start", u"type": u"application/atom+xml"}) + handler.addQuickElement(u"link", None, + {u"href": reverse("opds_authors"), + u"rel": u"start", + u"type": u"application/atom+xml"}) + handler.addQuickElement(u"link", None, + {u"href": full_url(os.path.join(settings.STATIC_URL, "opensearch.xml")), + u"rel": u"search", + u"type": u"application/opensearchdescription+xml"}) def add_item_elements(self, handler, item): @@ -238,6 +151,41 @@ class OPDSFeed(Atom1Feed): handler.addQuickElement(u"rights", item['item_copyright']) +class AcquisitionFeed(Feed): + feed_type = OPDSFeed + link = u'http://www.wolnelektury.pl/' + item_enclosure_mime_type = "application/epub+zip" + author_name = u"Wolne Lektury" + author_link = u"http://www.wolnelektury.pl/" + + def item_title(self, book): + return book.title + + def item_description(self): + return u'' + + def item_link(self, book): + return book.get_absolute_url() + + def item_author_name(self, book): + try: + return book.tags.filter(category='author')[0].name + except KeyError: + return u'' + + def item_author_link(self, book): + try: + return book.tags.filter(category='author')[0].get_absolute_url() + except KeyError: + return u'' + + def item_enclosure_url(self, book): + return full_url(book.root_ancestor.epub_file.url) + + def item_enclosure_length(self, book): + return book.root_ancestor.epub_file.size + + class RootFeed(Feed): feed_type = OPDSFeed title = u'Wolne Lektury' @@ -291,13 +239,7 @@ class ByCategoryFeed(Feed): return u'' -class ByTagFeed(Feed): - feed_type = OPDSFeed - link = u'http://www.wolnelektury.pl/' - item_enclosure_mime_type = "application/epub+zip" - author_name = u"Wolne Lektury" - author_link = u"http://www.wolnelektury.pl/" - +class ByTagFeed(AcquisitionFeed): def link(self, tag): return tag.get_absolute_url() @@ -319,33 +261,6 @@ class ByTagFeed(Feed): return books - def item_title(self, book): - return book.title - - def item_description(self): - return u'' - - def item_link(self, book): - return book.get_absolute_url() - - def item_author_name(self, book): - try: - return book.tags.filter(category='author')[0].name - except KeyError: - return u'' - - def item_author_link(self, book): - try: - return book.tags.filter(category='author')[0].get_absolute_url() - except KeyError: - return u'' - - def item_enclosure_url(self, book): - return "http://%s%s" % (Site.objects.get_current().domain, book.root_ancestor.epub_file.url) - - def item_enclosure_length(self, book): - return book.root_ancestor.epub_file.size - @factory_decorator(logged_in_or_basicauth()) class UserFeed(Feed): @@ -375,13 +290,7 @@ class UserFeed(Feed): @factory_decorator(logged_in_or_basicauth()) -class UserSetFeed(Feed): - feed_type = OPDSFeed - link = u'http://www.wolnelektury.pl/' - item_enclosure_mime_type = "application/epub+zip" - author_name = u"Wolne Lektury" - author_link = u"http://www.wolnelektury.pl/" - +class UserSetFeed(AcquisitionFeed): def link(self, tag): return tag.get_absolute_url() @@ -397,34 +306,20 @@ class UserSetFeed(Feed): def items(self, tag): return Book.tagged.with_any([tag]) - def item_title(self, book): - return book.title - def item_description(self): - return u'' +class SearchFeed(AcquisitionFeed): + description = u"Wyniki wyszukiwania na stronie WolneLektury.pl" + title = u"Wyniki wyszukiwania" + + def get_object(self, request): + return request.GET.get('q', '') - def item_link(self, book): - return book.get_absolute_url() + def get_link(self, query): + return "%s?q=%s" % (reverse('search'), query) - def item_author_name(self, book): + def items(self, query): try: - return book.tags.filter(category='author')[0].name - except KeyError: - return u'' - - def item_author_link(self, book): - try: - return book.tags.filter(category='author')[0].get_absolute_url() - except KeyError: - return u'' - - def item_enclosure_url(self, book): - return "http://%s%s" % (Site.objects.get_current().domain, book.root_ancestor.epub_file.url) - - def item_enclosure_length(self, book): - return book.root_ancestor.epub_file.size - -@logged_in_or_basicauth() -def user_set_feed(request): - return UserSetFeed()(request) - + return books_starting_with(query) + except ValueError: + # too short a query + return [] diff --git a/lib/basicauth.py b/lib/basicauth.py new file mode 100644 index 000000000..befcc6fe7 --- /dev/null +++ b/lib/basicauth.py @@ -0,0 +1,100 @@ +############################################################################# +# from http://djangosnippets.org/snippets/243/ + +from functools import wraps +import base64 + +from django.http import HttpResponse +from django.contrib.auth import authenticate, login + +# +def view_or_basicauth(view, request, test_func, realm = "", *args, **kwargs): + """ + This is a helper function used by 'logged_in_or_basicauth' and + 'has_perm_or_basicauth' (deleted) that does the nitty of determining if they + are already logged in or if they have provided proper http-authorization + and returning the view if all goes well, otherwise responding with a 401. + """ + if test_func(request.user): + # Already logged in, just return the view. + # + return view(request, *args, **kwargs) + + # They are not logged in. See if they provided login credentials + # + if 'HTTP_AUTHORIZATION' in request.META: + auth = request.META['HTTP_AUTHORIZATION'].split() + if len(auth) == 2: + # NOTE: We are only support basic authentication for now. + # + if auth[0].lower() == "basic": + uname, passwd = base64.b64decode(auth[1]).split(':') + user = authenticate(username=uname, password=passwd) + if user is not None: + if user.is_active: + login(request, user) + request.user = user + return view(request, *args, **kwargs) + + # Either they did not provide an authorization header or + # something in the authorization attempt failed. Send a 401 + # back to them to ask them to authenticate. + # + response = HttpResponse() + response.status_code = 401 + response['WWW-Authenticate'] = 'Basic realm="%s"' % realm + return response + + +# +def logged_in_or_basicauth(realm = ""): + """ + A simple decorator that requires a user to be logged in. If they are not + logged in the request is examined for a 'authorization' header. + + If the header is present it is tested for basic authentication and + the user is logged in with the provided credentials. + + If the header is not present a http 401 is sent back to the + requestor to provide credentials. + + The purpose of this is that in several django projects I have needed + several specific views that need to support basic authentication, yet the + web site as a whole used django's provided authentication. + + The uses for this are for urls that are access programmatically such as + by rss feed readers, yet the view requires a user to be logged in. Many rss + readers support supplying the authentication credentials via http basic + auth (and they do NOT support a redirect to a form where they post a + username/password.) + + Use is simple: + + @logged_in_or_basicauth + def your_view: + ... + + You can provide the name of the realm to ask for authentication within. + """ + def view_decorator(func): + def wrapper(request, *args, **kwargs): + return view_or_basicauth(func, request, + lambda u: u.is_authenticated(), + realm, *args, **kwargs) + return wrapper + return view_decorator + + +############################################################################# + + +def factory_decorator(decorator): + """ generates a decorator for a function factory class + if A(*) == f, factory_decorator(D)(A)(*) == D(f) + """ + def fac_dec(func): + @wraps(func) + def wrapper(*args, **kwargs): + return decorator(func(*args, **kwargs)) + return wrapper + return fac_dec diff --git a/scripts/fbreader.xml b/scripts/fbreader.xml new file mode 100644 index 000000000..69652b335 --- /dev/null +++ b/scripts/fbreader.xml @@ -0,0 +1,65 @@ + + + + + WolneLektury.pl + Wolne Lektury + Szkolna biblioteka internetowa + http://www.wolnelektury.pl/opds/ + http://www.wolnelektury.pl/opds/search/?q=%s + http://www.wolnelektury.pl/opds/user/ + http://www.wolnelektury.pl/uzytkownicy/wyloguj/?next=/opds/ + + http://www.wolnelektury.pl/opds/user/ + + + data:image/png;base64, +iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAADAFBMVEX////////////////////+ +///+///+//////7///////////////////7+///+///////+///+///+///9/v79/v79/v79/v3+ +/v3+/vv+/vv9/v3+/vz9/v39/fz9/fz9/fn9/fr9/fz+/f3+/v3+/f39/fz8/Pz7/Pv7/Pv7+/v6 ++/r5+vr4+vn2+fj2+fj7+fD3+Pb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nV9EiwfuDa/ZFEkGZPKW6wWQCHUG/Ii+jtSL3KvLq8AlP3jt1N3B5G +nNc0dOfOUNNcUrHT+AygiKK3N/V8cnIiSYVXz1PH7pYdTG/CHMTSxGj6aqI+jzbOLCCHrF9mPjy5 +FFLI58OPHzs3pdfy0YvEhVzl7RoaSx9DNQtQmPzzw9MLIY8OpjyQemUufZTAxMNvqbk6PASvnUU1 +2weFqfe9ihaR0hscfK9TkD86hKvuDNBPJP5cDyZulc6Kjxnznz3h4KYtZVACkPzYAXj2xpc4fKNM +64fUhKW3CTyjJQxNXsZc3XqDBKCePHbmYnu6iZ72rOC4C4ev5c+Iz4XnP3XSFrQ5zoHOyTPgweDY +AJZdH55aMwr3Uc1UFkAtmXjphazIDYU33yzW0YdHF+LgWHAqBFt4/exUBIPjkjf3dA20qjzgfX0T +lVPhkfQ+PEiPzRyUnRS3taSwM5NEN6d5oDwwOdlrL5zg2DAGbw0SwLADt6fX2qeYg3vw3F8d4Pbk +0pbzkpRe+mh9kcuB20uJU5luHkAOrrqfIDCzI9x7s1ivOLOD2v30fKfmBm5sf9BOnBJlJA8Sn8i7 +NoR6JhwCvC/HwRtKpp59fDeezIccPR3kpunB77h09OGtKyQkXfvBGwt1Eg4Fobfjl1+8z7ybOBei +MyjXTp+ClCWC6AruGriafnh1MNGUd4SSyAF0zMUzmcm3E6neJXRK5UxbA7NXqE54Xn3i4o1H6bGR +hwndCYcLQheSS1RW5TNjMi36bDehrP7YwMh9W1p07NKyAO6mvOhgBpgyN5iTZe8MTCh7QufV28qi +mXblamMDyB2D2esFzFwyuL4OqOxdxz6B6EetOjS48V8XGcTpvfQ3xOgk7scU/ZYAAAAASUVORK5C +YII= + + \ No newline at end of file diff --git a/wolnelektury/settings.py b/wolnelektury/settings.py index 0efb14531..a8bb82dd2 100644 --- a/wolnelektury/settings.py +++ b/wolnelektury/settings.py @@ -137,6 +137,7 @@ INSTALLED_APPS = [ 'infopages', 'suggest', 'lesmianator', + 'opds', ] CACHE_BACKEND = 'locmem:///?max_entries=3000' diff --git a/wolnelektury/static/opensearch.xml b/wolnelektury/static/opensearch.xml new file mode 100644 index 000000000..7a319f13b --- /dev/null +++ b/wolnelektury/static/opensearch.xml @@ -0,0 +1,12 @@ + + + Wolne Lektury + WolneLektury.pl, szkolna biblioteka internetowa. + lektury + Fundacja Nowoczesna Polska + pl + fundacja@nowoczesnapolska.org.pl + + + diff --git a/wolnelektury/urls.py b/wolnelektury/urls.py index a0b57b394..e3704f439 100644 --- a/wolnelektury/urls.py +++ b/wolnelektury/urls.py @@ -15,6 +15,7 @@ admin.autodiscover() urlpatterns = patterns('', url(r'^katalog/', include('catalogue.urls')), url(r'^materialy/', include('lessons.urls')), + url(r'^opds/', include('opds.urls')), url(r'^sugestia/', include('suggest.urls')), url(r'^lesmianator/?$', 'lesmianator.views.poem', name='lesmianator'), -- 2.20.1