src/cm/api/urls.py
author gibus
Wed, 11 Sep 2013 23:13:01 +0200
changeset 532 0bad3613f59d
parent 463 9c7de6dd1723
permissions -rw-r--r--
Reverse to YUI 3.0.0 since with YUI.3.10.3, comment content including words 'paragraph' or 'section' do not show up on Firefox, this is weird and has to be investigated.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
287
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     1
from django.conf.urls.defaults import *
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     2
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     3
from piston.resource import Resource
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     4
from piston.authentication import HttpBasicAuthentication
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     5
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     6
from cm.api.handlers import * 
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     7
auth = HttpBasicAuthentication(realm='Comt API')
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     8
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     9
text_handler = Resource(handler=TextHandler, authentication=auth)
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    10
textversion_handler = Resource(handler=TextVersionHandler, authentication=auth)
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    11
text_list_handler = Resource(handler=TextListHandler, authentication=auth)
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    12
text_delete_handler = Resource(handler=TextDeleteHandler, authentication=auth)
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    13
text_pre_edit_handler = Resource(handler=TextPreEditHandler, authentication=auth)
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    14
text_edit_handler = Resource(handler=TextEditHandler, authentication=auth)
293
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    15
text_feed_handler = Resource(handler=TextFeedHandler, authentication=auth)
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    16
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    17
tv_revert_handler = Resource(handler=TextVersionRevertHandler, authentication=auth)
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    18
tv_delete_handler = Resource(handler=TextVersionDeleteHandler, authentication=auth)
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    19
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    20
text_export_handler = Resource(handler=TextExportHandler, authentication=auth)
463
9c7de6dd1723 Fix import for use with api (with co_ment Drupal module for eg.).
gibus
parents: 415
diff changeset
    21
import_handler = Resource(handler=ImportHandler, authentication=auth)
293
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    22
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    23
comments_handler = Resource(handler=CommentsHandler, authentication=auth)
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    24
415
bacf162c7b58 Adds api/convert to return HTML document from legacy format + Saves attached images when just converting to HTML, without creating a text + Returns nb of detached and removed commentswhen updating text.
gibus
parents: 293
diff changeset
    25
convert_handler = Resource(handler=ConvertHandler, authentication=auth)
bacf162c7b58 Adds api/convert to return HTML document from legacy format + Saves attached images when just converting to HTML, without creating a text + Returns nb of detached and removed commentswhen updating text.
gibus
parents: 293
diff changeset
    26
293
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    27
client_handler = Resource(handler=ClientHandler, authentication=auth)
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    28
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    29
jsi8n_handler = Resource(handler=JSI18NHandler, authentication=None)
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    30
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    31
comment_frame_handler = Resource(handler=CommentFrameHandler, authentication=auth)
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    32
comment_handler = Resource(handler=CommentHandler, authentication=auth)
287
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    33
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    34
#doc_handler = Resource(handler=DocHandler)
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    35
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    36
urlpatterns = patterns('',
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    37
   url(r'^text/(?P<key>\w*)/$', text_handler),
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    38
   url(r'^text/$', text_list_handler),
293
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    39
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    40
   url(r'^text/(?P<key>\w*)/(?P<version_key>\w*)/revert/$', tv_revert_handler),
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    41
   url(r'^text/(?P<key>\w*)/(?P<version_key>\w*)/delete/$', tv_delete_handler),
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    42
   
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    43
   url(r'^text/(?P<key>\w*)/comments_frame/$', comment_frame_handler),
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    44
   url(r'^text/(?P<key>\w*)/comments/(?P<version_key>\w*)/$', comment_handler),
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    45
   
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    46
   url(r'^text/(?P<key>\w*)/export/(?P<format>\w*)/(?P<download>\w*)/(?P<whichcomments>\w*)/(?P<withcolor>\w*)/$', text_export_handler),
463
9c7de6dd1723 Fix import for use with api (with co_ment Drupal module for eg.).
gibus
parents: 415
diff changeset
    47
   url(r'^import/$', import_handler),
293
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    48
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    49
   url(r'^text/(?P<key>\w*)/feed/$', text_feed_handler),
287
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    50
   url(r'^text/(?P<key>\w*)/delete/$', text_delete_handler),
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    51
   url(r'^text/(?P<key>\w*)/pre_edit/$', text_pre_edit_handler),
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    52
   url(r'^text/(?P<key>\w*)/edit/$', text_edit_handler),
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    53
   url(r'^text/(?P<key>\w*)/(?P<version_key>\w*)/$', textversion_handler),
293
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    54
   url(r'^comments/$', comments_handler),
415
bacf162c7b58 Adds api/convert to return HTML document from legacy format + Saves attached images when just converting to HTML, without creating a text + Returns nb of detached and removed commentswhen updating text.
gibus
parents: 293
diff changeset
    55
   url(r'^convert/$', convert_handler),
293
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    56
   url(r'^client/$', client_handler),
2c52e4453bf7 api update (incl. doc)
raph
parents: 287
diff changeset
    57
   url(r'^jsi18n/$', jsi8n_handler),
287
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    58
   url(r'^doc/$', documentation),
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    59
)