Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Tips / Collection

Collection

依照使用者定義的條件,選集 (collection) 會產生搜尋結果的列表,並支援多種顯示方式。

https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/setuphandlers.py#L226 透過 @@qsOptions 可以查看 sortable_indexes 狀況

Products.ATContentTypes.criteria.DATE_INDICES should include DateRecurringIndex

欄位客製化: Archetypes, Dexterity plone.app.querystring registry.xml Add New Criterion

<registry
 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
 i18n:domain="plone">
  <records interface="plone.app.querystring.interfaces.IQueryField"
           prefix="plone.app.querystring.field.region">
    <value key="title" i18n:translate="">Region</value>
    <value key="description" i18n:translate="">A custom region index</value>
    <value key="enabled">True</value>
    <value key="sortable">False</value>
    <value key="operations">
      <element>plone.app.querystring.operation.selection.is</element>
    </value>
    <value key="vocabulary">cckf.region</value>
    <value key="group">Metadata</value>
  </records>
</registry>

排序 sort_on 設定值在重新編輯時可能更換

選集若採用 folderish 方式實作,介面設計是項挑戰,開始有 PLIP

regular expression

plone.app.querystring: Provides an queryparser, querybuilder and extra helper tools, to parse stored queries to actual results, used in new style Plone collections

Random Result 亂數結果與快取有關

Topic

舊版 有支援 SubTopic 昇級資訊

Folderish Collection

Migration from archetypes to dexterity

Plone.app.contenttypes can migrate all default Plone article types to Dexterity. This also includes topics, the earlier collections. The migration also includes most of the features, such as portlets, comments, contentrules, local roles, and local workflows.

warning

Earlier versions of the content are not retained during migration.
Migration of individual article types

With @@ pac_installer, there is a view that allows you to install plone.app.contenttypes without replacing the old Archetypes-based article types. Subsequently, the migration form is forwarded and the article types to be migrated can be selected. This allows them to migrate only certain Archetypes article types.
Migrating Topics

Topics supported so-called Subtopics, a feature that no longer exists in collections. Therefore, collections must first be folderish before migration from Subtopics can be performed. For this, the base class must be derived from plone.dexterity.content.Container and not from plone.dexterity.content.Item:

From plone.app.contenttypes.behaviors.collection import ICollection
From plone.dexterity.content import container
From zope.interface import implementer

@implementer (ICollection)
Class FolderishCollection (Container):
    passport

If the existing collection is to be overwritten, the Collection.xml can be used:

<? Xml version = "1.0"?>
<Object name = "Collection" meta_type = "Dexterity FTI">
  <Property name = "klass"> my.package.content.FolderishCollection </property>
</Object>

And, if the search for the parent collection is to be inherited, the changes from acquire query are required.
Migrate content translated with LinguaPlone

Because LinguaPlone does not support dexterity article types, LinguaPlone must first be migrated to plone.app.multilingual. For more information, see LinguaPlone Migration.
Migrating collective.contentleadimage

Collective.contentleadimage expanded the standard Plone article types by one image. This image is retained during migration, provided that the associated Dexterity article type has the "LeadImage" behavior. The navigation form with the comment extended fields: 'leadImage', 'leadImage_caption' and also the migration form shows for each Dexterity type whether it has the Behavior.
Migrate your own article types

During the migration of the standard article types, the own article types are not migrated. However, plone.app.contenttypes also contains a migration form for such article types: @@ custom_migration. The Dexterity article type to which you want to migrate must exist and the class of the old article type still exists. The old article type, however, does not have to be registered in portal_types - it can already be replaced by the dexterity type.

In the view @@ custom_migration, the corresponding dexterity type can be selected for each archetype. The fields can then be mapped to one another or fields can be ignored.

The configuration is then checked by invoking a migrated article: If this is done correctly, the test passed. Then the changes are rolled back.

portal_controlpanel 手動修改 4.3.12 看來只是設定成 visible 未選

pmr2.oauth Scope Manager