What are the Dexterity and Archetypes gotchas in Plone 4.1?
Asked Answered
L

3

9

In a recent question, toutpt said:

Dexterity needs Plone4.1 to play well with archetypes content and have all plone feature (history, diff, lock, ...)

I'm thinking of using Dexterity in a new site, alongside standard Archetypes objects like Pages, Files and so on. However, I've not been able to find a page listing the possible issues this may throw up.

I know there have been issues with Dexterity/Archetypes playing well together on a site, for example referencing between the two styles of content types. I'm wondering whether this is still an issue (it looks like toutpt may have fixed it), and what the other gotchas I should be aware of before diving in with Dexterity.

Initially my thought is to use Dexterity 1.0 and the version of Archetypes that ships with Plone 4.1, but I'm open to suggestions (e.g., versions 1.0-next for Dexterity).

Leander answered 27/5, 2011 at 11:31 Comment(1)
There are several good answers below covering different aspects of my question, so I've not marked any as a definitive "Answer". I hope this is reasonable SO etiquette.Leander
B
8

I'd recommend using Dexterity 1.0 with Plone 4.1 if you want a site that mixes Dexterity and Archetypes content. As always you can use 1.0-next if you want the bleeding edge, but I'm not aware of major issues that that would fix at this time.

Regarding references...zc.relation-style relations from Dexterity items to Archetypes have worked for quite some time. In Plone 4.1 it is now also possible to use Archetypes-style references from Archetypes items to Dexterity items if you enable the behavior from plone.app.referenceablebehavior for your Dexterity content type. The Archetypes IReferenceable adapter for Dexterity content doesn't yet provide the full API for adding, removing and retrieving reference information, though.

Beware answered 27/5, 2011 at 19:20 Comment(0)
D
7

I wouldn't use both Archetypes and Dexterity based content at the same time in a site.

It might work for very basic needs but there are incompatibilities. For example if any of your content contains non-ASCII characters, Dexterity will index those as Unicode in the catalog, but Archetypes will put utf-8 there. Mixing different types into the same catalog indexes is not supported at all and will break your site.

Using either only Archetypes or only Dexterity is fine. But the mix of the two need more work until they can coexist.

Disparagement answered 27/5, 2011 at 12:25 Comment(5)
Are these issues recorded as bugs, Hanno? I've deployed sites with AT stock content and Dexterity content coexisting peacefully, and I wasn't aware of showstopping issues. The main reason for the 4.1 suggestion is that cross-referencing from AT content (e.g. related items) to Dexterity content only works in 4.1 with plone.app.referenceablebehaviour.Benitobenjamen
We are also doing lots of sites with mixed Archetypes and Dexterity content. You do have to take a bit of care with the indexing but we haven't run into major issues.Beware
@optilude: I haven't followed Dexterity development for some time, I thought these problems were known but I never checked any issue trackers.Disparagement
Does this mean that, for example, having non-ASCII in a description or title field would break my site, as all types will have these fields indexed?Leander
Title and Description are ZCTextIndexes which use a Unicode aware splitter and lexicon, so these are always forced to Unicode and won't be a problem. It's all other field and keyword indexes that will be.Disparagement
R
5

In my mind, the key question is: are your new content types to be based on — or be extensions of — existing Plone content types? If so, start with Archetypes and ATContentTypes. (Also, if you need content-object translation, Dexterity just doesn't have it yet.)

Otherwise, if you've a tolerance for friction, Dexterity-built content types will be faster to develop, cleaner and lighter-weight than Archetypes-based types.

Roster answered 28/5, 2011 at 4:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.