Skip to main content

Default content types for Plone based on Dexterity

Project description

Introduction

http://jenkins.plone.org/job/plone.app.contenttypes/badge/icon

plone.app.contenttypes offers default content types for Plone based on Dexterity. This package replaces Products.ATContenttypes and will provide the default-types in Plone 5.

Warning: plone.app.contenttypes can be used on a new site without problems. Using it on a site with existing content requires migrating the sites content and is only recommended if you know what you’re doing! Please see the chapter “Migration”

It contains the same types as default Plone does:

  • Folder

  • Document

  • News item

  • File

  • Image

  • Link

  • Event (Using behaviors from plone.app.event)

  • Collection (this already replaces plone.app.collection which is no longer needed then)

The main difference from a users perspective is that these types are extendable through-the-web. This means you can add or remove fields and behaviors using the control-panel “Dexterity Content Types” (/@@dexterity-types).

The aim is to mimick the old default-types as closely as possible, not to change the content-creation experience for editors.

plone.app.contenttypes has been merged into the Plone 5.0 branch and will be shipped with the next Plone release: https://dev.plone.org/ticket/12344

Compatability

plone.app.contenttypes works with Plone 4.1+

Installation

Add this line in the eggs section of your buildout.cfg:

eggs =
    ...
    plone.app.contenttypes

If you have a mixed Plone site with Archetypes content and dexterity content use the extra requirement:

``plone.app.contenttypes ['atrefs']``

What happens to existing content?

If you install plone.app.contenttypes on a fresh site (i.e. when no content has been edited or added) the existing default-content will be replaced by dexterity-content to make sure it is still editable.

If you install plone.app.contenttypes in a existing site all Archetypes-based content of the default Types still exists and can be viewed but can’t be edited. On installation plone.app.contenttypes removes the type-definitions for the old default-types like this:

<object name="Document" remove="True" />

To make this content editable egain you need to migrate it to Dexterity (please see the section on migration) or uninstall plone.app.contenttypes.

Archetypes-based content provided by add-ons like Products.PloneFormGen will still work since only the default-types are replaced.

Uninstalling

To remove plone.app.contenttypes and return full functionality to old content and restore the AT-based default-types you have to install the import step “Types Tool” of the current base profile. Follow the following steps:

  • in the ZMI navigate to portal_setup and the tab “import”

  • in “Select Profile or Snapshot” leave “Current base profile (<Name of your Plonesite>)” selected. This is usually Products.CMFPlone

  • select the Types Tool (usually Step 44)

  • click “import selected steps”

Any content you created based on plone.app.contenttypes will not be editable until you reinstall plone.app.contenttypes.

Migration

Warning: Migrations are in an early stage and might break your site in some cases! Please read this thoroughly!

To migrate your content from Archetypes to Dexterity use the form at /@@atct_migrator.

plone.app.contenttypes includes migrations for the following use-cases:

  • from default Archetypes-based types to plone.app.contenttypes

  • from older versions of plone.app.contenttypes to current versions

Migrations that will be will come in future version:

  • from old plone.app.contenttypes-event to DX-plone.app.event

  • from AT-plone.app.event to DX-plone.app.event

  • from atct ATEvent to DX-plone.app.event

  • from ATTopic to DX-plone.app.collections

  • from AT-plone.app.collection to DX-plone.app.collections

There is a working migration from atct ATEvent to AT-plone.app.event in the plone.app.event package implemented as an upgrade step.

For migrations to work you need at least Products.contentmigration = 2.1.3 (part of Plone since Plone 4.2.5) and plone.app.intid (part of Plone since Plone 4.1.0).

Migrating Archetypes-based content to plone.app.contenttypes

plone.app.contenttypes can migrate the following types:

  • Folder

  • Document

  • News item

  • File

  • Image

  • Link

  • Collection

Migrating content that is translated with LinguaPlone

Since LinguaPlone does not support Dexterity you need to migrate from LinguaPlone to plone.app.multilingual (http://pypi.python.org/pypi/plone.app.multilingual). The migration from Products.LinguaPlone to plone.app.multilingual should happen before the migration from Archetypes to plone.app.contenttypes. For details on the migration see http://pypi.python.org/pypi/plone.app.multilingual#linguaplone-migration

Migrating from old versions of plone.app.contenttypes

Before version 1.0a2 the content-items did not implement marker-interfaces. They will break in newer versions since the views are now registered for these interfaces (e.g. plone.app.contenttypes.interfaces.IDocument). To fix this you can call the view /@@fix_base_classes on your site-root.

Since plone.app.contenttypes 1.1, the Collection type uses the new Collection behavior and the Event type utilizes behaviors from plone.app.event. In order to upgrade:

  1. First run the default profile (plone.app.contenttypes:default) and

  2. Then run the upgrade steps.

Migrating default-content that was extended with archetypes.schemaextender

The migration should warn you if any of your types are extended with archetypes.schemaextender. The data contained in these fields will be lost.

You need to implement a custom migration for your types and dexterity-behaviors for the functionality provided by the schemaextenders. This is an advanced development task and beyond the scope of this documentation.

Migrating custom content

Custom content will not be changed by plone.app.contenttypes and should continue to work as expeced. However if you’d like to migrate your content-types to Dexterity (you’ll have to create these types in Dexterity first) you might want to have a look at the code of plone.app.contenttypes.migration.migration.NewsItemMigrator as a blueprint.

Dependencies

  • plone.app.dexterity. Dexterity is shipped with Plone 4.3.x. Version pins for Dexterity are included in Plone 4.2.x. For Plone 4.1.x you need to pin the correct version for Dexterity in your buildout. See Installing Dexterity on older versions of Plone <http://developer.plone.org/reference_manuals/external/plone.app.dexterity/install.html#installing-dexterity-on-older-versions-of-plone>.

  • plone.app.collection.

Toubleshooting

ValueError on installing

When you try to install plone.app.contenttypes in a existing site you might get the following error:

  (...)
  Module Products.GenericSetup.utils, line 509, in _importBody
  Module Products.CMFCore.exportimport.typeinfo, line 60, in _importNode
  Module Products.GenericSetup.utils, line 730, in _initProperties
ValueError: undefined property 'schema'

Before installing plone.app.contenttypes you have to reinstall plone.app.collection to update collections to the version that uses Dexterity.

Information for Addon-Developers

The schemata of the types are set in xml-files using plone.supermodel. This allows the types to be editable trough the web.

If you want to extend these types with code consider using behaviors.

Differences to Products.ATContentTypes

  • The image of the News Item is not a field on the contenttype but a behavior that can add a image to any contenttypes (similar to http://pypi.python.org/pypi/collective.contentleadimage)

  • The functionality to transform (rotate and flip) images has been removed.

  • There is no more field Location. If you need georeferenceable consider using collective.geo.behaviour

  • The link on the image of the newsitem triggers an overlay

  • the link-type has the additional functionality to use the variable ${navigation_root_url} and ${portal_url}.

License

GNU General Public License, version 2

Contributors

Changelog

1.1a1 (2013-11-22)

  • Collection: get querybuilderresults view instead of using the QueryBuilder class directly. [maurits]

  • Fix migration restoreReferencesOrder removes references [joka]

  • Enable summary_view and all_content views for content types that have the collection behavior enabled. Define collection_view for those types so you can view the results. These simply show the results. The normal view of such a type will just show all fields in the usual dexterity way. [maurits, kaselis]

  • Add customViewFields to the Collection behavior. This was available on old collections too. [maurits, kaselis]

  • Change Collection to use a behavior. Issue #65. [maurits, kaselis]

  • Improved test coverage for test_migration [joka]

  • Add tests for vocabularies used for the migration [maethu]

  • Add migration-form /@@atct_migrate based on initial work by gborelli [pbauer, tiazma]

  • Add ATBlob tests and use migration layer for test_migration [joka]

  • Integrate plone.app.event. [thet]

1.0 (2013-10-08)

  • Remove AT content and create DX-content when installing in a fresh site. [pbauer]

  • Remove obsolete extra ‘migrate_atct’. [pbauer]

  • Add link and popup to the image of News Items. [pbauer]

  • Use the default profile title for the example content profile. [timo]

  • Unicode is expected, but obj.title and/or obj.description can be still be None in SearchableText indexer. [saily]

1.0rc1 (2013-09-24)

  • Implement a tearDownPloneSite method in testing.py to prevent test isolation problems. [timo]

  • Its possible to upload non-image data into a newsitem. The view was broken then. Now it shows the uploaded file for download below the content. Its no longer broken. [jensens]

  • Add contributor role as default for all add permissions in order to work together with the different plone worklfows, which assume it is set this way. [jensens]

  • fix #60: File Type has no mimetype specific icon in catalog metadata. Also fixed for Image. [jensens]

  • fix #58: Migration ignores “Exclude from Navigation”. [jensens]

  • disable LinkIntegrityNotifications during migrations, closes #40. [jensens]

  • Fix Bug on SearchableText_file indexer when input stream contains characters not convertable in ASCII. Assumes now utf-8 and replaces all unknown. Even if search can not find the words with special characters in, indexer does not break completely on those items. [jensens]

  • Remove dependency on plone.app.referenceablebehavior, as it depends on Products.Archetypes which installs the uid_catalog. [thet]

  • Make collection syndicatable. [vangheem]

  • Include the migration module not only when Products.ATContentTypes is installed but also archetypes.schemaextender. The schemaextender might not always be available. [thet]

  • Add fulltext search of file objects. [do3cc]

  • Fix link_redirect_view: Use index instead of template class var to let customization by ZCML of the template. [toutpt]

  • Add a permission for each content types. [toutpt]

1.0b2 (2013-05-31)

  • Fix translations to the plone domain, and some translations match existing translations in the plone domain. (ported from plone.app.collection) [bosim]

  • Fix atct_album_view and don’t use atctListAlbum.py. [pbauer]

  • Add constrains for content create with the Content profile. [ericof]

  • Add SearchableText indexer to Folder content type. [ericof]

  • Fix atct_album_view. [pbauer]

  • Removed dependency for collective.dexteritydiff since its features were merged into Products.CMFDiffTool. [pbauer]

  • Add test for behavior table_of_contents. [pbauer]

  • Add migration for blobnewsitems as proposed in https://github.com/plone/plone.app.blob/pull/2. [pbauer]

  • Require cmf.ManagePortal for migration. [pbauer]

  • Always migrate files and images to blob (fixes #26). [pbauer]

  • Add table of contents-behavior for documents. [pbauer]

  • Add versioning-behavior and it’s dependencies. [pbauer]

  • Remove image_view_fullscreen from the display-dropdown. [pbauer]

  • Enable selecting addable types on folders by default. [pbauer]

  • Fix reference-migrations if some objects were not migrated. [pbauer]

  • Keep the order references when migrating. [pabo3000]

  • Move templates into their own folder. [pbauer]

  • Moved migration related code to specific module. [gborelli]

  • Added migration Collection from app.collection to app.contenttypes. [kroman0]

  • Add missing i18n:attributes to ‘Edit’ and ‘View’ actions of File type. [saily]

  • Bind ‘View’ action to ${object_url}/view instead of ${object_url} as in ATCT for File and Image type. [saily]

  • Fixed installation of p.a.relationfield together with p.a.contenttypes. [kroman0]

  • Fixed creating aggregator of events on creating Plone site. [kroman0]

  • Added titles for menuitems. [kroman0]

  • Hide uninstall profile from @@plone-addsite. [kroman0]

  • Fix ‘ImportError: cannot import name Counter’ for Python 2.6. http://github.com/plone/plone.app.contenttypes/issues/19 [timo]

  • Move XML schema definitions to schema folder. [timo]

  • Prevent the importContent step from being run over and over again. [pysailor]

  • Add build status image. [saily]

  • Merge plone.app.collection (Tag: 2.0b5) into plone.app.contenttypes. [timo]

  • Refactor p.a.collection robot framework tests. [timo]

1.0b1 (2013-01-27)

  • Added mime type icon for file. [loechel]

  • Lead image behavior added. [timo]

  • Make NewsItem use the lead image behavior. [timo]

  • SearchableText indexes added. [reinhardt]

  • Set the text of front-page when creating a new Plone. [pbauer]

  • Robot framework test added. [Gomez]

1.0a2 (unreleased)

  • Move all templates from skins to browser views. [timo]

  • User custom base classes for all content types. [timo]

  • Migration view (@@fix_base_classes) added to migrate content objects that were created with version 1.0a1. [timo]

  • Mime Type Icon added for File View. [loechel]

1.0a1 (unreleased)

  • Initial release.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plone.app.contenttypes-1.1a1.zip (369.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page