File: configure.zcml

package info (click to toggle)
plone3 3.1.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 73,972 kB
  • ctags: 39,149
  • sloc: python: 209,481; xml: 25,065; sh: 1,395; makefile: 585; php: 129; lisp: 54
file content (96 lines) | stat: -rw-r--r-- 2,560 bytes parent folder | download
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:browser="http://namespaces.zope.org/browser"
           xmlns:five="http://namespaces.zope.org/five"
           xmlns:kss="http://namespaces.zope.org/kss"
           xmlns:zcml="http://namespaces.zope.org/zcml"
		   i18n_domain="kss"
		   >

  <include package="kss.core"/>

  <!-- Things to do only on Zope2 -->
  <configure zcml:condition="have compat_five">

    <interface
      interface=".interfaces.ISimpleContent"
      type="zope.app.content.interfaces.IContentType"
      />

    <five:traversable class=".simplecontent.SimpleContent" />

    <five:defaultViewable class=".simplecontent.SimpleContent" />


    <class class=".simplecontent.SimpleContent">
      <implements
        interface=".interfaces.ISimpleContent"
        />
      <require
        permission="zope.View"
        interface=".interfaces.ISimpleContent"
        />
    </class>

    <browser:addform
      label="Add kss demos folder"
      name="AddSimpleContent.html"
      schema=".interfaces.ISimpleContent"
      content_factory=".simplecontent.SimpleContent"
      fields=""
      permission="zope.View"
      />

    <five:registerClass
      class=".simplecontent.SimpleContent"
      meta_type="KssDemo SimpleContent"
      addview="AddSimpleContent.html"
      permission="zope.View"
      global="True"
      />

  </configure>

  <!-- Things to do only on Zope3 -->
  <configure zcml:condition="have compat_not_five">

    <class class=".simplecontent_z3.SimpleContent">
      <implements
        interface=".interfaces.ISimpleContent"
        />
    </class>

    <browser:addform
      label="Add kss demos folder"
      name="AddSimpleContent.html"
      schema=".interfaces.ISimpleContent"
      content_factory=".simplecontent_z3.SimpleContent"
      fields=""
      permission="zope.ManageContent"
      />

    <browser:addMenuItem
      class=".simplecontent_z3.SimpleContent"
      title="KSS demos folder"
      description="A folder to hold a set of KSS demos"
      permission="zope.ManageContent"
      view="AddSimpleContent.html"
      />

  </configure>
    
  <!-- Finally, include the browser packages -->
  <include package=".browser" />

  <!-- Bind my own listener to dispatch events to
       demo components.
  -->
  <subscriber handler=".events.dispatchRegistration"/>

  <!-- Register my registry as a global utility -->
  <utility
    factory=".registry.KSSDemoRegistry"
    provides="kss.demo.interfaces.IKSSDemoRegistry"
    permission="zope.Public"
    />

</configure>