Personal tools
Skip to content. | Skip to navigation
plone.app module
You will typically run plone.app.async in a ZEO environment, where you will have one or more worker instances that act as dispatchers carrying out jobs queued by your main zope instances. For the sake of simplicity it is assumed that you have one instance that can queue new jobs, and one worker instance that consumes them, both operating on a single database. * Each instance has to set the ZC_ASYNC_UUID environment variable in order to integrate properly with zc.async. * Each instance loads the single_db_instance.zcml configuration. The worker instance loads the single_db_worker.zcml configuration in order to setup the queue and configure itself as a dispatcher. For more details please look at the example buildout configurations included in the package.
This package aims to be an add-on for Plone (>= 3.x) integrating ZODB (>=3.8) blob support, which allows large binary data to be managed by the ZODB, but separately from your usual FileStorage database, i.e. Data.fs. This has several advantages, most importantly a much smaller Data.fs and better performance both cpu- as well as memory-wise.
This package implements the 'blocks' rendering model, by providing several transform stages that hook into plone.transformchain. The rendering stages are: plone.app.blocks.parsexml (order 8000) Turns the response in a repoze.xmliter XMLSerializer object. This is then used by the subsequent stages. If the input is not HTML, the transformation is aborted. plone.app.blocks.mergepanels (order 8100) Looks up the site layout and executes the panel merge algorithm. Sets a request variable ('plone.app.blocks.merged') to indicate that it has done its job. plone.app.blocks.tiles (order 8500) Resolve tiles and place them directly into the merged layout. This is the fallback for views that do not opt into ITilePageRendered. plone.app.blocks.esirender (order 8900) Only executed if the request key plone.app.blocks.esi is set and has a true value, as would be the case if any ESI-rendered tiles are included and ESI rendering is enabled globally. This step will serialise the response down to a string and perform some substitution to make ESI rendering work. The package also registers the sitelayout plone.resource resource type, allowing site layouts to be created easily as static HTML files served from resource directories. The URL to a site layout is typically something like: /++sitelayout++my.layout/site.html See plone.resource for more information about how to register resource directories. For site layouts, the type of the resource directory is sitelayout. It is possible to provide a manifest file that gives a title, description and alternative default file for a site layout HTML file in a resource directory. To create such a manifest, put a manifest.cfg file in the layout directory with the following structure: [sitelayout] title = My layout title description = Some description file = some-html-file.html All keys are optional. The file defaults to site.html. A vocabulary factory called plone.availableSiteLayouts is registered to allow lookup of all registered site layouts. The terms in this vocabulary use the URL as a value, the resource directory name as a token, and the title from the manifest (falling back on a sanitised version of the resource directory name) as the title. The current default site layout can be identified by the plone.registry key plone.defaultSiteLayout, which is set to None by default. To always use the current site default, use: <html data-layout="./@@default-site-layout"> The @@default-site-layout view will render the current default site layout. It is possible for the default site layout to be overridden per section, by having parent objects provide or be adaptable to plone.app.blocks.layoutbehavior.ILayoutAware. As the module name implies, this interface can be used as a plone.behavior behavior, but it can also be implemented directly or used as a standard adapter. The ILayoutAware interface defines three properties: content, which contains the body of the page to be rendered pageSiteLayout, which contains the path to the site layout to be used for the given page. It can be None if the default is to be used. sectionSiteLayout, which contains the path to the site layout to be used for pages underneath the given page (but not for the page itself). Again, it can be None if the default is to be used. To make use of the page site layout, use the following: <html data-layout="./@@default-site-layout"> See rendering.txt for detailed examples of how the processing is applied, and esi.txt for details about how Edge Side Includes can be supported.
Plone UI and default rules for plone.caching/z3c.caching
This package integrates the `Celery` distributed task queue into Plone. It allows you to configure Celery from your zope.conf configuration file, and make sending task messages honor the Zope transaction manager. Configuration ============= You can provide Celery configuration via the Zope configuration file. Here is an example:: %import plone.app.celery <celery-config celery> server-email no-reply@vandelay.com admins George Costanza, george@vandelay.com admins Cosmo Kramer, kosmo@vandelay.com <broker> host localhost port 5672 user guest password guest vhost / </broker> <celery> ignore-result true disable-rate-limits true task-publish-retry true <task-publish-retry-policy> max-retries 5 interval-start 0 interval-step 1 interval-max 0.5 </task-publish-retry-policy> default-queue default <queues> default dict(binding_key='default', exchange='default') feeds dict(binding_key='feeds', exchange='feeds') </queues> <routes> feed.tasks.import_feed dict(queue='feeds') images.compress image.compression.Compress </routes> </celery> </celery-config> You must use the `%import plone.app.celery` statement to import the Celery configuration schema. The top-level section always is called `<celery-config>` and that section must have a name (due to zope.conf limitations), but it's name is otherwise ignored. The Celery configuration is subdivided into namespaced sub-sections. Each Celery configuration key (as defined in the `Celery configuration documentation`_) consists of a namespace (such as `CELERY`, `CELERYD` or `BROKER`) and a configuration option (such as `HOST` or `ROUTES`); the only exceptions are the `SERVER_EMAIL` and `ADMINS` options. See the `Celery configuration defaults module`_ for a complete listing. Note that many Celery options make no sense in a Zope server context as you would normally only send task messages, not run a worker to process tasks. Using this subdivision, the ZConfig schema for Celery puts these options into a section for each namespace. Thus, all `BROKER` configuration is contained in a `<broker>` section, with each broker option lower-cased, underscores replaced with dashes. An option like `CELERY_TASK_PUBLISH_RETRY` thus becomes `task_publish_retry` in the `<celery>` section. The ZConfig schema enforces the type information set by Celery, and any option that takes a tuple (such as `CELERY_TASK_ERROR_WHITELIST` or `ADMINS`) can be listed multiple times in zope.conf to list all items. Options that take a dictionary (such as `CELERY_RESULT_ENGINE_OPTIONS` or `CELERY_QUEUES`) are configured in zope.conf using a new section with the option name, so in the case of `CELERY_QUEUES` add a `<queues>` section to the `celery` section listing each queue on a new line. Values are interpreted as python expressions. Some options are handled specially: * The `ADMINS` option takes a `name, email address` pair. * `CELERY_TASK_RESULT_EXPIRES` is listed as a time delta using ZConfig formatting. The set of suffixes recognized by ZConfig are: ‘w’ (weeks), ‘d’ (days), ‘h’ (hours), ‘m’ (minutes), ‘s’ (seconds). Values may be floats, for example:4w 2.5d 7h 12m 0.001s. * For the `CELERY_ROUTES` option, you can either specify python classes named by a dotted path or a python dictionary. By using the `%import plone.app.celery` line in your zope.conf configuration file, you automatically configure Celery to use the plone.app.celery loader. If you want to use a different loader, you need to set the `CELERY_LOADER` environment variable before the configuration file is processed.
Introduction plone.app.changeownership as it sounds is a plone package to change objects ownership. Problem There is no way in plone to transfer ownership of all objects owned by an user to a new user. To delete a plone member in such case is not an option. Solution plone.app.changeownership makes easy to transfer ownership from one ore more members to a new member. It also can change content metadata, like Creators field.
plone.app.collection
plone.app.content contains various views for Plone, such as folder_contents, as well as general content infrastructure, such as base classes and name choosers.
Listing and working with Plone content objects using plone.app.contentlisting This is valid for Plone 4.1 upwards. Many of the operations for customizations, templates, views and portlets in Plone are related to lists of content objects. Their sources can be different, although usually they are some sort of catalog search, the contents of a particular folder or a list of objects from a relation. To make it simpler to work with these, we have made plone.app.contentlisting, which ensures that lists of content objects always behave in the same way and according to predefined interfaces, regardless of what the source of the objects are. The integrator shouldn't have to care whether the list of objects came from the catalog, an ORM or they are the actual objects.