vendor/Five/1.2b-r20590

annotate fivedirectives.py @ 0:3673ed425f80

Vendor import of Five 1.2b+ (r20590)
author fguillaume
date Fri, 02 Dec 2005 20:25:42 +0000
parents
children
rev   line source
fguillaume@0 1 ##############################################################################
fguillaume@0 2 #
fguillaume@0 3 # Copyright (c) 2004, 2005 Zope Corporation and Contributors.
fguillaume@0 4 # All Rights Reserved.
fguillaume@0 5 #
fguillaume@0 6 # This software is subject to the provisions of the Zope Public License,
fguillaume@0 7 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
fguillaume@0 8 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
fguillaume@0 9 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
fguillaume@0 10 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
fguillaume@0 11 # FOR A PARTICULAR PURPOSE.
fguillaume@0 12 #
fguillaume@0 13 ##############################################################################
fguillaume@0 14 """Five ZCML directive schemas
fguillaume@0 15
fguillaume@0 16 $Id: fivedirectives.py 19221 2005-10-31 01:44:26Z efge $
fguillaume@0 17 """
fguillaume@0 18 from zope.interface import Interface
fguillaume@0 19 from zope.app.publisher.browser.metadirectives import IBasicResourceInformation
fguillaume@0 20 from zope.app.security.fields import Permission
fguillaume@0 21 from zope.configuration.fields import GlobalObject, Tokens, PythonIdentifier
fguillaume@0 22 from zope.configuration.fields import Bool
fguillaume@0 23 from zope.schema import ASCII
fguillaume@0 24 from zope.schema import TextLine
fguillaume@0 25
fguillaume@0 26 class IImplementsDirective(Interface):
fguillaume@0 27 """State that a class implements something.
fguillaume@0 28 """
fguillaume@0 29 class_ = GlobalObject(
fguillaume@0 30 title=u"Class",
fguillaume@0 31 required=True
fguillaume@0 32 )
fguillaume@0 33
fguillaume@0 34 interface = Tokens(
fguillaume@0 35 title=u"One or more interfaces",
fguillaume@0 36 required=True,
fguillaume@0 37 value_type=GlobalObject()
fguillaume@0 38 )
fguillaume@0 39
fguillaume@0 40 class ITraversableDirective(Interface):
fguillaume@0 41 """Make instances of class traversable publically.
fguillaume@0 42
fguillaume@0 43 This can be used to browse to pages, resources, etc.
fguillaume@0 44
fguillaume@0 45 Traversal can be controlled by registering an ITraverser adapter.
fguillaume@0 46 """
fguillaume@0 47 class_ = GlobalObject(
fguillaume@0 48 title=u"Class",
fguillaume@0 49 required=True
fguillaume@0 50 )
fguillaume@0 51
fguillaume@0 52 class IDefaultViewableDirective(Interface):
fguillaume@0 53 """Make instances of class viewable publically.
fguillaume@0 54
fguillaume@0 55 The default view is looked up using a IBrowserDefault adapter.
fguillaume@0 56 """
fguillaume@0 57 class_ = GlobalObject(
fguillaume@0 58 title=u"Class",
fguillaume@0 59 required=True
fguillaume@0 60 )
fguillaume@0 61
fguillaume@0 62 class ISizableDirective(Interface):
fguillaume@0 63 """Make instances of class send events.
fguillaume@0 64 """
fguillaume@0 65
fguillaume@0 66 class_ = GlobalObject(
fguillaume@0 67 title=u"Class",
fguillaume@0 68 required=True
fguillaume@0 69 )
fguillaume@0 70
fguillaume@0 71 class IContainerEventsDirective(Interface):
fguillaume@0 72 """Global switch to enable container events
fguillaume@0 73 """
fguillaume@0 74
fguillaume@0 75 class IDeprecatedManageAddDeleteDirective(Interface):
fguillaume@0 76 """Call manage_afterAdd & co for these contained content classes.
fguillaume@0 77 """
fguillaume@0 78 class_ = GlobalObject(
fguillaume@0 79 title=u"Class",
fguillaume@0 80 required=True,
fguillaume@0 81 )
fguillaume@0 82
fguillaume@0 83
fguillaume@0 84 class IBridgeDirective(Interface):
fguillaume@0 85 """Bridge from a Zope 2 interface to an equivalent Zope3 interface.
fguillaume@0 86 """
fguillaume@0 87 zope2 = GlobalObject(
fguillaume@0 88 title=u"Zope2",
fguillaume@0 89 required=True
fguillaume@0 90 )
fguillaume@0 91
fguillaume@0 92 package = GlobalObject(
fguillaume@0 93 title=u"Target package",
fguillaume@0 94 required=True
fguillaume@0 95 )
fguillaume@0 96
fguillaume@0 97 name = PythonIdentifier(
fguillaume@0 98 title=u"Zope3 Interface name",
fguillaume@0 99 description=u"If not supplied, the new interface will have the same "
fguillaume@0 100 u"name as the source interface.",
fguillaume@0 101 required=False
fguillaume@0 102 )
fguillaume@0 103
fguillaume@0 104 class IPagesFromDirectoryDirective(IBasicResourceInformation):
fguillaume@0 105 """Register each file in a skin directory as a page resource
fguillaume@0 106 """
fguillaume@0 107
fguillaume@0 108 for_ = GlobalObject(
fguillaume@0 109 title=u"The interface this view is for.",
fguillaume@0 110 required=False
fguillaume@0 111 )
fguillaume@0 112
fguillaume@0 113 module = GlobalObject(
fguillaume@0 114 title=u"Module",
fguillaume@0 115 required=True
fguillaume@0 116 )
fguillaume@0 117
fguillaume@0 118 directory = TextLine(
fguillaume@0 119 title=u"Directory",
fguillaume@0 120 description=u"The directory containing the resource data.",
fguillaume@0 121 required=True
fguillaume@0 122 )
fguillaume@0 123
fguillaume@0 124 class IRegisterClassDirective(Interface):
fguillaume@0 125
fguillaume@0 126 """registerClass directive schema.
fguillaume@0 127
fguillaume@0 128 Register Five content with Zope 2.
fguillaume@0 129 """
fguillaume@0 130
fguillaume@0 131 class_ = GlobalObject(
fguillaume@0 132 title=u'Instance Class',
fguillaume@0 133 description=u'Dotted name of the class that is registered.',
fguillaume@0 134 required=True
fguillaume@0 135 )
fguillaume@0 136
fguillaume@0 137 meta_type = ASCII(
fguillaume@0 138 title=u'Meta Type',
fguillaume@0 139 description=u'A human readable unique identifier for the class.',
fguillaume@0 140 required=True
fguillaume@0 141 )
fguillaume@0 142
fguillaume@0 143 permission = Permission(
fguillaume@0 144 title=u'Add Permission',
fguillaume@0 145 description=u'The permission for adding objects of this class.',
fguillaume@0 146 required=True
fguillaume@0 147 )
fguillaume@0 148
fguillaume@0 149 addview = ASCII(
fguillaume@0 150 title=u'Add View ID',
fguillaume@0 151 description=u'The ID of the add view used in the ZMI. Consider this '
fguillaume@0 152 u'required unless you know exactly what you do.',
fguillaume@0 153 default=None,
fguillaume@0 154 required=False
fguillaume@0 155 )
fguillaume@0 156
fguillaume@0 157 icon = ASCII(
fguillaume@0 158 title=u'Icon ID',
fguillaume@0 159 description=u'The ID of the icon used in the ZMI.',
fguillaume@0 160 default=None,
fguillaume@0 161 required=False
fguillaume@0 162 )
fguillaume@0 163
fguillaume@0 164 global_ = Bool(
fguillaume@0 165 title=u'Global scope?',
fguillaume@0 166 description=u'If "global" is False the class is only available in '
fguillaume@0 167 u'containers that explicitly allow one of its interfaces.',
fguillaume@0 168 default=True,
fguillaume@0 169 required=False
fguillaume@0 170 )