class IHotspotDirective(Interface):

    name = TextLine(title=u"The name of this hotspot",
                    description=u"",
                    required=True)

    obj = GlobalObject(title=u"The object this hotspot applies",
                       description=u"",
                       required=False)

    interface = GlobalObject(title=u"The interface this hotspot applies",
                             description=u"",
                             required=False)

    resource = TextLine(title=u"The resources this hotspot applies",
                        description=u"",
                        required=False)

    considerparams = Tokens(title=u"Request params to consider",
                            description=u"",
                            required=False,
                            value_type=TextLine())
示例#2
0
文件: zcml.py 项目: bendavis78/zope
class IImportStepDirective(Interface):
    """Register import steps with the global registry.
    """

    name = PythonIdentifier(title=u'Name', description=u'', required=True)

    title = MessageID(title=u'Title', description=u'', required=True)

    description = MessageID(title=u'Description',
                            description=u'',
                            required=True)

    handler = GlobalObject(title=u'Handler', description=u'', required=True)
示例#3
0
class IRepositoryDirective(Interface):
    name = \
        TextLine(title=u"Name of this repository. Must be unique among all "
                        "repositories. If no name is given, or the name is "
                        "specified as 'DEFAULT', the built-in repository is "
                        "configured with the given directive.",
                 required=False
                 )
    aggregate_class = \
        GlobalObject(title=u"A class to use as the default aggregate "
                            "implementation for this repository.",
                     required=False)
    repository_class = \
        GlobalObject(title=u"A class to use as the implementation for this "
                            "repository.",
                     required=False)
    make_default = \
        Bool(title=u"Indicates if this repository should be made the default "
                    "for all resources that do not explicitly specify a "
                    "repository. Defaults to False.",
             required=False
             )
示例#4
0
class ITypeWithFSSDirective(Interface):
    """Schema for fss:typeWithFSS directive"""

    class_ = GlobalObject(
        title=u'Class',
        description=u'Dotted name of class of AT based content type using FSS',
        required=True)

    fields = Tokens(
        title=u'Fields',
        description=u'Field name or space(s) separated field names',
        value_type=PythonIdentifier(),
        required=True)
示例#5
0
class IParrotDirective(Interface):
    """State that a class implements something.
    """
    class_ = GlobalObject(
        title=u"Class",
        required=True,
    )

    name = TextLine(
        title=u"Name",
        description=u"The parrots name.",
        required=True,
    )
示例#6
0
class IMonkeyPatchDirective(Interface):
    """ZCML directive to apply a monkey patch late in the configuration cycle.
    This version replaces one object with another.
    """

    class_ = GlobalObject(title=u"The class being patched", required=False)
    module = GlobalObject(title=u"The module being patched", required=False)
    handler = GlobalObject(
        title=u"A function to perform the patching.",
        description=
        u"Must take three parameters: class/module, original (string), and replacement",
        required=False)
    original = PythonIdentifier(title=u"Method or function to replace")
    replacement = GlobalObject(title=u"Method to function to replace with")
    preservedoc = Bool(title=u"Preserve docstrings?",
                       required=False,
                       default=True)
    preserveOriginal = Bool(
        title=
        u'Preserve the original function so that it is reachable view prefix _old_. Only works for def handler.',
        default=False,
        required=False)
    preconditions = Text(
        title=
        u'Preconditions (multiple, separated by space) to be satisified before applying this patch. Example: Products.LinguaPlone<=1.4.3',
        required=False,
        default=u'')
    ignoreOriginal = Bool(
        title=
        u"Ignore if the orginal function isn't present on the class/module being patched",
        default=False)
    docstringWarning = Bool(title=u"Add monkey patch warning in docstring",
                            required=False,
                            default=True)
    description = Text(title=u'Some comments about your monkey patch',
                       required=False,
                       default=u"(No comment)")
    order = Int(title=u"Execution order", required=False, default=1000)
示例#7
0
class IAuthTktAuthenticationPolicyDirective(Interface):
    secret = TextLine(title=u'secret', required=True)
    callback = GlobalObject(title=u'callback', required=False)
    cookie_name = ASCIILine(title=u'cookie_name',
                            required=False,
                            default='auth_tkt')
    secure = Bool(title=u"secure", required=False, default=False)
    include_ip = Bool(title=u"include_ip", required=False, default=False)
    timeout = Int(title=u"timeout", required=False, default=None)
    reissue_time = Int(title=u"reissue_time", required=False, default=None)
    max_age = Int(title=u"max_age", required=False, default=None)
    path = ASCIILine(title=u"path", required=False, default='/')
    http_only = Bool(title=u"http_only", required=False, default=False)
    wild_domain = Bool(title=u"wild_domain", required=False, default=True)
示例#8
0
class IAuthTktAuthenticationPolicyDirective(Interface):
    secret = TextLine(title=u('secret'), required=True)
    callback = GlobalObject(title=u('callback'), required=False)
    cookie_name = ASCIILine(title=u('cookie_name'),
                            required=False,
                            default='auth_tkt')
    secure = Bool(title=u('secure'), required=False, default=False)
    include_ip = Bool(title=u('include_ip'), required=False, default=False)
    timeout = Int(title=u('timeout'), required=False, default=None)
    reissue_time = Int(title=u('reissue_time'), required=False, default=None)
    max_age = Int(title=u('max_age'), required=False, default=None)
    path = ASCIILine(title=u('path'), required=False, default='/')
    http_only = Bool(title=u('http_only'), required=False, default=False)
    wild_domain = Bool(title=u('wild_domain'), required=False, default=True)
示例#9
0
class ILayoutDirective(Interface):
    context = GlobalObject(title=u"The interface or class this layout is for.",
                           required=False)

    layout = GlobalObject(
        title=u"",
        description=u"The layout class",
        required=False,
    )

    name = TextLine(
        title=u"The name of the layout",
        description=u'',
        required=False,
    )

    template = TextLine(title=u'The renderer asssociated with the layout',
                        description=u'',
                        required=True)

    containment = GlobalObject(
        title=u'Dotted name of a containment class or interface',
        required=False)
示例#10
0
class IResourceViewDirective(IViewDirective):
    for_ = \
        Tokens(title=u"The resource classes or interfaces to set up views "
                      "for. For each interface in the sequence, views for "
                      "the associated member resource class (member_view), "
                      "the associated collection resource class "
                      "(collection_view) or both (resource_view) are"
                      "generated.",
               required=True,
               value_type=GlobalObject())
    default_content_type = \
        GlobalObject(title=u"The default MIME content type to use when the "
                            "client does not indicate a preference. Unless "
                            "the default_response_content_type setting is "
                            "also specified, this applies to both the "
                            "request and the response content type.",
                     required=False)
    default_response_content_type = \
        GlobalObject(title=u"The default MIME content type to use for the "
                            "response when the client does not indicate a "
                            "preference. If this is not specified, the "
                            "setting for default_content_type is used.",
                     required=False)
    request_method = \
        Tokens(title=u"One or more request methods that need to be matched.",
               required=True,
               value_type=Choice(values=tuple(RequestMethods),
                                 default=RequestMethods.GET,
                                 ),
               )
    enable_messaging = \
        Bool(title=u"Flag indicating if messaging should be enabled for "
                    "this view (defaults to False for GET views and to "
                    "TRUE for PUT/POST/PATCH views).",
             default=None,
             required=False,
             )
示例#11
0
class IFormDirective(ICommonFormInformation):
    """
    Define an automatically generated form.

    The form directive does nto require the data to be stored in its context,
    but leaves the storing procedure to the to a method.
    """
    class_ = GlobalObject(title=u"Class",
                          description=u"""
        A class to provide the `getData()` and `setData()` methods or
        completely custom methods to be used by a custom template.

        This class is used as a mix-in class. As a result, it needn't
        subclass any special classes, such as BrowserView.""",
                          required=True)
示例#12
0
class IPanelDirective(Interface):
    context = GlobalObject(title=u"The interface or class this panel is for.",
                           required=False)

    panel = GlobalObject(
        title=u"",
        description=u"The panel function",
        required=False,
    )

    name = TextLine(
        title=u"The name of the panel",
        description=u'',
        required=False,
    )

    attr = TextLine(title=u'The callable attribute of the panel object'
                    u'(default is __call__)',
                    description=u'',
                    required=False)

    renderer = TextLine(title=u'The renderer asssociated with the panel',
                        description=u'',
                        required=False)
示例#13
0
class IFullInfo(IDirectiveInfo):
    """Information that all top-level directives (not subdirectives) have
    """

    handler = GlobalObject(
        title=u("Directive handler"),
        description=u("The dotted name of the directive handler"),
    )

    usedIn = GlobalInterface(
        title=u("The directive types the directive can be used in"),
        description=u("The interface of the directives that can contain "
                      "the directive"),
        default=IConfigurationContext,
    )
示例#14
0
class IAdapterDirective(Interface):
    """
    Register an adapter
    """

    factory = Tokens(
        title=u"Adapter factory/factories",
        description=(u"A list of factories (usually just one) that create"
                     " the adapter instance."),
        required=True,
        value_type=GlobalObject()
        )

    provides  = GlobalInterface(
        title=u"Interface the component provides",
        description=(u"This attribute specifies the interface the adapter"
                     " instance must provide."),
        required=False,
        )

    for_ = Tokens(
        title=u"Specifications to be adapted",
        description=u"This should be a list of interfaces or classes",
        required=False,
        value_type=GlobalObject(
          missing_value=object(),
          ),
        )

    name = TextLine(
        title=u"Name",
        description=(u"Adapters can have names.\n\n"
                     "This attribute allows you to specify the name for"
                     " this adapter."),
        required=False,
        )
示例#15
0
class IAdapterTraverserPlugin(INamedTraverserPlugin):
    """Adapter traverser plugin zcml directive.

    Adapts context to the given interface.
    """

    adapter = GlobalObject(
        title=u"The interface this plugin will be adapting to.",
        required=True,
    )

    adapter_name = TextLine(
        title=u"Adapter name to use when adapting to given interface.",
        required=False,
    )
示例#16
0
文件: zcml.py 项目: bendavis78/zope
class IPipelineDirective(Interface):
    """Declare a list of application names in a WSGI pipeline"""

    for_ = Tokens(
        title=u'Request types',
        description=u'The request types that should use this pipeline',
        value_type=GlobalObject())

    names = Tokens(
        title=u'Application names',
        description=(
            u'The list of WSGI application names to use. '
            u'The last name in the list declares a simple application; '
            u'the rest declare a middleware application.'),
        value_type=TextLine())
示例#17
0
class ICommonInformation(Interface):
    """
    Common information for all successive directives
    """

    name = TextLine(title=u"Name",
                    description=u"The name of the generated view.",
                    required=True)

    schema = GlobalInterface(
        title=u"Schema",
        description=u"The schema from which the form is generated.",
        required=True)

    for_ = GlobalInterface(title=u"Interface",
                           description=u"""
        The interface this page (view) applies to.

        The view will be for all objects that implement this
        interface. The schema is used if the for attribute is not
        specified.

        If the for attribute is specified, then the objects views must
        implement or be adaptable to the schema.""",
                           required=False)

    permission = Permission(
        title=u"Permission",
        description=u"The permission needed to use the view.",
        required=True)

    layer = GlobalInterface(
        title=u"Layer",
        description=u"The later the view is in. Default: 'default'",
        required=False)

    template = Path(title=u"Template",
                    description=u"An alternate template to use for the form.",
                    required=False)

    class_ = GlobalObject(title=u"Class",
                          description=u"""
        A class to provide custom widget definitions or methods to be
        used by a custom template.

        This class is used as a mix-in class. As a result, it needn't
        subclass any special classes, such as BrowserView.""",
                          required=False)
示例#18
0
class ICommonAddInformation(Interface):
    """
    Common information for add forms
    """

    content_factory = GlobalObject(title=u"Content factory",
                                   description=u"""
        An object to call to create new content objects.

        This attribute isn't used if a class is specified that
        implements createAndAdd.""",
                                   required=False)

    content_factory_id = Id(
        title=u"Content factory id",
        description=u"A factory id to create new content objects",
        required=False,
    )

    arguments = Tokens(title=u"Arguments",
                       description=u"""
        A list of field names to supply as positional arguments to the
        factory.""",
                       required=False,
                       value_type=PythonIdentifier())

    keyword_arguments = Tokens(title=u"Keyword arguments",
                               description=u"""
        A list of field names to supply as keyword arguments to the
        factory.""",
                               required=False,
                               value_type=PythonIdentifier())

    set_before_add = Tokens(
        title=u"Set before add",
        description=u"""
        A list of fields to be assigned to the newly created object
        before it is added.""",
        required=False,
        value_type=PythonIdentifier(),
    )

    set_after_add = Tokens(title=u"Set after add",
                           description=u"""
        A list of fields to be assigned to the newly created object
        after it is added.""",
                           required=False,
                           value_type=PythonIdentifier())
示例#19
0
class IPagesDirective(IBasicViewInformation):
    """
    Define multiple pages without repeating all of the parameters.

    The pages directive allows multiple page views to be defined
    without repeating the 'for', 'permission', 'class', 'layer',
    'allowed_attributes', and 'allowed_interface' attributes.
    """

    for_ = GlobalObject(title=u"The interface or class this view is for.",
                        required=False)

    permission = Permission(
        title=u"Permission",
        description=u"The permission needed to use the view.",
        required=True)
class IExpressionTypeDirective(Interface):
    """Register a new TALES expression type"""

    name = TextLine(
        title=u"Name",
        description=u"""Name of the expression. This will also be used
        as the prefix in actual TALES expressions.""",
        required=True
        )

    handler = GlobalObject(
        title=u"Handler",
        description=u"""Handler is class that implements
        zope.tales.interfaces.ITALESExpression.""",
        required=True
        )
示例#21
0
class IRegisterPreferenceGroupDirective(Interface):
    """Register a new preference group directive"""

    annotation_factory = GlobalObject(title=u"The annotation factory for this preference group",
                                      required=True)

    directive_name = fields.TextLine(title=u"The name for this directive",
                                     required=True)

    group_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=True,
               )
示例#22
0
class IInclude(Interface):
    """The `include`, `includeOverrides` and `exclude`
    directives.

    These directives allows you to include or preserve including of
    another ZCML file in the configuration. This enables you to write
    configuration files in each package and then link them together.
    """

    file = NativeStringLine(
        title=u"Configuration file name",
        description=(u"The name of a configuration file to be included/"
                     u"excluded, relative to the directive containing the "
                     u"including configuration file."),
        required=False,
    )

    files = NativeStringLine(
        title=u"Configuration file name pattern",
        description=u"""
        The names of multiple configuration files to be included/excluded,
        expressed as a file-name pattern, relative to the directive
        containing the including or excluding configuration file.
        The pattern can include:

        - ``*`` matches 0 or more characters

        - ``?`` matches a single character

        - ``[<seq>]`` matches any character in seq

        - ``[!<seq>]`` matches any character not in seq

        The file names are included in sorted order, where sorting is
        without regard to case.
        """,
        required=False,
    )

    package = GlobalObject(
        title=u"Include or exclude package",
        description=u"""
        Include or exclude the named file (or configure.zcml) from the
        directory of this package.
        """,
        required=False,
    )
示例#23
0
class IStaticSubscriptionDirective(Interface):
    """
    Define a global, static, transient subscription.

    Static subscriptions are not persistent and live only in the
    memory of individual processes. Thus, failed deliveries cannot be
    re-attempted after process shutdown. And of course the delivery history
    is also transient and local to a process.
    """

    for_ = GlobalObject(
        title=IWebhookSubscription['for_'].title,
        description=IWebhookSubscription['for_'].description,
        default=IWebhookSubscription['for_'].default,
        required=False,
    )

    when = ObjectEventInterface(
        title=IWebhookSubscription['when'].title,
        description=IWebhookSubscription['when'].description,
        default=IWebhookSubscription['when'].default,
        required=False,
    )

    to = IWebhookSubscription['to'].bind(None)

    dialect = TextLine(
        # We can't use the field directly because it wants to validate
        # against a Choice using a vocabulary based on registered utilities.
        # That doesn't work as an argument if we're still registering those
        # utilities.
        title=IWebhookSubscription['dialect_id'].title,
        description=IWebhookSubscription['dialect_id'].description,
        default=IWebhookSubscription['dialect_id'].default,
        required=False)

    owner = IWebhookSubscription['owner_id'].bind(None)

    permission = Permission(title=u"The permission to check",
                            description=u"""
        If given, and an *owner* is also specified, then only data that
        has this permission for the *owner* will result in an attempted delivery.
        If not given, but an *owner* is given, this will default to the standard
        view permission ID, ``zope.View``.
        """,
                            required=False)
示例#24
0
文件: zcml.py 项目: bendavis78/zope
class IRequestFactoryDirective(Interface):
    """Link information from a request to a request factory"""

    name = TextLine(title=u'Name',
                    description=u'The name of the request factory.')

    factory = GlobalObject(
        title=u'Factory',
        description=(u'The request factory, which is a callable '
                     u'that accepts one parameter, the WSGI environment, '
                     u'and returns a request object. '
                     u'The factory can return None if it decides it can '
                     u'not handle the given environment.'),
        required=True)

    schemes = Tokens(
        title=u'URL Schemes',
        description=(u'A list of URL schemes to support. This matches the '
                     u'wsgi.url_scheme parameter. Defaults to "http https".'),
        value_type=TextLine(),
        required=False)

    methods = Tokens(
        title=u'Methods',
        description=(u'A list of HTTP method names. If the method is a "*", '
                     u'then all methods will match. Example: "GET POST"'),
        value_type=TextLine(),
        required=False)

    mimetypes = Tokens(
        title=u'Mime Types',
        description=(u'A list of content/mime types of the request. If the '
                     u'type is a "*" then all types will be matched. '
                     u'Example: "text/html text/xml"'),
        value_type=TextLine(),
        required=False)

    priority = Int(
        title=u'Priority',
        description=(u'A priority number used to decide between coexistent '
                     u'request factories.  A higher priority number '
                     u'is chosen before a lower priority number.'),
        required=False)
示例#25
0
class IAnonymousObjectFactoryDirective(IBaseAnonymousObjectFactoryDirective):
    """
    Defines the ``ext:anonymousObjectFactory`` directive.

    This directive registers a single
    :class:`nti.externaliaztion.interfaces.IAnonymousObjectFactory`
    for a single field used within a single object.

    .. versionadded:: 1.0a3
    """
    factory = GlobalObject(
        title=u'The class object that will be created.',
        required=True,
    )

    pass_external_object_to_factory = Bool(
        title=(u"Pass the external object to the factory."),
        description=(
            u"If true (*not* the default), then, the factory will recieve "
            u"one argument, the anonymous external data. "
            u'Otherwise, it gets no arguments.'),
        default=False,
        required=False,
    )

    trusted = Bool(
        title=
        u"Ignore any value for ``__external_can_create__`` on the factory.",
        required=False,
        default=False,
    )

    title = MessageID(
        title=u"Title",
        description=u"Provides a title for the object.",
        required=False,
    )

    description = MessageID(
        title=u"Description",
        description=u"Provides a description for the object.",
        required=False)
示例#26
0
class ISystemViewDirective(Interface):
    view = GlobalObject(
        title=_BLANK,
        description=u('The view function'),
        required=False,
    )

    attr = TextLine(title=u(
        'The callable attribute of the view object(default is __call__)'),
                    description=_BLANK,
                    required=False)

    renderer = TextLine(title=u('The renderer asssociated with the view'),
                        description=_BLANK,
                        required=False)

    wrapper = TextLine(title=u(
        'The *name* of the view that acts as a wrapper for this view.'),
                       description=_BLANK,
                       required=False)
示例#27
0
文件: zcml.py 项目: c0ns0le/zenoss-4
class IExportStepDirective(Interface):
    name = PythonIdentifier(
        title=u'Name',
        description=u'',
        required=True)

    title = MessageID(
        title=u'Title',
        description=u'',
        required=True)

    description = MessageID(
        title=u'Description',
        description=u'',
        required=True)

    handler = GlobalObject(
        title=u'Handler',
        description=u'',
        required=True)
示例#28
0
class IIncludePluginsDirective(Interface):
    """Auto-include any ZCML in the dependencies of this package."""

    package = GlobalObject(
        title=u"Package to auto-include for",
        description=u"""
        Auto-include all plugins to this package.
        """,
        required=True,
    )

    file = BytesLine(
        title=u"ZCML filename to look for",
        description=u"""
        Name of a particular ZCML file to look for.
        If omitted, autoinclude will scan for standard filenames
        (e.g. meta.zcml, configure.zcml, overrides.zcml)
        """,
        required=False,
    )
示例#29
0
class ISoaplibHandlerDirective(Interface):
    """Handles http/soap requests
    """

    name = TextLine(title=u"name",
                    description=u"The name of the requested view")

    for_ = GlobalObject(title=u"For Interface",
                        description=u"The interface the directive is used for",
                        required=False)

    service_definitions = List(
        title=u"Service Definitions",
        description=u"The service definitions to be served",
        required=True)

    app_namespace = TextLine(
        title=u"Application Namespace",
        description=u"The namespace for the soap application",
        required=True)
示例#30
0
class IClassObjectFactoryDirective(interface.Interface):
    """
    Defines the ``ext:classObjectFactory`` directive.

    This directive registers a single
    :class:`nti.externalization.interfaces.IClassObjectFactory`.

    The factory will be registered for a class object.
    """

    factory = GlobalObject(
        title=u'The class object that will be created.',
        description=
        u"This must define the ``__external_can_create__`` attribute to be true.",
        required=True)

    name = PythonIdentifier(
        title=u"The name for the factory.",
        description=
        (u"If not given, the ``__external_class_name__`` of the class will be used. "
         u"If that's not available, the ``__name__`` will be used."),
        required=False,
    )

    trusted = Bool(
        title=
        u"Ignore any value for ``__external_can_create__`` on the factory.",
        required=False,
        default=False,
    )

    title = MessageID(
        title=u"Title",
        description=u"Provides a title for the object.",
        required=False,
    )

    description = MessageID(
        title=u"Description",
        description=u"Provides a description for the object.",
        required=False)