Back to index

plone3  3.1.7
directives.py
Go to the documentation of this file.
00001 from zope.interface import Interface
00002 from zope.configuration.fields import GlobalObject, Tokens, Path, \
00003      PythonIdentifier, MessageID
00004 from zope.schema import TextLine, Text, Id, Choice, Float
00005 from fields import PathList
00006 from zope.app.component.metadirectives import IBasicViewInformation
00007 from zope.app.publisher.browser.metadirectives import IBasicResourceInformation
00008 
00009 try:
00010     from zope.security.zcml import Permission
00011 except ImportError:
00012     # Zope < 2.10
00013     from zope.app.security.fields import Permission
00014 
00015 
00016 class IConcatResourceDirective(IBasicResourceInformation):
00017     """
00018     Defines a concatenated browser resource
00019     """
00020 
00021     name = TextLine(
00022         title=u"The name of the resource",
00023         description=u"""
00024         This is the name used in resource urls. Resource urls are of
00025         the form site/@@/resourcename, where site is the url of
00026         "site", a folder with a service manager.
00027 
00028         We make resource urls site-relative (as opposed to
00029         content-relative) so as not to defeat caches.""",
00030         required=True
00031         )
00032 
00033     files = PathList(
00034         title=u"Files",
00035         description=u"A space separated list of resource files",
00036         required=True
00037         )
00038 
00039     compress_level = Choice(
00040         title=u"Compress level",
00041         description=u"Level of compression applied, by default 'safe'.",
00042         values=(u'none', u'safe', u'full', u'stripped', u'devel', u'safe-devel', u'full-devel'),
00043         required=False,
00044         )
00045 
00046     caching = Choice(
00047         title=u"Caching strategy",
00048         description=u"Enables caching in memory for faster debugging, by default not enabled.",
00049         values=(u'default', u'memory'),
00050         required=False,
00051         )
00052 
00053     lmt_check_period = Float(
00054         title=u"Last modification time checking",
00055         description=u"""Sets a grace period in seconds, until which the last modification times
00056                         are never fetched again from the filesystem. In other words, the system will
00057                         react after this time for recent changes. For debugging, it is best
00058                         to set this to 0, for production it can be left to the default 60.0""",
00059         required=False,
00060         )
00061 
00062