Copyright (c) 2007-2011 Infrae. All rights reserved.
See also LICENSE.txt

Silva ZCML Directives Reference
=================

This document is meant as a reference for the Silva zcml directives, and
details each directive and it's supported attributes.  As always, and in
particular with zcml, the most complete reference is the source code itself.
This document was created with the intent of providing an easier to use
zcml reference.  For more information, see the interfaces in
Products/Silva/zcml/directives.py

There are currently three Silva zcml directives, silva:extension,
silva:content and silva:versionedcontent.  The silva:versionedcontent directive
extends silva:content, and so all attributes of silva:content are available
to silva:versionedcontent.

silva:extension
---------------

This directive is used to register a Silva extension.  A Silva extension is a
Zope 2 product, so this directive would be placed in that product's
configure.zcml file.

 attributes:

 * name - the name of the extension, which is identical to the name of the
   product directory.

 * title - the title of the extension.  This is the title or the brief
   description of the extension and will appear in the extensions service.

 * depends - a space-separated list of other Silva extensions this extension
   depends on.  This directive is optional, as the default is 'Silva'.
   A product may have multiple dependencies, for example SilvaNews depends
   on SilvaDocument and SilvaExternalSources.  In this case, both are supplied
   as values to this attribute.

silva:content
-------------

This directive registers a (non-versioned) content object that is part
of an extension.  Note: 'content' refers to any meta_type that will be
exposed in the SMI, and so includes Assets.

 attributes:

 * extension_name - required - the name of the extension this content is part of.
   This is same as the 'name' attribute of silva:extension

 * content - required - the class that defines this content type

 * priority - optional - a floating point number specifying the priority
   of this content type.  The priority controls it's placement within the
   SMI add list.  If this is omitted from the directive, the content is placed
   in the middle of the add list.  See also Products/Silva/priority_settings.txt.

 * icon - optional - the path to the content's icon on the filesystem,
   relative to the Product's directory.  (e.g. www/content_icon.png)

 * content_factory - optional - if this content type has special needs
   when a new object is created, you can specify a custom content
   factory method.  Typically this takes the same form as the old-style
   (Zope2 / pre Silva-2.0) manage_addContent functions.  This can be
   disregarded if your content type can use the default factory method
   (which most content types can.)

silva:versionedcontent
----------------------

This directive registers a versioned content object that is part of an
extension.  All of the attributes in the silva:content directive are
available in this one, so only the new attributes will be listed below.

 attributes:

 * version - required - the class that defines the version of the content

 * version_factory - optional - like content_factory, this attribute
   points to a custom old-style (Zope2 / pre Silva-2.0) manage_addContentVersion
   function. This can be disregarded if your content type can use the default
   factory method (which most content types can.)

