Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install dolmen.app.layout

How to install dolmen.app.layout

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install dolmen.app.layout
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0b2 Available View build log
1.0b1 Available View build log
1.0a2 Available View build log
1.0a1 Available View build log
Windows (64-bit)
1.0b2 Available View build log
1.0b1 Available View build log
1.0a2 Available View build log
1.0a1 Available View build log
Mac OS X (10.5+)
1.0b2 Available View build log
1.0b1 Available View build log
1.0a2 Available View build log
1.0a1 Available View build log
Linux (32-bit)
1.0b2 Available View build log
1.0b1 Available View build log
1.0a2 Available View build log
1.0a1 Available View build log
Linux (64-bit)
1.0b2 Available View build log
1.0b1 Available View build log
1.0a2 Available View build log
1.0a1 Available View build log
Lastest release
version 1.0b2 on Feb 2nd, 2011

dolmen.app.layout provides ready-to-use components to get a fully functional and extensively pluggable User Interface for a Dolmen application (see dolmen.app.site).

About Dolmen

Dolmen is an application development framework based on Grok and ZTK which also provides a CMS (Content Management System) out of the box. Dolmen is being made with four main objectives in mind: easily pluggable, rock solid and fast content type development, readability and speed.

Getting started

We import all the needed dependencies of the tests:

>>> from dolmen import content
>>> from grokcore.component import testing
>>> from zope.site.hooks import getSite
>>> from zope.component import getMultiAdapter
>>> from zope.publisher.browser import TestRequest

We import everything needed for the API verification:

>>> from zope.interface import verify
>>> from dolmen.app.layout import interfaces as API

We define and intanciate a Context object and a request for our tests to come:

>>> class Mammoth(content.Content):
...    content.name(u'Furry Mammoth')

>>> testing.grok_component('mammoth', Mammoth)

>>> root = getSite()
>>> root['manfred'] = Mammoth()
>>> manfred = root['manfred']

>>> request = TestRequest()

Global interface

>>> from dolmen.app.layout import master
>>> API.IGlobalUI.extends(API.IContentProviders)
>>> API.IGlobalUI.providedBy(master)
>>> verify.verifyObject(API.IGlobalUI, master)
Content providers
>>> for name, attr in API.IContentProviders.namesAndDescriptions():
...   print "%s: %s" % (name, attr.getDoc())
Footer: Viewlet manager for the bottom part of the body.
AboveBody: Viewlet manager located above the main content.
BelowBody: Viewlet manager located below the main content.
Header: Viewlet manager involved in rendering the HTML head.
Top: Viewlet manager for the top part of the body.
Resources: Viewlet manager including resources.
>>> interfaceDescription(API.IGlobalUI)
Master: Base layout using all the `IContentProviders` components to build a coherent yet overridable rendering.

Contextual UI

>>> from dolmen.app.layout import viewlets
>>> API.IContextualUI.providedBy(viewlets)
>>> verify.verifyObject(API.IContextualUI, viewlets)
>>> interfaceDescription(API.IContextualUI)
ContextualActions: Viewlet rendering contextual actions.
FlashMessages: Viewlet displaying site-wide messages.

View components

>>> from dolmen.app.layout import models

Models are base classes to be used in your own classes. dolmen.app.layout provides a collections of ready-to-use models:

>>> API.IModels.providedBy(models)
>>> verify.verifyObject(API.IModels, models)
>>> interfaceDescription(API.IModels)
Index: Page showing as default view on an object.
Form: Generic page form.
Page: Page embedded in a layout.
Default views

dolmen.app.layout registers some views, out-of-the-box, to allow you to interact with your dolmen.content objects and your application:

>>> API.IBaseViews.providedBy(models)
>>> verify.verifyObject(API.IBaseViews, models)
>>> interfaceDescription(API.IBaseViews)
Edit: Default edit form.
Add: Default add form.
DefaultView: Display form used as index.
Delete: Default delete form.

We can now test to see if our default views are retrieved:

>>> view = getMultiAdapter((manfred, request), name="index")
>>> view
<dolmen.app.layout.models.DefaultView object at ...>

>>> edit = getMultiAdapter((manfred, request), name="edit")
>>> edit
<dolmen.app.layout.models.Edit object at ...>

The add form is a bit different, as it relies on an adding view (see dolmen.forms.crud and dolmen.content for more information):

>>> from dolmen.forms.crud import Adder

>>> adding = Adder(root, request)
>>> adding
<dolmen.forms.crud.addview.Adder object at ...>

>>> adding.traverse("dolmen.app.layout.Mammoth", None)
<dolmen.app.layout.models.Add object at ...>


dolmen.app.layout provides a browser layer and a skin, to serve as a base component for your own skins:

>>> from dolmen.app.layout import skin

>>> API.ISkin.providedBy(skin)
>>> verify.verifyObject(API.ISkin, skin)
>>> interfaceDescription(API.ISkin)
IBaseSkin: Skin providing the IBaseLayer. Can be applied directly or inherited.
IBaseLayer: Layer used to register all the Dolmen centric view components.
Resource: Viewlet component used to include resources


All Dolmen packages are sponsorised by NPAI (http://www.npai.fr)


1.0b2 (2011-02-01)
  • Updated versions dependencies to remove the use of megrok.resource in favor of fanstatic.
1.0b1 (2010-11-16)
  • The ContextualMenu viewlet now computes the URL using the 'url' attribute of the entries, as it should be.
1.0a2 (2010-11-05)
  • Dependencies have been slimmed down : dolmen.app.layout now longer provides coverage for the megrok.z3ctable and zeam.form.composed packages. We now rely on the grokcore packages and no longer on the grok package itself.
  • Tests no longer use zope.testing.
1.0a1 (2010-06-03)
  • The flash messages are now retrieved thanks to grokcore.message.
  • Tests have been corrected and simplified.
  • Using now zeam.form instead of z3c.form.
  • Using now dolmen.menu instead of megrok.menu.
  • dolmen.app.layout now required python2.6 to work. This is due to the use of class decorators.
0.5.1 (2010-02-26)
  • Corrected the success message getter for the Delete form. It used to fetch the property object and try to persist it. Now, it gets its value as it should.
0.5.0 (2010-02-25)
  • Using now the latest megrok.layout. This removes the need for the ApplicationAwareView mixin. This version of dolmen.app.layout will only work with Grok >= 1.1rc1.
0.4.0 (2010-02-17)
  • INotFound errors are not located in the index.html view. This allows to use a layout transparently. The __parent__ is set to the ob attribute of the INotFound object.
  • The contextual menu is no longer restricted to IBaseContent objects. It is now registered for Interface.
  • The dependencies have been greatly reduced by the removal of all the zope.app packages.
0.3.1 (2010-01-21)
  • Bug fix: the success message of a Delete form is a property and can't be called directly through the class. We need to use fget.
0.3 (2009-12-26)
  • The layout now provides and uses a way to include resources, using megrok.resourceviewlet. Two components have been added for that: ResourcesManager and Resource, respectively a viewletmanager and a viewlet base class.
  • The imports has been modified to avoid using any zope.app package.
0.2.2 (2009-11-03)
  • Now the configure.zcml includes the megrok.z3ctable meta.zcml.
  • Updated dependencies in setup.py
0.2.1 (2009-11-02)
  • Corrected flash messages and redirection in the delete form.
0.2 (2009-11-02)
  • Added Delete form to complete the CRUD actions.
0.1 (2009-11-02)
  • Initial release

Subscribe to package updates

Last updated Feb 2nd, 2011

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.