ZCML Directives: zope.browserresource.metadirectives

ZCML directives for defining browser resources

interface zope.browserresource.metadirectives.IBasicResourceInformation[source]

This is the basic information for all browser resources.

layer

The layer the resource should be found in

For information on layers, see the documentation for the skin directive. Defaults to “default”.

Implementation:zope.configuration.fields.GlobalInterface
Read Only:False
Required:False
Default Value:None

Value Type

Implementation:zope.schema.InterfaceField
Read Only:False
Required:True
Default Value:None
permission

The permission needed to access the resource.

If a permission isn’t specified, the resource will always be accessible.

Implementation:zope.security.zcml.Permission
Read Only:False
Required:False
Default Value:None
Allowed Type:str
interface zope.browserresource.metadirectives.IResourceDirective[source]

Extends: zope.browserresource.metadirectives.IBasicResourceInformation

Defines a browser resource.

name

The name of the resource

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.

Implementation:zope.schema.TextLine
Read Only:False
Required:True
Default Value:None
Allowed Type:unicode
factory

Resource Factory

The factory used to create the resource. The factory should only expect to get the request passed when called.

Implementation:zope.configuration.fields.GlobalObject
Read Only:False
Required:False
Default Value:None
file

File

The file containing the resource data. The resource type that will be created depends on file extension. The named IResourceFactoryFactory utilities are registered per extension. If no factory is registered for given file extension, the default FileResource factory will be used.

Implementation:zope.configuration.fields.Path
Read Only:False
Required:False
Default Value:None
Allowed Type:unicode
image

Image

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.

Implementation:zope.configuration.fields.Path
Read Only:False
Required:False
Default Value:None
Allowed Type:unicode
template

Template

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.

Implementation:zope.configuration.fields.Path
Read Only:False
Required:False
Default Value:None
Allowed Type:unicode
interface zope.browserresource.metadirectives.II18nResourceDirective[source]

Extends: zope.browserresource.metadirectives.IBasicResourceInformation

Defines an i18n’d resource.

name

The name of the resource

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.

Implementation:zope.schema.TextLine
Read Only:False
Required:True
Default Value:None
Allowed Type:unicode
defaultLanguage

Default language

Defines the default language

Implementation:zope.schema.TextLine
Read Only:False
Required:False
Default Value:None
Allowed Type:unicode
interface zope.browserresource.metadirectives.II18nResourceTranslationSubdirective[source]

Extends: zope.browserresource.metadirectives.IBasicResourceInformation

Subdirective to II18nResourceDirective.

language

Language

Language of this translation of the resource

Implementation:zope.schema.TextLine
Read Only:False
Required:True
Default Value:None
Allowed Type:unicode
file

File

The file containing the resource data.

Implementation:zope.configuration.fields.Path
Read Only:False
Required:False
Default Value:None
Allowed Type:unicode
image

Image

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.

Implementation:zope.configuration.fields.Path
Read Only:False
Required:False
Default Value:None
Allowed Type:unicode
interface zope.browserresource.metadirectives.IResourceDirectoryDirective[source]

Extends: zope.browserresource.metadirectives.IBasicResourceInformation

Defines a directory containing browser resources.

name

The name of the resource

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.

Implementation:zope.schema.TextLine
Read Only:False
Required:True
Default Value:None
Allowed Type:unicode
directory

Directory

The directory containing the resource data.

Implementation:zope.configuration.fields.Path
Read Only:False
Required:True
Default Value:None
Allowed Type:unicode
interface zope.browserresource.metadirectives.IIconDirective[source]

Define an icon for an interface.

name

The name of the icon.

The name shows up in URLs/paths. For example ‘foo’.

Implementation:zope.schema.TextLine
Read Only:False
Required:True
Default Value:None
Allowed Type:unicode
for_

The interface this icon is for.

The icon will be for all objects that implement this interface.

Implementation:zope.configuration.fields.GlobalInterface
Read Only:False
Required:True
Default Value:None

Value Type

Implementation:zope.schema.InterfaceField
Read Only:False
Required:True
Default Value:None
file

File

The file containing the icon.

Implementation:zope.configuration.fields.Path
Read Only:False
Required:False
Default Value:None
Allowed Type:unicode
resource

Resource

A resource containing the icon.

Implementation:zope.schema.TextLine
Read Only:False
Required:False
Default Value:None
Allowed Type:unicode
title

Title

Descriptive title

Implementation:zope.configuration.fields.MessageID
Read Only:False
Required:False
Default Value:None
Allowed Type:unicode
layer

The layer the icon should be found in

For information on layers, see the documentation for the skin directive. Defaults to “default”.

Implementation:zope.configuration.fields.GlobalInterface
Read Only:False
Required:False
Default Value:None

Value Type

Implementation:zope.schema.InterfaceField
Read Only:False
Required:True
Default Value:None
width

The width of the icon.

The width will be used for the <img width=”…” /> attribute. Defaults to 16.

Implementation:zope.schema.Int
Read Only:False
Required:False
Default Value:16
Allowed Type:int, long
height

The height of the icon.

The height will be used for the <img height=”…” /> attribute. Defaults to 16.

Implementation:zope.schema.Int
Read Only:False
Required:False
Default Value:16
Allowed Type:int, long