예제 #1
0
class IContentTypeDirective(Interface):

    portal_type = configuration_fields.MessageID(title=_('Portal type'),
                                                 description='',
                                                 required=True)

    class_ = configuration_fields.GlobalObject(title=_('Class'),
                                               description='',
                                               required=False)

    schema = configuration_fields.GlobalInterface(title='',
                                                  description='',
                                                  required=True)

    behaviors = configuration_fields.Tokens(
        title='',
        description='',
        value_type=configuration_fields.GlobalInterface(),
        required=False)

    allowed_types = configuration_fields.Tokens(
        title='',
        description='',
        value_type=configuration_fields.MessageID(),
        required=False)

    add_permission = configuration_fields.MessageID(
        title=_('Add permission'), default=DEFAULT_ADD_PERMISSION)
예제 #2
0
class IDescribeAction(Interface):

    group = DescGroupId(
        title=u"Group name",
        description=u"Identifier of the group this action belongs to.")

    name = DescActionId(
        title=u"Name",
        description=u"Unique identifier of the action within the group.")

    order = schema.Int(
        title=u"Order",
        description=u"Order in which this action should be displayed.",
        required=False)

    interface = fields.GlobalObject(title=u"Interface", required=True)

    permission = Permission(title=u"Permission", required=True)

    title = fields.MessageID(title=u"Title", required=False)

    description = fields.MessageID(title=u"Description", required=False)

    klass = fields.GlobalObject(title=u"Class",
                                description=u"""
        Action definition class that builds it's own title/description.
        This is an alternative to title/description defined in ZCML.
        """,
                                required=False)
예제 #3
0
class IBehaviorDirective(Interface):
    """Directive which registers a new behavior type.

    The registration consists of:

        * a global named utility registered by interface identifier
        * a global named utility registered by lookup name
        * an associated global and unnamed behavior adapter
    """

    name = TextLine(title=u'Name',
                    description=u'Convenience lookup name for this behavior',
                    required=False)

    title = configuration_fields.MessageID(
        title=u'Title',
        description=u'A user friendly title for this behavior',
        required=True)

    description = configuration_fields.MessageID(
        title=u'Description',
        description=u'A longer description for this behavior',
        required=False)

    provides = configuration_fields.GlobalInterface(
        title=u'An interface to which the behavior can be adapted',
        description=u'This is what the conditional adapter factory will '
        u'be registered as providing',
        required=True)

    marker = configuration_fields.GlobalInterface(
        title=u'A marker interface to be applied by the behavior',
        description=u'If factory is not given, then this is optional',
        required=False)

    factory = configuration_fields.GlobalObject(
        title=u'The factory for this behavior',
        description=u'If this is not given, the behavior is assumed to '
        u'provide a marker interface',
        required=False)

    for_ = configuration_fields.GlobalObject(
        title=u'The type of object to register the conditional adapter '
        u'factory for',
        description=u'This is optional - the default is to register the '
        u'factory for zope.interface.Interface',
        required=False)

    name_only = configuration_fields.Bool(
        title=u'Do not register the behavior under the dotted path, but '
        u'only under the given name',
        description=u'Use this option to register a behavior for the same '
        u'provides under a different name.',
        required=False)
예제 #4
0
class ISettingDirective(Interface):

    key = fields.PythonIdentifier(title=u"Key")

    text = fields.MessageID(title=u"Text that describes the setting")

    alt_text = fields.MessageID(title=u"Text that describes 'setting=False'",
                                required=False)

    default = fields.Bool(title=u"Default setting",
                          required=True,
                          default=False)
예제 #5
0
class IBehaviorDirective(Interface):
    """Directive which registers a new behavior type.

    The registration consists of:

        * a global named utility registered by interface identifier
        * a global named utility registered by lookup name
        * an associated global and unnamed behavior adapter
    """

    name = TextLine(title=u"Name",
                    description=u"Convenience lookup name for this behavior",
                    required=False)

    title = configuration_fields.MessageID(
        title=u"Title",
        description=u"A user friendly title for this behavior",
        required=True)

    description = configuration_fields.MessageID(
        title=u"Description",
        description=u"A longer description for this behavior",
        required=False)

    provides = configuration_fields.GlobalInterface(
        title=u"An interface to which the behavior can be adapted",
        description=u"This is what the conditional adapter factory will "
        u"be registered as providing",
        required=True)

    marker = configuration_fields.GlobalInterface(
        title=u"A marker interface to be applied by the behavior",
        description=u"If factory is not given, then this is optional",
        required=False)

    factory = configuration_fields.GlobalObject(
        title=u"The factory for this behavior",
        description=u"If this is not given, the behavior is assumed to "
        u"provide a marker interface",
        required=False)

    for_ = configuration_fields.GlobalObject(
        title=u"The type of object to register the conditional adapter "
        u"factory for",
        description=u"This is optional - the default is to register the "
        u"factory for zope.interface.Interface",
        required=False)
예제 #6
0
class IDescribeCrowd(Interface):

    group = DescGroupId(title=u"Group",
                        description=u"""
        Optional identifier of the group.  When specified, this description applies
        to the group only.
        """,
                        required=False)

    action = DescActionId(title=u"Action",
                          description=u"""
        Optional identifier of the action of the group.  If specified, this description
        applies to the action only.
        """,
                          required=False)

    crowd = CrowdId(title=u"Crowd",
                    description=u"Identifier of the crowd.",
                    required=False)

    crowd_factory = fields.GlobalObject(
        title=u"Crowd factory",
        description=u"Alternative way to specify the crowd.",
        required=False)

    factory = fields.GlobalObject(
        title=u"Description class",
        description=u"Optional class that to build the title/description.",
        required=False)

    title = fields.MessageID(title=u"Title",
                             description=u"""
        A quick way to specify the title from ZCML.
        It will be assigned to the "factory" instance dict.
        """,
                             required=False)

    description = fields.MessageID(title=u"Description",
                                   description=u"""
        A quick way to specify the description from ZCML.
        It will be assigned to the "factory" instance dict.
        """,
                                   required=False)
예제 #7
0
class IResourceDirectory(Interface):

    name = configuration_fields.MessageID(
        title=_('Name where is going to be published'),
        description='',
        required=True)

    directory = Path(title='The name of the directory',
                     description='Publish at /static the directory',
                     required=True)
예제 #8
0
class IDescribeGroup(Interface):

    name = DescGroupId(title=u"Name",
                       description=u"Unique identifier of the group.")

    title = fields.MessageID(title=u"Title",
                             description=u"Group title displayed to the user.",
                             required=False)

    description = fields.MessageID(
        title=u"Description",
        description=u"Group description displayed to the user.",
        required=False)

    klass = fields.GlobalObject(title=u"Class",
                                description=u"""
        Group definition class that builds it's own title/description.
        This is an alternative to title/description defined in ZCML.
        """,
                                required=False)
예제 #9
0
class IAddOn(Interface):

    name = configuration_fields.PythonIdentifier(title=_('Name of the addon'),
                                                 description='',
                                                 required=True)

    title = configuration_fields.MessageID(title=_('Name of the addon'),
                                           description='',
                                           required=True)

    handler = configuration_fields.GlobalObject(
        title=_('Handler for the addon'), description='', required=True)
예제 #10
0
class IBehaviorDirective(Interface):
    """Directive which registers a new behavior type (a global, named
    utility) and associated behavior adapter factory (a global, unnamed
    adapter)
    """

    title = configuration_fields.MessageID(
        title=u"Title",
        description=u"A user friendly title for this behavior",
        required=True)

    description = configuration_fields.MessageID(
        title=u"Description",
        description=u"A longer description for this behavior",
        required=False)

    provides = configuration_fields.GlobalInterface(
        title=u"An interface to which the behavior can be adapted",
        description=u"This is what the conditional adapter factory will "
        u"be registered as providing",
        required=True)

    marker = configuration_fields.GlobalInterface(
        title=u"A marker interface to be applied by the behavior",
        description=u"If provides is given and factory is not given, then "
        u"this is optional",
        required=False)

    factory = configuration_fields.GlobalObject(
        title=u"The factory for this behavior",
        description=u"If this is not given, the behavior is assumed to "
        u"provide a marker interface",
        required=False)

    for_ = configuration_fields.GlobalObject(
        title=u"The type of object to register the conditional adapter "
        u"factory for",
        description=u"This is optional - the default is to register the "
        u"factory for zope.interface.Interface",
        required=False)
예제 #11
0
class IPreferenceGroupDirective(Interface):
    """Register a preference group."""

    # The id is not required, since the root group has an empty id.
    id = OptionalDottedName(
        title=u"Id",
        description=u"""
            Id of the preference group used to access the group. The id should
            be a valid path in the preferences tree.""",
        required=False,
        )

    schema = fields.GlobalInterface(
        title=u"Schema",
        description=u"Schema of the preference group used defining the "
                    u"preferences of the group.",
        required=False
        )

    title = fields.MessageID(
        title=u"Title",
        description=u"Title of the preference group used in UIs.",
        required=True
        )

    description = fields.MessageID(
        title=u"Description",
        description=u"Description of the preference group used in UIs.",
        required=False
        )

    category = fields.Bool(
        title=u"Is Group a Category",
        description=u"Denotes whether this preferences group is a category.",
        required=False,
        default=False
        )