[Testbot] Plone 4.3 - Python 2.6 - Build # 1906 - Regression! - 5 failure(s)

jenkins at plone.org jenkins at plone.org
Sat Mar 29 14:52:23 UTC 2014


-------------------------------------------------------------------------------
Plone 4.3 - Python 2.6 - Build # 1906 - Still Failing!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-4.3-python-2.6/1906/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-03-20T16:54:05+01:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/e3cbf99e7d6742db81e62053a26f3013f10e271e

In the migration framework, fix queries for Archetype objects, where only
  interfaces are used to skip brains with no or Dexterity meta_type. In some
  cases Dexterity and Archetype objects might provide the same marker
  interfaces.

Files changed:
M CHANGES.rst
M plone/app/contenttypes/migration/utils.py
M plone/app/contenttypes/migration/vocabularies.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 0706162..2acdd6b 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,12 @@ Changelog
 1.2a2 (unreleased)
 ------------------
 
+- In the migration framework, fix queries for Archetype objects, where only
+  interfaces are used to skip brains with no or Dexterity meta_type. In some
+  cases Dexterity and Archetype objects might provide the same marker
+  interfaces.
+  [thet]
+
 - Add logging messages to content migrator for more verbosity on what's
   happening while running the migration.
   [thet]
diff --git a/plone/app/contenttypes/migration/utils.py b/plone/app/contenttypes/migration/utils.py
index 57b281b..b44af32 100644
--- a/plone/app/contenttypes/migration/utils.py
+++ b/plone/app/contenttypes/migration/utils.py
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+from Products.Archetypes.interfaces import IBaseObject
 from Products.ATContentTypes.interfaces.document import IATDocument
 from Products.ATContentTypes.interfaces.event import IATEvent
 from Products.ATContentTypes.interfaces.file import IATFile
@@ -119,8 +120,11 @@ def _compareSchemata(interface):
     portal = getSite()
     pc = portal.portal_catalog
     brains = pc(object_provides=interface.__identifier__)
-    if brains:
-        obj = brains[0].getObject()
+    for brain in brains:
+        if not brain.meta_type or 'dexterity' in brain.meta_type.lower():
+            # There might be DX types with same iface and meta_type than AT
+            continue
+        obj = brain.getObject()
         real_fields = set(obj.Schema()._names)
         orig_fields = set(obj.schema._names)
         diff = [i for i in real_fields.difference(orig_fields)]
diff --git a/plone/app/contenttypes/migration/vocabularies.py b/plone/app/contenttypes/migration/vocabularies.py
index b9283ed..b3f0594 100644
--- a/plone/app/contenttypes/migration/vocabularies.py
+++ b/plone/app/contenttypes/migration/vocabularies.py
@@ -1,11 +1,11 @@
 # -*- coding: utf-8 -*-
-from zope.interface import implements
-from zope.schema.vocabulary import SimpleVocabulary
-from zope.schema.interfaces import IVocabularyFactory
-
+from Products.Archetypes.interfaces import IBaseObject
 from Products.CMFCore.utils import getToolByName
 from plone.app.contenttypes.migration.utils import ATCT_LIST
 from plone.app.contenttypes.migration.utils import isSchemaExtended
+from zope.interface import implements
+from zope.schema.interfaces import IVocabularyFactory
+from zope.schema.vocabulary import SimpleVocabulary
 from .. import _
 
 
@@ -40,6 +40,9 @@ def count(brains):
                 pt = "BlobImage"
         if not counter.get(pt):
             counter[pt] = 0
+        if not i.meta_type or 'dexterity' in i.meta_type.lower():
+            # There might be DX types with same iface and meta_type than AT
+            continue
         counter[pt] += 1
     return counter
 
@@ -63,9 +66,9 @@ def results(context, show_extended=False):
 
         elif not show_extended and not is_extended:
             ifaces.append(iface)
+
     catalog = getToolByName(context, "portal_catalog")
     brains = catalog.search({'object_provides': ifaces})
-
     counter = count(brains)
 
     return SimpleVocabulary(get_terms(context,


Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-03-20T17:12:28+01:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/bea3e5706be1319edbe07846c0584115bdfc0a49

 Add a ICustomMigrator interface to the migration framework, which can be used
  to register custom migrator adapters. This can be useful to add custom
  migrators to more than one or all content types. For example for
  schemaextenders, which are registered on a interface, which is provided by
  several content types.

Files changed:
M CHANGES.rst
M plone/app/contenttypes/migration/configure.zcml
M plone/app/contenttypes/migration/migration.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 2acdd6b..70da840 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,13 @@ Changelog
 1.2a2 (unreleased)
 ------------------
 
+- Add a ICustomMigrator interface to the migration framework, which can be used
+  to register custom migrator adapters. This can be useful to add custom
+  migrators to more than one or all content types, for example for
+  schemaextenders, which are registered on a interface, which is provided by
+  several content types.
+  [thet]
+
 - In the migration framework, fix queries for Archetype objects, where only
   interfaces are used to skip brains with no or Dexterity meta_type. In some
   cases Dexterity and Archetype objects might provide the same marker
diff --git a/plone/app/contenttypes/migration/configure.zcml b/plone/app/contenttypes/migration/configure.zcml
index f4ca85e..2da2eca 100644
--- a/plone/app/contenttypes/migration/configure.zcml
+++ b/plone/app/contenttypes/migration/configure.zcml
@@ -63,4 +63,6 @@
       name="plone.app.contenttypes.migration.extendedtypes"
       provides="zope.schema.interfaces.IVocabularyFactory" />
 
+  <adapter name="nullmigrator" factory=".migration.BaseCustomMigator"/>
+
 </configure>
diff --git a/plone/app/contenttypes/migration/migration.py b/plone/app/contenttypes/migration/migration.py
index 30a401c..ddd35d6 100644
--- a/plone/app/contenttypes/migration/migration.py
+++ b/plone/app/contenttypes/migration/migration.py
@@ -26,11 +26,16 @@
 from plone.namedfile.file import NamedBlobFile
 from plone.namedfile.file import NamedBlobImage
 from z3c.relationfield import RelationValue
+from zope.component import adapter
+from zope.component import getAdapters
 from zope.component import getUtility
 from zope.event import notify
+from zope.interface import Interface
+from zope.interface import implementer
 from zope.intid.interfaces import IIntIds
 from zope.lifecycleevent import ObjectModifiedEvent
 
+
 import logging
 logger = logging.getLogger(__name__)
 
@@ -191,10 +196,39 @@ def migrate_relatedItems(self):
         self.new._relatedItemsOrder = self.old._relatedItemsOrder
 
 
-class ATCTBaseMigrator(CMFItemMigrator, ReferenceMigrator):
+class ICustomMigrator(Interface):
+    """Adapter implementer interface for custom migrators.
+    Please note that you have to register named adapters in order to be able to
+    register multiple adapters to the same adaptee.
+    """
+    def migrate(old, new):
+        """Start the custom migraton.
+        :param old: The old content object.
+        :param new: The new content object.
+        """
+
+
+ at implementer(ICustomMigrator)
+ at adapter(Interface)
+class BaseCustomMigator(object):
+    """Base custom migration class. Does nothing.
+
+    You can use this as base class for your custom migrator adapters.
+    You might register it to some specific orginal content interface.
+    """
+    def __init__(self, context):
+        self.context = context
+
+    def migrate(self, old, new):
+        return
+
+
+class ATCTContentMigrator(CMFItemMigrator, ReferenceMigrator):
+    """Base for contentish ATCT
+    """
 
     def __init__(self, *args, **kwargs):
-        super(ATCTBaseMigrator, self).__init__(*args, **kwargs)
+        super(ATCTContentMigrator, self).__init__(*args, **kwargs)
         logger.info(
             "Migrating object %s" %
             '/'.join(self.old.getPhysicalPath())
@@ -204,20 +238,34 @@ def migrate_atctmetadata(self):
         field = self.old.getField('excludeFromNav')
         self.new.exclude_from_nav = field.get(self.old)
 
-
-class ATCTContentMigrator(ATCTBaseMigrator,
-                          CMFItemMigrator,
-                          ReferenceMigrator):
-    """Base for contentish ATCT
-    """
+    def migrate_custom(self):
+        """Get all ICustomMigrator registered migrators and run the migration.
+        """
+        for _, migrator in getAdapters((self.old, ), ICustomMigrator):
+            migrator.migrate(self.old, self.new)
 
 
-class ATCTFolderMigrator(ATCTBaseMigrator,
-                         CMFFolderMigrator,
-                         ReferenceMigrator):
+class ATCTFolderMigrator(CMFFolderMigrator, ReferenceMigrator):
     """Base for folderish ATCT
     """
 
+    def __init__(self, *args, **kwargs):
+        super(ATCTFolderMigrator, self).__init__(*args, **kwargs)
+        logger.info(
+            "Migrating object %s" %
+            '/'.join(self.old.getPhysicalPath())
+        )
+
+    def migrate_atctmetadata(self):
+        field = self.old.getField('excludeFromNav')
+        self.new.exclude_from_nav = field.get(self.old)
+
+    def migrate_custom(self):
+        """Get all ICustomMigrator registered migrators and run the migration.
+        """
+        for _, migrator in getAdapters((self.old, ), ICustomMigrator):
+            migrator.migrate(self.old, self.new)
+
 
 class DocumentMigrator(ATCTContentMigrator):
 


Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-03-20T17:14:49+01:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/704a56a736c731742247110c90ada810fbe276f1

typo

Files changed:
M CHANGES.rst

diff --git a/CHANGES.rst b/CHANGES.rst
index 70da840..d7323d7 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -6,7 +6,7 @@ Changelog
 
 - Add a ICustomMigrator interface to the migration framework, which can be used
   to register custom migrator adapters. This can be useful to add custom
-  migrators to more than one or all content types, for example for
+  migrators to more than one or all content types. For example for
   schemaextenders, which are registered on a interface, which is provided by
   several content types.
   [thet]


Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-03-21T00:46:59+01:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/116a1c0b911b0801a310cc695b3af62985c533ac

Register folderish views not for plone.app.contenttypes' IFolder but for
  plone.dexterity's IDexterityContainer. Now, these views can be used on any
  folderish Dexterity content.

Files changed:
M CHANGES.rst
M plone/app/contenttypes/browser/configure.zcml

diff --git a/CHANGES.rst b/CHANGES.rst
index d7323d7..136a0fc 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,11 @@ Changelog
 1.2a2 (unreleased)
 ------------------
 
+- Register folderish views not for plone.app.contenttypes' IFolder but for
+  plone.dexterity's IDexterityContainer. Now, these views can be used on any
+  folderish Dexterity content.
+  [thet]
+
 - Add a ICustomMigrator interface to the migration framework, which can be used
   to register custom migrator adapters. This can be useful to add custom
   migrators to more than one or all content types. For example for
diff --git a/plone/app/contenttypes/browser/configure.zcml b/plone/app/contenttypes/browser/configure.zcml
index 50a5d26..9270c0f 100644
--- a/plone/app/contenttypes/browser/configure.zcml
+++ b/plone/app/contenttypes/browser/configure.zcml
@@ -125,7 +125,7 @@
 
   <browser:page
     name="folder_listing"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     template="templates/folder_listing.pt"
     permission="zope2.View"
@@ -145,7 +145,7 @@
 
   <browser:page
     name="folder_full_view"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     template="templates/folder_full_view.pt"
     permission="zope2.View"
@@ -155,7 +155,7 @@
 
   <browser:page
     name="folder_summary_view"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     template="templates/folder_summary_view.pt"
     permission="zope2.View"
@@ -175,7 +175,7 @@
 
   <browser:page
     name="folder_tabular_view"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     template="templates/folder_tabular_view.pt"
     permission="zope2.View"
@@ -185,7 +185,7 @@
 
   <browser:page
     name="atct_album_view"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     class=".album_view.AlbumView"
     template="templates/atct_album_view.pt"


Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-03-23T13:41:42+01:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/b2259447435b18cd552a42526bdb2564cf1e146e

rm unused import

Files changed:
M plone/app/contenttypes/migration/utils.py

diff --git a/plone/app/contenttypes/migration/utils.py b/plone/app/contenttypes/migration/utils.py
index b44af32..f0f2292 100644
--- a/plone/app/contenttypes/migration/utils.py
+++ b/plone/app/contenttypes/migration/utils.py
@@ -1,5 +1,4 @@
 # -*- coding: utf-8 -*-
-from Products.Archetypes.interfaces import IBaseObject
 from Products.ATContentTypes.interfaces.document import IATDocument
 from Products.ATContentTypes.interfaces.event import IATEvent
 from Products.ATContentTypes.interfaces.file import IATFile


Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-03-24T01:52:00+01:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/55b1cd0411f0690cac17efc1ad418b2c78033656

+- Do a better check, if LinguaPlone is installed, based on the presence of the
+  LinguaPlone browser layer. Asking the quick installer tool might claim it's
+  installed, where it's not.

Files changed:
M CHANGES.rst
M plone/app/contenttypes/migration/browser.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 136a0fc..3f918eb 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,11 @@ Changelog
 1.2a2 (unreleased)
 ------------------
 
+- Do a better check, if LinguaPlone is installed, based on the presence of the
+  "LinguaPlone" browser layer. Asking the quick installer tool might claim it's
+  installed, where it's not.
+  [thet]
+
 - Register folderish views not for plone.app.contenttypes' IFolder but for
   plone.dexterity's IDexterityContainer. Now, these views can be used on any
   folderish Dexterity content.
@@ -26,7 +31,8 @@ Changelog
   happening while running the migration.
   [thet]
 
-- Fix @@atct_migrator and @@atct_migrator_results templates work within Plone3.
+- Use Plone 4 based @@atct_migrator and @@atct_migrator_results template
+  structure.
   [thet]
 
 
diff --git a/plone/app/contenttypes/migration/browser.py b/plone/app/contenttypes/migration/browser.py
index 1beb9eb..4fb6e16 100644
--- a/plone/app/contenttypes/migration/browser.py
+++ b/plone/app/contenttypes/migration/browser.py
@@ -9,6 +9,7 @@
 from plone.app.contenttypes.migration import migration
 from plone.app.contenttypes.migration.utils import ATCT_LIST
 from plone.app.contenttypes.migration.utils import isSchemaExtended
+from plone.browserlayer.interfaces import ILocalBrowserLayerType
 from plone.dexterity.content import DexterityContent
 from plone.dexterity.interfaces import IDexterityContent
 from plone.z3cform.layout import wrap_form
@@ -336,8 +337,8 @@ def estimated_migration_time(self):
     def linguaplone_installed(self):
         """Is Products.LinguaPlone installed?
         """
-        pq = getToolByName(self.context, 'portal_quickinstaller')
-        return pq.isProductInstalled('LinguaPlone')
+        existing = queryUtility(ILocalBrowserLayerType, name='LinguaPlone')
+        return bool(existing)
 
 
 class ATCTMigratorResults(BrowserView):


Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-03-24T12:51:50+01:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/de2dbf2c74a7cecf6c8cba13e36cfc73051f7b49

rm unecessary title prop

Files changed:
M plone/app/contenttypes/profiles/default/types.xml

diff --git a/plone/app/contenttypes/profiles/default/types.xml b/plone/app/contenttypes/profiles/default/types.xml
index 603d76d..ac9b7eb 100644
--- a/plone/app/contenttypes/profiles/default/types.xml
+++ b/plone/app/contenttypes/profiles/default/types.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0"?>
 <object meta_type="Plone Types Tool" name="portal_types">
- <property name="title">Controls the available content types in your portal</property>
 
  <!-- We remove old ATContentTypes if they exist.
       Instances of these types can still be looked at since the


Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-03-29T15:17:59+01:00
Author: Philip Bauer (pbauer) <bauer at starzel.de>
Commit: https://github.com/plone/plone.app.contenttypes/commit/1b26017b384b0a777912edd9ea6d2903944fddcd

Merge branch 'thet'

Files changed:
M CHANGES.rst
M plone/app/contenttypes/browser/configure.zcml
M plone/app/contenttypes/migration/browser.py
M plone/app/contenttypes/migration/configure.zcml
M plone/app/contenttypes/migration/migration.py
M plone/app/contenttypes/migration/utils.py
M plone/app/contenttypes/migration/vocabularies.py
M plone/app/contenttypes/profiles/default/types.xml

diff --git a/CHANGES.rst b/CHANGES.rst
index 0706162..3f918eb 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,11 +4,35 @@ Changelog
 1.2a2 (unreleased)
 ------------------
 
+- Do a better check, if LinguaPlone is installed, based on the presence of the
+  "LinguaPlone" browser layer. Asking the quick installer tool might claim it's
+  installed, where it's not.
+  [thet]
+
+- Register folderish views not for plone.app.contenttypes' IFolder but for
+  plone.dexterity's IDexterityContainer. Now, these views can be used on any
+  folderish Dexterity content.
+  [thet]
+
+- Add a ICustomMigrator interface to the migration framework, which can be used
+  to register custom migrator adapters. This can be useful to add custom
+  migrators to more than one or all content types. For example for
+  schemaextenders, which are registered on a interface, which is provided by
+  several content types.
+  [thet]
+
+- In the migration framework, fix queries for Archetype objects, where only
+  interfaces are used to skip brains with no or Dexterity meta_type. In some
+  cases Dexterity and Archetype objects might provide the same marker
+  interfaces.
+  [thet]
+
 - Add logging messages to content migrator for more verbosity on what's
   happening while running the migration.
   [thet]
 
-- Fix @@atct_migrator and @@atct_migrator_results templates work within Plone3.
+- Use Plone 4 based @@atct_migrator and @@atct_migrator_results template
+  structure.
   [thet]
 
 
diff --git a/plone/app/contenttypes/browser/configure.zcml b/plone/app/contenttypes/browser/configure.zcml
index 50a5d26..9270c0f 100644
--- a/plone/app/contenttypes/browser/configure.zcml
+++ b/plone/app/contenttypes/browser/configure.zcml
@@ -125,7 +125,7 @@
 
   <browser:page
     name="folder_listing"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     template="templates/folder_listing.pt"
     permission="zope2.View"
@@ -145,7 +145,7 @@
 
   <browser:page
     name="folder_full_view"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     template="templates/folder_full_view.pt"
     permission="zope2.View"
@@ -155,7 +155,7 @@
 
   <browser:page
     name="folder_summary_view"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     template="templates/folder_summary_view.pt"
     permission="zope2.View"
@@ -175,7 +175,7 @@
 
   <browser:page
     name="folder_tabular_view"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     template="templates/folder_tabular_view.pt"
     permission="zope2.View"
@@ -185,7 +185,7 @@
 
   <browser:page
     name="atct_album_view"
-    for="plone.app.contenttypes.interfaces.IFolder"
+    for="plone.dexterity.interfaces.IDexterityContainer"
     layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer"
     class=".album_view.AlbumView"
     template="templates/atct_album_view.pt"
diff --git a/plone/app/contenttypes/migration/browser.py b/plone/app/contenttypes/migration/browser.py
index 1beb9eb..4fb6e16 100644
--- a/plone/app/contenttypes/migration/browser.py
+++ b/plone/app/contenttypes/migration/browser.py
@@ -9,6 +9,7 @@
 from plone.app.contenttypes.migration import migration
 from plone.app.contenttypes.migration.utils import ATCT_LIST
 from plone.app.contenttypes.migration.utils import isSchemaExtended
+from plone.browserlayer.interfaces import ILocalBrowserLayerType
 from plone.dexterity.content import DexterityContent
 from plone.dexterity.interfaces import IDexterityContent
 from plone.z3cform.layout import wrap_form
@@ -336,8 +337,8 @@ def estimated_migration_time(self):
     def linguaplone_installed(self):
         """Is Products.LinguaPlone installed?
         """
-        pq = getToolByName(self.context, 'portal_quickinstaller')
-        return pq.isProductInstalled('LinguaPlone')
+        existing = queryUtility(ILocalBrowserLayerType, name='LinguaPlone')
+        return bool(existing)
 
 
 class ATCTMigratorResults(BrowserView):
diff --git a/plone/app/contenttypes/migration/configure.zcml b/plone/app/contenttypes/migration/configure.zcml
index f4ca85e..2da2eca 100644
--- a/plone/app/contenttypes/migration/configure.zcml
+++ b/plone/app/contenttypes/migration/configure.zcml
@@ -63,4 +63,6 @@
       name="plone.app.contenttypes.migration.extendedtypes"
       provides="zope.schema.interfaces.IVocabularyFactory" />
 
+  <adapter name="nullmigrator" factory=".migration.BaseCustomMigator"/>
+
 </configure>
diff --git a/plone/app/contenttypes/migration/migration.py b/plone/app/contenttypes/migration/migration.py
index 30a401c..ddd35d6 100644
--- a/plone/app/contenttypes/migration/migration.py
+++ b/plone/app/contenttypes/migration/migration.py
@@ -26,11 +26,16 @@
 from plone.namedfile.file import NamedBlobFile
 from plone.namedfile.file import NamedBlobImage
 from z3c.relationfield import RelationValue
+from zope.component import adapter
+from zope.component import getAdapters
 from zope.component import getUtility
 from zope.event import notify
+from zope.interface import Interface
+from zope.interface import implementer
 from zope.intid.interfaces import IIntIds
 from zope.lifecycleevent import ObjectModifiedEvent
 
+
 import logging
 logger = logging.getLogger(__name__)
 
@@ -191,10 +196,39 @@ def migrate_relatedItems(self):
         self.new._relatedItemsOrder = self.old._relatedItemsOrder
 
 
-class ATCTBaseMigrator(CMFItemMigrator, ReferenceMigrator):
+class ICustomMigrator(Interface):
+    """Adapter implementer interface for custom migrators.
+    Please note that you have to register named adapters in order to be able to
+    register multiple adapters to the same adaptee.
+    """
+    def migrate(old, new):
+        """Start the custom migraton.
+        :param old: The old content object.
+        :param new: The new content object.
+        """
+
+
+ at implementer(ICustomMigrator)
+ at adapter(Interface)
+class BaseCustomMigator(object):
+    """Base custom migration class. Does nothing.
+
+    You can use this as base class for your custom migrator adapters.
+    You might register it to some specific orginal content interface.
+    """
+    def __init__(self, context):
+        self.context = context
+
+    def migrate(self, old, new):
+        return
+
+
+class ATCTContentMigrator(CMFItemMigrator, ReferenceMigrator):
+    """Base for contentish ATCT
+    """
 
     def __init__(self, *args, **kwargs):
-        super(ATCTBaseMigrator, self).__init__(*args, **kwargs)
+        super(ATCTContentMigrator, self).__init__(*args, **kwargs)
         logger.info(
             "Migrating object %s" %
             '/'.join(self.old.getPhysicalPath())
@@ -204,20 +238,34 @@ def migrate_atctmetadata(self):
         field = self.old.getField('excludeFromNav')
         self.new.exclude_from_nav = field.get(self.old)
 
-
-class ATCTContentMigrator(ATCTBaseMigrator,
-                          CMFItemMigrator,
-                          ReferenceMigrator):
-    """Base for contentish ATCT
-    """
+    def migrate_custom(self):
+        """Get all ICustomMigrator registered migrators and run the migration.
+        """
+        for _, migrator in getAdapters((self.old, ), ICustomMigrator):
+            migrator.migrate(self.old, self.new)
 
 
-class ATCTFolderMigrator(ATCTBaseMigrator,
-                         CMFFolderMigrator,
-                         ReferenceMigrator):
+class ATCTFolderMigrator(CMFFolderMigrator, ReferenceMigrator):
     """Base for folderish ATCT
     """
 
+    def __init__(self, *args, **kwargs):
+        super(ATCTFolderMigrator, self).__init__(*args, **kwargs)
+        logger.info(
+            "Migrating object %s" %
+            '/'.join(self.old.getPhysicalPath())
+        )
+
+    def migrate_atctmetadata(self):
+        field = self.old.getField('excludeFromNav')
+        self.new.exclude_from_nav = field.get(self.old)
+
+    def migrate_custom(self):
+        """Get all ICustomMigrator registered migrators and run the migration.
+        """
+        for _, migrator in getAdapters((self.old, ), ICustomMigrator):
+            migrator.migrate(self.old, self.new)
+
 
 class DocumentMigrator(ATCTContentMigrator):
 
diff --git a/plone/app/contenttypes/migration/utils.py b/plone/app/contenttypes/migration/utils.py
index 57b281b..f0f2292 100644
--- a/plone/app/contenttypes/migration/utils.py
+++ b/plone/app/contenttypes/migration/utils.py
@@ -119,8 +119,11 @@ def _compareSchemata(interface):
     portal = getSite()
     pc = portal.portal_catalog
     brains = pc(object_provides=interface.__identifier__)
-    if brains:
-        obj = brains[0].getObject()
+    for brain in brains:
+        if not brain.meta_type or 'dexterity' in brain.meta_type.lower():
+            # There might be DX types with same iface and meta_type than AT
+            continue
+        obj = brain.getObject()
         real_fields = set(obj.Schema()._names)
         orig_fields = set(obj.schema._names)
         diff = [i for i in real_fields.difference(orig_fields)]
diff --git a/plone/app/contenttypes/migration/vocabularies.py b/plone/app/contenttypes/migration/vocabularies.py
index b9283ed..b3f0594 100644
--- a/plone/app/contenttypes/migration/vocabularies.py
+++ b/plone/app/contenttypes/migration/vocabularies.py
@@ -1,11 +1,11 @@
 # -*- coding: utf-8 -*-
-from zope.interface import implements
-from zope.schema.vocabulary import SimpleVocabulary
-from zope.schema.interfaces import IVocabularyFactory
-
+from Products.Archetypes.interfaces import IBaseObject
 from Products.CMFCore.utils import getToolByName
 from plone.app.contenttypes.migration.utils import ATCT_LIST
 from plone.app.contenttypes.migration.utils import isSchemaExtended
+from zope.interface import implements
+from zope.schema.interfaces import IVocabularyFactory
+from zope.schema.vocabulary import SimpleVocabulary
 from .. import _
 
 
@@ -40,6 +40,9 @@ def count(brains):
                 pt = "BlobImage"
         if not counter.get(pt):
             counter[pt] = 0
+        if not i.meta_type or 'dexterity' in i.meta_type.lower():
+            # There might be DX types with same iface and meta_type than AT
+            continue
         counter[pt] += 1
     return counter
 
@@ -63,9 +66,9 @@ def results(context, show_extended=False):
 
         elif not show_extended and not is_extended:
             ifaces.append(iface)
+
     catalog = getToolByName(context, "portal_catalog")
     brains = catalog.search({'object_provides': ifaces})
-
     counter = count(brains)
 
     return SimpleVocabulary(get_terms(context,
diff --git a/plone/app/contenttypes/profiles/default/types.xml b/plone/app/contenttypes/profiles/default/types.xml
index 603d76d..ac9b7eb 100644
--- a/plone/app/contenttypes/profiles/default/types.xml
+++ b/plone/app/contenttypes/profiles/default/types.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0"?>
 <object meta_type="Plone Types Tool" name="portal_types">
- <property name="title">Controls the available content types in your portal</property>
 
  <!-- We remove old ATContentTypes if they exist.
       Instances of these types can still be looked at since the




-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 29683 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140329/d04cd06b/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 164397 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140329/d04cd06b/attachment-0003.obj>


More information about the Testbot mailing list