summaryrefslogtreecommitdiff
path: root/src/mailman/rest/configure.zcml
blob: 95bcfd1944242bda17e138581d74f174b0f0ab21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!-- -*- xml -*- -->
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:webservice="http://namespaces.canonical.com/webservice">

  <include package="zope.component" file="meta.zcml"/>
  <include package="zope.security" file="meta.zcml"/>
  <include package="lazr.restful" file="meta.zcml"/>
  <include package="lazr.restful" file="configure.zcml"/>

  <webservice:register module="mailman.interfaces.domain" />
  <webservice:register module="mailman.interfaces.listmanager" />
  <webservice:register module="mailman.interfaces.system" />

  <adapter factory="zope.publisher.http.HTTPCharsets" />

  <adapter
    for="mailman.interfaces.domain.IDomainManager"
    provides="mailman.interfaces.domain.IDomainCollection"
    factory="mailman.rest.adapters.DomainCollection"
    />

  <adapter
    for="mailman.interfaces.domain.IDomain
         lazr.restful.simple.Request"
    provides="zope.traversing.browser.interfaces.IAbsoluteURL"
    factory="mailman.rest.urls.DomainURLMapper"
    />

  <adapter
    for="zope.interface.Interface
         lazr.restful.simple.Request"
    provides="zope.traversing.browser.interfaces.IAbsoluteURL"
    factory="mailman.rest.urls.FallbackURLMapper"
    />

  <adapter
    for="mailman.interfaces.mailinglist.IMailingList
         lazr.restful.simple.Request"
    provides="zope.traversing.browser.interfaces.IAbsoluteURL"
    factory="mailman.rest.urls.MailingListURLMapper"
    />

  <adapter
    for="zope.publisher.interfaces.NotFound
         lazr.restful.simple.Request"
    provides="zope.interface.Interface"
    factory="lazr.restful.error.NotFoundView"
    name="index.html"
    />

  <utility
    factory="mailman.rest.configuration.AdminWebServiceConfiguration"
    provides="lazr.restful.interfaces.IWebServiceConfiguration">
  </utility>

</configure>