2 __date__ ="$2009-09-17 16:16:54$"
4 from django.conf.urls.defaults import *
6 from api.resources import *
8 FORMAT_EXT = r"\.(?P<emitter_format>xml|json|yaml)$"
10 urlpatterns = patterns('',
11 # url(r'^hello$', hello_resource, {'emitter_format': 'json'}),
12 # url(r'^hello\.(?P<emitter_format>.+)$', hello_resource),
15 url(r'^toolbar/buttons$', toolbar_buttons, {'emitter_format': 'json'}),
18 url(r'^toolbar/scriptlets$', scriptlets, {'emitter_format': 'json'}),
21 url(r'^documents$', library_resource,
22 {'emitter_format': 'json'}, name="document_list_view"),
24 url(r'^documents'+FORMAT_EXT, library_resource,
25 name="document_list_view_withformat"),
27 url(r'^documents/(?P<docid>[^/]+)'+FORMAT_EXT,
28 document_resource, name="document_view_withformat"),
30 url(r'^documents/(?P<docid>[^/]+)$',
31 document_resource, {'emitter_format': 'json'},
32 name="document_view"),
34 url(r'^documents/(?P<docid>[^/]+)/text$',
35 document_text_resource, {'emitter_format': 'rawxml'},
38 url(r'^documents/(?P<docid>[^/]+)/dc' + FORMAT_EXT,
40 name="docdc_view_withformat"),
42 url(r'^documents/(?P<docid>[^/]+)/dc$',
43 document_dc_resource, {'emitter_format': 'json'},
46 url(r'^documents/(?P<docid>[^/]+)/parts$',
47 document_resource, {'emitter_format': 'json'},
48 name="docparts_view"),
50 # url(r'^posts/(?P<post_slug>[^/]+)/$', blogpost_resource),
51 # url(r'^other/(?P<username>[^/]+)/(?P<data>.+)/$', arbitrary_resource),