[Hippo-cms7-user] Mixins

Berry van Halderen b.vanhalderen at 1hippo.com
Wed Dec 16 13:04:36 CET 2009


On Wed, Dec 16, 2009 at 12:53 PM, nvankampenhout
<nvankampenhout at yahoo.co.uk> wrote:

> I think I will need to move some parts of my document types into mixins, to
> avoid duplication of code and configuration. For example, it seems that a
> workflow can only be configured for one document type (is this correct?). So
> to prevent duplicating that workflow configuration for each document type, I
> could configure it for a mixin, and add that mixin to each document type I
> want to workflow to apply to.
>

There may be multiple workflows active on your document type, however
they do need to be in seperate categories.  The workflow displayed in
the CMS, can be from multiple categories though.
So it is possible to have three document types, one base type
"myns:building" and two "myns:office" and "myns:home" that extend from
this base type. You can then define a workflow in a category "base"
that shows workflow from the base class, such of a class having the
methods "build" and "demolish" and then define also for "myns:office"
and "myns:home" separate workflows in the "extended" category.
You still need to configure the CMS to display the "base" and the
"extended" workflow.

Maybe this is also a solution for you, however you can also define the
workflow documents (they still must be hippo:document or hippo:request
derived) on mixins.  For the data-model and the repository this is
valid.

The update-all-content from the repository will work fine, but I think
you cannot manage the mixings from the template editor and you need to
manually configure the templates afaik.  This manual editing is not
the elegant path and discouraged.

\Berry



More information about the Hippo-cms7-user mailing list