Personal tools
You are here: Home Documentation Manuals Plone Upgrade Guide Version-specific migration procedures and tips Upgrading Plone 2.5 to 3.0 Updating add-on products for Plone 3.0 Indexes declared in Archetypes schemata need to be moved to GenericSetup
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

6.4.2.14. Indexes declared in Archetypes schemata need to be moved to GenericSetup

Up one level
If you have declared indexes or metadata directly on the Archetypes field declarations, and you are using GenericSetup to install your types/FTIs, you will need to move them to GenericSetup.

This applies if you have moved from using install_types() in Extensions/Install.py, to installing new content types/FTIs with GenericSetup using a types.xml import step.

For each field that specifies an index, like this example from PoiIssue.py r40594 :

  StringField(
      name='issueType',
      index="FieldIndex:schema",
      widget=SelectionWidget(
          label="Issue type",
          description="Select the type of issue.",
          label_msgid='Poi_label_issueType',
          description_msgid='Poi_help_issueType',
          i18n_domain='Poi',
      ),
      enforceVocabulary=True,
      vocabulary='getIssueTypesVocab',
      required=True
  ),

…you need to move the creation to catalog.xml with GenericSetup. If there is index="FieldIndex", that means you need a new index, of type FieldIndex, with the name being the name of the accessor method:

  <index name="getIssueType" meta_type="FieldIndex">
    <indexed_attr value="getIssueType"/>
  </index>

If there is also :schema or :metadata, e.g. index="FieldIndex:schema", you also need a metadata column:

  <column value="getIssueType"/>

This is necessary because the schema does not really exist at install time, so there is no way GenericSetup can inspect it and configure new indexes. This was a bad design from the start, as portal-wide indexes do not belong in type-specific schemata anyway.

by Alexander Limi last modified May 3, 2007 - 09:59
Contributors: Martin Aspeli, Geir Bækholt, Sisi Nutt
All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by