Personal tools
Skip to content. | Skip to navigation
The Python Scripts product provides support for restricted execution of Python scripts, exposing them as callable objects within the Zope environment. Providing access to extra modules Python script objects have a limited number of “safe” modules available to them by default. In the course of working with Zope, you will probably wish to make other modules available to script objects. The Utility.py module in the PythonScripts products provides a simple way to make modules available for use by script objects on a site-wide basis. Before making a module available to Python scripts, you should carefully consider the potential for abuse or misuse of the module, since all users with permission to create and edit Python scripts will be able to use any functions and classes defined in the module. In some cases, you may want to create a custom module that just imports a subset of names from another module and make that custom module available to reduce the risk of abuse. The easiest way to make modules available to Python scripts on your site is to create a new directory in your Products directory containing an __init__.py file. At Zope startup time, this “product” will be imported, and any module assertions you make in the __init__.py will take effect. Here’s how to do it: In your Products directory (either in lib/python of your Zope installation or in the root of your Zope install, depending on your deployment model), create a new directory with a name like “GlobalModules”. In the new directory, create a file named __init__.py. Edit the __init__.py file, and add calls to the ‘allow_module’ function (located in the Products.PythonScripts.Utility module), passing the names of modules to be enabled for use by scripts. For example: from Products.PythonScripts.Utility import allow_module allow_module('base64') allow_module('re') allow_module('DateTime.DateTime') This example adds the modules ‘base64’, ‘re’ and the ‘DateTime’ module in the ‘DateTime’ package for use by Python scripts. Note that for packages (dotted names), each module in the package path will become available to script objects. Restart your Zope server. After restarting, the modules you enabled in your custom product will be available to Python scripts. Placing security assertions within the package/module you are trying to import will not work unless that package/module is located in your Products directory. This is because that package/module would have to be imported for its included security assertions to take effect, but to do that would require importing a module without any security declarations, which defeats the point of the restricted Python environment. Products work differently as they are imported at Zope startup. By placing a package/module in your Products directory, you are asserting, among other things, that it is safe for Zope to check that package/module for security assertions. As a result, please be careful when place packages or modules that are not Zope Products in the Products directory.
Enterprise-strength blogging for Plone
Use your Blog with any Weblog Editor that supports the `MetaWeblog API`_. This feature requires the ``Products.MetaWeblogPASPlugin`` product to be installed into your Plone site. .. _MetaWeblog API: http://www.metaweblogapi.com/
QuotaFolder is a folder-ish object that restricts the total number of objects, their total size and their individual maximum size. QuotaFolder takes subfolders (recursively) into account, so it should not be possible to escape the quota restrictions. The basic goal of QuotaFolder is not to put an absolute limit on ZODB usage - it is impossible to determine this. For example, each object may have several revisions in the ZODB, and some of the internal state of the object is stored in the ZODB that's not returned by get_size(). The goal is to limit the use of objects in general, to prevent people from offering large files or using up resources with enormous amounts of objects.
A registry for linked Stylesheet files and Javascripts. This registry is mainly aimed at solving the following usecases: - Enable product authors to register stylesheets with their product installers without having to resort to override either header.pt or ploneCustom.css creating potential conflicts with other products. - Enable more componentialization of the stylesheets provided with Plone (and other products) without having to increase the number of http requests for a Plone page. - Enable condition checking on stylesheets. Great for variable look-and-feel for groups/roles/folders/departments/content-types/etc - Enable inline dynamic stylesheets. For those style rules that should vary for each request. Mainly used for things like header-bar- backgroundimages, department colors etc. - Enable developers to activate/deactivate their styles in a simpler way - Enable compression to safe bandwidth and download time If several stylesheets listed directly after each other in the registry have the same parameters and expression, they will be concatenated into a larger, composite, stylesheet on rendering. - This can be useful for splitting stylesheets into smaller components for overrideing, while preserving cacheability and minimising the number of http-requests to Plone. This tool was started at the excellent SnowSprint 2005 - Organised by Telesis in the Austrian Alps. Thanks, Jodok! :)
You can read more about robots.txt at: * http://www.google.com/bot.html * http://www.robotstxt.org/wc/exclusion-admin.html
Zope 2 session management.
Several Plone products have a need to handle simple attachments: content types that do not have a workflow of their own but will reuse the permissions on their container. SimpleAttachment implements simple file and image attachment types that can serve this need.
Features: * DocumentConverters * StemmerSupport for 13 languages * SimilaritySearch for english text (based on the Levenshtein distance) * NearSearch, * PluggableParsers * extended StopWords support * full integration in ZCatalog * TestFunctionality through ZMI * ExtensibleArchitecture * being MoreEfficient than the current !TextIndex * full globbing support (wildcard search) * NormalizationSupport (e.g. reducing accented characters to their base form) * full UnicodeAwareness * Relevance ranking of search results added. Searches are now ranked using an extended cosine measure. The cosine measure is based on a vector model and calculates the document "score" based on the frequency of the query terms inside the document result set. * Much faster phrase/near search: the old implementation of TextIndexNG had to perform a very expensive job at query time when phrase/near search was performed. Re-using the !WidCode module of !ZCTextIndex made this operation less expensive. * Left-truncation added: TextIndexNG can be configured creation-time time to support left-truncation (means you can search for "*suffix") Left-truncation is an option because this feature requires a second reverted index inside the lexicion and much more memory! * optional auto-expansion support: This optional feature allows you to get better search results when some of the query terms could not be found. The index expands a query term "foo" to "foo*" if there was no hit for "foo". This expansion is currently global for the index. This feature will be available on a per-query basis in a later version. (Auto-expansion will be extended in a later version to search for similiar terms) * improved HTML converter: now using Chris Withers "Strip-o-Gram" module instead of the Strip-Tag-Parser * added converter for text/sgml * Similarity search (soundex, metaphone, doublemetaphone) dropped and replace with a more general approach and language indepedant approach using the Levenshtein distance. * range searches like "Fi..Foo" * substring searches "substring"