Пример #1
0
class II18nResourceTranslationSubdirective(IBasicResourceInformation):
    """
    Subdirective to II18nResourceDirective.
    """

    language = TextLine(
        title=u"Language",
        description=u"Language of this translation of the resource",
        required=True
        )

    file = Path(
        title=u"File",
        description=u"The file containing the resource data.",
        required=False
        )

    image = Path(
        title=u"Image",
        description=u"""
        If the image attribute is used, then an image resource, rather
        than a file resource will be created.

        This attribute is deprecated, as images are now simply files.
        Use the "file" attribute instead.
        """,
        required=False
        )
Пример #2
0
class IResourceDirective(IBasicResourceInformation):
    """
    Defines a browser resource.

    .. seealso:: `.FileResourceFactory`
    """

    name = TextLine(title=u"The name of the resource",
                    description=u"""
        This is the name used in resource urls. Resource urls are of
        the form ``<site>/@@/resourcename``, where ``<site>`` is the url of
        "site", a folder with a site manager.

        We make resource urls site-relative (as opposed to
        content-relative) so as not to defeat caches.""",
                    required=True)

    factory = GlobalObject(
        title=u"Resource Factory",
        description=u"The factory used to create the resource. The factory "
        u"should only expect to get the request passed when "
        u"called.",
        required=False)

    file = Path(
        title=u"File",
        description=u"The file containing the resource data. The resource "
        u"type that will be created depends on file extension. "
        u"The named IResourceFactoryFactory utilities are "
        u"registered per extension. If no factory is registered "
        u"for given file extension, the default FileResource "
        u"factory will be used.",
        required=False)

    image = Path(title=u"Image",
                 description=u"""
        If the image attribute is used, then an image resource, rather
        than a file resource will be created.

        This attribute is deprecated in favor of pluggable resource types,
        registered per extension. Use the "file" attribute instead.
        """,
                 required=False)

    template = Path(title=u"Template",
                    description=u"""
        If the template attribute is used, then a page template resource,
        rather than a file resource will be created.

        This attribute is deprecated in favor of pluggable resource types,
        registered per extension. Use the "file" attribute instead. To
        use page template resources, you need to install zope.ptresource
        package.
        """,
                    required=False)
Пример #3
0
class IFaviconDirective(Interface):

    for_ = GlobalObject(
        title=u"Specification of the object that has this favicon",
        required=True)

    file = Path(title=u"Path to the image file", required=True)
Пример #4
0
class IRegisterProfileDirective(Interface):
    """Register profiles with the global registry.
    """

    name = PythonIdentifier(title=u'Name',
                            description=u"If not specified 'default' is used.",
                            default=u'default',
                            required=False)

    title = MessageID(title=u'Title',
                      description=u'Optional title for the profile.',
                      default=None,
                      required=False)

    description = MessageID(
        title=u'Description',
        description=u'Optional description for the profile.',
        default=None,
        required=False)

    directory = Path(
        title=u'Path',
        description=u"If not specified 'profiles/<name>' is used.",
        required=False)

    provides = GlobalObject(title=u'Type',
                            description=u"If not specified 'BASE' is used.",
                            default=BASE,
                            required=False)

    for_ = GlobalObject(
        title=u'Site Interface',
        description=u'If not specified the profile is always available.',
        default=None,
        required=False)
Пример #5
0
class IStylesheetDirective(Interface):
    """ Register XSLT file with the global registry.
    """

    source = TextLine(
        title=u"Source",
        description=u"The source of XML data.",
        required=True
        )

    from_ = TextLine(
        title=u"From",
        description=u"Value which describes XML data before transformation.",
        required=True
        )

    to = TextLine(
        title=u"To",
        description=u"Value which describes XML data after transformation.",
        required=True
        )

    file = Path(
        title=u"XSLT file",
        description=u"The XSLT file to register.",
        required=True
        )
Пример #6
0
class IImportProfileUpgradeStep(Interface):
    """Register an upgrade step which imports a generic setup profile
    specific to this upgrade step.
    """

    title = zope.schema.TextLine(
        title=u"Title",
        required=True)

    description = zope.schema.TextLine(
        title=u"Upgrade step description",
        required=False)

    profile = zope.schema.TextLine(
        title=u"GenericSetup profile id",
        required=True)

    source = zope.schema.ASCII(
        title=u"Source version",
        required=True)

    destination = zope.schema.ASCII(
        title=u"Destination version",
        required=True)

    directory = Path(
        title=u'Path',
        required=True)

    handler = GlobalObject(
        title=u'Handler',
        required=False)
Пример #7
0
class IViewPageSubdirective(Interface):
    """
    Subdirective to IViewDirective.
    """

    name = TextLine(title=u"The name of the page (view)",
                    description=u"""
        The name shows up in URLs/paths. For example 'foo' or
        'foo.html'. This attribute is required unless you use the
        subdirective 'page' to create sub views. If you do not have
        sub pages, it is common to use an extension for the view name
        such as '.html'. If you do have sub pages and you want to
        provide a view name, you shouldn't use extensions.""",
                    required=True)

    attribute = PythonIdentifier(
        title=u"The name of the view attribute implementing the page.",
        description=u"""
        This refers to the attribute (method) on the view that is
        implementing a specific sub page.""",
        required=False)

    template = Path(title=u"The name of a template that implements the page.",
                    description=u"""
        Refers to a file containing a page template (should end in
        extension '.pt' or '.html').""",
                    required=False)
Пример #8
0
class IRegisterConfigDirective(Interface):
    """Register pipeline configurations with the global registry.
    """

    name = PythonIdentifier(title=u'Name',
                            description=u"If not specified 'default' is used.",
                            default=u'default',
                            required=False)

    title = MessageID(
        title=u'Title',
        description=u'Optional title for the pipeline configuration.',
        default=None,
        required=False)

    description = MessageID(
        title=u'Description',
        description=u'Optional description for the pipeline configuration.',
        default=None,
        required=False)

    configuration = Path(
        title=u'Configuration',
        description=u"The pipeline configuration file to register.",
        required=True)
Пример #9
0
class ITileDirective(Interface):
    """Directive which registers a new type of tile
    """

    name = schema.DottedName(
        title=u"Name",
        description=u"A unique, dotted name for the tile",
    )

    title = MessageID(
        title=u"Title",
        description=u"A user friendly title, used when configuring the tile",
        required=False)

    description = MessageID(
        title=u"Description",
        description=u"A longer summary of the tile's purpose and function",
        required=False)

    icon = MessageID(
        title=u"Icon",
        description=u"Image that represents tile purpose and function",
        required=False)

    add_permission = Permission(
        title=u"Add permission",
        description=u"Name of the permission required to instantiate "
        u"this tile",
        required=False,
    )

    schema = GlobalInterface(
        title=u"Configuration schema for the tile",
        description=u"This is used to create standard add/edit forms",
        required=False,
    )

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

    layer = GlobalInterface(title=u"The layer the tile is available for",
                            required=False)

    class_ = GlobalObject(title=u"Class",
                          description=u"Class implementing this tile",
                          required=False)

    template = Path(
        title=u"The name of a template that renders this tile",
        description=u"Refers to a file containing a page template",
        required=False,
    )

    permission = Permission(
        title=u"View permission",
        description=u"Name of the permission required to view this item",
        required=False,
    )
Пример #10
0
class IRegisterDirectoryDirective(Interface):
    """Register directories with the global registry.
    """

    name = PythonIdentifier(title=u'Name',
                            description=u'Name of the directory.',
                            required=True)

    directory = Path(
        title=u'Path',
        description=u'Path relative to the package. If not specified, '
        u"'skins/<name>' is used.",
        required=False)

    recursive = Bool(
        title=u'Recursive?',
        description=u'False by default. If true, register all subdirectories '
        u'as well.',
        required=False)

    ignore = Tokens(
        title=u'Ignore',
        description=u'Files and subdirectories that should be ignored. If '
        u"not specified, 'CVS' and '.svn' are ignored.",
        value_type=ASCIILine(),
        required=False)
Пример #11
0
class ICarouselDirective(Interface):
    """
    A ZCML directive for register a banner or pager template for Carousel.
    """

    name = TextLine(
        title="The name of the banner or pager",
        description="The name shows up in URLs/paths. For example 'foo'.",
        required=True,
    )

    template = Path(
        title="The name of a template that implements the banner or pager",
        description="Refers to a file containing a page template (should end in"
        "extension '.pt' or '.html').",
        required=True)

    title = MessageID(title="The browser menu label for the banner or pager",
                      required=True)

    layer = GlobalInterface(
        title="The layer the banner or pager is declared for",
        description="The default layer for which the banner or pager is "
        "applicable. By default it is applied to all layers.",
        required=False)
Пример #12
0
class IPanelDirective(Interface):
    name = schema.TextLine(
        title=_("Name"),
        required=True
    )

    title = schema.TextLine(
        title=_("Title"),
        required=True
    )

    description = schema.TextLine(
        title=_("Description"),
        required=True
    )

    template = Path(
        title=_("Template"),
        required=True
    )

    layer = GlobalInterface(
        title=_("Layer"),
        required=True,
        default=IDefaultBrowserLayer,
    )
Пример #13
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
        )
Пример #14
0
class IGadflyRoot(Interface):
    """This directive creates a globale connection to an RDBMS."""

    path = Path(
        title=u"Path of Gadfly Root",
        description=u"Specifies the path of the gadfly root relative to the"
        u"packge.",
        required=True)
class IDataSourceDirective(Interface):

    name = schema.TextLine(
        title=u'Name',
        description=u'Identifier of the group',
    )

    json_source = Path(
        title=u'Name of the json file where the source is stored',
        description=u'''
            Refers to a file containing json in this format:

                {
                    'Group Title': [
                        {
                            'honorific': 'Mr',
                            'first': 'firstname',
                            'last': 'lastname',
                            'email': '*****@*****.**',
                            'description': 'description'        
                        }, ...
                    ],
                    'Group Title': [
                        {
                            'honorific': 'Mr',
                            'first': 'firstname',
                            'last': 'lastname',
                            'email': '*****@*****.**',
                            'description': 'description'        
                        }, ...
                    ]
                }
        ''')

    site = schema.TextLine(
        title=u'Site',
        description=u'Site ID',
        required=False,
    )

    title = schema.TextLine(
        title=u'Title',
        description=u'Title of the group',
        required=False,
    )

    description = schema.TextLine(title=u'Description',
                                  description=u'Description of the group',
                                  required=False)

    select_label = schema.TextLine(title=u'Label',
                                   description=u'Label of the selection field',
                                   required=False)

    select_description = schema.TextLine(title=u'Selection field description',
                                         required=False)

    form_label = schema.TextLine(title=u'Label in the form', required=False)
Пример #16
0
class IUpgradeStepDirectoryDirective(Interface):

    profile = zope.schema.TextLine(
        title=u"GenericSetup profile id",
        required=True)

    directory = Path(
        title=u'Path to the upgrade steps directory',
        required=True)
Пример #17
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)
Пример #18
0
class IRegisterFile(Interface):

    path = Path(
        title=u("File path"),
        description=u("This is the path name of the file to be registered."),
    )

    title = Text(title=u("Short summary of the file"),
                 description=u("This will be used in file listings"),
                 required=False)
Пример #19
0
class IFileSystemRepositoryDirective(IRepositoryDirective):
    directory = \
        Path(title=u"The directory the representation files for the "
                    "root collection resources are kept. Defaults to "
                    "the current working directory.",
             required=False,
             )
    content_type = \
        GlobalObject(title=u"The (MIME) content type to use for the "
                            "representation files. Defaults to CSV.",
                     required=False)
class IOnlineHelpTopicDirective(Interface):
    """Register an online topic.

    Optionally you can register a topic for a component and view.
    """

    id = NativeStringLine(
        title=u"Topic Id",
        description=u"Id of the topic as it will appear in the URL.",
        required=True)

    title = MessageID(
        title=u"Title",
        description=u"Provides a title for the online Help Topic.",
        required=True)

    parent = NativeStringLine(title=u"Parent Topic",
                              description=u"Id of the parent topic.",
                              default="",
                              required=False)

    for_ = GlobalInterface(
        title=u"Object Interface",
        description=u"Interface for which this Help Topic is registered.",
        default=None,
        required=False)

    view = NativeStringLine(
        title=u"View Name",
        description=u"The view name for which this Help Topic is registered.",
        default="",
        required=False)

    doc_path = Path(
        title=u"Path to File",
        description=u"Path to the file that contains the Help Topic content.",
        required=True)

    class_ = GlobalObject(
        title=u"Factory",
        description=u"""
        The factory is the topic class used for initializeing the topic""",
        required=False,
    )

    resources = Tokens(title=u"A list of resources.",
                       description=u"""
        A list of resources which shall be used for the Help Topic.
        The resources must be located in the same directory as
        the Help Topic definition.
        """,
                       value_type=TextLine(),
                       required=False)
Пример #21
0
class IRegisterTranslationsDirective(Interface):
    """Register translations with the global site manager."""

    directory = Path(title=u"Directory",
                     description=u"Directory containing the translations",
                     required=True)

    domain = TextLine(
        title=u"Domain",
        description=u"Translation domain to register.  If not specified, "
        "all domains found in the directory are registered",
        required=False)
Пример #22
0
class IUpgradeStepDirectoryDirective(Interface):

    profile = zope.schema.TextLine(title=u"GenericSetup profile id",
                                   required=True)

    directory = Path(title=u'Path to the upgrade steps directory',
                     required=True)

    soft_dependencies = Tokens(
        title=u'List of Generic Setup profile dependencies.',
        description=u'Format: "my.package:default"',
        required=False,
        value_type=zope.schema.TextLine())
Пример #23
0
class IRegisterProfileDirective(Interface):

    """Register profiles with the global registry.
    """

    name = PythonIdentifier(
        title=u'Name',
        description=u"If not specified 'default' is used.",
        default=u'default',
        required=False)

    title = MessageID(
        title=u'Title',
        description=u'Optional title for the profile.',
        default=None,
        required=False)

    description = MessageID(
        title=u'Description',
        description=u'Optional description for the profile.',
        default=None,
        required=False)

    directory = Path(
        title=u'Path',
        description=u"If not specified 'profiles/<name>' is used.",
        required=False)

    provides = GlobalObject(
        title=u'Type',
        description=u"If not specified 'BASE' is used.",
        default=BASE,
        required=False)

    for_ = GlobalObject(
        title=u'Site Interface',
        description=u'If not specified the profile is always available.',
        default=None,
        required=False)

    pre_handler = GlobalObject(
        title=u'Pre handler',
        description=(u'Function called before applying all steps. '
                     'It gets passed the setup tool as context.'),
        required=False)

    post_handler = GlobalObject(
        title=u'Post handler',
        description=(u'Function called after applying all steps. '
                     'It gets passed the setup tool as context.'),
        required=False)
Пример #24
0
class IAddSCSSDirective(Interface):

    path = Path(title=u'Path to the .scss file', required=True)

    for_ = GlobalInterface(title=u'The interface the context should provide.',
                           required=False)

    layer = GlobalInterface(title=u'The interface the request should provide.',
                            required=False)

    before = TextLine(title=u'The name of an already added file.',
                      description=u'The name usually consists of'
                      ' "package:relative file path"',
                      required=False)
Пример #25
0
class IQueuedDeliveryDirective(IDeliveryDirective):
    """This directive creates and registers a global queued mail utility. It
    should be only called once during startup."""

    queuePath = Path(title=u"Queue Path",
                     description=u"Defines the path for the queue directory.",
                     required=True)

    processorThread = Bool(
        title=u"Run Queue Processor Thread",
        description=u"Indicates whether to run queue processor in a thread "
        "in this process.",
        required=False,
        default=True)
Пример #26
0
class ISkinDirective(interface.Interface):
    path = Path(title=u"Path",
                description=u"Path to the directory containing the skin.",
                required=True)

    discovery = Bool(title=u"Discovery",
                     description=(u"Enables run-time discovery."),
                     required=False)

    request_type = TextLine(
        title=u"The request type string or dotted name interface.",
        description=(u"If provided, skin objects will be registered "
                     u"as named adapters for the request type interface."),
        required=False)
Пример #27
0
class IResourceDirective(IBasicResourceInformation):
    """
    Defines a browser resource
    """

    name = TextLine(title=u"The name of the resource",
                    description=u"""
        This is the name used in resource urls. Resource urls are of
        the form site/@@/resourcename, where site is the url of
        "site", a folder with a site manager.

        We make resource urls site-relative (as opposed to
        content-relative) so as not to defeat caches.""",
                    required=True)

    factory = GlobalObject(
        title=u"Resource Factory",
        description=u"The factory used to create the resource. The factory "
        u"should only expect to get the request passed when "
        u"called.",
        required=False)

    file = Path(title=u"File",
                description=u"The file containing the resource data.",
                required=False)

    image = Path(title=u"Image",
                 description=u"""
        If the image attribute is used, then an image resource, rather
        than a file resource will be created.""",
                 required=False)

    template = Path(title=u"Template",
                    description=u"""
        If the template attribute is used, then a page template resource,
        rather than a file resource will be created.""",
                    required=False)
Пример #28
0
class IRegisterCustomizationDirective(Interface):

    product = MessageID(
        title=u'Product title',
        default=None,
        required=False)

    image = Path(
        title=u'Path to the logo image',
        default=None,
        required=False)

    order = Int(
        title=u'Customization odering number',
        default=10,
        required=False)
Пример #29
0
class IIconDirective(Interface):
    """
    Define an icon for an interface
    """

    name = TextLine(
        title=u"The name of the icon.",
        description=u"The name shows up in URLs/paths. For example 'foo'.",
        required=True)

    for_ = GlobalInterface(title=u"The interface this icon is for.",
                           description=u"""
        The icon will be for all objects that implement this
        interface.""",
                           required=True)

    file = Path(title=u"File",
                description=u"The file containing the icon.",
                required=False)

    resource = TextLine(title=u"Resource",
                        description=u"A resource containing the icon.",
                        required=False)

    title = MessageID(title=u"Title",
                      description=u"Descriptive title",
                      required=False)

    layer = GlobalInterface(title=u"The layer the icon should be found in",
                            description=u"""
        For information on layers, see the documentation for the skin
        directive. Defaults to "default".""",
                            required=False)

    width = Int(title=u"The width of the icon.",
                description=u"""
        The width will be used for the <img width="..." />
        attribute. Defaults to 16.""",
                required=False,
                default=16)

    height = Int(title=u"The height of the icon.",
                 description=u"""
        The height will be used for the <img height="..." />
        attribute. Defaults to 16.""",
                 required=False,
                 default=16)
Пример #30
0
class IResourceDirectoryDirective(IBasicResourceInformation):
    """
    Defines a directory containing browser resource
    """

    name = TextLine(title=u"The name of the resource",
                    description=u"""
        This is the name used in resource urls. Resource urls are of
        the form site/@@/resourcename, where site is the url of
        "site", a folder with a site manager.

        We make resource urls site-relative (as opposed to
        content-relative) so as not to defeat caches.""",
                    required=True)

    directory = Path(
        title=u"Directory",
        description=u"The directory containing the resource data.",
        required=True)